Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Colour scheme in an Applet

Reply
Thread Tools

Colour scheme in an Applet

 
 
Roedy Green
Guest
Posts: n/a
 
      08-05-2005
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/...s_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
 
Reply With Quote
 
 
 
 
Thomas Hawtin
Guest
Posts: n/a
 
      08-05-2005
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/
 
Reply With Quote
 
 
 
 
Raymond DeCampo
Guest
Posts: n/a
 
      08-06-2005
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.
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      08-06-2005
On Sat, 06 Aug 2005 01:54:04 GMT, Raymond DeCampo
<(E-Mail Removed)> 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/...s_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
 
Reply With Quote
 
Thomas Hawtin
Guest
Posts: n/a
 
      08-06-2005
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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the point of having 16 bit colour if a computer monitor can only display 8 bit colour? How do you edit 16 bit colour when you can only see 8 bit? Scotius Digital Photography 6 07-13-2010 03:33 AM
Getting default colour for <input> - or just the old colour jodleren Javascript 2 01-12-2008 02:57 PM
Java Web Start causing Windows Explorer to change colour scheme from Ultimate to Basic test Computer Support 1 05-27-2007 01:36 AM
Colour blindness, photography and colour management Tor Lillqvist Digital Photography 12 05-24-2004 08:57 AM
Colour scheme Tristan Computer Support 2 10-03-2003 03:04 PM



Advertisments