ChartCat 1.2

li.netcat.chart.util
Class PolarScalePart

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.PolarScalePart
All Implemented Interfaces:
Part

public class PolarScalePart
extends TagPart

Represents a round scale that looks for example like this:

It can be used to tag 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 polar scale part knows itself where to place in a container so that the scale corresponds to the grid.

Author:
Arthur Marxer

Field Summary
 
Fields inherited from class li.netcat.chart.util.AbstractPart
BACKGROUND, FOREGROUND, PERSPECTIVE
 
Constructor Summary
PolarScalePart(PolarGraphPart part)
          Constructs a new PolarScalePart that attaches to the given polar part.
 
Method Summary
 float getAutoPerspectiveX()
          Returns the x-direction of the auto perspective vector.
 float getAutoPerspectiveY()
          Returns the y-direction of the auto perspective vector.
 int getMarkInterval()
          Returns the mark interval.
 PolarGraphPart getPolarGraphPart()
          Returns the polar graph part that gets decorated by this scale part.
 TagConstraints getTagConstraints(java.awt.Graphics g)
          Subclasses must implement this method to report the tag constraints that do the first displacements.
 Tag[] getTags(java.awt.Graphics g)
          Subclasses must implement this method to report the list of tags that must be layouted.
protected  Pen preparePen(Pen pen, ScaleModel scaleModel, int markIndex)
          Callback method, that can be overridden by subclasses to influence the pen that draws the line before the tag gets created.
protected  Tag prepareTag(Tag tag, ScaleModel scaleModel, int markIndex, java.awt.Graphics g)
          Callback method, that can be overridden by subclasses to influence the created tag.
protected  TextLook prepareTextLook(TextLook look, ScaleModel scaleModel, int markIndex)
          Callback method, that can be overridden by subclasses to influence the text look before the tag gets created.
 void setAutoPerspective(float x, float y)
          Sets a vector that is used to define the perspective positions of the tags automatically.
 void setMarkInterval(int interval)
          Sets the mark interval.
 void setPolarGraphPart(PolarGraphPart part)
          Sets the polar graph part that gets decorated by this scale part.
 
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
 

Constructor Detail

PolarScalePart

public PolarScalePart(PolarGraphPart part)
Constructs a new PolarScalePart that attaches to the given polar part.

Parameters:
part - The polar part that needs to be decorated by this scale or null.
Method Detail

getPolarGraphPart

public PolarGraphPart getPolarGraphPart()
Returns the polar graph part that gets decorated by this scale part.

Returns:
The polar graph part, might also be null.

setPolarGraphPart

public void setPolarGraphPart(PolarGraphPart part)
Sets the polar graph part that gets decorated by this scale part.

Parameters:
part - The polar graph part that gets decorated by this scale part.

setAutoPerspective

public void setAutoPerspective(float x,
                               float y)
Sets a vector that is used to define the perspective positions of the tags automatically. A value of (0, 0) turns this feature off.

Parameters:
x - The x-direction of the perspective.
y - The y-direction of the perspective.

getAutoPerspectiveX

public float getAutoPerspectiveX()
Returns the x-direction of the auto perspective vector.

Returns:
The x-direction of the auto perspective vector.

getAutoPerspectiveY

public float getAutoPerspectiveY()
Returns the y-direction of the auto perspective vector.

Returns:
The y-direction of the auto perspective vector.

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)
Description copied from class: TagPart
Subclasses must implement this method to report the tag constraints that do the first displacements.

Specified by:
getTagConstraints in class TagPart
Parameters:
g - The relevant graphics object.
Returns:
The constraints that define where to place the tag labels.

getTags

public Tag[] getTags(java.awt.Graphics g)
Description copied from class: TagPart
Subclasses must implement this method to report the list of tags that must be layouted.

Specified by:
getTags in class TagPart
Parameters:
g - The relevant graphics object.
Returns:
An array of tags that must be layouted, can also be empty or null, but must not contain null entries.

prepareTextLook

protected TextLook prepareTextLook(TextLook look,
                                   ScaleModel scaleModel,
                                   int markIndex)
Callback method, that can be overridden by subclasses to influence the text look before the tag gets created. This implementation modifies the text look according to the colors of the textPenBox.

Parameters:
look - The default look of the text.
scaleModel - The scale model used as data source.
markIndex - The current markIndex for the scale model.
Returns:
The look parameter.

preparePen

protected Pen preparePen(Pen pen,
                         ScaleModel scaleModel,
                         int markIndex)
Callback method, that can be overridden by subclasses to influence the pen that draws the line before the tag gets created. This implementation returns the pen according to the linePenBox.

Parameters:
pen - The default pen.
scaleModel - The scale model used as data source.
markIndex - The current markIndex for the scale model.
Returns:
The pen parameter.

prepareTag

protected Tag prepareTag(Tag tag,
                         ScaleModel scaleModel,
                         int markIndex,
                         java.awt.Graphics g)
Callback method, that can be overridden by subclasses to influence the created tag. This implementation returns the tag parameter without modification.

Parameters:
tag - The default tag that can be modified.
scaleModel - The scale model used as data source.
markIndex - The current markIndex for the scale model.
g - The graphics object that should be used to calculate string widths.
Returns:
The tag parameter.

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