Class PencilScene

java.lang.Object
org.opensourcephysics.cabrillo.tracker.PencilScene
All Implemented Interfaces:
Comparable<PencilScene>, Drawable, Interactive, Measurable, Trackable

public class PencilScene extends Object implements Interactive, Trackable, Comparable<PencilScene>
A PencilScene is a collection of PencilDrawings and an optional PencilCaption.
Author:
Douglas Brown
  • Field Details

    • frame

      protected TFrame frame
    • panelID

      protected Integer panelID
  • Constructor Details

    • PencilScene

      public PencilScene()
      Constructor.
  • Method Details

    • draw

      public void draw(DrawingPanel panel, Graphics g)
      Description copied from interface: Drawable
      Draws a representation of an object in a drawing panel.
      Specified by:
      draw in interface Drawable
    • getDrawings

      public ArrayList<PencilDrawing> getDrawings()
      Gets the drawings.
      Returns:
      the drawings
    • getCaption

      public PencilCaption getCaption()
      Gets the caption. May return null.
      Returns:
      the caption
    • setCaption

      public void setCaption(PencilCaption caption)
      Sets the caption.
      Parameters:
      caption - the caption.
    • setColor

      public void setColor(Color color)
      Sets the color of the caption and all drawings.
      Parameters:
      color - the color
    • setStartFrame

      public int setStartFrame(int start)
      Sets the start frame.
      Parameters:
      start - the desired start frame
      Returns:
      the resulting start frame
    • setEndFrame

      public int setEndFrame(int end)
      Sets the end frame.
      Parameters:
      end - the desired end frame
      Returns:
      the resulting end frame
    • getDescription

      public String getDescription(TrackerPanel trackerPanel)
      Gets a compact description suitable for the PencilControl sceneDropdown.
      Parameters:
      trackerPanel - the TrackerPanel with videoclip data
      Returns:
      the description
    • includesFrame

      public boolean includesFrame(int frame)
    • isVisible

      public boolean isVisible()
      Gets the visibility of this scene.
      Returns:
      true if visible
    • setVisible

      public void setVisible(boolean vis)
      Sets the visibility of this scene.
      Parameters:
      vis - true for visible
    • isHeavy

      public boolean isHeavy()
      Gets the heavy state of this scene. When heavy, bold fonts and heavy lines are displayed.
      Returns:
      true if heavy
    • setHeavy

      public void setHeavy(boolean heavy)
      Sets the heavy state of this scene.
      Parameters:
      heavy - true for heavy lines and bold font
    • getXMin

      public double getXMin()
      Description copied from interface: Measurable
      Gets the minimum x needed to draw this object.
      Specified by:
      getXMin in interface Measurable
      Returns:
      minimum
    • getXMax

      public double getXMax()
      Description copied from interface: Measurable
      Gets the maximum x needed to draw this object.
      Specified by:
      getXMax in interface Measurable
      Returns:
      maximum
    • getYMin

      public double getYMin()
      Description copied from interface: Measurable
      Gets the minimum y needed to draw this object.
      Specified by:
      getYMin in interface Measurable
      Returns:
      minimum
    • getYMax

      public double getYMax()
      Description copied from interface: Measurable
      Gets the maximum y needed to draw this object.
      Specified by:
      getYMax in interface Measurable
      Returns:
      minimum
    • isMeasured

      public boolean isMeasured()
      Description copied from interface: Measurable
      Determines if information is available to set min/max values. Objects that store data should return false if data is null.
      Specified by:
      isMeasured in interface Measurable
      Returns:
      true if min/max values are valid
    • compareTo

      public int compareTo(PencilScene that)
      Specified by:
      compareTo in interface Comparable<PencilScene>
    • findInteractive

      public Interactive findInteractive(DrawingPanel panel, int xpix, int ypix)
      Specified by:
      findInteractive in interface Interactive
    • setEnabled

      public void setEnabled(boolean enabled)
      Specified by:
      setEnabled in interface Interactive
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface Interactive
    • setXY

      public void setXY(double x, double y)
      Specified by:
      setXY in interface Interactive
    • setX

      public void setX(double x)
      Specified by:
      setX in interface Interactive
    • setY

      public void setY(double y)
      Specified by:
      setY in interface Interactive
    • getX

      public double getX()
      Specified by:
      getX in interface Interactive
    • getY

      public double getY()
      Specified by:
      getY in interface Interactive
    • measure

      protected void measure()
      Measures this scene to determine an appropriate margin.
    • getLoader

      public static XML.ObjectLoader getLoader()
      Returns the XML.ObjectLoader for this class.
      Returns:
      the object loader