|
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.AbstractPart
li.netcat.chart.util.TextPart
li.netcat.chart.util.TagPart
Abstract super class of all parts that have to layout a series of labels (tags) that might need special handling of overlaps. Examples are scales or value parts that label directly some areas of the chart. The naming "tag" is used for this concept.
This class basically holds an instance of a tag manager, an instance of a pen that draws the lines and insets that define the bounds of the tags.
Field Summary |
Fields inherited from class li.netcat.chart.util.AbstractPart |
BACKGROUND, FOREGROUND, PERSPECTIVE |
Constructor Summary | |
TagPart()
Constructs and initializes a new instance of a TagPart . |
Method Summary | |
protected Tag |
createTag(DeviceString text,
float x,
float y)
Utility methods for subclasses that creates a tag with the corresponding properties. |
protected Tag |
createTag(DeviceString text,
float x,
float y,
java.lang.Object perspective)
Utility methods for subclasses that creates a tag with the corresponding properties. |
protected Tag |
createTag(DeviceString text,
TextLook textLook,
Pen pen,
float x,
float y,
java.lang.Object perspective)
Utility methods for subclasses that creates a tag with the corresponding properties. |
float |
getAdditionalLineLength()
Returns the additional line length that shifts the text in the direction of the lines by an additional amount. |
int |
getBottom()
Returns the bottom inset. |
Layout |
getLayout(java.awt.Graphics g)
Returns an instance of a layout that is able to report the bounds of this part and is able to paint this part. |
int |
getLeft()
Returns the left inset. |
PenBox |
getLinePenBox()
Returns the pen box that provides the pens used to draw the lines from the tag to the target point. |
Pen |
getPen()
Returns the pen that is used to draw the line from the tag to the target point. |
int |
getRight()
Returns the right inset. |
abstract TagConstraints |
getTagConstraints(java.awt.Graphics g)
Subclasses must implement this method to report the tag constraints that do the first displacements. |
TagManager |
getTagManager()
Returns the instance of the tag manager that is responsible to do the layout. |
abstract Tag[] |
getTags(java.awt.Graphics g)
Subclasses must implement this method to report the list of tags that must be layouted. |
PenBox |
getTextPenBox()
Returns the pen box that provides the pens used to draw the texts. |
int |
getTop()
Returns the top inset. |
void |
setAdditionalLineLength(float length)
Sets the additional line length that shifts the text in the direction of the lines by an additional amount. |
void |
setInsets(int top,
int left,
int bottom,
int right)
Sets the insets of this TagPart . |
void |
setLinePenBox(PenBox penBox)
Sets a pen box that provides the pens used to draw the lines from the tag to the target point. |
void |
setPen(Pen pen)
Sets the pen that is used to draw the lines from the tag to the target point. |
void |
setTagManager(TagManager manager)
Sets the instance of the tag manager that is responsible to do the layout. |
void |
setTextPenBox(PenBox penBox)
Sets a pen box that provides the pens used to draw the texts. |
Methods inherited from class li.netcat.chart.util.TextPart |
getTextLook, setTextLook |
Methods inherited from class li.netcat.chart.util.AbstractPart |
getChart, getPerspective, invalidate, setChart, setPerspective |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TagPart()
TagPart
.
Method Detail |
public Pen getPen()
null
.public void setPen(Pen pen)
pen
- The pen, specify null
to avoid the painting of the lines.public PenBox getLinePenBox()
public void setLinePenBox(PenBox penBox)
penBox
- The pen box, or null if the default pen should be used.public PenBox getTextPenBox()
public void setTextPenBox(PenBox penBox)
penBox
- The pen box, or null if the default should be used.public float getAdditionalLineLength()
public void setAdditionalLineLength(float length)
public int getTop()
public int getLeft()
public int getBottom()
public int getRight()
public void setInsets(int top, int left, int bottom, int right)
TagPart
. The insets are added to the bounds of the text before
the detection of overlaps takes place.
top
- The top inset.left
- The left inset.bottom
- The bottom inset.right
- The right inset.public TagManager getTagManager()
TagManager
.public void setTagManager(TagManager manager)
manager
- The new tag manager, not null
.public Layout getLayout(java.awt.Graphics g)
Part
g
- The relevant graphics object.
null
.protected Tag createTag(DeviceString text, float x, float y)
text
- The text of the tag.x
- The x-coordinate of the target point.y
- The y-coordinate of the target point.protected Tag createTag(DeviceString text, float x, float y, java.lang.Object perspective)
text
- The text of the tag.x
- The x-coordinate of the target point.y
- The y-coordinate of the target point.perspective
- The perspective position of the tag.PerspectivePart
protected Tag createTag(DeviceString text, TextLook textLook, Pen pen, float x, float y, java.lang.Object perspective)
text
- The text of the tag.textLook
- The look of the text.pen
- The pen used to paint the line.x
- The x-coordinate of the target point.y
- The y-coordinate of the target point.perspective
- The perspective position of the tag.PerspectivePart
public abstract TagConstraints getTagConstraints(java.awt.Graphics g)
g
- The relevant graphics object.
public abstract Tag[] getTags(java.awt.Graphics g)
g
- The relevant graphics object.
null
, but must not contain null
entries.
|
ChartCat 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |