public class SceneObjectTip extends LabelSausage implements SceneObjectIndicator
MisoScenePanel. The tip
foreground and background are controlled by the following UIManager properties:
SceneObjectTip.background SceneObjectTip.foreground SceneObjectTip.font (falls back to Label.font)
| Modifier and Type | Class and Description |
|---|---|
static interface |
SceneObjectTip.TipLayout
Used to position a scene tip in relation to the object with which
it is associated.
|
| Modifier and Type | Field and Description |
|---|---|
Rectangle |
bounds
The bounding box of this tip, or null prior to layout().
|
| Constructor and Description |
|---|
SceneObjectTip(String text,
Icon icon)
Construct a SceneObjectTip.
|
| Modifier and Type | Method and Description |
|---|---|
Rectangle |
getBounds()
Returns the bounds of the indicator when drawn.
|
boolean |
isLaidOut()
Returns whether the indicator has already been laid out (and thus doesn't need to be again)
|
void |
layout(Graphics2D gfx,
SceneObject tipFor,
Rectangle boundary)
Called to initialize the tip so that it can be painted.
|
void |
paint(Graphics2D gfx)
Paints the indicator in the scene.
|
static void |
registerTipLayout(String prefix,
SceneObjectTip.TipLayout layout)
It may be desirable to layout object tips specially depending on
what sort of actions they represent, so we allow different tip
layout algorithms to be registered for particular object prefixes.
|
void |
removed()
Called when the indicator is removed from the scene.
|
String |
toString()
Generates a string representation of this instance.
|
void |
update(Icon icon,
String tiptext)
Updates the Icon and text for the indicator.
|
public Rectangle bounds
public boolean isLaidOut()
SceneObjectIndicatorisLaidOut in interface SceneObjectIndicatorpublic void layout(Graphics2D gfx, SceneObject tipFor, Rectangle boundary)
layout in interface SceneObjectIndicatortipFor - the scene object that we're a tip for.boundary - the boundary of all displayable space.public void paint(Graphics2D gfx)
SceneObjectIndicatorSceneObjectIndicator.layout(Graphics2D, SceneObject, Rectangle)paint in interface SceneObjectIndicatorpublic Rectangle getBounds()
SceneObjectIndicatorgetBounds in interface SceneObjectIndicatorpublic void removed()
SceneObjectIndicatorremoved in interface SceneObjectIndicatorpublic void update(Icon icon, String tiptext)
SceneObjectIndicatorupdate in interface SceneObjectIndicatorpublic String toString()
public static void registerTipLayout(String prefix, SceneObjectTip.TipLayout layout)
Copyright © 2015. All rights reserved.