Class MessageDrawable

java.lang.Object
org.opensourcephysics.display.MessageDrawable
All Implemented Interfaces:
Drawable

public class MessageDrawable extends Object implements 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 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

      protected Font font
    • fontname

      protected String fontname
    • fontsize

      protected int fontsize
    • fontstyle

      protected int fontstyle
    • ignoreRepaint

      protected boolean ignoreRepaint
  • Constructor Details

    • MessageDrawable

      public MessageDrawable()
      Constructs a MessageDrawable using graphics
    • MessageDrawable

      public MessageDrawable(DrawingPanel panel)
      Constructs a MessageDrawable optionally creating JLabels correctly positioned on a DrawingPanel
      Parameters:
      panel -
  • Method Details

    • setIgnoreRepaint

      public void setIgnoreRepaint(boolean ignore)
    • setMessageFont

      public void setMessageFont(Font aFont)
      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

      public void setMessage(DrawingPanel panel, String msg, int location)
      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

      protected void moveToView(DrawingPanel panel)
    • draw

      public void draw(DrawingPanel panel, Graphics g)
      Draws this rectangle using the AWT drawing API. Required to implement the Drawable interface.
      Specified by:
      draw in interface Drawable
      Parameters:
      panel - DrawingPanel
      g - Graphics
    • drawOn3D

      public void drawOn3D(Component panel, Graphics g)
      Draws this message boxes on a DrawingPanel3D. Required to implement the Drawable interface.
      Parameters:
      panel - DrawingPanel
      g - Graphics
    • dispose

      public void dispose(DrawingPanel panel)
    • finalize

      public void finalize()
      Overrides:
      finalize in class Object