ChartCat 1.2

li.netcat.chart.util.tag
Class DefaultTagManager

java.lang.Object
  extended byli.netcat.chart.util.tag.DefaultTagManager
All Implemented Interfaces:
TagManager

public class DefaultTagManager
extends java.lang.Object
implements TagManager

Default implementation of the TagManager interface. This class implements three different styles of labels and three different methods of how to handle overlaps.

Author:
Arthur Marxer

Field Summary
static int METHOD_MOVE
          The METHOD_MOVE moves a label to another position if an overlap occurs.
static int METHOD_REMOVE
          The METHOD_REMOVE simply does not paint a label that overlaps with another.
static int METHOD_STAY
          The METHOD_STAY simply ignores overlaps of labels.
static int STYLE_DASH
          The STYLE_DASH paints a small dash at the left or right of the label and connects the end of the dash with the line that points to the target position.
static int STYLE_TURN
          The STYLE_TURN tries to turn the labels when they overlap.
static int STYLE_UNDERLINE
          The STYLE_UNDERLINE underlines the label and connects this line with the line that points to the target.
 
Constructor Summary
DefaultTagManager(int style, int method)
          Constructs a new DefaultTagManager with the given style and the given method.
 
Method Summary
 float getDashLength()
          Returns the length of the dash line.
 Layout getLayout(TagPart tagPart, java.awt.Graphics g)
          Handles overlaps of the given labels and calculates the resulting layout.
 int getMethod()
          Returns the method of this tag manager.
 float getPerpendicularMoveLength()
          Under certain circumstances when labels get moved, they need a movement in the perpendicular direction.
 int getStyle()
          Returns the style of this tag manager.
 boolean getTurnSmoothly()
          Returns true if the tags get turned smoothly.
 float getTurnTextLineGap()
          Returns the gap between the turned text and the line that connects with the target.
 void setDashLength(float dashLength)
          Sets the length of the dash line.
 void setMethod(int method)
          Sets the method that gets applied when overlaps of the labels occur.
 void setPerpendicularMoveLength(float length)
          Under certain circumstances when labels get moved, they need a movement in the perpendicular direction.
 void setStyle(int style)
          Sets the style of this tag manager.
 void setTurnSmoothly(boolean flag)
          Specify false to use only horizontal and vertical tags.
 void setTurnTextLineGap(float turnTextLineGap)
          Sets the gap between the turned text and the line that connects with the target.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STYLE_DASH

public static final int STYLE_DASH
The STYLE_DASH paints a small dash at the left or right of the label and connects the end of the dash with the line that points to the target position.

See Also:
Constant Field Values

STYLE_UNDERLINE

public static final int STYLE_UNDERLINE
The STYLE_UNDERLINE underlines the label and connects this line with the line that points to the target.

See Also:
Constant Field Values

STYLE_TURN

public static final int STYLE_TURN
The STYLE_TURN tries to turn the labels when they overlap.

See Also:
Constant Field Values

METHOD_STAY

public static final int METHOD_STAY
The METHOD_STAY simply ignores overlaps of labels.

See Also:
Constant Field Values

METHOD_MOVE

public static final int METHOD_MOVE
The METHOD_MOVE moves a label to another position if an overlap occurs.

See Also:
Constant Field Values

METHOD_REMOVE

public static final int METHOD_REMOVE
The METHOD_REMOVE simply does not paint a label that overlaps with another.

See Also:
Constant Field Values
Constructor Detail

DefaultTagManager

public DefaultTagManager(int style,
                         int method)
Constructs a new DefaultTagManager with the given style and the given method.

Parameters:
style - The style of the labels. Specify one of STYLE_DASH, STYLE_UNDERLINE or STYLE_TURN.
method - The method that gets applied when overlaps of the labels occur. Specify one of METHOD_STAY, METHOD_MOVE or METHOD_REMOVE.
Method Detail

getStyle

public int getStyle()
Returns the style of this tag manager.

Returns:
One of STYLE_DASH, STYLE_UNDERLINE or STYLE_TURN.

setStyle

public void setStyle(int style)
Sets the style of this tag manager.

Parameters:
style - The style of the labels. Specify one of STYLE_DASH, STYLE_UNDERLINE or STYLE_TURN.

