ChartCat 1.2

li.netcat.chart.util
Class LineLegendPart

java.lang.Object
  extended byli.netcat.chart.util.AbstractPart
      extended byli.netcat.chart.util.TextPart
          extended byli.netcat.chart.util.LegendPart
              extended byli.netcat.chart.util.LineLegendPart
All Implemented Interfaces:
Part

public class LineLegendPart
extends LegendPart

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.

Author:
Arthur Marxer

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

LineLegendPart

public LineLegendPart(GraphPart graphPart)
Constructs a new LineLegendPart that refers to the given GraphPart.

Parameters:
graphPart - The graph part to which this legend refers to.

LineLegendPart

public LineLegendPart(GraphPart graphPart,
                      int orientation)
Constructs a new LineLegendPart that refers to the given GraphPart and uses the given orientation.

Parameters:
graphPart - The graph part to which this legend refers to.
orientation - The orientation, specify either HORIZONTAL or VERTICAL.
Method Detail

getLineLength

public float getLineLength()
Returns the length of the line.

Returns:
The length of the line in pixel.

setLineLength

public void setLineLength(float length)
Sets the length of the line.

Parameters:
length - The length of the line in pixel.

getPaintLine

public boolean getPaintLine()
Returns true if the lines get painted. This parameter is only used when the runtime instance of the GrapPart is not known to this legend.

Returns:
true if the lines get painted.

setPaintLine

public void setPaintLine(boolean paintLine)
If true the legend paints the lines. This parameter is only used when the runtime instance of the GrapPart is not known to this legend.

Parameters:
paintLine - The flag.

getPaintSymbol

public boolean getPaintSymbol()
Returns true if the symbols get painted. This parameter is only used when the runtime instance of the GrapPart is not known to this legend.

Returns:
true if the symbols get painted.

setPaintSymbol

public void setPaintSymbol(boolean paintSymbol)
If true the legend paints the symbols. This parameter is only used when the runtime instance of the GrapPart is not known to this legend.

Parameters:
paintSymbol - The flag.

getItemWidth

protected float getItemWidth(GraphLook graphLook)
Description copied from class: LegendPart
Subclasses must implement this method to report the item width.

Specified by:
getItemWidth in class LegendPart
Parameters:
graphLook - The current graph look.
Returns:
The width of the item.

getItemHeight

protected float getItemHeight(GraphLook graphLook)
Description copied from class: LegendPart
Subclasses must implement this method to report the item height.

Specified by:
getItemHeight in class LegendPart
Parameters:
graphLook - The current graph look.
Returns:
The height of the item.

layoutItem

protected void layoutItem(java.awt.Graphics g,
                          DefaultLayout layout,
                          java.awt.geom.Rectangle2D.Float itemBounds,
                          GraphLook graphLook,
                          int rowIndex,
                          int columnIndex)
Description copied from class: LegendPart
Subclasses must implement this method to layout an item.

Specified by:
layoutItem in class LegendPart
Parameters:
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

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