lt.monarch.chart.marker
Class SimpleLabelLayouter

java.lang.Object
  extended by lt.monarch.chart.marker.SimpleLabelLayouter
All Implemented Interfaces:
java.io.Serializable, LabelLayouter

public class SimpleLabelLayouter
extends java.lang.Object
implements LabelLayouter, java.io.Serializable

See Also:
Serialized Form

Constructor Summary
Constructor and Description
SimpleLabelLayouter()
          Constructor of label layouter.
 
Method Summary
Modifier and Type Method and Description
 LabelLayouts getLayoutType()
          Returns label layout type.
 int getMaximumDistance()
          Returns maximum distance from marker label to marker position.
 int getStep()
          Returns layouting step - distance (in pixels) between layouting positions.
 void layout(Chart chart, MarkerConstraints[][] constraints)
          This method layouts labels that are specified in array of marker constraints.
 void setLayoutType(LabelLayouts layoutType)
          Sets label layout type.
 void setMaximumDistance(int distance)
          Sets maximum distance (in pixels) from marker label to marker position.
 void setStep(int step)
          Sets layouting step.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleLabelLayouter

public SimpleLabelLayouter()
Constructor of label layouter.

Method Detail

layout

public void layout(Chart chart,
                   MarkerConstraints[][] constraints)
This method layouts labels that are specified in array of marker constraints. It depends from layout type, layout step and chart. Layout type specifies where to put labels from the positions of markers. Layout step determines distance between layout positions. Chart is used to determine if labels are inside or outside chart area.

Specified by:
layout in interface LabelLayouter
Parameters:
chart - Chart is used to determine if labels are inside or outside chart area.
constraints - Array of marker constraints.

setStep

public void setStep(int step)
Sets layouting step. This value determines distance (in pixels) between layouting positions.

Parameters:
step - Distance (in pixels) between layouting positions.

getStep

public int getStep()
Returns layouting step - distance (in pixels) between layouting positions.

Returns:
Layouting step

setLayoutType

public void setLayoutType(LabelLayouts layoutType)
Sets label layout type.

Parameters:
layoutType - Label layout type.

getLayoutType

public LabelLayouts getLayoutType()
Returns label layout type.

Returns:
Label layout type.

setMaximumDistance

public void setMaximumDistance(int distance)
Sets maximum distance (in pixels) from marker label to marker position.

Parameters:
distance - Maximum distance (in pixels) from marker label to marker position.

getMaximumDistance

public int getMaximumDistance()
Returns maximum distance from marker label to marker position.

Returns:
Maximum distance from marker label to marker position.