|
||||||||||
| 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.PositionableIcon
jmri.jmrit.display.SignalMastIcon
public class SignalMastIcon
An icon to display a status of a SignalMast.
For now, this is done via text.
SignalMastManager,
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.BaselineResizeBehavior, 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.PositionableIcon |
|---|
_iconFamily, _iconMap, _rotate, _scale |
| 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 | |
|---|---|
SignalMastIcon(Editor editor)
|
|
| Method Summary | |
|---|---|
Positionable |
deepClone()
Make a deep copy of Positional object. |
void |
displayState(String state)
Drive the current state of the display from the state of the underlying SignalMast object. |
void |
dispose()
Clean up when this object is no longer needed. |
void |
doMouseClicked(MouseEvent e)
Change the SignalMast aspect when the icon is clicked. |
protected void |
editItem()
|
Positionable |
finishClone(Positionable p)
Finsh the deep Copy of a Positional object. |
int |
getClickMode()
|
boolean |
getLitMode()
|
NamedBeanHandle<SignalMast> |
getNamedSignalMast()
|
String |
getNameString()
Methods to add popup menu items return true if a popup item is set |
String |
getPName()
|
SignalMast |
getSignalMast()
|
String |
mastState()
Get current appearance of the mast |
void |
performMouseClicked(MouseEvent e)
This was added in so that the layout editor can handle the mouseclicked when zoomed in |
void |
propertyChange(PropertyChangeEvent e)
|
void |
rotate(int deg)
|
protected void |
rotateOrthogonal()
popup AbstractAction method overrides |
void |
setClickMode(int mode)
|
boolean |
setEditIconMenu(JPopupMenu popup)
|
boolean |
setEditItemMenu(JPopupMenu popup)
|
void |
setLitMode(boolean mode)
|
boolean |
setRotateOrthogonalMenu(JPopupMenu popup)
Rotate othogonally return true if popup is set |
void |
setScale(double s)
|
void |
setShowAutoText(boolean state)
|
void |
setSignalMast(NamedBeanHandle<SignalMast> sh)
Attached a signalmast element to this display item |
void |
setSignalMast(String pName)
Taken from the layout editor Attached a numbered element to this display item |
boolean |
showPopUp(JPopupMenu popup)
Pop-up just displays the name |
String |
useIconSet()
|
void |
useIconSet(String icon)
|
| Methods inherited from class jmri.jmrit.display.PositionableIcon |
|---|
cloneMap, getDegrees, getFamily, getIcon, getIconStateNames, getScale, maxHeight, maxWidth, setFamily |
| 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 int clickMode
protected boolean litMode
False means ignore (always show R/Y/G/etc appearance on screen); True means show DefaultSignalAppearanceMap.DARK if lit is set false.
Note that setting the appearance "DefaultSignalAppearanceMap.DARK" explicitly will show the dark icon regardless of how this is set.
| Constructor Detail |
|---|
public SignalMastIcon(Editor editor)
| Method Detail |
|---|
public void setShowAutoText(boolean state)
public Positionable deepClone()
Positionable
deepClone in interface PositionabledeepClone in class PositionableLabelpublic Positionable finishClone(Positionable p)
Positionable
finishClone in interface PositionablefinishClone in class PositionableLabelpublic void setSignalMast(NamedBeanHandle<SignalMast> sh)
sh - Specific SignalMast handlepublic void setSignalMast(String pName)
pName - Used as a system/user name to lookup the SignalMast objectpublic NamedBeanHandle<SignalMast> getNamedSignalMast()
public SignalMast getSignalMast()
public String mastState()
public void propertyChange(PropertyChangeEvent e)
propertyChange in interface PropertyChangeListenerpublic String getPName()
public String getNameString()
Positionable
getNameString in interface PositionablegetNameString in class PositionableLabelpublic boolean showPopUp(JPopupMenu popup)
showPopUp in interface PositionableshowPopUp in class PositionableLabelpublic boolean setRotateOrthogonalMenu(JPopupMenu popup)
PositionableLabel
setRotateOrthogonalMenu in interface PositionablesetRotateOrthogonalMenu in class PositionableLabelpublic boolean setEditItemMenu(JPopupMenu popup)
setEditItemMenu in interface PositionablesetEditItemMenu in class PositionableLabelprotected void editItem()
public void doMouseClicked(MouseEvent e)
doMouseClicked in interface PositionabledoMouseClicked in class PositionableLabele - public void performMouseClicked(MouseEvent e)
public void useIconSet(String icon)
public String useIconSet()
public void displayState(String state)
public boolean setEditIconMenu(JPopupMenu popup)
setEditIconMenu in interface PositionablesetEditIconMenu in class PositionableLabelprotected void rotateOrthogonal()
PositionableIcon
rotateOrthogonal in class PositionableIconpublic void rotate(int deg)
rotate in interface Positionablerotate in class PositionableIconpublic void setScale(double s)
setScale in interface PositionablesetScale in class PositionableIconpublic void setClickMode(int mode)
public int getClickMode()
public void setLitMode(boolean mode)
public boolean getLitMode()
public void dispose()
PositionableLabel
dispose in class PositionableLabel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||