|
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
Abstract super class of a legend part. The legend consists of an arbitrary number of texts that are preceded by symbols. It has an orientation and a maximum width or height.
Field Summary | |
static int |
HORIZONTAL
Equal to ChartConstants.HORIZONTAL |
static int |
VERTICAL
Equal to ChartConstants.VERTICAL |
Fields inherited from class li.netcat.chart.util.AbstractPart |
BACKGROUND, FOREGROUND, PERSPECTIVE |
Constructor Summary | |
LegendPart()
Constructs a new instance of a legend part and initializes it to its defaults. |
Method Summary | |
GraphPart |
getGraphPart()
Returns the graph part that provides the GraphLook and the LegendModel . |
float |
getHGap()
Returns the horizontal gap between the columns of the legend. |
protected abstract float |
getItemHeight(GraphLook graphLook)
Subclasses must implement this method to report the item height. |
float |
getItemTextGap()
Returns the gap between item and text. |
protected abstract float |
getItemWidth(GraphLook graphLook)
Subclasses must implement this method to report the item width. |
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. |
float |
getMaxHeight()
Returns the maximum height of this legend. |
float |
getMaxWidth()
Returns the maximum with of this legend. |
int |
getOrientation()
Returns the orientation of this legend. |
float |
getVGap()
Returns the vertical gap between the rows of the legend. |
boolean |
isMovable()
|
protected abstract 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 |
setGraphPart(GraphPart graphPart)
Sets the graph part to this LegendPart that provides the GraphLook and the LegendModel . |
void |
setHGap(float hgap)
Sets the horizontal gap between the columns of the legend. |
void |
setItemTextGap(float gap)
Sets the gap between item and text. |
void |
setMaxHeight(float height)
Sets the maximum height of this legend. |
void |
setMaxWidth(float width)
Sets the maximum with of this legend. |
void |
setOrientation(int orientation)
Sets the orientation of this legend. |
void |
setVGap(float vgap)
Sets the vertical gap between the rows of the legend. |
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 |
Field Detail |
public static final int VERTICAL
ChartConstants.VERTICAL
public static final int HORIZONTAL
ChartConstants.HORIZONTAL
Constructor Detail |
public LegendPart()
Method Detail |
public GraphPart getGraphPart()
GraphLook
and the LegendModel
.
null
.public void setGraphPart(GraphPart graphPart)
LegendPart
that provides the GraphLook
and the LegendModel
.
graphPart
- The graph part, might be null
.public float getItemTextGap()
public void setItemTextGap(float gap)
gap
- The gap between item and text in pixel.public float getHGap()
public void setHGap(float hgap)
hgap
- The horizontal gap in pixel.public float getVGap()
public void setVGap(float vgap)
vgap
- The vertical gap in pixel.public float getMaxWidth()
HORIZONTAL
. If not all elements
fit on one row, then, the remaining elements are placed on the next row.
public void setMaxWidth(float width)
HORIZONTAL
. If not all elements
fit on one row, then, the remaining elements are placed on the next row.
width
- The maximum width of this legend.public float getMaxHeight()
VERTICAL
. If not all elements
fit on one column, then, the remaining elements are placed on the next column.
public void setMaxHeight(float height)
VERTICAL
. If not all elements
fit on one column, then, the remaining elements are placed on the next column.
height
- The maximum height of this legend.public int getOrientation()
HORIZONTAL
or VERTICAL
.public void setOrientation(int orientation)
orientation
- Specify either HORIZONTAL
or VERTICAL
to layout the legend in rows or columns.public Layout getLayout(java.awt.Graphics g)
Part
g
- The relevant graphics object.
null
.public boolean isMovable()
protected abstract float getItemWidth(GraphLook graphLook)
graphLook
- The current graph look.
protected abstract float getItemHeight(GraphLook graphLook)
graphLook
- The current graph look.
protected abstract void layoutItem(java.awt.Graphics g, DefaultLayout layout, java.awt.geom.Rectangle2D.Float itemBounds, GraphLook graphLook, int rowIndex, int columnIndex)
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 |