|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
jmri.jmrit.display.IconAdder
public class IconAdder
Provides a simple editor for selecting N NamedIcons. Class for Icon Editors implements "Drag n Drop". Allows drops from icons dragged from a Catalog preview pane.
See SensorIcon for an item
that might want to have that type of information, and
PanelEditor
for an example of how to use this.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static ResourceBundle |
rb
|
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
IconAdder()
|
|
IconAdder(boolean allowDeletes)
|
|
IconAdder(String type)
|
|
| Method Summary | |
|---|---|
protected void |
addAdditionalButtons(JPanel p)
|
void |
addCatalog()
|
void |
addDirectoryToCatalog(File dir)
|
boolean |
addIconIsEnabled()
|
void |
addTreeToCatalog(CatalogTree tree)
|
void |
complete(ActionListener addIconAction,
boolean changeIcon,
boolean addToTable,
boolean update)
|
void |
dispose()
Clean up when its time to make it all go away |
protected void |
doIconPanel()
|
CatalogTreeNode |
getDefaultIconNode()
|
CatalogTreeNode |
getDefaultIconNodeFromMap()
|
NamedIcon |
getIcon(String key)
Returns a new NamedIcon object for your own use. |
Hashtable<String,NamedIcon> |
getIconMap()
Returns a new Hashtable of only the icons selected for display. |
int |
getNumIcons()
|
NamedBean |
getTableSelection()
Used by Panel Editor to make the final installation of the icon(s) into the user's Panel. |
void |
initDefaultIcons()
|
void |
makeIconPanel(boolean useDefaults)
After all the calls to setIcon(...) are made, make the icon display. |
void |
reset()
|
protected void |
setIcon(int order,
String label,
NamedIcon icon)
|
void |
setIcon(int order,
String label,
String name)
install the icons used to represent all the states of the entity being edited |
void |
setParent(JFrame parent)
|
void |
setPickList(PickListModel tableModel)
After the calls to makeIconPanel(), optionally. |
void |
setSelection(NamedBean bean)
|
void |
valueChanged(ListSelectionEvent e)
When a Pick list is installed, table selection controls the Add button |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final ResourceBundle rb
| Constructor Detail |
|---|
public IconAdder()
public IconAdder(boolean allowDeletes)
public IconAdder(String type)
| Method Detail |
|---|
public void reset()
public void initDefaultIcons()
public CatalogTreeNode getDefaultIconNodeFromMap()
public CatalogTreeNode getDefaultIconNode()
protected void setIcon(int order,
String label,
NamedIcon icon)
order - -the index to Sensor's name and the inverse order that icons are drawn in doIconPanel()label - -the Sensor's name displayed in the icon panel and the key to the icon button in _iconMapicon - -the icon displayed in the icon button
public void setIcon(int order,
String label,
String name)
label - - the state name to display, Must be unique from all other
calls to this method.name - - the resource name of the icon image to displaorder - - (reverse) order of display, (0 last, to N first)public void setParent(JFrame parent)
public int getNumIcons()
public void makeIconPanel(boolean useDefaults)
protected void doIconPanel()
public void setPickList(PickListModel tableModel)
public void setSelection(NamedBean bean)
public void valueChanged(ListSelectionEvent e)
valueChanged in interface ListSelectionListenerpublic NamedBean getTableSelection()
Note! the selection is cleared. When two successive calls are made, the 2nd will always return null, regardless of the 1st return.
public NamedIcon getIcon(String key)
key - Name of key (label)
public Hashtable<String,NamedIcon> getIconMap()
public void complete(ActionListener addIconAction,
boolean changeIcon,
boolean addToTable,
boolean update)
protected void addAdditionalButtons(JPanel p)
public boolean addIconIsEnabled()
public void addCatalog()
public void addDirectoryToCatalog(File dir)
public void addTreeToCatalog(CatalogTree tree)
public void dispose()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||