getMethod

public int getMethod()
Returns the method of this tag manager.

Returns:
One of METHOD_STAY, METHOD_MOVE or METHOD_REMOVE.

setMethod

public void setMethod(int method)
Sets the method that gets applied when overlaps of the labels occur. Specify one of METHOD_STAY, METHOD_MOVE or METHOD_REMOVE.

Parameters:
method - The method.

getDashLength

public float getDashLength()
Returns the length of the dash line.

Returns:
The length of the dash line.

setDashLength

public void setDashLength(float dashLength)
Sets the length of the dash line. This parameter is only used if the style is set to STYLE_DASH.

Parameters:
dashLength - The length of the dash line.

getTurnTextLineGap

public float getTurnTextLineGap()
Returns the gap between the turned text and the line that connects with the target. This parameter is only used if the style is set to STYLE_TURN.

Returns:
The gap.

setTurnTextLineGap

public void setTurnTextLineGap(float turnTextLineGap)
Sets the gap between the turned text and the line that connects with the target. This parameter is only used if the style is set to STYLE_TURN.

Parameters:
turnTextLineGap - The gap.

getTurnSmoothly

public boolean getTurnSmoothly()
Returns true if the tags get turned smoothly.

Returns:
true if the tags get turned smoothly.

setTurnSmoothly

public void setTurnSmoothly(boolean flag)
Specify false to use only horizontal and vertical tags.

Parameters:
flag - The flag.

getPerpendicularMoveLength

public float getPerpendicularMoveLength()
Under certain circumstances when labels get moved, they need a movement in the perpendicular direction. This property specifies the amount of this perpendicular movement.

Returns:
The amount of movement in perpendicular direction.

setPerpendicularMoveLength

public void setPerpendicularMoveLength(float length)
Under certain circumstances when labels get moved, they need a movement in the perpendicular direction. This property specifies the amount of this perpendicular movement.

Parameters:
length - The amount of movement in perpendicular direction.

getLayout

public Layout getLayout(TagPart tagPart,
                        java.awt.Graphics g)
Description copied from interface: TagManager
Handles overlaps of the given labels and calculates the resulting layout.

Specified by:
getLayout in interface TagManager
Parameters:
tagPart - The tag part that havs to be layouted, never null.
Returns:
The calculated layout.

ChartCat 1.2

Copyright © 2003 - 2005 NetCat Inc.. All rights reserved. Feedback

Chart,Charting,Charts,Java,Java Chart,Java Charting,Java Charts,Chart Java,Charts Java,3D,3D Chart,3Dchart,Graph,Graphs,Chart Graph,Java Graph,Diagram,Diagrams,Java Diagram,Java Diagrams,Curve,Curves,Bar Chart,Pie Chart,Line Chart,Area Chart,Bar Graph,Pie Graph,Line Graph,Java Diagram,Chart Diagram,Package,Library,Chart Library,Chart Engine,Chart Package,Graph Package,Paint,Support,Graphic,Graphics,Print, Chart,Charting,Charts,Java,Java Chart,Java Charting,Java Charts,Chart Java,Charts Java,3D,3D Chart,3Dchart,Graph,Graphs,Chart Graph,Java Graph,Diagram,Diagrams,Java Diagram,Java Diagrams,Curve,Curves,Bar Chart,Pie Chart,Line Chart,Area Chart,Bar Graph,Pie Graph,Line Graph,Java Diagram,Chart Diagram,Package,Library,Chart Library,Chart Engine,Chart Package,Graph Package,Paint,Support,Graphic,Graphics,Print, Chart,Charting,Charts,Java,Java Chart,Java Charting,Java Charts,Chart Java,Charts Java,3D,3D Chart,3Dchart,Graph,Graphs,Chart Graph,Java Graph,Diagram,Diagrams,Java Diagram,Java Diagrams,Curve,Curves,Bar Chart,Pie Chart,Line Chart,Area Chart,Bar Graph,Pie Graph,Line Graph,Java Diagram,Chart Diagram,Package,Library,Chart Library,Chart Engine,Chart Package,Graph Package,Paint,Support,Graphic,Graphics,Print