org.opensourcephysics.drawing3d.utils
Class Style

java.lang.Object
  extended by org.opensourcephysics.drawing3d.utils.Style

public class Style
extends java.lang.Object


Field Summary
static int CENTERED
           
static int CHANGED_DEPTH_FACTOR
           
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_RESOLUTION
           
static int CHANGED_SENSITIVITY
           
static int CHANGED_TEXTURES
           
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
           
 
Constructor Summary
Style(Element _element)
          Package-private constructor User must obtain Style objects from elements, by using the getStyle() method
 
Method Summary
 Style clone()
          Returns a clone of this style
 void copyTo(Style target)
          Copies this style onto another
 double getAmbientFactor()
           
 boolean getCombine()
           
 double getDepthFactor()
           
 Element getElement()
           
 java.awt.Color getExtraColor()
           
 java.awt.Paint getFillColor()
           
 java.awt.Color getLineColor()
           
 java.awt.Stroke getLineStroke()
          Gets the Stroke derived from the line width
 float getLineWidth()
           
 int getRelativePosition()
           
 Resolution getResolution()
           
 int getSensitivity()
           
 java.lang.Object[] getTextures()
           
 double getTransparency()
           
 boolean isDrawingFill()
           
 boolean isDrawingLines()
           
 void setAmbientFactor(double _factor)
           
 void setDepthFactor(double factor)
           
 void setDrawingFill(boolean _drawsFill)
           
 void setDrawingLines(boolean _drawsLines)
           
 void setExtraColor(java.awt.Color _color)
           
 void setFillColor(java.awt.Paint _color)
           
 void setLineColor(java.awt.Color _color)
           
 void setLineWidth(float _width)
           
 void setRelativePosition(int _position)
           
 void setResolution(Resolution _resolution)
           
 void setSensitivity(int _s)
          Set the accuracy for the mouse to find a point on the screen
 void setTexture(java.lang.Object texture1, java.lang.Object texture2, double transparency, boolean combine)
           
 
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

CHANGED_DEPTH_FACTOR

public static final int CHANGED_DEPTH_FACTOR
See Also:
Constant Field Values

CHANGED_RESOLUTION

public static final int CHANGED_RESOLUTION
See Also:
Constant Field Values

CHANGED_TEXTURES

public static final int CHANGED_TEXTURES
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
Constructor Detail

Style

public Style(Element _element)
Package-private constructor User must obtain Style objects from elements, by using the getStyle() method

Parameters:
_element - Element
Method Detail

getElement

public Element getElement()

clone

public Style clone()
Returns a clone of this style

Overrides:
clone in class java.lang.Object

copyTo

public void copyTo(Style target)
Copies this style onto another

Parameters:
target -

setLineColor

public void setLineColor(java.awt.Color _color)

getLineColor

public final java.awt.Color getLineColor()

setLineWidth

public void setLineWidth(float _width)

getLineWidth

public final float getLineWidth()

getLineStroke

public final java.awt.Stroke getLineStroke()
Gets the Stroke derived from the line width

Returns:
Stroke
See Also:
Stroke

setFillColor

public void setFillColor(java.awt.Paint _color)

getFillColor

public final java.awt.Paint getFillColor()

setExtraColor

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

getExtraColor

public final java.awt.Color getExtraColor()

setResolution

public void setResolution(Resolution _resolution)

getResolution

public final Resolution getResolution()

isDrawingFill

public boolean isDrawingFill()

setDrawingFill

public void setDrawingFill(boolean _drawsFill)

isDrawingLines

public boolean isDrawingLines()

setDrawingLines

public void setDrawingLines(boolean _drawsLines)

setDepthFactor

public void setDepthFactor(double factor)

getDepthFactor

public double getDepthFactor()

setTexture

public void setTexture(java.lang.Object texture1,
                       java.lang.Object texture2,
                       double transparency,
                       boolean combine)

getTextures

public java.lang.Object[] getTextures()

getTransparency

public double getTransparency()

getCombine

public boolean getCombine()

setAmbientFactor

public void setAmbientFactor(double _factor)

getAmbientFactor

public double getAmbientFactor()

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()