lt.monarch.chart.chart2D.breakline
Class ChartBreakLine

java.lang.Object
  extended by lt.monarch.chart.engine.AbstractChartObject<ChartPaintTags>
      extended by lt.monarch.chart.chart2D.breakline.ChartBreakLine
All Implemented Interfaces:
java.io.Serializable, ChartObject, StyleEditorEntity

public class ChartBreakLine
extends AbstractChartObject<ChartPaintTags>

Chart break element. Breaks chart axes and removes chart area defined with from and to parameters and replaces with a break line.

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  Axis2DY axis
           
protected  double breakBottom
           
protected  double breakTop
           
protected  double from
           
protected  int margin
           
protected  Orientation orientation
           
protected  double[] proportion
           
protected  BreakLineStrategy strategy
           
protected  double to
           
 
Fields inherited from class lt.monarch.chart.engine.AbstractChartObject
AXIS_SORT_POSITION, BREAK_LINE_POSITION, DEFAULT_SORT_POSITION, GRID_SORT_POSITION, MARKER_SERIES_SORT_POSITION, MARKERS_SORT_POSITION, paintStyle, SERIES_SORT_POSITION, sortPosition, style
 
Constructor Summary
Constructor and Description
ChartBreakLine(Axis2DY axis, double from, double to)
          Constructs break line object
 
Method Summary
Modifier and Type Method and Description
 void draw(AbstractGraphics g)
          Paints the break line in the specified Graphics context.
 Axis2DY getAxis()
          Returns brekline y axis.
 double getFrom()
          Returns brekline from value.
 int getMargin()
          Returns brekline margin.
 double[] getProportion()
          Returns breakline divided chart proportions.
 int getSortPosition()
          Returns chart object paint order index.
 double getTo()
          Returns brekline to value.
 boolean isWithinAxisRange()
           
 void setBreakPosition(double bottom, double top)
           
 void setMargin(int margin)
          Sets brekline margin in pixels.
 void setProportion(double[] proportion)
          Sets breakline divided chart proportions default {0.5, 0.5}.
 void setStrategy(BreakLineStrategies strat)
          Sets break line startegy.
 
Methods inherited from class lt.monarch.chart.engine.AbstractChartObject
activate, chart, copy, deactivate, dispose, finalize, getChart, getChartObjectBounds, getPaintStyle, getParent, getStyle, getStyle, invalidate, isVisible, layout, repaint, repaint, setChart, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

breakBottom

protected double breakBottom

breakTop

protected double breakTop

margin

protected int margin

proportion

protected double[] proportion

strategy

protected BreakLineStrategy strategy

orientation

protected Orientation orientation

axis

protected Axis2DY axis

from

protected double from

to

protected double to
Constructor Detail

ChartBreakLine

public ChartBreakLine(Axis2DY axis,
                      double from,
                      double to)
               throws InvalidParameterException
Constructs break line object

Parameters:
axis - the Y axis on which set break line
from - starting axis value for a break to begin
to - ending axis value for a break to end
Throws:
InvalidParameterException - when y axis doesn't have major parameters
Method Detail

isWithinAxisRange

public boolean isWithinAxisRange()

getAxis

public Axis2DY getAxis()
Returns brekline y axis.

Returns:
y axis

getFrom

public double getFrom()
Returns brekline from value.

Returns:
from value

getTo

public double getTo()
Returns brekline to value.

Returns:
to value

draw

public void draw(AbstractGraphics g)
Paints the break line in the specified Graphics context.

Parameters:
g - the Graphics context in which to paint break line

setStrategy

public void setStrategy(BreakLineStrategies strat)
Sets break line startegy.

Parameters:
strat - one of BreakLineStrategies

setMargin

public void setMargin(int margin)
Sets brekline margin in pixels.

Parameters:
margin - breakline size

getMargin

public int getMargin()
Returns brekline margin.

Returns:
breakline size

setProportion

public void setProportion(double[] proportion)
Sets breakline divided chart proportions default {0.5, 0.5}.

Parameters:
proportion - divided chart proportions

getProportion

public double[] getProportion()
Returns breakline divided chart proportions.

Returns:
proportion divided chart proportions

getSortPosition

public int getSortPosition()
Description copied from interface: ChartObject
Returns chart object paint order index.

Specified by:
getSortPosition in interface ChartObject
Overrides:
getSortPosition in class AbstractChartObject<ChartPaintTags>
Returns:
object paint order index

setBreakPosition

public void setBreakPosition(double bottom,
                             double top)