org.opensourcephysics.drawing2d
Class Style

java.lang.Object
  extended by org.opensourcephysics.drawing2d.Style

public class Style
extends java.lang.Object


Field Summary
static int CENTERED
           
static int CHANGED_DRAWING_FILL
           
static int CHANGED_DRAWING_LINES
           
static int CHANGED_EXTRA_COLOR
           
static int CHANGED_FILL_COLOR
           
static int CHANGED_LINE_COLOR
           
static int CHANGED_LINE_WIDTH
           
static int CHANGED_RELATIVE_POSITION
           
static int CHANGED_SENSITIVITY
           
static int DEFAULT_SENSITIVITY
           
static int EAST
           
static int NORTH
           
static int NORTH_EAST
           
static int NORTH_WEST
           
static int SOUTH
           
static int SOUTH_EAST
           
static int SOUTH_WEST
           
static int WEST
           
 
Method Summary
 Style clone()
          Returns a clone of this style
 void copyTo(Element targetElement)
          Returns a clone of this style
 java.awt.Color getExtraColor()
           
 java.awt.Paint getFillColor()
           
 java.awt.Color getLineColor()
           
 float getLineWidth()
           
 int getRelativePosition()
           
 int getSensitivity()
           
 boolean isDrawingFill()
           
 boolean isDrawingLines()
           
 void setDrawingFill(boolean _drawsFill)
           
 void setDrawingLines(boolean _drawsLines)
           
 void setExtraColor(java.awt.Color _color)
           
 void setFillColor(java.awt.Paint _fill)
           
 void setLineColor(java.awt.Color _color)
           
 void setLineWidth(float _width)
           
 void setPaint(java.lang.String filename)
          Paints the element using an image file
 void setPaint(java.lang.String filename, double width, double height)
          Paints the element using an image file
 void setRelativePosition(int _position)
           
 void setSensitivity(int _s)
          Set the accuracy for the mouse to find a point on the screen
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SENSITIVITY

public static final int DEFAULT_SENSITIVITY
See Also:
Constant Field Values

CHANGED_LINE_COLOR

public static final int CHANGED_LINE_COLOR
See Also:
Constant Field Values

CHANGED_LINE_WIDTH

public static final int CHANGED_LINE_WIDTH
See Also:
Constant Field Values

CHANGED_FILL_COLOR

public static final int CHANGED_FILL_COLOR
See Also:
Constant Field Values

CHANGED_DRAWING_FILL

public static final int CHANGED_DRAWING_FILL
See Also:
Constant Field Values

CHANGED_DRAWING_LINES

public static final int CHANGED_DRAWING_LINES
See Also:
Constant Field Values

CHANGED_RELATIVE_POSITION

public static final int CHANGED_RELATIVE_POSITION
See Also:
Constant Field Values

CHANGED_SENSITIVITY

public static final int CHANGED_SENSITIVITY
See Also:
Constant Field Values

CHANGED_EXTRA_COLOR

public static final int CHANGED_EXTRA_COLOR
See Also:
Constant Field Values

CENTERED

public static final int CENTERED
See Also:
Constant Field Values

NORTH

public static final int NORTH
See Also:
Constant Field Values

SOUTH

public static final int SOUTH
See Also:
Constant Field Values

EAST

public static final int EAST
See Also:
Constant Field Values

WEST

public static final int WEST
See Also:
Constant Field Values

NORTH_EAST

public static final int NORTH_EAST
See Also:
Constant Field Values

NORTH_WEST

public static final int NORTH_WEST
See Also:
Constant Field Values

SOUTH_EAST

public static final int SOUTH_EAST
See Also:
Constant Field Values

SOUTH_WEST

public static final int SOUTH_WEST
See Also:
Constant Field Values
Method Detail

clone

public Style clone()
Returns a clone of this style

Overrides:
clone in class java.lang.Object

copyTo

public void copyTo(Element targetElement)
Returns a clone of this style


setLineColor

public final void setLineColor(java.awt.Color _color)

getLineColor

public final java.awt.Color getLineColor()

setLineWidth

public final void setLineWidth(float _width)

getLineWidth

public final float getLineWidth()

setFillColor

public final void setFillColor(java.awt.Paint _fill)

getFillColor

public final java.awt.Paint getFillColor()

setExtraColor

public final void setExtraColor(java.awt.Color _color)

getExtraColor

public final java.awt.Color getExtraColor()

isDrawingFill

public final boolean isDrawingFill()

setDrawingFill

public final void setDrawingFill(boolean _drawsFill)

isDrawingLines

public final boolean isDrawingLines()

setDrawingLines

public final void setDrawingLines(boolean _drawsLines)

setRelativePosition

public final void setRelativePosition(int _position)

getRelativePosition

public final int getRelativePosition()

setSensitivity

public final void setSensitivity(int _s)
Set the accuracy for the mouse to find a point on the screen

Parameters:
_s - sensitive pixels around the hot spot. 0 for the full area

getSensitivity

public final int getSensitivity()

setPaint

public final void setPaint(java.lang.String filename)
Paints the element using an image file

Parameters:
filename - the source image file

setPaint

public final void setPaint(java.lang.String filename,
                           double width,
                           double height)
Paints the element using an image file

Parameters:
filename - the source image file
width - the desired width of the image
height - the desired height of the image