|
||||||||||
| 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.LayoutMemoryIcon
public class LayoutMemoryIcon
An icon to display a status of a Memory.
The value of the memory can't be changed with this icon.
This module is derived with only a few changes from MemoryIcon.java by Bob Jacobsen Copyright (c) 2004. A name change was needed to work around the hard dependence on PanelEditor in MemoryIconXml.java, without risking compromising existing PanelEditor panels.
Another difference from MemoryIcon.java, is that this defaults to a text instead of the red X icon displayed when Panel Editor is loaded. If the user needs to "find" the MemoryIcon, putting text into the Memory Table is suggested.
This module has been modified (from MemoryIcon.java) to use a resource bundle for its user-seen text, like other LayoutEditor modules.
| 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 |
|---|
| 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 | |
|---|---|
LayoutMemoryIcon()
|
|
| Method Summary | |
|---|---|
void |
addKeyAndIcon(NamedIcon icon,
String keyValue)
|
void |
dispose()
Clean up when this object is no longer needed. |
NamedIcon |
getDefaultIcon()
|
HashMap |
getMap()
|
Memory |
getMemory()
|
boolean |
isSelectable()
|
protected int |
maxHeight()
This may be called during the superclass ctor, so before construction of this object is complete. |
protected int |
maxWidth()
This may be called during the superclass ctor, so before construction of this object is complete. |
void |
mouseClicked(MouseEvent e)
Clicks are ignored |
void |
propertyChange(PropertyChangeEvent e)
|
void |
setDefaultIcon(NamedIcon n)
|
void |
setMemory(String pName)
Attached a named Memory to this display item |
void |
setProperToolTip()
|
void |
setSelectable(boolean b)
|
protected void |
showPopUp(MouseEvent e)
Pop-up displays the Memory name, allows you to remove the icon. |
void |
updateSize()
Update the AWT and Swing size information due to change in internal state, e.g. if one or more of the icons that might be displayed is changed |
| 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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public LayoutMemoryIcon()
| Method Detail |
|---|
public void setDefaultIcon(NamedIcon n)
public NamedIcon getDefaultIcon()
public void setMemory(String pName)
pName - Used as a system/user name to lookup the Memory objectpublic Memory getMemory()
public HashMap getMap()
public void addKeyAndIcon(NamedIcon icon,
String keyValue)
protected int maxHeight()
maxHeight in class LayoutPositionableLabelprotected int maxWidth()
maxWidth in class LayoutPositionableLabelpublic void propertyChange(PropertyChangeEvent e)
propertyChange in interface PropertyChangeListenerpublic void setProperToolTip()
setProperToolTip in class LayoutPositionableLabelpublic void setSelectable(boolean b)
public boolean isSelectable()
protected void showPopUp(MouseEvent e)
Rotate is not supported for text-holding memories
Because this class can change between icon and text forms, we recreate the popup object each time.
showPopUp in class LayoutPositionableLabelpublic void updateSize()
LayoutPositionableLabel
updateSize in class LayoutPositionableLabelpublic 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 | |||||||||