Welcome to Dream.In.Code
Getting Help is Easy!

Join 107,422 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,221 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Enigma

 
Reply to this topicStart new topic

Enigma

potator
post 11 Jun, 2008 - 11:17 PM
Post #1


D.I.C Head

Group Icon
Joined: 2 Dec, 2007
Posts: 68



Dream Kudos: 125
My Contributions


So I've been working on this project for nearly 9 months and I'm glad to say I'm finished with it. I first posted it in a forum where it was baleeted because the mods said I should write a tutorial. I wrote a half-hearted tutorial after fixing a few logical errors. It turns out you can't edit your tutorials and I now realize that the whole program that I posted has a major critical flaw that I had yet to realize. I'm working to have it removed, if not updated soon. I decided for my final project in my computer science class, I would create a GUI for it. I use a Linux machine at home, but the school computers run windows, so I have provided the look and feel for both:

Note: The GUI was created with NetBeans, so if you unzip the folder and create a new project form existing source, you should be able to see everything.


Attached File(s)
Attached File  Enigma_Linux_Build.zip ( 380.82k ) Number of downloads: 16
Attached File  Enigma_Windows_Build.zip ( 411.09k ) Number of downloads: 20
User is offlineProfile CardPM

Go to the top of the page


Tom9729
post 12 Jun, 2008 - 02:39 PM
Post #2


Debian guru

Group Icon
Joined: 30 Dec, 2007
Posts: 1,392



Thanked 7 times

Dream Kudos: 325
My Contributions


An interesting project. smile.gif

The only problem I ran into was that the buttons in the "Rotors" "Inverters" and "Enigma" boxes are too small for their text, so the text inside reverts to "..." which probably isn't what you intend.
User is online!Profile CardPM

Go to the top of the page

potator
post 14 Jun, 2008 - 12:33 AM
Post #3


D.I.C Head

Group Icon
Joined: 2 Dec, 2007
Posts: 68



Dream Kudos: 125
My Contributions


Yeah, that's why I had to create a Linux and windows build. They have different styles. I've got my appearance set to Human on Ubuntu. The Windows should be fine for XP.
User is offlineProfile CardPM

Go to the top of the page

Tom9729
post 14 Jun, 2008 - 12:37 PM
Post #4


Debian guru

Group Icon
Joined: 30 Dec, 2007
Posts: 1,392



Thanked 7 times

Dream Kudos: 325
My Contributions


You should try adding some code to autodetect which operating system is being run, and set OS-specific options appropriately. smile.gif

For example, a class from one of my projects:
CODE

import java.lang.String;

public class SystemUtil
{
    /**
     * Some operating system constants are below.
     * Just a few things to note...
     *
     * - The only ones I'm likely to be testing are Linux
     *   and (ugh) Windows.
     *
     * - I assume the Mac OS string returned by Java
     *   is referring to OS X and not any of it's earlier
     *   cousins.
     *
     * - Just some conventions that can make using
     *   these a bit easier. Unix-like OS's have odd
     *   constants. Unsupported is 0, so you can use
     *   our good friend the exclamation point in
     *   cond-statements.
     *
     * - Do not absolutely rely on these. I'm not sure
     *   why Java would lie, but IT MIGHT. Or who knows,
     *   maybe Microsoft will release "Windows Linux Edition"
     *   or something that will completely confuse this function.
     *   That would not be good.
     */

    /** Integer constant for GNU/Linux. */
    public static final int OS_LIN = 1;
    /** Integer constant for Windows. */
    public static final int OS_WIN = 2;
    /** Integer constant for BSD. */
    public static final int OS_BSD = 3;
    /** Integer constant for Mac OS X. */
    public static final int OS_MAC = 5;
    /** Integer constant for Solaris. */
    public static final int OS_SOL = 7;
    /** Integer constant for an unsupported OS. */
    public static final int OS_UNS = 0;

    /**
     * Try to determine which operating system we're in.
     *
     * @return A guess of which OS this is.
     * @author Tom Arnold
     */
    public static int getOS()
    {
        String prop = System.getProperty("os.name").toLowerCase();

        if (prop.contains("linux"))
        {
            return OS_LIN;
        }

        else if (prop.contains("windows"))
        {
            return OS_WIN;
        }

        else if (prop.contains("bsd"))
        {
            return OS_BSD;
        }

        else if (prop.contains("solaris"))
        {
            return OS_SOL;
        }

        else if (prop.contains("mac"))
        {
            return OS_MAC;
        }

        else
        {
            return OS_UNS;
        }
    }
}
User is online!Profile CardPM

Go to the top of the page

potator
post 8 Aug, 2008 - 10:19 PM
Post #5


D.I.C Head

Group Icon
Joined: 2 Dec, 2007
Posts: 68



Dream Kudos: 125
My Contributions


QUOTE(Tom9729 @ 14 Jun, 2008 - 12:37 PM) *

You should try adding some code to autodetect which operating system is being run, and set OS-specific options appropriately. smile.gif


That's really cool, but as previously shown, we could be running the same OS and have a different Look and Feel setting. This becomes infinitely difficult to handle.
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 8/28/08 08:39PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month