Package jmri.jmrit.display.palette
Class ItemPalette
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
jmri.util.JmriJFrame
jmri.jmrit.display.DisplayFrame
jmri.jmrit.display.palette.ItemPalette
- All Implemented Interfaces:
ComponentListener,WindowListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,ChangeListener,RootPaneContainer,WindowConstants,BeanInterface,ModifiedFlag,WindowInterface
Container for adding items to Control Panels. Starting point for palette package.
Loads and stores icons used in Control Panel Editor panels. For background colors to work on a particular editor instance, select the 'Item Palette' item under 'Add Items' menu and configure the 'Backgrounds' tab ItemPalette for that editor. Otherwise any item can be dragged and dropped to any editor.
The icons are displayed on the background of the last editor to call the
ItemPalette instance. In session the user can set it to another color or a white/gray
squares pattern using the "View on:" combo. This choice is shared across tabs
as a field on the DisplayFrame parent frame.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class jmri.util.JmriJFrame
JmriJFrame.ScreenDimensionsNested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrameNested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrameNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategyNested classes/interfaces inherited from interface jmri.util.swing.WindowInterface
WindowInterface.Hint -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static JTabbedPane(package private) static final Stringstatic final intFields inherited from class jmri.util.JmriJFrame
allowInFrameServlet, properties, reuseFrameSavedPosition, reuseFrameSavedSized, windowInterfaceFields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabledFields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSORFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static booleanAdd a new Family of icons to the device type.(package private) static voidaddItemTab(ItemPanel itemPanel, String key, String tabTitle) protected static boolean************ Currently only needed for IndicatorTO type **************protected static void(package private) static voidbuildTabPane(ItemPalette palette) static StringconvertText(String name) Default key names as listed in defaultPanelIcons.xml are Bundle keys and nodes in the CatalogTree.static ItemPalettegetDefault(String title, Editor ed) (package private) static List<org.jdom2.Element>getFamilyMaps(String type) Get all the Families of icons for a given device type.getIconMap(String type, String family) getLevel4Family(String type, String family) getLevel4FamilyMaps(String type) (package private) static intloadDefaultFamilyMap(List<org.jdom2.Element> families, HashMap<String, HashMap<String, NamedIcon>> familyMap) (package private) static voidloadDefaultIndicatorTOMap(List<org.jdom2.Element> typeList, HashMap<String, HashMap<String, HashMap<String, NamedIcon>>> familyTOMap) (package private) static voidloadFamilies(String typeName, List<org.jdom2.Element> families) loadFamilyMap(CatalogTreeNode node) static voidstatic voidloadMissingItemType(String itemType) (package private) static booleanprotected static voidremoveIconMap(String type, String family) Remove a Family of icons from the device type.protected static voidremoveLevel4IconMap(String type, String family, String key) void(package private) static voidsetTabs()void(package private) static CatalogTreeNodestatic voidStore palette icons in preferences file catalogTrees.xmlMethods inherited from class jmri.jmrit.display.DisplayFrame
getBackground, getCurrentColor, getEditor, getPreviewBackground, getPreviewBg, reSize, setPreviewBg, updateBackgroundMethods inherited from class jmri.util.JmriJFrame
addHelpMenu, componentHidden, componentMoved, componentResized, componentShown, dispose, generateWindowRef, getAllowInFrameServlet, getEscapeKeyAction, getEscapeKeyClosesWindow, getFrame, getFrame, getFrameList, getFrameList, getIndexedProperty, getMaximumSize, getModifiedFlag, getPreferredSize, getProperty, getPropertyNames, getSavePosition, getSaveSize, getScreenDimensions, getWindowFrameRef, getWindowInterface, handleModified, hasIndexedProperty, hasProperty, initComponents, makePrivateWindow, makePublicWindow, markWindowModified, multipleInstances, pack, setAllowInFrameServlet, setEscapeKeyAction, setEscapeKeyClosesWindow, setFrameLocation, setIndexedProperty, setModifiedFlag, setProperty, setSavePosition, setSaveSize, setShutDownTask, setWindowInterface, show, show, storeValues, undecorate, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpenedMethods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateMethods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecoratedMethods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFrontMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMinimumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.awt.MenuContainer
getFont, postEvent
-
Field Details
-
STRUT_SIZE
- See Also:
-
RED_X
- See Also:
-
_tabPane
-
_tabIndex
-
-
Constructor Details
-
ItemPalette
-
-
Method Details
-
storeIcons
Store palette icons in preferences file catalogTrees.xml -
store3levelMap
static CatalogTreeNode store3levelMap(String type, HashMap<String, HashMap<String, NamedIcon>> familyMap) -
loadIcons
-
loadSavedIcons
-
loadIndicatorFamilyMap
static HashMap<String,HashMap<String, loadIndicatorFamilyMapHashMap<String, NamedIcon>>> (CatalogTreeNode node) -
loadFamilyMap
-
getDefaultIconItemTypes
static List<org.jdom2.Element> getDefaultIconItemTypes() throws org.jdom2.JDOMException, IOException- Throws:
org.jdom2.JDOMExceptionIOException
-
loadDefaultIcons
-
loadFamilies
-
loadMissingItemType
-
loadDefaultFamilyMap
-
loadDefaultIndicatorTOMap
-
getDefault
-
setEditor
-
buildTabPane
-
addItemTab
-
getTabWidth
-
setTabs
-
stateChanged
- Specified by:
stateChangedin interfaceChangeListener
-
addFamily
Add a new Family of icons to the device type.- Parameters:
type- type to retrievefamily- name for iconMap "family"iconMap- icon HashMap providing the images- Returns:
- result
-
getFamilyMaps
Get all the Families of icons for a given device type.- Parameters:
type- type- Returns:
- map of families
-
removeIconMap
Remove a Family of icons from the device type.- Parameters:
type- typefamily- family
-
getIconMap
-
addLevel4Family
protected static boolean addLevel4Family(String type, String family, HashMap<String, HashMap<String, NamedIcon>> iconMap) ************ Currently only needed for IndicatorTO type **************- Parameters:
type- typefamily- familyiconMap- iconMap- Returns:
- result
-
addLevel4FamilyMap
-
getLevel4FamilyMaps
-
getLevel4Family
-
removeLevel4IconMap
-
cloneMap
-
convertText
Default key names as listed in defaultPanelIcons.xml are Bundle keys and nodes in the CatalogTree. However users also define icon sets and store them in the CatalogTree. The names the user has defined for these sets (i.e.family" name) are also nodes in the CatalogTree. So it is expected that such names will fall through as an Exception. Thus these names are returned as the user has entered them. There is no failure of I18N here.- Parameters:
name- key name- Returns:
- usable UI display name
-
