Class PencilScene
java.lang.Object
org.opensourcephysics.cabrillo.tracker.PencilScene
- All Implemented Interfaces:
Comparable<PencilScene>,Drawable,Interactive,Measurable,Trackable
A PencilScene is a collection of PencilDrawings and an optional PencilCaption.
- Author:
- Douglas Brown
-
Field Summary
FieldsFields inherited from interface org.opensourcephysics.media.core.Trackable
PROPERTY_ADJUSTING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(PencilScene that) voiddraw(DrawingPanel panel, Graphics g) Draws a representation of an object in a drawing panel.findInteractive(DrawingPanel panel, int xpix, int ypix) Gets the caption.getDescription(TrackerPanel trackerPanel) Gets a compact description suitable for the PencilControl sceneDropdown.Gets the drawings.static XML.ObjectLoaderReturns the XML.ObjectLoader for this class.doublegetX()doublegetXMax()Gets the maximum x needed to draw this object.doublegetXMin()Gets the minimum x needed to draw this object.doublegetY()doublegetYMax()Gets the maximum y needed to draw this object.doublegetYMin()Gets the minimum y needed to draw this object.booleanincludesFrame(int frame) booleanbooleanisHeavy()Gets the heavy state of this scene.booleanDetermines if information is available to set min/max values.booleanGets the visibility of this scene.protected voidmeasure()Measures this scene to determine an appropriate margin.voidsetCaption(PencilCaption caption) Sets the caption.voidSets the color of the caption and all drawings.voidsetEnabled(boolean enabled) intsetEndFrame(int end) Sets the end frame.voidsetHeavy(boolean heavy) Sets the heavy state of this scene.intsetStartFrame(int start) Sets the start frame.voidsetVisible(boolean vis) Sets the visibility of this scene.voidsetX(double x) voidsetXY(double x, double y) voidsetY(double y) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opensourcephysics.display.Interactive
isInteractive
-
Field Details
-
frame
-
panelID
-
-
Constructor Details
-
PencilScene
public PencilScene()Constructor.
-
-
Method Details
-
draw
Description copied from interface:DrawableDraws a representation of an object in a drawing panel. -
getDrawings
Gets the drawings.- Returns:
- the drawings
-
getCaption
Gets the caption. May return null.- Returns:
- the caption
-
setCaption
Sets the caption.- Parameters:
caption- the caption.
-
setColor
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
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:MeasurableGets the minimum x needed to draw this object.- Specified by:
getXMinin interfaceMeasurable- Returns:
- minimum
-
getXMax
public double getXMax()Description copied from interface:MeasurableGets the maximum x needed to draw this object.- Specified by:
getXMaxin interfaceMeasurable- Returns:
- maximum
-
getYMin
public double getYMin()Description copied from interface:MeasurableGets the minimum y needed to draw this object.- Specified by:
getYMinin interfaceMeasurable- Returns:
- minimum
-
getYMax
public double getYMax()Description copied from interface:MeasurableGets the maximum y needed to draw this object.- Specified by:
getYMaxin interfaceMeasurable- Returns:
- minimum
-
isMeasured
public boolean isMeasured()Description copied from interface:MeasurableDetermines if information is available to set min/max values. Objects that store data should return false if data is null.- Specified by:
isMeasuredin interfaceMeasurable- Returns:
- true if min/max values are valid
-
compareTo
- Specified by:
compareToin interfaceComparable<PencilScene>
-
findInteractive
- Specified by:
findInteractivein interfaceInteractive
-
setEnabled
public void setEnabled(boolean enabled) - Specified by:
setEnabledin interfaceInteractive
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceInteractive
-
setXY
public void setXY(double x, double y) - Specified by:
setXYin interfaceInteractive
-
setX
public void setX(double x) - Specified by:
setXin interfaceInteractive
-
setY
public void setY(double y) - Specified by:
setYin interfaceInteractive
-
getX
public double getX()- Specified by:
getXin interfaceInteractive
-
getY
public double getY()- Specified by:
getYin interfaceInteractive
-
measure
protected void measure()Measures this scene to determine an appropriate margin. -
getLoader
Returns the XML.ObjectLoader for this class.- Returns:
- the object loader
-