User's Manual
15
Innovatec Look and Feel
Pluggable Look and Feel
All enics applications should implement the
com.innovatec.plaf.InnovatecLookAndFeel
look and feel.
import com.innovatec.plaf.InnovatecLookAndFeel;...static{try{UIManager.setLookAndFeel( new
InnovatecLookAndFeel() );}catch( Exception e ){}}
Colors
Foreground/Text
Foreground colors should contrast extremely with the background. Since most of our background colors are very light,
labels, and text areas will have black foreground colors. Buttons on the other hand have very dark backgrounds, so
their text will normally be white.
Background
Backgrounds for panels should be light and change in color and or image with different concept area. For example if
there are two panels on one screen that represent different ideas, utility record and meter status, they should be of
different colors to make them easily distinguishable.
Since colors cannot be completely relied upon due to color blindness, images with different subtle textures should be
used as well. Images can be added by using
com.innovatec.ui.BasicPanel
instead of JPanel, and setting the image
through
BasicPanel.setBackgroundImage
.
Navigation Keyboard
In general, navigating between components follows these rules.
•
Tab or Ctrl-Tab. Moves keyboard focus to the next component or to the first member of the next group of
components. Use Ctrl-Tab when the component itself accepts tabs, as in text fields, tables, and tabbed panes.
•
Shift-Tab. Moves keyboard focus to the previous component or to the first component in the previous group of
components.
•
Arrow keys. Moves keyboard focus within the individual components of a group of components, for example,
within menu items in a menu or within radio buttons in a group of radio buttons.
Most of the keyboard navigation is taken care of by Java, some changes in tab order may need to be implemented
by specifying the next focusable component to a component. This can be accomplished by
JComponent.setNextFocusableComponent
.
Mnemonics
Mnemonics are another keyboard alternative to the mouse. Mnemonics can be used to navigate menus.
Rules of thumb for creating mnemonics:
1.
If the mnemonic does not appear in the table of common mnemonics, choose the first letter of the menu item.
For instance, choose J for Justify.
2.
If the first letter of the menu item conflicts with those of other menus, choose a prominent consonant. For
instance, the letter S has already been designated as the mnemonic for the Style command. Therefore, choose
the letter Z as the mnemonic for the Size command.
3.
If the first letter of the menu item and the prominent consonant conflict with those of other menu items, choose
a prominent vowel.
Mnemonics can be set by
AbstractButton.setMnemonic
.
Mnemonics can also be added to any item with a label. This can make it very easy to go directly to a component and
add information. A mnemonic can be added to a component via the label by
JLabel.setLabelFor
and
JLabel.setDisplayMnemonic
.