|
ChartCat 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectli.netcat.chart.util.tag.DefaultTagManager
Default implementation of the TagManager
interface. This class implements
three different styles of labels and three different methods of how to
handle overlaps.
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 |
public static final int STYLE_DASH
public static final int STYLE_UNDERLINE
public static final int STYLE_TURN
public static final int METHOD_STAY
public static final int METHOD_MOVE
public static final int METHOD_REMOVE
Constructor Detail |
public DefaultTagManager(int style, int method)
DefaultTagManager
with the given style and the given method.
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 |
public int getStyle()
STYLE_DASH
, STYLE_UNDERLINE
or STYLE_TURN
.public void setStyle(int style)
style
- The style of the labels. Specify one of STYLE_DASH
, STYLE_UNDERLINE
or STYLE_TURN
.public int getMethod()
METHOD_STAY
, METHOD_MOVE
or METHOD_REMOVE
.public void setMethod(int method)
METHOD_STAY
,
METHOD_MOVE
or METHOD_REMOVE
.
method
- The method.public float getDashLength()
public void setDashLength(float dashLength)
STYLE_DASH
.
dashLength
- The length of the dash line.public float getTurnTextLineGap()
STYLE_TURN
.
public void setTurnTextLineGap(float turnTextLineGap)
STYLE_TURN
.
turnTextLineGap
- The gap.public boolean getTurnSmoothly()
true
if the tags get turned smoothly.
true
if the tags get turned smoothly.public void setTurnSmoothly(boolean flag)
false
to use only horizontal and vertical tags.
flag
- The flag.public float getPerpendicularMoveLength()
public void setPerpendicularMoveLength(float length)
length
- The amount of movement in perpendicular direction.public Layout getLayout(TagPart tagPart, java.awt.Graphics g)
TagManager
getLayout
in interface TagManager
tagPart
- The tag part that havs to be layouted, never null
.
|
ChartCat 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |