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 TypeMethodDescriptionint
compareTo
(PencilScene that) void
draw
(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.ObjectLoader
Returns the XML.ObjectLoader for this class.double
getX()
double
getXMax()
Gets the maximum x needed to draw this object.double
getXMin()
Gets the minimum x needed to draw this object.double
getY()
double
getYMax()
Gets the maximum y needed to draw this object.double
getYMin()
Gets the minimum y needed to draw this object.boolean
includesFrame
(int frame) boolean
boolean
isHeavy()
Gets the heavy state of this scene.boolean
Determines if information is available to set min/max values.boolean
Gets the visibility of this scene.protected void
measure()
Measures this scene to determine an appropriate margin.void
setCaption
(PencilCaption caption) Sets the caption.void
Sets the color of the caption and all drawings.void
setEnabled
(boolean enabled) int
setEndFrame
(int end) Sets the end frame.void
setHeavy
(boolean heavy) Sets the heavy state of this scene.int
setStartFrame
(int start) Sets the start frame.void
setVisible
(boolean vis) Sets the visibility of this scene.void
setX
(double x) void
setXY
(double x, double y) void
setY
(double y) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:Drawable
Draws 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:Measurable
Gets the minimum x needed to draw this object.- Specified by:
getXMin
in interfaceMeasurable
- Returns:
- minimum
-
getXMax
public double getXMax()Description copied from interface:Measurable
Gets the maximum x needed to draw this object.- Specified by:
getXMax
in interfaceMeasurable
- Returns:
- maximum
-
getYMin
public double getYMin()Description copied from interface:Measurable
Gets the minimum y needed to draw this object.- Specified by:
getYMin
in interfaceMeasurable
- Returns:
- minimum
-
getYMax
public double getYMax()Description copied from interface:Measurable
Gets the maximum y needed to draw this object.- Specified by:
getYMax
in interfaceMeasurable
- 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 interfaceMeasurable
- Returns:
- true if min/max values are valid
-
compareTo
- Specified by:
compareTo
in interfaceComparable<PencilScene>
-
findInteractive
- Specified by:
findInteractive
in interfaceInteractive
-
setEnabled
public void setEnabled(boolean enabled) - Specified by:
setEnabled
in interfaceInteractive
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceInteractive
-
setXY
public void setXY(double x, double y) - Specified by:
setXY
in interfaceInteractive
-
setX
public void setX(double x) - Specified by:
setX
in interfaceInteractive
-
setY
public void setY(double y) - Specified by:
setY
in interfaceInteractive
-
getX
public double getX()- Specified by:
getX
in interfaceInteractive
-
getY
public double getY()- Specified by:
getY
in 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
-