|
You can change the colours you want to use with NimROD Look & Feel passing parameters to the JVM.
This is the list of allowed paramenters:
| Parameter | Target | Format |
nimrodlf.p1 | sets the primary 1 | #RRGGBB |
nimrodlf.p2 | sets the primary 2 | #RRGGBB |
nimrodlf.p3 | sets the primary 3 | #RRGGBB |
nimrodlf.s1 | sets the secondary 1 | #RRGGBB |
nimrodlf.s2 | sets the secondary 2 | #RRGGBB |
nimrodlf.s3 | sets the secondary 3 | #RRGGBB |
nimrodlf.w | sets white | #RRGGBB |
nimrodlf.b | sets black | #RRGGBB |
nimrodlf.selection | sets all primary colours | #RRGGBB |
nimrodlf.background | sets all secondary colours | #RRGGBB |
Now, there is a new parameter, nimrodlf.opacity, to set the new menu and JInternalFrames opacity features.
This method is very powerfull, but you must write several parameters in the command line. To make easier NimROD Look & Feel,
now you can put all those parameters in a file and reuse it in all your Java applications. So, there is another new parameter,
nimrodlf.themeFile, which substitutes previous parameters. The final parameter list is:
| Parameter | Target | Format |
nimrodlf.p1 | sets the primary 1 | #RRGGBB |
nimrodlf.p2 | sets the primary 2 | #RRGGBB |
nimrodlf.p3 | sets the primary 3 | #RRGGBB |
nimrodlf.s1 | sets the secondary 1 | #RRGGBB |
nimrodlf.s2 | sets the secondary 2 | #RRGGBB |
nimrodlf.s3 | sets the secondary 3 | #RRGGBB |
nimrodlf.w | sets white | #RRGGBB |
nimrodlf.b | sets black | #RRGGBB |
nimrodlf.selection | sets all primary colours | #RRGGBB |
nimrodlf.background | sets all secondary colours | #RRGGBB |
nimrodlf.menuOpacity | sets menu opacity | 0-255 |
nimrodlf.frameOpacity | sets JInternalFrame opacity | 0-255 |
nimrodlf.themeFile | substitutes previous parameters | file name |
nimrodlf.themeURL | like nimrodlf.themeFile but with URLs. | URL to the theme file. |
Must I write the theme files AND write a parameter in the command line? No. In fact, is possible to choose colours without write
anything and the process is quite simple, because there is a theme editor and, if the file is named NimRODThemeFile.theme,
is not necessary to write anything in the command line because the file is automaticaly loaded.
|
|
The nimrodlf.jar file has a theme editor. In most systems, double clicking
nimrodlf.jar is enough to use it, but if this doesn't work, you can write:
java -jar nimrodlf.jar
You should get this:
The application has then colored squares to set the themes colours, an slider to set the menus opacity and another one to set
the JInternalFrames opcacity, and a huge "Test" button
to test the colours we have chosen. There are two buttons to open and save theme files and some tabs with example panels showing
the NimROD Look & Feel with the chosen colours.
You can set the menus transparency level moving the slider, and clicking in the colored squares will show a dialog where you can
choose the colour for that square.
A Swing theme is defined by eight colours, although only four are used in the wild:
- Black, for texts
- White, for texts fields background
- Background, the background colour of almost everything.
- Selection, the colour for focused controls
"Selection" and "Background" groups have four squares, and one is slightly separated, because although Swing uses three colours
for each category, those three colours must be coordinated, so they must by the same colour, but more dark. For example, if we want
a grey background, the first square will be "our" grey, the second will be lighter and the third will be even lighter.
You can define the squares one by one, but if you define the separated square, the three colours will be automaticaly set.
When you have chosen your favorite colours, click "Test" button and see the results in the tabs.
In this example, I've chose dark gray for "Background", blue for "Selections" and, for contrast, I've chose white for "Black"
and a dark gray for "White". Then clicked on "Test" and...
|
|
When the theme is completed, clicking on "Save" button will open a dialog to choose the directory and the name for the theme
file.
The editor has chose the default name for the theme: NimRODThemeFile.theme.
When NimROD Look & Feel is loaded, it looks in the command line for nimrodlf.themeFile paramater to
get the theme file to use. If there isn't paramater, it looks for a file named NimRODThemeFile.theme in
working directory. So if you name your theme file NimRODThemeFile.theme and put it in the working directory you
won't need to pass anything to the JVM in the command line.
Of course, you can change the filename and invoke the application using the nimrodlf.themeFile option. You can
have a directory with theme files an use them in all your java applications.
|