org.scilab.forge.scirenderer.ruler
Class RulerDrawer

java.lang.Object
  extended by org.scilab.forge.scirenderer.ruler.RulerDrawer

public class RulerDrawer
extends java.lang.Object

Author:
Pierre Lando

Constructor Summary
RulerDrawer(TextureManager textureManager)
          Ruler drawer constructor.
 
Method Summary
 RulerDrawingResult computeRuler(DrawingTools drawingTools, RulerModel model, Transformation canvasProjection)
          Compute different parameters on a ruler
 void disposeResources()
          Dispose all used resources.
 void draw(DrawingTools drawingTools)
          Draw the ruler
 RulerDrawingResult draw(DrawingTools drawingTools, RulerModel model)
          Ruler drawing method.
 RulerModel getModel()
          Get the model
 java.util.List<java.lang.Double> getSubTicksValue()
          Get the subticks values
 java.util.List<java.lang.Double> getTicksValue()
          Get the ticks values
 void setSpriteFactory(RulerSpriteFactory spriteFactory)
          Set the current RulerSpriteFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RulerDrawer

public RulerDrawer(TextureManager textureManager)
Ruler drawer constructor.

Parameters:
textureManager - the TextureManager of the canvas where the ruler will be drawn.
Method Detail

draw

public RulerDrawingResult draw(DrawingTools drawingTools,
                               RulerModel model)
Ruler drawing method.

Parameters:
drawingTools - the DrawingTools of the canvas where the ruler will be drawn.
model - the RulerModel of the drawn ruler.
Returns:
the RulerDrawingResult give information about how the ruler have been drawn.

draw

public void draw(DrawingTools drawingTools)
Draw the ruler

Parameters:
drawingTools - the DrawingTools of the canvas where the ruler will be drawn.

getModel

public RulerModel getModel()
Get the model

Returns:
the ruler model.

getSubTicksValue

public java.util.List<java.lang.Double> getSubTicksValue()
Get the subticks values

Returns:
the values.

getTicksValue

public java.util.List<java.lang.Double> getTicksValue()
Get the ticks values

Returns:
the values.

computeRuler

public RulerDrawingResult computeRuler(DrawingTools drawingTools,
                                       RulerModel model,
                                       Transformation canvasProjection)
Compute different parameters on a ruler

Parameters:
drawingTools - the DrawingTools of the canvas where the ruler will be drawn.
rulerModel - the RulerModel of the drawn ruler.
canvasProjection - the canvas projection.

setSpriteFactory

public void setSpriteFactory(RulerSpriteFactory spriteFactory)
Set the current RulerSpriteFactory. All existing sprite will be cleared. This ruler drawer will use the new RulerSpriteFactory.

Parameters:
spriteFactory - the new RulerSpriteFactory.

disposeResources

public void disposeResources()
Dispose all used resources.