|
||||||||||
| 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
jmri.jmrit.display.IndicatorTurnoutIcon
public class IndicatorTurnoutIcon
An icon to display a status and state of a color coded turnout.
This responds to only KnownState, leaving CommandedState to some other graphic representation later.
"state" is the state of the underlying turnout ("closed", "thrown", etc.)
"status" is the operating condition of the track ("clear", "occupied", etc.)
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. This will display the setting of the turnout points.
The status is indicated by color and changes are done only done by the occupancy sensing - OBlock or other sensor.
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 |
|---|
| Fields inherited from class jmri.jmrit.display.TurnoutIcon |
|---|
_iconMap, _name2stateMap, _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 | |
|---|---|
IndicatorTurnoutIcon(Editor editor)
|
|
| Method Summary | |
|---|---|
void |
addPath(String path)
|
Positionable |
deepClone()
Make a deep copy of Positional object. |
void |
dispose()
Clean up when this object is no longer needed. |
protected void |
editItem()
|
Positionable |
finishClone(Positionable p)
Finsh the deep Copy of a Positional object. |
NamedIcon |
getIcon(String status,
int state)
Get clear icon by its localized bean state name |
Hashtable<String,Hashtable<Integer,NamedIcon>> |
getIconMaps()
|
NamedBeanHandle<OBlock> |
getNamedOccBlock()
|
NamedBeanHandle<Sensor> |
getNamedOccSensor()
|
String |
getNameString()
Methods to add popup menu items return true if a popup item is set |
OBlock |
getOccBlock()
|
Sensor |
getOccSensor()
|
Iterator<String> |
getPaths()
|
String |
getStateName(Integer state)
|
String |
getStatus()
|
int |
maxHeight()
|
int |
maxWidth()
|
void |
propertyChange(PropertyChangeEvent evt)
|
void |
removePath(String path)
|
void |
rotate(int deg)
|
protected void |
rotateOrthogonal()
popup AbstractAction.actionPerformed method overrides |
void |
setIcon(String status,
String stateName,
NamedIcon icon)
Place icon by its localized bean state name |
void |
setOccBlock(String pName)
Attached a named OBlock to display status |
void |
setOccBlockHandle(NamedBeanHandle<OBlock> blockHandle)
|
void |
setOccSensor(String pName)
Attached a named sensor to display status from OBlocks |
void |
setOccSensorHandle(NamedBeanHandle<Sensor> sen)
|
void |
setPaths(ArrayList<String> paths)
|
void |
setScale(double s)
|
void |
setShowTrain(boolean set)
|
boolean |
showTrain()
|
| Methods inherited from class jmri.jmrit.display.TurnoutIcon |
|---|
cloneMap, doMouseClicked, edit, getFamily, getIcon, getIcon, getNamedTurnout, getStateName, getTristate, getTurnout, setEditIconMenu, setEditItemMenu, setFamily, setIcon, setTristate, setTurnout, setTurnout, showPopUp |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IndicatorTurnoutIcon(Editor editor)
| Method Detail |
|---|
public Positionable deepClone()
Positionable
deepClone in interface PositionabledeepClone in class TurnoutIconpublic Positionable finishClone(Positionable p)
Positionable
finishClone in interface PositionablefinishClone in class TurnoutIconpublic Hashtable<String,Hashtable<Integer,NamedIcon>> getIconMaps()
public void setOccSensor(String pName)
setOccSensor in interface IndicatorTrackpName - Used as a system/user name to lookup the sensor objectpublic void setOccSensorHandle(NamedBeanHandle<Sensor> sen)
setOccSensorHandle in interface IndicatorTrackpublic Sensor getOccSensor()
getOccSensor in interface IndicatorTrackpublic NamedBeanHandle<Sensor> getNamedOccSensor()
getNamedOccSensor in interface IndicatorTrackpublic void setOccBlock(String pName)
setOccBlock in interface IndicatorTrackpName - Used as a system/user name to lookup the OBlock objectpublic void setOccBlockHandle(NamedBeanHandle<OBlock> blockHandle)
setOccBlockHandle in interface IndicatorTrackpublic OBlock getOccBlock()
getOccBlock in interface IndicatorTrackpublic NamedBeanHandle<OBlock> getNamedOccBlock()
getNamedOccBlock in interface IndicatorTrackpublic void setShowTrain(boolean set)
setShowTrain in interface IndicatorTrackpublic boolean showTrain()
showTrain in interface IndicatorTrackpublic Iterator<String> getPaths()
getPaths in interface IndicatorTrackpublic void setPaths(ArrayList<String> paths)
setPaths in interface IndicatorTrackpublic void addPath(String path)
addPath in interface IndicatorTrackpublic void removePath(String path)
removePath in interface IndicatorTrack
public void setIcon(String status,
String stateName,
NamedIcon icon)
status - - the track condition of the iconstateName - - NamedBean name of turnout stateicon - - icon corresponding to status and state
public NamedIcon getIcon(String status,
int state)
public String getStateName(Integer state)
public String getStatus()
public int maxHeight()
maxHeight in interface PositionablemaxHeight in class TurnoutIconpublic int maxWidth()
maxWidth in interface PositionablemaxWidth in class TurnoutIconprotected void rotateOrthogonal()
rotateOrthogonal in class TurnoutIconpublic void setScale(double s)
setScale in interface PositionablesetScale in class TurnoutIconpublic void rotate(int deg)
rotate in interface Positionablerotate in class TurnoutIconpublic String getNameString()
Positionable
getNameString in interface PositionablegetNameString in class TurnoutIconpublic void propertyChange(PropertyChangeEvent evt)
propertyChange in interface PropertyChangeListenerpropertyChange in class TurnoutIconprotected void editItem()
editItem in class TurnoutIconpublic void dispose()
PositionableLabel
dispose in class TurnoutIcon
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||