|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.ui.BAMutil
public class BAMutil
Button, Action and Menu utilities: static helper methods for building ucar.unidata.UI's.
| Nested Class Summary | |
|---|---|
static class |
BAMutil.ActionToggle
This wraps a regular action and makes it into a "toggle action", and associates it with an AbstractButton. |
| Field Summary | |
|---|---|
static String |
ACCEL
Action Property specifies menu accelerator |
static String |
MNEMONIC
Action Property specifies menu mneumonic |
static String |
ROLLOVER_ICON
Action Property specifies Rollover icon name |
static String |
STATE
the state of "toggle" actions = Boolean |
static String |
TOGGLE
Action Property specifies is its a toggle |
| Constructor Summary | |
|---|---|
BAMutil()
|
|
| Method Summary | |
|---|---|
static AbstractButton |
addActionToContainer(Container c,
Action act)
Same as addActionToContainerPos, but add to end of Container |
static AbstractButton |
addActionToContainerPos(Container c,
Action act,
int pos)
creates an AbstractButton using the given Action and adds it to the given Container at the position.. |
static JMenuItem |
addActionToMenu(JMenu menu,
Action act)
_more_ |
static JMenuItem |
addActionToMenu(JMenu menu,
Action act,
int menuPos)
creates a MenuItem using the given Action and adds it to the given Menu. |
static ImageIcon |
getIcon(String name,
boolean errMsg)
Get the named Icon from the default resource (jar file). |
static Image |
getImage(String name)
Get the named Image from the default resource (jar file). |
static AbstractButton |
makeButtcon(Icon icon,
Icon rollover,
String tooltip,
boolean is_toggle)
Make a "buttcon" = button with an Icon |
static Cursor |
makeCursor(String name)
Make a cursor from the named Image in the default resource (jar file) |
static void |
setActionProperties(AbstractAction act,
String icon_name,
String action_name,
boolean is_toggle,
int mnemonic,
int accel)
Standard way to set Properties for Actions. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ROLLOVER_ICON
public static final String TOGGLE
public static final String MNEMONIC
public static final String ACCEL
public static final String STATE
| Constructor Detail |
|---|
public BAMutil()
| Method Detail |
|---|
public static ImageIcon getIcon(String name,
boolean errMsg)
name - name of the Icon ( will look for errMsg - true= print error message if not found
public static Image getImage(String name)
name - name of the Image ( will look for public static Cursor makeCursor(String name)
name - name of the Image ( will look for
public static AbstractButton makeButtcon(Icon icon,
Icon rollover,
String tooltip,
boolean is_toggle)
icon - the normal Iconrollover - the rollover Icontooltip - the tooltipis_toggle - if true, make JToggleButton, else JButton
public static JMenuItem addActionToMenu(JMenu menu,
Action act,
int menuPos)
Action.SHORT_DESCRIPTION String MenuItem text (required)
Action.SMALL_ICON Icon the Icon to Use
BAMutil.ROLLOVER_ICON Icon the rollover Icon
BAMutil.TOGGLE Boolean true if its a toggle
BAMutil.MNEMONIC Integer menu item shortcut
BAMutil.ACCEL Integer menu item global keyboard accelerator
menu - add to this menuact - the Action to make it out ofmenuPos -
public static JMenuItem addActionToMenu(JMenu menu,
Action act)
menu - act -
public static AbstractButton addActionToContainerPos(Container c,
Action act,
int pos)
Action.SMALL_ICON Icon the Icon to Use (required)
BAMutil.ROLLOVER_ICON Icon the rollover Icon
Action.SHORT_DESCRIPTION String tooltip
BAMutil.TOGGLE Boolean true if its a toggle
c - add to this Containeract - the Action to make it out ofpos - add to the container at this position (if pos < 0, add at the end)
public static AbstractButton addActionToContainer(Container c,
Action act)
c - act -
public static void setActionProperties(AbstractAction act,
String icon_name,
String action_name,
boolean is_toggle,
int mnemonic,
int accel)
act - add properties to this actionicon_name - name of icon (or null).action_name - menu name / tooltipis_toggle - true if its a togglemnemonic - menu item shortcutaccel - menu item global keyboard accelerator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||