ChartCat 1.2

li.netcat.chart.util
Class CartesianScalePart

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

public class CartesianScalePart
extends TagPart

Represents a straight scale that looks for example like this:

It can be used to tag a Cartesian grid or the vertical component of a polar grid. This part uses the tag concept and is therefore very flexible in its strategy and layout. For more details, see the super class TagPart.

The Cartesian scale part can be positioned at the top, left, bottom or right of a Cartesian graph part or at the left or right of a polar graph part.

Author:
Arthur Marxer

Field Summary
static int BOTTOM
          Equal to ChartConstants.BOTTOM
static int LEFT
          Equal to ChartConstants.LEFT
static int RIGHT
          Equal to ChartConstants.RIGHT
static int TOP
          Equal to ChartConstants.TOP
 
Fields inherited from class li.netcat.chart.util.AbstractPart
BACKGROUND, FOREGROUND, PERSPECTIVE
 
Constructor Summary
CartesianScalePart(CartesianGraphPart part, int position)
          Constructs a new CartesianScalePart that attaches to the given Cartesian part at the given position.
CartesianScalePart(PolarGraphPart part, int position)
          Constructs a new CartesianScalePart that attaches to the given polar part at the given position.
 
Method Summary
 GraphPart getGraphPart()
          Returns the graph part that gets decorated by this scale part.
 int getMarkInterval()
          Returns the mark interval.
 int getPosition()
          Returns the position of this scale.
 TagConstraints getTagConstraints(java.awt.Graphics g)
          This overridden method returns the tag constraints that are used to position all labels.
 Tag[] getTags(java.awt.Graphics g)
          This overridden methods creates all tags using the corresponding scale model of the current part.
 void setGraphPart(GraphPart part)
          Sets the graph part that gets decorated by this scale.
 void setMarkInterval(int interval)
          Sets the mark interval.
 void setPosition(int position)
          Sets the position of this scale.
 
Methods inherited from class li.netcat.chart.util.TagPart
createTag, createTag, createTag, getAdditionalLineLength, getBottom, getLayout, getLeft, getLinePenBox, getPen, getRight, getTagManager, getTextPenBox, getTop, setAdditionalLineLength, setInsets, setLinePenBox, setPen, setTagManager, setTextPenBox
 
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

TOP

public static final int TOP
Equal to ChartConstants.TOP

See Also:
Constant Field Values

LEFT

public static final int LEFT
Equal to ChartConstants.LEFT

See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
Equal to ChartConstants.BOTTOM

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Equal to ChartConstants.RIGHT

See Also:
Constant Field Values
Constructor Detail

CartesianScalePart

public CartesianScalePart(PolarGraphPart part,
                          int position)
Constructs a new CartesianScalePart that attaches to the given polar part at the given position.

Parameters:
part - The polar part that needs to be decorated by this scale or null.
position - The position of the scale. Specify either LEFT or RIGHT.

CartesianScalePart

public CartesianScalePart(CartesianGraphPart part,
                          int position)
Constructs a new CartesianScalePart that attaches to the given Cartesian part at the given position.

Parameters:
part - The Cartesian part that needs to be decorated by this scale or null.
position - The position of the scale. Specify either TOP, LEFT, BOTTOM or RIGHT.
Method Detail

getGraphPart

public GraphPart getGraphPart()
Returns the graph part that gets decorated by this scale part.

Returns:
The graph part, might also be null.

setGraphPart

public void setGraphPart(GraphPart part)
Sets the graph part that gets decorated by this scale.

Parameters:
part - The part must be either an instance of CartesianGraphPart or PolarGraphPart. If the position is TOP or BOTTOM, this parameter can not be of instance PolarGraphPart.

getPosition

public int getPosition()
Returns the position of this scale.

Returns:
One of TOP, LEFT, BOTTOM or RIGHT.

setPosition

public void setPosition(int position)
Sets the position of this scale.

Parameters:
position - Specify one of TOP, LEFT, BOTTOM or RIGHT. If the current graph part is an instance of a PolarGraphPart, this parameter can only be LEFT or RIGHT.

getMarkInterval

public int getMarkInterval()
Returns the mark interval. If this value is set e.g. to 3, only every third mark of the scale gets painted. The default value is one.

Returns:
The mark interval.

setMarkInterval

public void setMarkInterval(int interval)
Sets the mark interval. If this value is set e.g. to 3, only every third mark of the scale gets painted. The default value is one.

Parameters:
interval - The new interval, must be >=1.

getTagConstraints

public TagConstraints getTagConstraints(java.awt.Graphics g)
This overridden method returns the tag constraints that are used to position all labels.

Specified by:
getTagConstraints in class TagPart
Parameters:
g - The relevant graphics object.
Returns:
null if the current graph part is null or an instance of LineTagConstraints.

getTags

public Tag[] getTags(java.awt.Graphics g)
This overridden methods creates all tags using the corresponding scale model of the current part.

Specified by:
getTags in class TagPart
Parameters:
g - The relevant graphics object.
Returns:
The list of all tags.

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