Package jmri.jmrit.display.palette
Class IconItemPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- jmri.jmrit.display.palette.ItemPanel
-
- jmri.jmrit.display.palette.IconItemPanel
-
- All Implemented Interfaces:
java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,javax.accessibility.Accessible
- Direct Known Subclasses:
BackgroundItemPanel
,ClockItemPanel
public class IconItemPanel extends ItemPanel
ItemPanel for plain Icons and Backgrounds. Does NOT use IconDialog class to add, replace or delete icons.- See Also:
palette class diagram
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
IconItemPanel.ADropJLabel
(package private) class
IconItemPanel.ADropTargetListener
class
IconItemPanel.IconDisplayPanel
class
IconItemPanel.IconDragJLabel
(package private) class
IconItemPanel.IconListener
-
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
Fields Modifier and Type Field Description protected CatalogPanel
_catalog
protected javax.swing.JButton
_catalogButton
protected javax.swing.JButton
_deleteIconButton
protected int
_level
protected java.awt.datatransfer.DataFlavor
_namedIconDataFlavor
protected java.awt.datatransfer.DataFlavor
_positionableDataFlavor
protected IconItemPanel.IconDisplayPanel
_selectedIcon
-
Fields inherited from class jmri.jmrit.display.palette.ItemPanel
_askOnce, _bottomPanel, _currentIconMap, _doneAction, _frame, _iconFamilyPanel, _iconPanel, _initialized, _instructions, _itemType, _linkName, _previewPanel, _suppressDragging, _update, _wasEmpty, INDICATOR_TRACK, LIGHT, MULTISENSOR, NAME_MAP, PORTAL, RPSREPORTER, SENSOR, SIGNALHEAD, STATE_MAP, TURNOUT
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor Description IconItemPanel(DisplayFrame parentFrame, java.lang.String type)
Constructor for plain icons and backgrounds.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
deleteIcon()
Action item for makeBottomPanel.void
deselectIcon()
NamedIcon
getUpdateIcon()
protected void
hideCatalog()
protected void
hideIcons()
void
init()
Initialize panel for selecting a new Control Panel item or for updating an existing item.void
init(java.awt.event.ActionListener doneAction)
Init for update of existing palette item type.protected void
initIconFamiliesPanel()
Initialize or reset an ItemPanel.protected void
initLinkPanel()
protected javax.swing.JPanel
instructions()
protected CatalogPanel
makeCatalog()
protected void
makeFamiliesPanel()
Part of the initialization and reseting of an ItemPanel.protected javax.swing.JPanel
makeIconDisplayPanel(java.lang.String key, java.util.HashMap<java.lang.String,NamedIcon> iconMap, boolean dropIcon)
Utility for above method.protected javax.swing.JPanel
makeItemButtonPanel()
Make a button panel to populate editing an ItemPanelprotected javax.swing.JPanel
makeSpecialBottomPanel(boolean update)
Replacement panel for _bottomPanel when no icon families exist for _itemType.protected void
previewColorChange()
protected void
putIcon(java.lang.String name, NamedIcon icon)
protected java.lang.String
setIconName(java.lang.String name)
protected void
setSelection(IconItemPanel.IconDisplayPanel panel)
void
setUpdateIcon(NamedIcon icon)
protected void
showCatalog()
-
Methods inherited from class jmri.jmrit.display.palette.ItemPanel
addIconsToPanel, checkIconMap, closeDialogs, itemGridBagConstraint, loadDefaultType, makeBottomPanel, makeNewIconMap, makePreviewPanel, makeUpdateButton, mapsAreEqual, reSizeDisplay, shellDimension, wrapIconImage
-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
_catalogButton
protected javax.swing.JButton _catalogButton
-
_deleteIconButton
protected javax.swing.JButton _deleteIconButton
-
_catalog
protected CatalogPanel _catalog
-
_selectedIcon
protected IconItemPanel.IconDisplayPanel _selectedIcon
-
_positionableDataFlavor
protected java.awt.datatransfer.DataFlavor _positionableDataFlavor
-
_namedIconDataFlavor
protected java.awt.datatransfer.DataFlavor _namedIconDataFlavor
-
_level
protected int _level
-
-
Constructor Detail
-
IconItemPanel
public IconItemPanel(DisplayFrame parentFrame, java.lang.String type)
Constructor for plain icons and backgrounds.- Parameters:
type
- typeparentFrame
- parentFrame
-
-
Method Detail
-
init
public void init()
Description copied from class:ItemPanel
Initialize panel for selecting a new Control Panel item or for updating an existing item. Adds table if item is a bean. i.e. customizes for the item type. Called by enclosing TabbedPanel on change of displayed tab Pane.
-
init
public void init(java.awt.event.ActionListener doneAction)
Init for update of existing palette item type.- Parameters:
doneAction
- doneAction
-
instructions
protected javax.swing.JPanel instructions()
- Specified by:
instructions
in classItemPanel
-
makeCatalog
protected CatalogPanel makeCatalog()
-
previewColorChange
protected void previewColorChange()
- Overrides:
previewColorChange
in classItemPanel
-
initIconFamiliesPanel
protected void initIconFamiliesPanel()
Description copied from class:ItemPanel
Initialize or reset an ItemPanel.- Overrides:
initIconFamiliesPanel
in classItemPanel
-
makeFamiliesPanel
protected void makeFamiliesPanel()
Description copied from class:ItemPanel
Part of the initialization and reseting of an ItemPanel. Allows divergence for different panel needs.- Specified by:
makeFamiliesPanel
in classItemPanel
-
makeIconDisplayPanel
protected javax.swing.JPanel makeIconDisplayPanel(java.lang.String key, java.util.HashMap<java.lang.String,NamedIcon> iconMap, boolean dropIcon)
Description copied from class:ItemPanel
Utility for above method. Implementation returns a JPanel extension containing a bordered JLabel extension of icon and labels- Specified by:
makeIconDisplayPanel
in classItemPanel
- Parameters:
key
- name of iconiconMap
- containing icon for possible replacementdropIcon
- JLabel extension may be replaceable or dragable.- Returns:
- the JPanel
-
makeItemButtonPanel
protected javax.swing.JPanel makeItemButtonPanel()
Description copied from class:ItemPanel
Make a button panel to populate editing an ItemPanel- Specified by:
makeItemButtonPanel
in classItemPanel
- Returns:
- the panel
-
makeSpecialBottomPanel
protected javax.swing.JPanel makeSpecialBottomPanel(boolean update)
Replacement panel for _bottomPanel when no icon families exist for _itemType.- Specified by:
makeSpecialBottomPanel
in classItemPanel
- Parameters:
update
- edit icons on a panel- Returns:
- the panel
-
hideCatalog
protected void hideCatalog()
-
showCatalog
protected void showCatalog()
-
deleteIcon
protected void deleteIcon()
Action item for makeBottomPanel.
-
setSelection
protected void setSelection(@Nonnull IconItemPanel.IconDisplayPanel panel)
-
deselectIcon
public void deselectIcon()
-
setIconName
protected java.lang.String setIconName(java.lang.String name)
-
initLinkPanel
protected void initLinkPanel()
-
setUpdateIcon
public void setUpdateIcon(NamedIcon icon)
-
getUpdateIcon
public NamedIcon getUpdateIcon()
-
-