org.opensourcephysics.display
Class InteractiveCircle

java.lang.Object
  extended by org.opensourcephysics.display.Circle
      extended by org.opensourcephysics.display.MeasuredCircle
          extended by org.opensourcephysics.display.InteractiveCircle
All Implemented Interfaces:
Drawable, Interactive, Measurable
Direct Known Subclasses:
Protractor, Protractor.Tip

public class InteractiveCircle
extends MeasuredCircle
implements Interactive

A measured circle that implements Interactive. The InteractiveCircle class also demonstrates how to implement a simple XML loader.

Version:
1.0
Author:
Wolfgang Christian, Francisco Equembre

Nested Class Summary
protected static class InteractiveCircle.InteractiveCircleLoader
          A class to save and load InteractiveCircle data in an XMLControl.
 
Field Summary
 
Fields inherited from class org.opensourcephysics.display.Circle
color, pixRadius, x, y
 
Constructor Summary
InteractiveCircle()
          Constructs an InteractiveCircle at the origin.
InteractiveCircle(double x, double y)
          Constructs an InteractiveCircle with the given parameters.
 
Method Summary
 Interactive findInteractive(DrawingPanel panel, int xpix, int ypix)
           
static XML.ObjectLoader getLoader()
           
 boolean isEnabled()
           
 boolean isInside(DrawingPanel panel, int xpix, int ypix)
           
 void setEnabled(boolean _enableInteraction)
          Enables mouse interactions.
 
Methods inherited from class org.opensourcephysics.display.MeasuredCircle
getXMax, getXMin, getYMax, getYMin, isMeasured, setMeasured
 
Methods inherited from class org.opensourcephysics.display.Circle
draw, getX, getY, setX, setXY, setY, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opensourcephysics.display.Interactive
getX, getY, setX, setXY, setY
 
Methods inherited from interface org.opensourcephysics.display.Measurable
getXMax, getXMin, getYMax, getYMin, isMeasured
 
Methods inherited from interface org.opensourcephysics.display.Drawable
draw
 

Constructor Detail

InteractiveCircle

public InteractiveCircle(double x,
                         double y)
Constructs an InteractiveCircle with the given parameters.

Parameters:
x -
y -

InteractiveCircle

public InteractiveCircle()
Constructs an InteractiveCircle at the origin.

Method Detail

setEnabled

public void setEnabled(boolean _enableInteraction)
Enables mouse interactions.

Specified by:
setEnabled in interface Interactive
Parameters:
_enableInteraction -

isEnabled

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

isInside

public boolean isInside(DrawingPanel panel,
                        int xpix,
                        int ypix)

findInteractive

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

getLoader

public static XML.ObjectLoader getLoader()