Colour scheme in an Applet

Discussion in 'Java' started by Roedy Green, Aug 5, 2005.

  1. Roedy Green

    Roedy Green Guest

    This is a question for the compulsive.

    How do you best handle a colour scheme for an Applet?

    ways to consider include:

    1. put constants in an interlace

    2. put constants in a class

    3. put constants in a nested static class

    4. use an enum.

    5. put them direct in an interface. The main problem here is IDEs
    reordering will not keep them all together.

    consider ease of defining standard colour schemes to be used in many
    Applets.

    Randomising effects.


    --
    Bush crime family lost/embezzled $3 trillion from Pentagon.
    Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
    http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

    Canadian Mind Products, Roedy Green.
    See http://mindprod.com/iraq.html photos of Bush's war crimes
     
    Roedy Green, Aug 5, 2005
    #1
    1. Advertising

  2. Roedy Green wrote:
    >
    > How do you best handle a colour scheme for an Applet?


    > 1. put constants in an interlace


    I'd go for this. But use static imports if I wanted to use without the
    qualifying name. Or possibly in a class and use methods instead of
    constants.

    Alternatively use constants as keys to a map.

    Tom Hawtin
    --
    Unemployed English Java programmer
    http://jroller.com/page/tackline/
     
    Thomas Hawtin, Aug 5, 2005
    #2
    1. Advertising

  3. Roedy Green wrote:
    > This is a question for the compulsive.
    >
    > How do you best handle a colour scheme for an Applet?
    >
    > ways to consider include:
    >
    > 1. put constants in an interlace
    >
    > 2. put constants in a class
    >
    > 3. put constants in a nested static class
    >
    > 4. use an enum.
    >
    > 5. put them direct in an interface. The main problem here is IDEs
    > reordering will not keep them all together.
    >
    > consider ease of defining standard colour schemes to be used in many
    > Applets.
    >
    > Randomising effects.
    >
    >


    Define them outside of code in a resource file. Then changing colors
    won't require a re-compile.

    Ray

    --
    XML is the programmer's duct tape.
     
    Raymond DeCampo, Aug 6, 2005
    #3
  4. Roedy Green

    Roedy Green Guest

    On Sat, 06 Aug 2005 01:54:04 GMT, Raymond DeCampo
    <> wrote or quoted :

    >Define them outside of code in a resource file. Then changing colors
    >won't require a re-compile.


    It is an added benefit you can let customers change the colour scheme
    even if you don't give them the source code.

    --
    Bush crime family lost/embezzled $3 trillion from Pentagon.
    Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
    http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

    Canadian Mind Products, Roedy Green.
    See http://mindprod.com/iraq.html photos of Bush's war crimes
     
    Roedy Green, Aug 6, 2005
    #4
  5. Raymond DeCampo wrote:
    > Roedy Green wrote:
    >
    >> How do you best handle a colour scheme for an Applet?

    >
    > Define them outside of code in a resource file. Then changing colors
    > won't require a re-compile.


    If it's only developers changing the colours, then that seems overkill.
    Even a basic implementation would be more difficult. I like my colour
    schemes to have some kind of relationship between the colours, rather
    than an angry fruit salad effect. So for easy of use, I should be able
    to have some kind of computation going on.

    Tom Hawtin
    --
    Unemployed English Java programmer
    http://jroller.com/page/tackline/
     
    Thomas Hawtin, Aug 6, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob Love

    applet vs. canvas in applet

    Rob Love, Jul 7, 2003, in forum: Java
    Replies:
    1
    Views:
    621
    Liu, Chunyen
    Jul 7, 2003
  2. webster
    Replies:
    0
    Views:
    859
    webster
    Jul 20, 2003
  3. Andrew Thompson
    Replies:
    0
    Views:
    414
    Andrew Thompson
    Aug 5, 2003
  4. Blah Blah
    Replies:
    0
    Views:
    1,432
    Blah Blah
    Aug 13, 2003
  5. jodleren
    Replies:
    2
    Views:
    204
    Thomas 'PointedEars' Lahn
    Jan 12, 2008
Loading...

Share This Page