|
||||||||||
| 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.SlipTurnoutIcon
public class SlipTurnoutIcon
An icon to display a status of a Slip, either Single or Double.
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.
Note: lower west to lower east icon is used for storing the slip icon, in a single slip, even if the slip is set for upper west to upper east.
With a 3-Way point we use the following translations
Based upon the TurnoutIcon by Bob Jacobsen
| 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 | |
|---|---|
static int |
DOUBLESLIP
Constant used to refer to a Double Slip Configuration. |
static int |
EAST
Constant used to referred to the Turnout address configured to operate the east (or second for a three way) of the Turnout. |
static int |
LOWEREAST
Constant used for a scissor crossing using 4 turnout address, and refers to the turnout located at the lower east. |
static int |
LOWERWEST
Constant used for a scissor crossing using 4 turnout address, and refers to the turnout located at the lower west. |
static int |
SCISSOR
Constant used to refer to a Scissor (Double Crossover) Configuration. |
static int |
SINGLESLIP
Constant used to refer to a Single Slip Configuration. |
static int |
THREEWAY
Constant used to refer to a Three Way Turnout Configuration. |
static int |
WEST
Constant used to referred to the Turnout address configured to operate the west (or first for a three way) of the Turnout. |
| 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, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
SlipTurnoutIcon(Editor editor)
|
|
| Method Summary | |
|---|---|
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()
|
NamedIcon |
getInconsistentIcon()
|
NamedIcon |
getLowerWestToLowerEastIcon()
|
NamedIcon |
getLowerWestToUpperEastIcon()
|
String |
getLWLEText()
Get the text used in the pop-up for setting the route from Lower West to Lower East. |
String |
getLWUEText()
Get the text used in the pop-up for setting the route from Lower West to Upper East For a scissor crossing this the Left-hand crossing. |
NamedBeanHandle<Turnout> |
getNamedTurnout(int turn)
|
String |
getNameString()
Methods to add popup menu items return true if a popup item is set |
boolean |
getSingleSlipRoute()
Single Slip Route, determines if the slip route is from upper west to upper east (true) or lower west to lower east (false) This also doubles up for the three way and determines if the first turnout routes to the upper (true) or lower (false) exit point. |
boolean |
getTristate()
|
Turnout |
getTurnout(int turn)
Returns the turnout located at the position specified. |
protected HashMap<Turnout,Integer> |
getTurnoutSettings()
|
int |
getTurnoutType()
|
NamedIcon |
getUnknownIcon()
|
NamedIcon |
getUpperWestToLowerEastIcon()
|
NamedIcon |
getUpperWestToUpperEastIcon()
|
String |
getUWLEText()
Get the text used in the pop-up for setting the route from Upper West to Lower East. |
String |
getUWUEText()
Get the text used in the pop-up for setting the route from Upper West to Upper East. |
protected boolean |
isSlipBusy()
Method to query if Slip is busy (returns true if commands are being issued to Slips turnouts) |
int |
maxHeight()
|
int |
maxWidth()
|
void |
propertyChange(PropertyChangeEvent e)
|
protected void |
reset()
|
void |
rotate(int deg)
|
protected void |
rotateOrthogonal()
popup AbstractAction.actionPerformed method overrides |
void |
setInconsistentIcon(NamedIcon i)
|
void |
setLowerWestToLowerEastIcon(NamedIcon i)
|
void |
setLowerWestToUpperEastIcon(NamedIcon i)
|
void |
setLWLEText(String txt)
|
void |
setLWUEText(String txt)
|
void |
setScale(double s)
|
void |
setSingleSlipRoute(boolean route)
|
protected void |
setSlipBusy()
Method to set Slip busy when commands are being issued to Slip turnouts |
protected void |
setSlipNotBusy()
Method to set Slip not busy when all commands have been issued to Slip turnouts |
boolean |
setTextEditMenu(JPopupMenu popup)
|
void |
setTristate(boolean set)
|
void |
setTurnout(NamedBeanHandle<Turnout> to,
int turn)
Attached a namedBean Handle turnout to this display item |
void |
setTurnout(String pName,
int turn)
Attached a named turnout to this display item |
void |
setTurnoutType(int slip)
Sets the type of turnout configuration which is being used |
void |
setUnknownIcon(NamedIcon i)
|
void |
setUpperWestToLowerEastIcon(NamedIcon i)
|
void |
setUpperWestToUpperEastIcon(NamedIcon i)
|
void |
setUWLEText(String txt)
|
void |
setUWUEText(String txt)
|
boolean |
showPopUp(JPopupMenu popup)
Displays a popup menu to select a given state, rather than cycling through each state |
void |
slipTurnoutTextEdit(String name)
|
| 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 |
|---|
public static final int WEST
public static final int EAST
public static final int LOWERWEST
public static final int LOWEREAST
public static final int DOUBLESLIP
public static final int SINGLESLIP
public static final int THREEWAY
public static final int SCISSOR
| Constructor Detail |
|---|
public SlipTurnoutIcon(Editor editor)
| Method Detail |
|---|
public void setTurnout(String pName,
int turn)
pName - Used as a system/user name to lookup the turnout objectturn - is used to determine which turnout position this is for.
0x01 - West
0x02 - East
0x04 - Lower West
0x06 - Upper East
public void setTurnout(NamedBeanHandle<Turnout> to,
int turn)
to - Used as the NamedBeanHandle to lookup the turnout objectturn - is used to determine which turnout position this is for.
public void setTurnoutType(int slip)
slip - - valid values are
public int getTurnoutType()
public boolean getSingleSlipRoute()
In a Scissor crossing this returns true if only two turnout address are required to set the crossing or false if four turnout address are required
public void setSingleSlipRoute(boolean route)
public Turnout getTurnout(int turn)
turn - See constants for EAST, WEST, LOWEREAST, LOWERWESTpublic NamedBeanHandle<Turnout> getNamedTurnout(int turn)
public NamedIcon getLowerWestToUpperEastIcon()
public void setLowerWestToUpperEastIcon(NamedIcon i)
public NamedIcon getUpperWestToLowerEastIcon()
public void setUpperWestToLowerEastIcon(NamedIcon i)
public NamedIcon getLowerWestToLowerEastIcon()
public void setLowerWestToLowerEastIcon(NamedIcon i)
public NamedIcon getUpperWestToUpperEastIcon()
public void setUpperWestToUpperEastIcon(NamedIcon i)
public NamedIcon getInconsistentIcon()
public void setInconsistentIcon(NamedIcon i)
public NamedIcon getUnknownIcon()
public void setUnknownIcon(NamedIcon i)
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 getNameString()
Positionable
getNameString in interface PositionablegetNameString in class PositionableLabelpublic void setTristate(boolean set)
public boolean getTristate()
protected 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 String getLWUEText()
public String getUWLEText()
public String getLWLEText()
public String getUWUEText()
public void setLWUEText(String txt)
public void setUWLEText(String txt)
public void setLWLEText(String txt)
public void setUWUEText(String txt)
protected void edit()
edit in class PositionableLabelpublic void doMouseClicked(MouseEvent e)
doMouseClicked in interface PositionabledoMouseClicked in class PositionableLabele - protected HashMap<Turnout,Integer> getTurnoutSettings()
protected void reset()
public boolean showPopUp(JPopupMenu popup)
showPopUp in interface PositionableshowPopUp in class PositionableLabelpopup - public boolean setTextEditMenu(JPopupMenu popup)
setTextEditMenu in interface PositionablesetTextEditMenu in class PositionableLabelpublic void slipTurnoutTextEdit(String name)
public void dispose()
PositionableLabel
dispose in class PositionableLabelprotected void setSlipBusy()
protected void setSlipNotBusy()
protected boolean isSlipBusy()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||