|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jomic.tools.UiTools
public final class UiTools
User interface tools.
Field Summary | |
---|---|
static int |
FRAME_INSET
Inset to use at the border of a JFrame or JDialog. |
Method Summary | |
---|---|
void |
addKeyStrokeAction(javax.swing.JComponent component,
java.lang.String keyStrokeName,
javax.swing.Action action)
|
void |
attemptToRemoveActionListener(javax.swing.AbstractButton button,
java.awt.event.ActionListener listener)
Provided that button is not null, remove listener from it. |
void |
attemptToRemoveDocumentListener(javax.swing.JTextField field,
javax.swing.event.DocumentListener listener)
Provided that field is not null, remove listener from its Document
. |
void |
centerUp(java.awt.Component frame)
Center frame in upper half of the screen. |
javax.swing.JPanel |
createDialogMainPanel()
|
java.awt.Component |
createRigidAreaBetweenButtons()
Create ridig area to put "some" space between two buttons in a BoxLayout. |
void |
fillMnemonics(javax.swing.JMenu menu)
Set mnemonics in menu depending on the labels of the MenuItems. |
void |
fillMnemonics(javax.swing.JMenuBar bar)
Set mnemonics in bar depending on the labels of the Menus and MenuItems. |
java.awt.Cursor |
getInvisibleCursor()
Get an invisible Cursor. |
java.lang.String |
getKeyText(int keyCode)
Get (English) text for keyboard code. |
void |
initColumnWidths(javax.swing.JTable table)
This method picks good column sizes. |
static UiTools |
instance()
|
java.lang.String |
keyStrokeToString(javax.swing.KeyStroke keyStroke)
Get a string that is parseably by KeyStroke.getKeyStroke() . |
void |
removeKeyStroke(javax.swing.JComponent component,
javax.swing.KeyStroke[] keyStrokes)
Remove for a JComponent all keyStrokes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int FRAME_INSET
Method Detail |
---|
public java.awt.Cursor getInvisibleCursor()
public java.lang.String getKeyText(int keyCode)
public static UiTools instance()
public void addKeyStrokeAction(javax.swing.JComponent component, java.lang.String keyStrokeName, javax.swing.Action action)
public void attemptToRemoveActionListener(javax.swing.AbstractButton button, java.awt.event.ActionListener listener)
button
is not null, remove listener
from it.
public void attemptToRemoveDocumentListener(javax.swing.JTextField field, javax.swing.event.DocumentListener listener)
field
is not null, remove listener
from its Document
.
public void centerUp(java.awt.Component frame)
public javax.swing.JPanel createDialogMainPanel()
public java.awt.Component createRigidAreaBetweenButtons()
Box.createRigidArea(java.awt.Dimension)
public void fillMnemonics(javax.swing.JMenu menu)
menu
depending on the labels of the MenuItems.
public void fillMnemonics(javax.swing.JMenuBar bar)
bar
depending on the labels of the Menus and MenuItems.
public void initColumnWidths(javax.swing.JTable table)
public java.lang.String keyStrokeToString(javax.swing.KeyStroke keyStroke)
Get a string that is parseably by KeyStroke.getKeyStroke()
. (KeyStroke.toString()
does not return such a string.)
However, there is one keystroke that cannot be represented as a string that can be parsed
back to a keystroke - a typed space character. In order to bind an action to a typed space
character, KeyStroke.getKeyStroke(new Character(' '), 0)
needs to be called.
KeyStroke.getKeyStroke(java.lang.String)
public void removeKeyStroke(javax.swing.JComponent component, javax.swing.KeyStroke[] keyStrokes)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |