|
||||||||||
| 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.SensorIcon
public class SensorIcon
An icon to display a status of a Sensor.
| Nested Class Summary | |
|---|---|
(package private) class |
SensorIcon.SensorPopupUtil
|
| 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 |
| 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, _iconEditor, _iconEditorFrame, _namedIcon, _paletteFrame, _popupUtil, _positionable, _rotateText, _showTooltip, _text, _tooltip, _unRotatedText, _viewCoordinates, active, disableItem, 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 | |
|---|---|
SensorIcon(Editor editor)
|
|
SensorIcon(NamedIcon s,
Editor editor)
|
|
SensorIcon(String s,
Editor editor)
|
|
| Method Summary | |
|---|---|
boolean |
buttonLive()
|
(package private) void |
changeLayoutSensorType()
|
protected HashMap<Integer,NamedIcon> |
cloneMap(HashMap<Integer,NamedIcon> map,
SensorIcon pos)
|
Positionable |
deepClone()
Make a deep copy of Positional object. |
void |
displayState(int state)
Drive the current state of the display from the state of the turnout. |
void |
dispose()
Clean up when this object is no longer needed. |
void |
doMouseClicked(MouseEvent e)
|
void |
doMousePressed(MouseEvent e)
|
void |
doMouseReleased(MouseEvent e)
|
protected void |
edit()
|
protected void |
editItem()
|
Positionable |
finishClone(Positionable p)
Finsh the deep Copy of a Positional object. |
void |
flashSensor(int tps,
int state1,
int state2)
|
String |
getActiveText()
|
Color |
getBackgroundActive()
|
Color |
getBackgroundInActive()
|
Color |
getBackgroundInconsistent()
|
Color |
getBackgroundUnknown()
|
String |
getFamily()
|
NamedIcon |
getIcon(int state)
|
NamedIcon |
getIcon(String state)
Get icon by its localized bean state name |
String |
getInactiveText()
|
String |
getInconsistentText()
|
boolean |
getMomentary()
|
NamedBean |
getNamedBean()
Provides a generic method to return the bean associated with the Positionable |
NamedBeanHandle<Sensor> |
getNamedSensor()
|
String |
getNameString()
Methods to add popup menu items return true if a popup item is set |
String |
getOriginalText()
|
Sensor |
getSensor()
|
Color |
getTextActive()
|
Color |
getTextInActive()
|
Color |
getTextInconsistent()
|
Color |
getTextUnknown()
|
String |
getUnknownText()
|
(package private) void |
makeIconMap()
|
void |
propertyChange(PropertyChangeEvent e)
|
(package private) int |
sensorState()
Get current state of attached sensor |
void |
sensorTextEdit(String name)
|
void |
setActiveText(String i)
|
void |
setBackgroundActive(Color color)
|
void |
setBackgroundInActive(Color color)
|
void |
setBackgroundInconsistent(Color color)
|
void |
setBackgroundUnknown(Color color)
|
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 |
setInactiveText(String i)
|
void |
setInconsistentText(String i)
|
void |
setMomentary(boolean m)
|
void |
setOriginalText(String s)
|
void |
setSensor(NamedBeanHandle<Sensor> s)
Attached a named sensor to this display item |
void |
setSensor(String pName)
Attached a named sensor to this display item |
void |
setText(String s)
|
void |
setTextActive(Color color)
|
boolean |
setTextEditMenu(JPopupMenu popup)
popup AbstractAction.actionPerformed method overrides |
void |
setTextInActive(Color color)
|
void |
setTextInconsistent(Color color)
|
void |
setTextUnknown(Color color)
|
void |
setUnknownText(String i)
|
boolean |
showPopUp(JPopupMenu popup)
Pop-up just displays the sensor name |
(package private) JMenu |
stateMenu(String name,
int state)
|
void |
stopFlash()
|
(package private) void |
updateItem()
|
(package private) void |
updateSensor()
|
| Methods inherited from class jmri.jmrit.display.PositionableIcon |
|---|
cloneMap, getDegrees, getIconStateNames, maxHeight, maxWidth, rotate, rotateOrthogonal, setScale |
| 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, getLocation, getParent, getPreferredSize, getX, getY, invalidate, isOpaque, repaint, requestFocusInWindow, setBackground, setBorder, setForeground, setLocation, setLocation, setOpaque, setSize, setVisible |
| Field Detail |
|---|
public static final int UNKOWN_FONT_COLOR
public static final int UNKOWN_BACKGROUND_COLOR
public static final int ACTIVE_FONT_COLOR
public static final int ACTIVE_BACKGROUND_COLOR
public static final int INACTIVE_FONT_COLOR
public static final int INACTIVE_BACKGROUND_COLOR
public static final int INCONSISTENT_FONT_COLOR
public static final int INCONSISTENT_BACKGROUND_COLOR
protected HashMap<String,Integer> _name2stateMap
protected HashMap<Integer,String> _state2nameMap
JCheckBoxMenuItem momentaryItem
TableItemPanel _itemPanel
String originalText
boolean momentary
Color textColorActive
Color textColorInActive
Color textColorUnknown
Color textColorInconsistent
Color backgroundColorActive
Color backgroundColorInActive
Color backgroundColorUnknown
Color backgroundColorInconsistent
String activeText
String inactiveText
String inconsistentText
String unknownText
int flashStateOn
int flashStateOff
boolean flashon
ActionListener taskPerformer
Timer flashTimer
static org.slf4j.Logger log
| Constructor Detail |
|---|
public SensorIcon(Editor editor)
public SensorIcon(NamedIcon s,
Editor editor)
public SensorIcon(String s,
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 PositionableIconpublic void setSensor(String pName)
pName - System/user name to lookup the sensor objectpublic void setSensor(NamedBeanHandle<Sensor> s)
s - the Sensorpublic Sensor getSensor()
public NamedBean getNamedBean()
PositionableLabel
getNamedBean in interface PositionablegetNamedBean in class PositionableLabelpublic NamedBeanHandle<Sensor> getNamedSensor()
void makeIconMap()
public void setIcon(String name,
NamedIcon icon)
public NamedIcon getIcon(String state)
getIcon in class PositionableIconpublic NamedIcon getIcon(int state)
public String getFamily()
getFamily in class PositionableIconpublic void setFamily(String family)
setFamily in class PositionableIconint sensorState()
public void propertyChange(PropertyChangeEvent e)
propertyChange in interface PropertyChangeListenerpublic String getNameString()
Positionable
getNameString in interface PositionablegetNameString in class PositionableLabelpublic boolean showPopUp(JPopupMenu popup)
showPopUp in interface PositionableshowPopUp in class PositionableLabelpublic boolean setTextEditMenu(JPopupMenu popup)
setTextEditMenu in interface PositionablesetTextEditMenu in class PositionableLabelpublic void sensorTextEdit(String name)
public void displayState(int state)
displayState in class PositionableIconpublic boolean setEditItemMenu(JPopupMenu popup)
setEditItemMenu in interface PositionablesetEditItemMenu in class PositionableLabelprotected void editItem()
void updateItem()
public boolean setEditIconMenu(JPopupMenu popup)
setEditIconMenu in interface PositionablesetEditIconMenu in class PositionableLabelprotected void edit()
edit in class PositionableLabelvoid updateSensor()
public void setOriginalText(String s)
public String getOriginalText()
public void setText(String s)
setText in class PositionableLabelpublic boolean getMomentary()
public void setMomentary(boolean m)
public boolean buttonLive()
public void doMousePressed(MouseEvent e)
doMousePressed in interface PositionabledoMousePressed in class PositionableLabelpublic void doMouseReleased(MouseEvent e)
doMouseReleased in interface PositionabledoMouseReleased in class PositionableLabelpublic void doMouseClicked(MouseEvent e)
doMouseClicked in interface PositionabledoMouseClicked in class PositionableLabelpublic void dispose()
PositionableLabel
dispose in class PositionableLabel
protected HashMap<Integer,NamedIcon> cloneMap(HashMap<Integer,NamedIcon> map,
SensorIcon pos)
public void setTextActive(Color color)
public Color getTextActive()
public void setTextInActive(Color color)
public Color getTextInActive()
public void setTextUnknown(Color color)
public Color getTextUnknown()
public void setTextInconsistent(Color color)
public Color getTextInconsistent()
public void setBackgroundActive(Color color)
public Color getBackgroundActive()
public void setBackgroundInActive(Color color)
public Color getBackgroundInActive()
public void setBackgroundUnknown(Color color)
public Color getBackgroundUnknown()
public void setBackgroundInconsistent(Color color)
public Color getBackgroundInconsistent()
public String getActiveText()
public void setActiveText(String i)
public String getInactiveText()
public void setInactiveText(String i)
public String getInconsistentText()
public void setInconsistentText(String i)
public String getUnknownText()
public void setUnknownText(String i)
JMenu stateMenu(String name,
int state)
void changeLayoutSensorType()
public void flashSensor(int tps,
int state1,
int state2)
public void stopFlash()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||