|
||||||||||
| 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
public class PositionableLabel
PositionableLabel is a JLabel that can be dragged around the inside of the enclosing Container using a right-drag.
The positionable parameter is a global, set from outside. The 'fixed' parameter is local, set from the popup here.
| 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 boolean |
_control
|
protected boolean |
_controlling
|
protected int |
_displayLevel
|
protected boolean |
_editable
|
protected Editor |
_editor
|
protected boolean |
_hidden
|
protected boolean |
_icon
|
(package private) IconAdder |
_iconEditor
|
(package private) JFrame |
_iconEditorFrame
Methods for Item Popups in Panel editor |
protected NamedIcon |
_namedIcon
|
(package private) JmriJFrame |
_paletteFrame
|
(package private) PositionablePopupUtil |
_popupUtil
|
protected boolean |
_positionable
|
protected boolean |
_rotateText
|
protected boolean |
_showTooltip
|
protected boolean |
_text
|
protected ToolTip |
_tooltip
|
protected String |
_unRotatedText
|
protected boolean |
_viewCoordinates
|
(package private) boolean |
active
|
(package private) JCheckBoxMenuItem |
disableItem
|
(package private) static org.slf4j.Logger |
log
|
static ResourceBundle |
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 | |
|---|---|
PositionableLabel(NamedIcon s,
Editor editor)
|
|
PositionableLabel(String s,
Editor editor)
|
|
| Method Summary | |
|---|---|
protected NamedIcon |
cloneIcon(NamedIcon icon,
PositionableLabel pos)
|
Positionable |
deepClone()
Make a deep copy of Positional object. |
void |
dispose()
Clean up when this object is no longer needed. |
void |
doMouseClicked(MouseEvent event)
|
void |
doMouseDragged(MouseEvent event)
|
void |
doMouseEntered(MouseEvent event)
|
void |
doMouseExited(MouseEvent event)
|
void |
doMouseMoved(MouseEvent event)
|
void |
doMousePressed(MouseEvent event)
|
void |
doMouseReleased(MouseEvent event)
|
boolean |
doViemMenu()
Use the 'Standard' presentation of the popup menu items. |
protected void |
edit()
|
protected void |
editIcon()
|
Positionable |
finishClone(Positionable p)
Finsh the deep Copy of a Positional object. |
int |
getDegrees()
|
int |
getDisplayLevel()
|
Editor |
getEditor()
|
int |
getHeight()
|
NamedBean |
getNamedBean()
Provides a generic method to return the bean associated with the Positionable |
String |
getNameString()
Methods to add popup menu items return true if a popup item is set |
PositionablePopupUtil |
getPopupUtility()
|
boolean |
getSaveOpaque()
|
double |
getScale()
|
Dimension |
getSize()
|
JComponent |
getTextComponent()
|
ToolTip |
getTooltip()
|
String |
getUnRotatedText()
When text is rotated or in an icon mode, the return of getText() may be null or some other value |
boolean |
getViewCoordinates()
|
int |
getWidth()
|
boolean |
isActive()
"active" means that the object is still displayed, and should be stored. |
boolean |
isBackground()
|
boolean |
isControl()
|
boolean |
isControlling()
|
boolean |
isEditable()
|
boolean |
isHidden()
|
boolean |
isIcon()
|
boolean |
isPositionable()
|
boolean |
isRotated()
|
boolean |
isText()
|
protected void |
makeIconEditorFrame(Container pos,
String name,
boolean table,
IconAdder editor)
For item popups in Panel Editor |
protected void |
makePalettteFrame(String title)
For item popups in Control Panel Editor |
protected NamedIcon |
makeTextOverlaidIcon(String text,
NamedIcon ic)
Create an image of icon with text overlaid |
int |
maxHeight()
|
int |
maxHeightTrue()
|
int |
maxWidth()
|
int |
maxWidthTrue()
|
protected void |
paintComponent(Graphics g)
|
void |
remove()
Removes this object from display and persistance |
void |
rotate(int deg)
|
protected void |
rotateOrthogonal()
|
void |
saveOpaque(boolean set)
|
void |
setControlling(boolean enabled)
|
void |
setDegrees(int deg)
|
boolean |
setDisableControlMenu(JPopupMenu popup)
|
void |
setDisplayLevel(int l)
|
void |
setEditable(boolean enabled)
|
boolean |
setEditIconMenu(JPopupMenu popup)
|
boolean |
setEditItemMenu(JPopupMenu popup)
|
void |
setEditor(Editor ed)
|
void |
setHidden(boolean hide)
|
void |
setLevel(int l)
Delayed setDisplayLevel for DnD |
void |
setPopupUtility(PositionablePopupUtil tu)
|
void |
setPositionable(boolean enabled)
Positionable methods |
boolean |
setRotateMenu(JPopupMenu popup)
Rotate degrees return true if popup is set |
boolean |
setRotateOrthogonalMenu(JPopupMenu popup)
Rotate othogonally return true if popup is set |
void |
setScale(double s)
|
boolean |
setScaleMenu(JPopupMenu popup)
Scale percentage return true if popup is set |
void |
setShowTooltip(boolean set)
|
protected void |
setSuperText(String text)
|
void |
setText(String text)
|
boolean |
setTextEditMenu(JPopupMenu popup)
|
void |
setTooltip(ToolTip tip)
|
void |
setViewCoordinates(boolean enabled)
|
void |
showHidden()
|
boolean |
showPopUp(JPopupMenu popup)
Call to a Positionable that has unique requirements - e.g. |
boolean |
showTooltip()
|
boolean |
storeItem()
Store a permanent copy of this Positionable The editorXml will call this method to find out whether it should store this Positionable item. |
void |
updateIcon(NamedIcon s)
|
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 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 ResourceBundle rbean
protected Editor _editor
protected boolean _icon
protected boolean _text
protected boolean _control
protected NamedIcon _namedIcon
protected ToolTip _tooltip
protected boolean _showTooltip
protected boolean _editable
protected boolean _positionable
protected boolean _viewCoordinates
protected boolean _controlling
protected boolean _hidden
protected int _displayLevel
protected String _unRotatedText
protected boolean _rotateText
PositionablePopupUtil _popupUtil
JFrame _iconEditorFrame
IconAdder _iconEditor
JmriJFrame _paletteFrame
JCheckBoxMenuItem disableItem
boolean active
static org.slf4j.Logger log
| Constructor Detail |
|---|
public PositionableLabel(String s,
Editor editor)
public PositionableLabel(NamedIcon s,
Editor editor)
| Method Detail |
|---|
public final boolean isIcon()
public final boolean isText()
public final boolean isControl()
public Editor getEditor()
getEditor in interface Positionablepublic void setEditor(Editor ed)
setEditor in interface Positionablepublic void setPositionable(boolean enabled)
setPositionable in interface Positionablepublic final boolean isPositionable()
isPositionable in interface Positionablepublic void setEditable(boolean enabled)
setEditable in interface Positionablepublic boolean isEditable()
isEditable in interface Positionablepublic void setViewCoordinates(boolean enabled)
setViewCoordinates in interface Positionablepublic boolean getViewCoordinates()
getViewCoordinates in interface Positionablepublic void setControlling(boolean enabled)
setControlling in interface Positionablepublic boolean isControlling()
isControlling in interface Positionablepublic void setHidden(boolean hide)
setHidden in interface Positionablepublic boolean isHidden()
isHidden in interface Positionablepublic void showHidden()
showHidden in interface Positionablepublic void setLevel(int l)
public void setDisplayLevel(int l)
setDisplayLevel in interface Positionablepublic int getDisplayLevel()
getDisplayLevel in interface Positionablepublic void setShowTooltip(boolean set)
setShowTooltip in interface Positionablepublic boolean showTooltip()
showTooltip in interface Positionablepublic void setTooltip(ToolTip tip)
setTooltip in interface Positionablepublic ToolTip getTooltip()
getTooltip in interface Positionablepublic String getNameString()
Positionable
getNameString in interface Positionablepublic Positionable deepClone()
Positionable
deepClone in interface Positionablepublic String getUnRotatedText()
public Positionable finishClone(Positionable p)
Positionable
finishClone in interface Positionablepublic JComponent getTextComponent()
getTextComponent in interface Positionable
protected NamedIcon cloneIcon(NamedIcon icon,
PositionableLabel pos)
public void doMousePressed(MouseEvent event)
doMousePressed in interface Positionablepublic void doMouseReleased(MouseEvent event)
doMouseReleased in interface Positionablepublic void doMouseClicked(MouseEvent event)
doMouseClicked in interface Positionablepublic void doMouseDragged(MouseEvent event)
doMouseDragged in interface Positionablepublic void doMouseMoved(MouseEvent event)
doMouseMoved in interface Positionablepublic void doMouseEntered(MouseEvent event)
doMouseEntered in interface Positionablepublic void doMouseExited(MouseEvent event)
doMouseExited in interface Positionablepublic boolean storeItem()
Positionable
storeItem in interface Positionablepublic boolean doViemMenu()
Positionable
doViemMenu in interface Positionablepublic void setPopupUtility(PositionablePopupUtil tu)
setPopupUtility in interface Positionablepublic PositionablePopupUtil getPopupUtility()
getPopupUtility in interface Positionablepublic void updateSize()
updateSize in interface Positionablepublic int maxWidth()
maxWidth in interface Positionablepublic int maxHeight()
maxHeight in interface Positionablepublic int maxWidthTrue()
public int maxHeightTrue()
public boolean isBackground()
public boolean isRotated()
public void updateIcon(NamedIcon s)
public boolean showPopUp(JPopupMenu popup)
showPopUp in interface Positionablepublic boolean setRotateOrthogonalMenu(JPopupMenu popup)
setRotateOrthogonalMenu in interface Positionableprotected void rotateOrthogonal()
public boolean setEditItemMenu(JPopupMenu popup)
setEditItemMenu in interface Positionablepublic boolean setEditIconMenu(JPopupMenu popup)
setEditIconMenu in interface Positionable
protected void makeIconEditorFrame(Container pos,
String name,
boolean table,
IconAdder editor)
protected void edit()
protected void editIcon()
protected void makePalettteFrame(String title)
public boolean setRotateMenu(JPopupMenu popup)
setRotateMenu in interface Positionablepublic boolean setScaleMenu(JPopupMenu popup)
setScaleMenu in interface Positionablepublic boolean setTextEditMenu(JPopupMenu popup)
setTextEditMenu in interface Positionablepublic boolean setDisableControlMenu(JPopupMenu popup)
setDisableControlMenu in interface Positionablepublic void setScale(double s)
setScale in interface Positionablepublic double getScale()
getScale in interface Positionablepublic void saveOpaque(boolean set)
public boolean getSaveOpaque()
getSaveOpaque in interface Positionablepublic void rotate(int deg)
rotate in interface Positionable
protected NamedIcon makeTextOverlaidIcon(String text,
NamedIcon ic)
public void setDegrees(int deg)
public int getDegrees()
getDegrees in interface Positionablepublic void dispose()
public void remove()
remove in interface Positionablepublic boolean isActive()
protected void setSuperText(String text)
public void setText(String text)
setText in class JLabelpublic Dimension getSize()
getSize in class Componentpublic int getHeight()
getHeight in interface PositionablegetHeight in class JComponentpublic int getWidth()
getWidth in interface PositionablegetWidth in class JComponentprotected void paintComponent(Graphics g)
paintComponent in class JComponentpublic NamedBean getNamedBean()
getNamedBean in interface Positionable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||