java.lang.Object
org.opensourcephysics.cabrillo.tracker.TMat
All Implemented Interfaces:
PropertyChangeListener, EventListener, Drawable, Measurable, Trackable

public class TMat extends Object implements Measurable, Trackable, PropertyChangeListener
This is a trackable rectangular background mat that draws itself on a tracker panel behind the video.
Author:
Douglas Brown
  • Field Details

  • Constructor Details

    • TMat

      public TMat(TrackerPanel panel)
      Creates a mat for the specified tracker panel
      Parameters:
      panel - the tracker panel
  • Method Details

    • setTrackerPanel

      public void setTrackerPanel(TrackerPanel panel)
    • draw

      public void draw(DrawingPanel panel, Graphics g)
      Draws the image mat on the panel.
      Specified by:
      draw in interface Drawable
      Parameters:
      panel - the drawing panel requesting the drawing
      g - the graphics context on which to draw
    • getDrawingBounds

      protected Rectangle2D getDrawingBounds()
    • getPaint

      public Paint getPaint()
      Gets the paint.
      Returns:
      the paint used to draw the mat
    • setPaint

      public void setPaint(Paint paint)
      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 interface Measurable
      Returns:
      minimum x
    • getXMax

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

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

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

      public boolean isMeasured()
      Reports whether information is available to set min/max values.
      Specified by:
      isMeasured in interface Measurable
      Returns:
      true if min/max values are valid
    • refresh

      public void refresh()
      Refreshes this mat.
    • checkVideo

      protected void checkVideo(TrackerPanel panel)
    • propertyChange

      public void propertyChange(PropertyChangeEvent e)
      Responds to property change events.
      Specified by:
      propertyChange in interface PropertyChangeListener
      Parameters:
      e - the property change event
    • cleanup

      public void cleanup()
      Cleans up this mat
    • finalize

      public void finalize()
      Overrides:
      finalize in class Object
    • getBounds

      protected Rectangle getBounds()
    • invalidate

      public void invalidate()