Class TurnoutIcon

  • All Implemented Interfaces:
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.SwingConstants, Positionable, InlineLogixNG
    Direct Known Subclasses:
    IndicatorTurnoutIcon

    public class TurnoutIcon
    extends PositionableIcon
    implements java.beans.PropertyChangeListener
    An icon to display a status of a turnout.

    This responds to only KnownState, leaving CommandedState to some other graphic representation later.

    A click on the icon will command a state change. Specifically, it will set the CommandedState to the opposite (THROWN vs CLOSED) of the current KnownState.

    The default icons are for a left-handed turnout, facing point for east-bound traffic.

    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.JLabel

        javax.swing.JLabel.AccessibleJLabel
      • Nested classes/interfaces inherited from class javax.swing.JComponent

        javax.swing.JComponent.AccessibleJComponent
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Constructor Summary

      Constructors 
      Constructor Description
      TurnoutIcon​(Editor editor)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void addTristateEntry​(javax.swing.JPopupMenu popup)  
      (package private) void alternateOnClick()  
      boolean buttonLive()  
      protected java.util.HashMap<java.lang.Integer,​NamedIcon> cloneMap​(java.util.HashMap<java.lang.Integer,​NamedIcon> map, TurnoutIcon pos)  
      Positionable deepClone()
      Make a deep copy of Positional object.
      void displayState​(int state)
      Drive the current state of the display from the state of the turnout.
      void dispose()
      Clean up when this object is no longer needed.
      void doMouseClicked​(JmriMouseEvent e)  
      void doMousePressed​(JmriMouseEvent e)  
      void doMouseReleased​(JmriMouseEvent e)  
      protected void edit()  
      protected void editItem()  
      protected Positionable finishClone​(TurnoutIcon pos)  
      boolean getDirectControl()  
      NamedIcon getIcon​(int state)  
      NamedIcon getIcon​(java.lang.String state)
      Get icon by its localized bean state name.
      boolean getMomentary()  
      NamedBean getNamedBean()
      Provide a generic method to return the bean associated with the Positionable.
      NamedBeanHandle<Turnout> getNamedTurnout()  
      java.lang.String getNameString()
      Get the name of the positional as a String.
      java.lang.String getStateName​(int state)  
      boolean getTristate()  
      Turnout getTurnout()  
      java.lang.String getTypeString()
      Get the type of the positional as a String.
      int maxHeight()  
      int maxWidth()  
      void propertyChange​(java.beans.PropertyChangeEvent e)  
      void rotate​(int deg)  
      protected void rotateOrthogonal()
      ****** popup AbstractAction method overrides ********
      void setDirectControl​(boolean m)  
      boolean setEditIconMenu​(javax.swing.JPopupMenu popup)
      Add additional menu items to the menu.
      boolean setEditItemMenu​(javax.swing.JPopupMenu popup)
      Add additional menu items to the menu.
      void setIcon​(java.lang.String name, NamedIcon icon)
      Place icon by its localized bean state name.
      void setMomentary​(boolean m)  
      void setScale​(double s)  
      void setTristate​(boolean set)  
      void setTurnout​(java.lang.String pName)
      Attach a named turnout to this display item.
      void setTurnout​(NamedBeanHandle<Turnout> to)  
      boolean showPopUp​(javax.swing.JPopupMenu popup)
      Pop-up displays unique attributes of turnouts
      (package private) int turnoutState()
      Get current state of attached turnout
      (package private) void updateItem()  
      (package private) void updateTurnout()  
      • Methods inherited from class javax.swing.JLabel

        checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setUI, setVerticalAlignment, setVerticalTextPosition, 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, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait