Package org.opensourcephysics.display
Class InteractiveLabel
java.lang.Object
org.opensourcephysics.display.Circle
org.opensourcephysics.display.MeasuredCircle
org.opensourcephysics.display.InteractiveLabel
- All Implemented Interfaces:
Drawable,Interactive,Measurable
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructor InteractiveLabelInteractiveLabel(String str) Constructor InteractiveLabel -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(DrawingPanel panel, Graphics g) Draws the circle.findInteractive(DrawingPanel panel, int xpix, int ypix) intGets the label's offset in the x direction.intGets the label's offset in the y direction.booleanGets the mouse interaction enabled property.booleanisInside(DrawingPanel panel, int xpix, int ypix) Checks to see if this object is enabled and if the pixel coordinates are inside the drawable.voidvoidsetConnectionPoint(int location) Sets the location of the connection point.voidsetEnabled(boolean enabled) Enables mouse interactionsvoidsetOffsetX(int offset) Sets the label's offset in the x direction.voidsetOffsetY(int offset) Sets the label's offset in the y direction.voidvoidvoidsetXY(double _x, double _y) Sets the x and y coordinates.Methods inherited from class org.opensourcephysics.display.MeasuredCircle
getLoader, getXMax, getXMin, getYMax, getYMin, isMeasured, setMeasuredMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opensourcephysics.display.Interactive
getX, getY, isInteractive, setX, setYMethods inherited from interface org.opensourcephysics.display.Measurable
getXMax, getXMin, getYMax, getYMin, isMeasured
-
Field Details
-
TOP_LEFT_LOCATION
public static final int TOP_LEFT_LOCATION- See Also:
-
CENTER_LOCATION
public static final int CENTER_LOCATION- See Also:
-
TOP_CENTER_LOCATION
public static final int TOP_CENTER_LOCATION- See Also:
-
connection_location
public int connection_location -
text
-
font
-
fontname
-
fontsize
protected int fontsize -
fontstyle
protected int fontstyle
-
-
Constructor Details
-
InteractiveLabel
public InteractiveLabel()Constructor InteractiveLabel -
InteractiveLabel
Constructor InteractiveLabel- Parameters:
str-
-
-
Method Details
-
setXY
public void setXY(double _x, double _y) Description copied from class:CircleSets the x and y coordinates.- Specified by:
setXYin interfaceInteractive- Overrides:
setXYin classCircle
-
setText
-
setText
-
resetBoxSize
public void resetBoxSize() -
setConnectionPoint
public void setConnectionPoint(int location) Sets the location of the connection point. Location values are:TOP_LEFT_LOCATION, TOP_CENTER_LOCATION- Parameters:
location- int
-
setOffsetX
public void setOffsetX(int offset) Sets the label's offset in the x direction.- Parameters:
offset- int
-
getOffsetX
public int getOffsetX()Gets the label's offset in the x direction. -
setOffsetY
public void setOffsetY(int offset) Sets the label's offset in the y direction.- Parameters:
offset- int
-
getOffsetY
public int getOffsetY()Gets the label's offset in the y direction. -
draw
Description copied from class:CircleDraws the circle. -
findInteractive
- Specified by:
findInteractivein interfaceInteractive
-
isInside
Checks to see if this object is enabled and if the pixel coordinates are inside the drawable.- Parameters:
panel-xpix-ypix-- Returns:
- true if the pixel coordinates are inside; false otherwise
-
setEnabled
public void setEnabled(boolean enabled) Enables mouse interactions- Specified by:
setEnabledin interfaceInteractive- Parameters:
enabled- boolean
-
isEnabled
public boolean isEnabled()Gets the mouse interaction enabled property.- Specified by:
isEnabledin interfaceInteractive- Returns:
- boolean
-