|
||||||||||
| 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.LayoutPositionableLabel
jmri.jmrit.display.LayoutSignalHeadIcon
public class LayoutSignalHeadIcon
This module provides an icon to display a status of a SignalHead on a LayoutEditor panel. This routine was copied from SignalHeadIcon.java, written by Bob Jacobsen, with only minor changes. The main differences are related to the hard interdependence between SignalHeadIconXml.java and PanelEditor.java, which made it very hard to use SignalHeadIcon.java directly with LayoutEditor without risking trouble for existing Panel Editor panels. Rectifying these differences is especially important when storing and loading a saved panel. That said, this module is linked to LayoutEditor.
This module has also been modified to use a resources bundle for its user-seen text as other LayoutEditor modules do.
SignalHeads are located via the SignalHeadManager, which in turn is located via the InstanceManager.
SignalHeadManager,
InstanceManager,
Serialized Form| 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.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected int |
clickMode
What to do on click? |
protected boolean |
litMode
How to handle lit vs not lit? |
| Fields inherited from class jmri.jmrit.display.LayoutPositionableLabel |
|---|
layoutPanel |
| 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 | |
|---|---|
LayoutSignalHeadIcon()
|
|
| Method Summary | |
|---|---|
void |
displayState(int state)
Drive the current state of the display from the state of the underlying SignalHead object. |
void |
dispose()
Clean up when this object is no longer needed. |
int |
getClickMode()
|
NamedIcon |
getDarkIcon()
|
NamedIcon |
getFlashGreenIcon()
|
NamedIcon |
getFlashRedIcon()
|
NamedIcon |
getFlashYellowIcon()
|
NamedIcon |
getGreenIcon()
|
NamedIcon |
getHeldIcon()
|
boolean |
getLitMode()
|
NamedIcon |
getRedIcon()
|
SignalHead |
getSignalHead()
|
NamedIcon |
getYellowIcon()
|
int |
headState()
Get current appearance of the head |
protected int |
maxHeight()
|
protected int |
maxWidth()
|
void |
mouseClicked(MouseEvent e)
Change the SignalHead state when the icon is clicked. |
void |
propertyChange(PropertyChangeEvent e)
|
void |
setClickMode(int mode)
|
void |
setDarkIcon(NamedIcon i)
|
void |
setFlashGreenIcon(NamedIcon i)
|
void |
setFlashRedIcon(NamedIcon i)
|
void |
setFlashYellowIcon(NamedIcon i)
|
void |
setGreenIcon(NamedIcon i)
|
void |
setHeldIcon(NamedIcon i)
|
void |
setLitMode(boolean mode)
|
void |
setProperToolTip()
|
void |
setRedIcon(NamedIcon i)
|
void |
setSignalHead(String pName)
Attached a numbered element to this display item |
void |
setYellowIcon(NamedIcon i)
|
protected void |
showPopUp(MouseEvent e)
Pop-up just displays the name |
| Methods inherited from class jmri.jmrit.display.LayoutPositionableLabel |
|---|
connect, displayCoordinateEdit, getControlling, getDisplayLevel, getEditable, getFixed, getForceControlOff, getPositionable, getShowTooltip, getViewCoordinates, isActive, isBackground, isIcon, isText, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, newStyleMenuItem, setControlling, setDisplayLevel, setDisplayLevel, setEditable, setFixed, setFontSize, setFontStyle, setForceControlOff, setPanel, setPositionable, setShowTooltip, setViewCoordinates, updateSize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int clickMode
protected boolean litMode
False means ignore (always show R/Y/G/etc appearance on screen); True means show "dark" if lit is set false.
Note that setting the appearance "DARK" explicitly will show the dark icon regardless of how this is set.
| Constructor Detail |
|---|
public LayoutSignalHeadIcon()
| Method Detail |
|---|
public void setSignalHead(String pName)
pName - Used as a system/user name to lookup the SignalHead objectpublic SignalHead getSignalHead()
public NamedIcon getHeldIcon()
public void setHeldIcon(NamedIcon i)
public NamedIcon getDarkIcon()
public void setDarkIcon(NamedIcon i)
public NamedIcon getRedIcon()
public void setRedIcon(NamedIcon i)
public NamedIcon getFlashRedIcon()
public void setFlashRedIcon(NamedIcon i)
public NamedIcon getYellowIcon()
public void setYellowIcon(NamedIcon i)
public NamedIcon getFlashYellowIcon()
public void setFlashYellowIcon(NamedIcon i)
public NamedIcon getGreenIcon()
public void setGreenIcon(NamedIcon i)
public NamedIcon getFlashGreenIcon()
public void setFlashGreenIcon(NamedIcon i)
protected int maxHeight()
maxHeight in class LayoutPositionableLabelprotected int maxWidth()
maxWidth in class LayoutPositionableLabelpublic int headState()
public void propertyChange(PropertyChangeEvent e)
propertyChange in interface PropertyChangeListenerpublic void setProperToolTip()
setProperToolTip in class LayoutPositionableLabelprotected void showPopUp(MouseEvent e)
showPopUp in class LayoutPositionableLabelpublic void displayState(int state)
public void setClickMode(int mode)
public int getClickMode()
public void setLitMode(boolean mode)
public boolean getLitMode()
public void mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenermouseClicked in class LayoutPositionableLabele - public void dispose()
LayoutPositionableLabel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||