DESY ACOP Beans Home

com.cosylab.gui.components.gauger
Class ScaleTransformRenderer

java.lang.Object
  extended by com.cosylab.gui.components.gauger.ScaleTransformRenderer

public class ScaleTransformRenderer
extends java.lang.Object

ScaleTransformRenderer renders the gauger component defined by ScaleTransform. This class is responsible for interpreting the transform and rendering background, scale and ticks. Renderer will render custom defined scale segments.

Version:
$id$
Author:
Ales Pucelj

Constructor Summary
ScaleTransformRenderer(Gauger gauger)
          Creates a new ScaleTransformRenderer object.
 
Method Summary
 void render(ScaleTransform transform, java.awt.Graphics2D g)
          Render entire gauger.
 void renderArcSegment(java.awt.Graphics2D g, ScaleTransform.ArcSegment segment, int n, int i)
          Renders borders and background of an arc segment.
 void renderBackground(java.awt.Graphics2D g)
          Renders background of gauger.
protected  void renderRectangleSegment(java.awt.Graphics2D g, ScaleTransform.RectangleSegment segment, int n, int i)
           
 void renderScale(java.awt.Graphics2D g)
          Renders scale.
 void renderTicks(java.awt.Graphics2D g)
          Renders ticks and tick labels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScaleTransformRenderer

public ScaleTransformRenderer(Gauger gauger)
Creates a new ScaleTransformRenderer object.

Parameters:
gauger - Gauger which this transform will render.
Method Detail

renderBackground

public void renderBackground(java.awt.Graphics2D g)
Renders background of gauger. Fills the area with background color of gauger.

Parameters:
g - Context to render to.

renderRectangleSegment

protected void renderRectangleSegment(java.awt.Graphics2D g,
                                      ScaleTransform.RectangleSegment segment,
                                      int n,
                                      int i)

renderScale

public void renderScale(java.awt.Graphics2D g)
Renders scale. Renders individual scale segments.

Parameters:
g - Graphic context to render to.

renderArcSegment

public void renderArcSegment(java.awt.Graphics2D g,
                             ScaleTransform.ArcSegment segment,
                             int n,
                             int i)
Renders borders and background of an arc segment.

Parameters:
g - Graphic context to render to.
segment - Segment to render.
n - Total number of segments.
i - Current segment index.

renderTicks

public void renderTicks(java.awt.Graphics2D g)
Renders ticks and tick labels.

Parameters:
g - Graphic context to render to.

render

public void render(ScaleTransform transform,
                   java.awt.Graphics2D g)
Render entire gauger.

Parameters:
transform - Transform used for rendering.
g - Graphic context to render to.


Copyright © 2010. All Rights Reserved.