|
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.LegendPart
li.netcat.chart.util.LineLegendPart
Represents a legend that refers to lines in a chart and looks for example like this:
It uses a line and/or a symbol to refer to the graph line with the same paint and/or symbol.
The flags whether to paint lines and symbols are automatically gathered from the graph part (if it is of a known instance) or can be set manually. The length of the line can be specified in this class, all other properties in the super class.
Field Summary |
Fields inherited from class li.netcat.chart.util.LegendPart |
HORIZONTAL, VERTICAL |
Fields inherited from class li.netcat.chart.util.AbstractPart |
BACKGROUND, FOREGROUND, PERSPECTIVE |
Constructor Summary | |
LineLegendPart(GraphPart graphPart)
Constructs a new LineLegendPart that refers to the given GraphPart . |
|
LineLegendPart(GraphPart graphPart,
int orientation)
Constructs a new LineLegendPart that refers to the given GraphPart and uses
the given orientation. |
Method Summary | |
protected float |
getItemHeight(GraphLook graphLook)
Subclasses must implement this method to report the item height. |
protected float |
getItemWidth(GraphLook graphLook)
Subclasses must implement this method to report the item width. |
float |
getLineLength()
Returns the length of the line. |
boolean |
getPaintLine()
Returns true if the lines get painted.
|
boolean |
getPaintSymbol()
Returns true if the symbols get painted.
|
protected void |
layoutItem(java.awt.Graphics g,
DefaultLayout layout,
java.awt.geom.Rectangle2D.Float itemBounds,
GraphLook graphLook,
int rowIndex,
int columnIndex)
Subclasses must implement this method to layout an item. |
void |
setLineLength(float length)
Sets the length of the line. |
void |
setPaintLine(boolean paintLine)
If true the legend paints the lines.
|
void |
setPaintSymbol(boolean paintSymbol)
If true the legend paints the symbols.
|
Methods inherited from class li.netcat.chart.util.LegendPart |
getGraphPart, getHGap, getItemTextGap, getLayout, getMaxHeight, getMaxWidth, getOrientation, getVGap, isMovable, setGraphPart, setHGap, setItemTextGap, setMaxHeight, setMaxWidth, setOrientation, setVGap |
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 LineLegendPart(GraphPart graphPart)
LineLegendPart
that refers to the given GraphPart
.
graphPart
- The graph part to which this legend refers to.public LineLegendPart(GraphPart graphPart, int orientation)
LineLegendPart
that refers to the given GraphPart
and uses
the given orientation.
graphPart
- The graph part to which this legend refers to.orientation
- The orientation, specify either HORIZONTAL
or VERTICAL
.Method Detail |
public float getLineLength()
public void setLineLength(float length)
length
- The length of the line in pixel.public boolean getPaintLine()
true
if the lines get painted.
This parameter is only used when the runtime instance of the GrapPart
is not known to this legend.
public void setPaintLine(boolean paintLine)
true
the legend paints the lines.
This parameter is only used when the runtime instance of the GrapPart
is not known to this legend.
paintLine
- The flag.public boolean getPaintSymbol()
true
if the symbols get painted.
This parameter is only used when the runtime instance of the GrapPart
is not known to this legend.
public void setPaintSymbol(boolean paintSymbol)
true
the legend paints the symbols.
This parameter is only used when the runtime instance of the GrapPart
is not known to this legend.
paintSymbol
- The flag.protected float getItemWidth(GraphLook graphLook)
LegendPart
getItemWidth
in class LegendPart
graphLook
- The current graph look.
protected float getItemHeight(GraphLook graphLook)
LegendPart
getItemHeight
in class LegendPart
graphLook
- The current graph look.
protected void layoutItem(java.awt.Graphics g, DefaultLayout layout, java.awt.geom.Rectangle2D.Float itemBounds, GraphLook graphLook, int rowIndex, int columnIndex)
LegendPart
layoutItem
in class LegendPart
g
- The current graphics context.layout
- The resulting layout.itemBounds
- The bounds of the current item.rowIndex
- The index of the row.columnIndex
- The index of the column.
|
ChartCat 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |