Package org.opensourcephysics.display
Class MessageDrawable
java.lang.Object
org.opensourcephysics.display.MessageDrawable
- All Implemented Interfaces:
Drawable
PixelRectangle demonstrates how to draw an object using the AWT drawing API.
- Version:
- 1.0 05/16/05
- Author:
- Wolfgang Christian, Jan Tobochnik, Harvey Gould
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a MessageDrawable using graphicsMessageDrawable
(DrawingPanel panel) Constructs a MessageDrawable optionally creating JLabels correctly positioned on a DrawingPanel -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose
(DrawingPanel panel) void
draw
(DrawingPanel panel, Graphics g) Draws this rectangle using the AWT drawing API.void
Draws this message boxes on a DrawingPanel3D.void
finalize()
protected void
moveToView
(DrawingPanel panel) void
void
setFontFactor
(double factor) Sets the font factor.protected void
setFontLevel
(int level) Sets the font level.void
setIgnoreRepaint
(boolean ignore) void
setMessage
(DrawingPanel panel, String msg, int location) Shows a message in a yellow text box.void
setMessageFont
(Font aFont) Sets the font factor.Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opensourcephysics.display.Drawable
isInteractive
-
Field Details
-
BOTTOM_LEFT
public static final int BOTTOM_LEFT- See Also:
-
BOTTOM_RIGHT
public static final int BOTTOM_RIGHT- See Also:
-
TOP_RIGHT
public static final int TOP_RIGHT- See Also:
-
TOP_LEFT
public static final int TOP_LEFT- See Also:
-
font
-
fontname
-
fontsize
protected int fontsize -
fontstyle
protected int fontstyle -
ignoreRepaint
protected boolean ignoreRepaint
-
-
Constructor Details
-
MessageDrawable
public MessageDrawable()Constructs a MessageDrawable using graphics -
MessageDrawable
Constructs a MessageDrawable optionally creating JLabels correctly positioned on a DrawingPanel- Parameters:
panel
-
-
-
Method Details
-
setIgnoreRepaint
public void setIgnoreRepaint(boolean ignore) -
setMessageFont
Sets the font factor.- Parameters:
factor
- the factor
-
setFontLevel
protected void setFontLevel(int level) Sets the font level.- Parameters:
level
- the level
-
setFontFactor
public void setFontFactor(double factor) Sets the font factor.- Parameters:
factor
- the factor
-
refreshGUI
public void refreshGUI() -
setMessage
Shows a message in a yellow text box. location 0=bottom left location 1=bottom right location 2=top right location 3=top left- Parameters:
msg
-location
-
-
moveToView
-
draw
Draws this rectangle using the AWT drawing API. Required to implement the Drawable interface. -
drawOn3D
Draws this message boxes on a DrawingPanel3D. Required to implement the Drawable interface.- Parameters:
panel
- DrawingPanelg
- Graphics
-
dispose
-
finalize
public void finalize()
-