physicon.graphLib
Class LinearScale

java.lang.Object
  |
  +--physicon.graphLib.GraphElementBase
        |
        +--physicon.graphLib.GraphScaleBase
              |
              +--physicon.graphLib.LinearScale

public class LinearScale
extends GraphScaleBase

Represents the linear scale. The scale is automatically oriented horizontally or vertically. The scale automatically chooses block type (2, 4, 5, 10 dashes/block).

See Also:
GraphScaleBase

Constructor Summary
LinearScale(LinearScaleDrawer _drawer, DoublePoint _minDpt, DoublePoint _maxDpt)
          Constructor.
LinearScale(LinearScaleDrawer _drawer, DoublePoint _minDpt, DoublePoint _maxDpt, int _numberOfLargeDashes)
          Constructor.
 
Method Summary
 DoublePoint getMaxPoint()
          Returns the copy of the initial point
 DoublePoint getMinPoint()
          Returns the copy of the initial point
 void setAutoMode()
          Sets the auto mode.
 void setManualMode(double _step, double _norm, int _dashPerBlock)
          Manually corrects the parameters of scale.
 void setMaxParam(double _param)
          Changes the final point of the scale.
 void setMinParam(double _param)
          Changes the initial point of the scale.
 void setRange(DoublePoint _minDpt, DoublePoint _maxDpt)
          Updates start and final positions of the scale.
 void updateDrawer()
          Updates the drawer object.
 
Methods inherited from class physicon.graphLib.GraphScaleBase
getMaxParam, getMinParam
 
Methods inherited from class physicon.graphLib.GraphElementBase
addDependent, contains, contains, getContainer, getContext, getDepend, getDrawer, getGEObject, getGraphElement, getRedrawFlag, getRefPoint, getRoughRect, getZLevel, isCreated, isVisible, setDrawer, setRedrawFlag, setRefPoint, setVisible, setZLevel, update
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearScale

public LinearScale(LinearScaleDrawer _drawer,
                   DoublePoint _minDpt,
                   DoublePoint _maxDpt,
                   int _numberOfLargeDashes)
Constructor.
Parameters:
_drawer - - the drawer object for the current scale
_minDpt - - the start point of the scale.
_maxDpt - - the finish point of the scale. This is the point where the scale is finished and where the arrow is started. minParam and maxParam of the super object are setted to the _minDpt.x and _maxDpt.x for the horizontal scale and to the _minDpt.y and _maxDpt.y for the vertical scale
_numberOfLargeDashes - - number of large dashes in scale. If zero number is automatically chosen.

LinearScale

public LinearScale(LinearScaleDrawer _drawer,
                   DoublePoint _minDpt,
                   DoublePoint _maxDpt)
Constructor.
Parameters:
_drawer - - the drawer object for the current scale
_minDpt - - the start point of the scale.
_maxDpt - - the finish point of the scale. This is the point where the scale is finished and where the arrow is started. minParam and maxParam of the super object are setted to the _minDpt.x and _maxDpt.x for the horizontal scale and to the _minDpt.y and _maxDpt.y for the vertical scale
Method Detail

setManualMode

public void setManualMode(double _step,
                          double _norm,
                          int _dashPerBlock)
Manually corrects the parameters of scale.
Parameters:
_step - - the step between the text labels.
_norm - - the parameter to round the current value displayed on the scale. The current value is devided on the given _norm. then it is rounded and then it is multiplayed on _norm. Thus if we want to round the value on the scale to the int value, we set _norm = 1; if we want 1 decimal sign after the point we set _norm = 10; ...
_dashPerBlock - - the number of dashes per one block.

setAutoMode

public void setAutoMode()
Sets the auto mode.

updateDrawer

public void updateDrawer()
Updates the drawer object. Automatically updates its parameters.
Overrides:
updateDrawer in class GraphScaleBase
See Also:
LinearScaleDrawer

setMinParam

public void setMinParam(double _param)
Changes the initial point of the scale.
Parameters:
_param - - new initial value of scale.
Overrides:
setMinParam in class GraphScaleBase

setMaxParam

public void setMaxParam(double _param)
Changes the final point of the scale.
Parameters:
_param - - new final value of scale.
Overrides:
setMaxParam in class GraphScaleBase

setRange

public void setRange(DoublePoint _minDpt,
                     DoublePoint _maxDpt)
Updates start and final positions of the scale. This gives you opportunity to shift the scale

getMinPoint

public DoublePoint getMinPoint()
Returns the copy of the initial point

getMaxPoint

public DoublePoint getMaxPoint()
Returns the copy of the initial point