|
||||||||||
| 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.JLabel
jmri.jmrit.display.PositionableLabel
jmri.jmrit.display.TurnoutIcon
public class TurnoutIcon
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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JLabel |
|---|
JLabel.AccessibleJLabel |
| 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 | |
|---|---|
protected Hashtable<Integer,NamedIcon> |
_iconMap
|
protected Hashtable<String,Integer> |
_name2stateMap
|
protected Hashtable<Integer,String> |
_state2nameMap
|
| Fields inherited from class jmri.jmrit.display.PositionableLabel |
|---|
_control, _controlling, _displayLevel, _editable, _editor, _hidden, _icon, _namedIcon, _positionable, _showTooltip, _text, _tooltip, _viewCoordinates, rb, rbean |
| Fields inherited from class javax.swing.JLabel |
|---|
labelFor |
| 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 javax.swing.SwingConstants |
|---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
TurnoutIcon(Editor editor)
|
|
| Method Summary | |
|---|---|
protected Hashtable<Integer,NamedIcon> |
cloneMap(Hashtable<Integer,NamedIcon> map,
TurnoutIcon pos)
|
Positionable |
deepClone()
Make a deep copy of Positional object. |
void |
dispose()
Clean up when this object is no longer needed. |
void |
doMouseClicked(MouseEvent e)
Throw the turnout when the icon is clicked |
protected void |
edit()
|
protected void |
editItem()
|
Positionable |
finishClone(Positionable p)
Finsh the deep Copy of a Positional object. |
String |
getFamily()
|
NamedIcon |
getIcon(int state)
|
NamedIcon |
getIcon(String state)
Get icon by its localized bean state name |
NamedBeanHandle<Turnout> |
getNamedTurnout()
|
String |
getNameString()
Methods to add popup menu items return true if a popup item is set |
String |
getStateName(int state)
|
boolean |
getTristate()
|
Turnout |
getTurnout()
|
int |
maxHeight()
|
int |
maxWidth()
|
void |
propertyChange(PropertyChangeEvent e)
|
void |
rotate(int deg)
|
protected void |
rotateOrthogonal()
popup AbstractAction method overrides |
boolean |
setEditIconMenu(JPopupMenu popup)
|
boolean |
setEditItemMenu(JPopupMenu popup)
|
void |
setFamily(String family)
|
void |
setIcon(String name,
NamedIcon icon)
Place icon by its bean state name key found in jmri.NamedBeanBundle.properties That is, by its localized bean state name |
void |
setScale(double s)
|
void |
setTristate(boolean set)
|
void |
setTurnout(NamedBeanHandle<Turnout> to)
|
void |
setTurnout(String pName)
Attached a named turnout to this display item |
boolean |
showPopUp(JPopupMenu popup)
Pop-up displays unique attributes of turnouts |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface jmri.jmrit.display.Positionable |
|---|
contains, getBackground, getBounds, getFont, getForeground, getHeight, getLocation, getParent, getPreferredSize, getWidth, getX, getY, invalidate, isOpaque, repaint, setBackground, setBorder, setForeground, setLocation, setLocation, setOpaque, setSize, setVisible |
| Field Detail |
|---|
protected Hashtable<Integer,NamedIcon> _iconMap
protected Hashtable<String,Integer> _name2stateMap
protected Hashtable<Integer,String> _state2nameMap
| Constructor Detail |
|---|
public TurnoutIcon(Editor editor)
| Method Detail |
|---|
public Positionable deepClone()
Positionable
deepClone in interface PositionabledeepClone in class PositionableLabelpublic Positionable finishClone(Positionable p)
Positionable
finishClone in interface PositionablefinishClone in class PositionableLabelpublic void setTurnout(String pName)
pName - Used as a system/user name to lookup the turnout objectpublic void setTurnout(NamedBeanHandle<Turnout> to)
public Turnout getTurnout()
public NamedBeanHandle<Turnout> getNamedTurnout()
public void setIcon(String name,
NamedIcon icon)
public NamedIcon getIcon(String state)
public NamedIcon getIcon(int state)
public String getFamily()
public void setFamily(String family)
public int maxHeight()
maxHeight in interface PositionablemaxHeight in class PositionableLabelpublic int maxWidth()
maxWidth in interface PositionablemaxWidth in class PositionableLabelpublic void propertyChange(PropertyChangeEvent e)
propertyChange in interface PropertyChangeListenerpublic String getStateName(int state)
public String getNameString()
Positionable
getNameString in interface PositionablegetNameString in class PositionableLabelpublic void setTristate(boolean set)
public boolean getTristate()
public boolean showPopUp(JPopupMenu popup)
showPopUp in interface PositionableshowPopUp in class PositionableLabelprotected void rotateOrthogonal()
rotateOrthogonal in class PositionableLabelpublic void setScale(double s)
setScale in interface PositionablesetScale in class PositionableLabelpublic void rotate(int deg)
rotate in interface Positionablerotate in class PositionableLabelpublic boolean setEditItemMenu(JPopupMenu popup)
setEditItemMenu in interface PositionablesetEditItemMenu in class PositionableLabelprotected void editItem()
public boolean setEditIconMenu(JPopupMenu popup)
setEditIconMenu in interface PositionablesetEditIconMenu in class PositionableLabelprotected void edit()
edit in class PositionableLabelpublic void doMouseClicked(MouseEvent e)
doMouseClicked in interface PositionabledoMouseClicked in class PositionableLabele - public void dispose()
PositionableLabel
dispose in class PositionableLabel
protected Hashtable<Integer,NamedIcon> cloneMap(Hashtable<Integer,NamedIcon> map,
TurnoutIcon pos)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||