Class TMat
java.lang.Object
org.opensourcephysics.cabrillo.tracker.TMat
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,Drawable
,Measurable
,Trackable
This is a trackable rectangular background mat that draws itself on a tracker
panel behind the video.
- Author:
- Douglas Brown
-
Field Summary
FieldsFields inherited from interface org.opensourcephysics.media.core.Trackable
PROPERTY_ADJUSTING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkVideo
(TrackerPanel panel) void
cleanup()
Cleans up this matvoid
draw
(DrawingPanel panel, Graphics g) Draws the image mat on the panel.void
finalize()
protected Rectangle
protected Rectangle2D
getPaint()
Gets the paint.double
getXMax()
Gets the maximum x needed to draw this object.double
getXMin()
Gets the minimum x needed to draw this object.double
getYMax()
Gets the maximum y needed to draw this object.double
getYMin()
Gets the minimum y needed to draw this object.void
boolean
Reports whether information is available to set min/max values.boolean
Gets the visibility of this mat.void
Responds to property change events.void
refresh()
Refreshes this mat.void
Sets the paint.void
setTrackerPanel
(TrackerPanel panel) void
setVisible
(boolean visible) Shows or hides this mat.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
-
drawnBounds
-
-
Constructor Details
-
TMat
Creates a mat for the specified tracker panel- Parameters:
panel
- the tracker panel
-
-
Method Details
-
setTrackerPanel
-
draw
Draws the image mat on the panel. -
getDrawingBounds
-
getPaint
Gets the paint.- Returns:
- the paint used to draw the mat
-
setPaint
Sets the paint.- Parameters:
paint
- the desired paint
-
setVisible
public void setVisible(boolean visible) Shows or hides this mat.- Parameters:
visible
-true
to show this mat.
-
isVisible
public boolean isVisible()Gets the visibility of this mat.- Returns:
true
if this mat is visible
-
getXMin
public double getXMin()Gets the minimum x needed to draw this object.- Specified by:
getXMin
in interfaceMeasurable
- Returns:
- minimum x
-
getXMax
public double getXMax()Gets the maximum x needed to draw this object.- Specified by:
getXMax
in interfaceMeasurable
- Returns:
- maximum x
-
getYMin
public double getYMin()Gets the minimum y needed to draw this object.- Specified by:
getYMin
in interfaceMeasurable
- Returns:
- minimum y
-
getYMax
public double getYMax()Gets the maximum y needed to draw this object.- Specified by:
getYMax
in interfaceMeasurable
- Returns:
- maximum y
-
isMeasured
public boolean isMeasured()Reports whether information is available to set min/max values.- Specified by:
isMeasured
in interfaceMeasurable
- Returns:
true
if min/max values are valid
-
refresh
public void refresh()Refreshes this mat. -
checkVideo
-
propertyChange
Responds to property change events.- Specified by:
propertyChange
in interfacePropertyChangeListener
- Parameters:
e
- the property change event
-
cleanup
public void cleanup()Cleans up this mat -
finalize
public void finalize() -
getBounds
-
invalidate
public void invalidate()
-