physicon.graphLib
Class CurveDrawerBase

java.lang.Object
  |
  +--physicon.graphLib.DrawerBase
        |
        +--physicon.graphLib.CurveDrawerBase
Direct Known Subclasses:
DashedCurveDrawer, ThinCurveDrawer

public class CurveDrawerBase
extends DrawerBase

Abstract curve drawer. Contains the array of points and methods to access it.


Constructor Summary
CurveDrawerBase(java.awt.Color _c)
          The constructor
CurveDrawerBase(java.awt.Color _c, boolean thick)
           
 
Method Summary
 void addBreakPoint(java.awt.Point _pt)
          Adds the point to the end of array.
 void addPoint(java.awt.Point _pt)
          Adds the point to the end of array
 int breakPointAt(int _i)
           
 int breakPointsNumber()
           
 boolean contains(java.awt.Point pt)
           
 void drawLocal(java.awt.Graphics g)
          Drawes the curve as the number of lines of correct color connecting points in the array
 java.awt.Color getColor()
          Returns the current curve color
 java.awt.Rectangle getLocalRoughRect()
          Returns local rough rect.
 java.util.Vector getPoints()
           
 java.awt.Point pointAt(int _i)
          Returns the point at the given index
 int pointsNumber()
           
 void reset()
          Calls @super method and removes all points from the array
 void setColor(java.awt.Color _c)
          Set new color for the curve
 void setThick(boolean isThick)
           
 
Methods inherited from class physicon.graphLib.DrawerBase
getGlobalLevel, getGlobalRefPoint, setGlobalLevel, setGlobalRefPoint
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CurveDrawerBase

public CurveDrawerBase(java.awt.Color _c)
The constructor
Parameters:
_c - - The color of curve

CurveDrawerBase

public CurveDrawerBase(java.awt.Color _c,
                       boolean thick)
Method Detail

getColor

public final java.awt.Color getColor()
Returns the current curve color

setColor

public void setColor(java.awt.Color _c)
Set new color for the curve
Parameters:
_c - - new curve color

pointAt

public final java.awt.Point pointAt(int _i)
Returns the point at the given index
Parameters:
_i - - Zero based number of point

addPoint

public final void addPoint(java.awt.Point _pt)
Adds the point to the end of array
Parameters:
_pt - - Reference to the point added

addBreakPoint

public final void addBreakPoint(java.awt.Point _pt)
Adds the point to the end of array. Sets the "breakPoint" attribute to it.
Parameters:
_pt - - Reference to the point added

pointsNumber

public final int pointsNumber()

getPoints

public final java.util.Vector getPoints()

breakPointsNumber

public final int breakPointsNumber()

breakPointAt

public final int breakPointAt(int _i)

contains

public boolean contains(java.awt.Point pt)
Overrides:
contains in class DrawerBase

getLocalRoughRect

public java.awt.Rectangle getLocalRoughRect()
Returns local rough rect. To do this the minimal rectangle that contains all the points in the array is constructed
Overrides:
getLocalRoughRect in class DrawerBase

reset

public void reset()
Calls @super method and removes all points from the array
Overrides:
reset in class DrawerBase

drawLocal

public void drawLocal(java.awt.Graphics g)
Drawes the curve as the number of lines of correct color connecting points in the array
Parameters:
g - - given Graphics object.
Overrides:
drawLocal in class DrawerBase

setThick

public void setThick(boolean isThick)