com.davisor.graphics.chart
Class AxisFactory.AxisMetrics

java.lang.Object
  extended bycom.davisor.graphics.chart.ChartFactory.ChartMetrics
      extended bycom.davisor.graphics.chart.AxisFactory.AxisMetrics
Direct Known Subclasses:
BarFactory.BarMetrics
Enclosing class:
AxisFactory

public class AxisFactory.AxisMetrics
extends ChartFactory.ChartMetrics

AxisMetrics is an AxisFactory internal info container that carries axis chart manufacturing parameters. An axis coordinate system is divided into several sections as shown by the following diagram:

  major            plot         minor
  :---------------->------------>-----> 
  :                :   back----->     : 
  :                :   : core-> :     :
  :                :   : :    : :     :
                                      XY = 2D coordinate area (core plane) 
             aw              sw	   Z = 3D coordinate area (side planes)
   EW_tw_+mw_?lw_#*_rw__@______@_*$_ew                                     
  |  |  ||  ||  |::    : :    : :: :  |eh tw = titleWidth                  
  |..|..||..||..|::....:.:....:.::.:..|   th = titleHeight            
  |..|..||..||..|::.../|.:....:.::.:..|$s                                  
  |..|..||..||..|::../.|.:....:.::.:..|*h mw = markerWidth
  |  |  ||  ||  |:: / /|.:____:.::.:..|@  mh = markerHeight
  |  |  ||  ||  |::| / | |    | :: :  |                                    
  |  |  ||  ||  |:y|/  | | XY | :: :  |   lw = labelWidth                  
  |  |  ||  ||  |:y| Z |.|____|.::.:..|   lh = labelHeight                 
  |  |  ||  ||  |:y|   |________:__:..|@                                   
 h|  |  ||  ||  |:y|  /        /::/:  |   sw = symbolWidth             
 e|  |  ||  ||  |:y| /    Z   / :/ :  |rh sh = symbolHeight                
 i|  |  ||  ||  |:y|/________/__/: :  |   
 g|..|..||..||..|::xxxxxxxxxxx..::.:..|*a  @ = plot offset                 
 h|..|..||..||..|::.............::.:..|#h  * = axis offset                 
 t|  |  ||  ||  |::             :: :  |    # = label offset                
  |  |  ||  ||  |::     axis    :: :  |    + = title offset                
  |..|..||..||..|_____________________|    $ = symbol offset               
  |  |  ||  ||  :::             :: :  |    ? = marker offset 
  |  |  ||  ||  :::    labels   :: :  |lh 
  |..|..||..||________________________|   aw = axisWidth (sum of * and #) 
  |..|..||..|_________________________|?  ah = axisHeight (sum of * and #)
  |  |  ||  ::  :::             :: :  |   sw = symbolWidth (sum of * and $)
  |  |  ||  ::  :::   markers   :: :  |mh sh = symbolHeight: sum of * and $
  |..|..||____________________________|   
  |..|..|_____________________________|+  rw = rotWidth                   
  |  |  ::  ::  :::             :: :  |   rh = rotHeight                  
  |  |  ::  ::  :::    title    :: :  |th                                 
  |..|________________________________|   EW = major edgeWidth            
  |  :  ::  ::: :::             :: :  |EH EH = major edgeHeight           
 y|___________________________________|   ew = minor edgeWidth            
  x               width  		      eh = minor edgeHeight           
 
Left/bottom edges are considered major edges as they may hold labels and titles. Right/top edges are considered minor edges as they may not hold labels and titles.

Width and height measure the total extends of the whole chart system. Other values measure the sizes of various components around central core area. Core area size is whatever is left over when all the other components are substracted from the total available area.

Title width measures the width of the outermost left column that actually contains some information, namely Y -axis title text. Title height measures the same for X -axis title text.

Beyond the title areas are major outer edges that contain space for overwide X- and Y -axis labels. An overwide label is a label so wide that when it starts from the origo, it crosses the orthgonal label and title areas, and extends still beyound them. Labels this wide are not typical however, so in most cases outer edges have zero width and heigh.

Title offset width measures the width between the Y -axis titles and labels. Title offset height measures the same for X -axis titles and labels.

Label width measures the width of the second outermost left column that contains information, namely, Y -axis labels. Label height measures the same for X -axis labels.

Axis width measures the width between plot area left edge and Y -axis label column. Axis height measures the same for X -axis. Axis width and height are sums of axis and label offsets.

Label offset width measures the width between the Y -axis line outer edge and Y -axis label column. Label offset height does the same for X -axis. The label offsets reserve space for symbols sticking out from principal plot area, and possible for some extra space, too. In particular, the gap between labels and axis line is visually so significant that the gap width is an user configurable axis attribute parameter.

Axis offset width measures the distance between Y -axis line center and the outer edge of the same line. In other words, this equals half of the Y -axis line width. Plese note also, that the inner half of axis line overlaps with plot area. Axis offset height measures the same for X -axis line. Typically, axis lines are quite thin, and axis offsets remain quite insignificant. With wider axis lines however, this is not so anymore, and therefore axis offsets must be taken into account when axis chart section sizes are measured.

Rotation width reserves space for horizontal isometric rendering. Rotation height does the same for vertical direction.

Plot offset width measures the gap between core drawing area and Y -axis line center. Plot offset height does the same for X -axis. The gap is used to reserve space for symbols like outer halves of edgemost bars in bar charts.

On the other side of plot area, symbol offsets reserve space for symbols that stick outside the top and right plot area edges. Symbol area serves much the same purpose as label offsets on plot area bottom and left edge, but with the difference that symbol offset area is right next to plot area, without an axis area between.

Beyound symbol offset area, outer minor edges measure the width of areas simimar to outer major edges. In particular, outer minor edges reserve space for labels that extend over orthogonal symbol areas and beyond. This is much more common a situation than with major outer edges, since symbol areas are typically much thinner than corresponding label and title areas.

All metric measurements use device coordinates.

See Also:
DataValue.deinterpolate(com.davisor.data.DataValue, com.davisor.data.DataValue), Type.zero()

Field Summary
protected  float M_ax
          Multiplier to orient X-axis.
protected  float[] M_axisOffset
          Axis offset size (never negative).
protected  float M_ay
          Multiplier to orient Y-axis.
protected  java.awt.Shape[] M_clip
          Clipping shapes for the coordinate area clipping.
protected  float[] M_coreSize
          Precomputed backplane size.
protected  float[] M_labelOffset
          Label offset size (never negative).
protected  float[] M_labelSize
          Label size.
protected  float[] M_majorEdge
          Major edge size.
protected  float[] M_markerOffset
          Marker offset size.
protected  float[] M_markerSize
          Marker size.
protected  float[] M_minorEdge
          Minor edge size.
protected  boolean[] M_opposite
          Axis opposite status.
protected  float[] M_origo
          Chart origo coordinates.
protected  float[] M_plotOffset
          Plot offset size.
protected  boolean[] M_reverse
          Axis reverse status.
protected  float[] M_rotSize
          Isometric shear section size.
protected  float[] M_symbolOffset
          Symbol offsets.
protected  float[] M_titleOffset
          Title offset size (never negative).
protected  float[] M_titleSize
          Title size.
 
Fields inherited from class com.davisor.graphics.chart.ChartFactory.ChartMetrics
M_height, M_width
 
Constructor Summary
AxisFactory.AxisMetrics(ChartAxes axes, float width, float height, float[] titleSize, float[] labelSize, float[] markerSize, float[] axisOffset, float[] labelOffset, float[] markerOffset, float[] symbolOffset, float[] majorEdge, float[] minorEdge, float[] rotSize)
          Creates a new internal axis info bundle.
AxisFactory.AxisMetrics(float width, float height)
          Creates new chart metrics.
 
Method Summary
 void clip(java.awt.Graphics g, int clipIndex)
          Controls which coordinate area clipping is enabled if any.
 void computeClip(boolean isometric)
          Calculates the clipping area for the coordinate area.
protected  void computeCoreSize(int dim)
          Computes coordinate back area size.
 float[] getAxisOffset()
          Gets the gap between the axis stroke line center and edge.
 float[] getAxisSize()
          Gets the gaps between the axis stroke line center and the top/right edge of axis labels area.
 float getAxisSize(int dim)
          Gets the gap between the axis stroke line center and the top/right edge of axis labels area.
 float[] getBackSize()
          Gets back area size.
 float getBottomMargin()
          Gets the bottom margin area height.
 float[] getCoreSize()
          Gets the core area size.
 float[] getLabelOffset()
          Gets the gap between the axis stroke line center and the top/right edge of axis area.
 float[] getLabelSize()
          Gets the label size.
 float getLeftMargin()
          Gets the left margin area width.
 float[] getMajorEdge()
          Gets the major edge size.
 float getMajorMargin(int dim)
          Gets the left/bottom margin area size.
 float getMargins(int dim)
          Gets the plotting area margins size.
 float[] getMarkerOffset()
          Gets the gap between markers and labels.
 float[] getMarkerSize()
          Gets the marker label size.
 float[] getMinorEdge()
          Gets the minor edge size.
 float[] getMinorMargin()
          Gets the right/top margin sizes.
 float getMinorMargin(int dim)
          Gets the right/top margin size.
 float[] getOrigo()
          Gets origo coordinates.
 float[] getPlotOffset()
          Gets the plot offset.
 float[] getPlotSize()
          Gets plotting area size in a new array.
 float getPlotSize(int dim)
          Gets the plotting area area size.
 float getRightMargin()
          Gets the right margin width.
 float[] getRotSize()
          Gets the isometric shear section size.
 float getRotSize(int dim)
          Gets the plot size compensated with isometric shear section size.
 float[] getSymbolOffset()
          Gets the symbol offset.
 float[] getSymbolSize()
          Gets the gap between the axis area and the left/bottom edge of minor edge.
 float getSymbolSize(int dim)
          Gets the gap between the axis area and the left/bottom edge of minor edge.
 float[] getTitleOffset()
          Gets the gap between the axis title and label areas.
 float[] getTitleSize()
          Gets the title size.
 float getTopMargin()
          Gets the top margin height.
 float getXOrient()
          Gets the multiplier that is used to orientate the X-axis.
 float getYOrient()
          Gets the multiplier that is used to orientate the Y-axis.
protected  void init(ChartAxes axes, float[] titleSize, float[] labelSize, float[] markerSize, float[] axisOffset, float[] labelOffset, float[] markerOffset, float[] symbolOffset, float[] majorEdge, float[] minorEdge, float[] rotSize)
          Initializes metrics.
 boolean isOpposite(int dim)
          Tests if given axis is in opposite position.
 void modifySize(int dim, float change)
          Changes chart size by modifying plot area size.
 void scale(float xFactor, float yFactor)
          Scales all metrics components.
 void scale(int dim, float factor)
          Applies linear scalar factor for given metrics dimension.
 void scaleToSize(java.lang.Number width, java.lang.Number height)
          Scales the metrics to make the chart meet given new size.
 void setAxisOffset(int dim, float axisOffset, boolean keepPlot)
          Sets the gap between the axis stroke line center and edge.
 void setAxisSize(int dim, float axisSize, boolean keepPlot)
          Sets the gap between the plot area outer edge and the labels area inner edge.
 void setCoreSize(float[] coreSize)
          Sets the axis core area size.
 void setLabelOffset(int dim, float labelOffset, boolean keepPlot)
          Sets the gap between the axis stroke line outer edge and the label area inner edge.
 void setLabelSize(int dim, float labelSize, boolean keepPlot)
          Sets label size.
 void setMajorEdge(int dim, float majorEdge, boolean keepPlot)
          Sets major edge size.
 void setMarkerOffset(int dim, float markerOffset, boolean keepPlot)
          Sets the gap between the label area outer edge and the marker area inner edge.
 void setMarkerSize(int dim, float markerSize, boolean keepPlot)
          Sets marker size.
 void setMinorEdge(int dim, float minorEdge, boolean keepPlot)
          Sets minor edge size.
 void setMinorMargin(int dim, float marginSize, boolean keepPlot)
          Sets the gap between plot area minor edge and chart outer edge.
 void setOrigo(float[] position)
          Sets origo position.
 void setOrigo(int dim, float position)
          Sets origo position.
 void setPlotOffset(float[] plotOffset, boolean keepPlot)
          Sets the plot offset width/height.
 void setPlotOffset(int dim, float plotOffset)
          Sets the plot offset width/height.
 void setPlotOffset(int dim, float plotOffset, boolean keepPlot)
          Sets the plot offset width/height.
 void setRotSize(int dim, float rotSize)
          Sets the isometric shear section's height.
 void setSize(int dim, float size)
          Sets the chart image's total height in device coordinates.
 void setSize(java.awt.geom.Rectangle2D backArea)
          Sets the size of the chart being manufactured.
 void setSymbolOffset(int dim, float symbolOffset, boolean keepPlot)
          Sets the gap between the axis offset area and minor edge.
 void setSymbolSize(int dim, float symbolSize, boolean keepPlot)
          Sets the symbol size width/height.
 void setTitleOffset(int dim, float titleOffset, boolean keepPlot)
          Sets the gap between the label area outer edge and the title area inner edge.
 void setTitleSize(int dim, float titleSize, boolean keepPlot)
          Sets title size.
 void setXOrient(float ax)
          Sets the multiplier that is used to orientate the X -axis.
 void setYOrient(float ay)
          Sets the multiplier that is used to orientate the Y -axis.
 java.lang.String toString()
          Gets axis metrix XML representation.
 float x(float x)
          Maps X device coordinate on X -axis according to current axis rendering preferences.
 float y(float y)
          Maps Y device coordinate on Y -axis according to current axis rendering preferences.
 
Methods inherited from class com.davisor.graphics.chart.ChartFactory.ChartMetrics
add, getHeight, getSize, getWidth, setHeight, setWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

M_axisOffset

protected float[] M_axisOffset
Axis offset size (never negative).


M_majorEdge

protected float[] M_majorEdge
Major edge size.


M_minorEdge

protected float[] M_minorEdge
Minor edge size.


M_labelOffset

protected float[] M_labelOffset
Label offset size (never negative).


M_labelSize

protected float[] M_labelSize
Label size.


M_markerOffset

protected float[] M_markerOffset
Marker offset size.


M_markerSize

protected float[] M_markerSize
Marker size.


M_origo

protected float[] M_origo
Chart origo coordinates.


M_plotOffset

protected float[] M_plotOffset
Plot offset size.


M_rotSize

protected float[] M_rotSize
Isometric shear section size.


M_symbolOffset

protected float[] M_symbolOffset
Symbol offsets. Doubles as Z -axis label size (never negative).


M_titleOffset

protected float[] M_titleOffset
Title offset size (never negative).


M_titleSize

protected float[] M_titleSize
Title size.


M_ax

protected float M_ax
Multiplier to orient X-axis.


M_ay

protected float M_ay
Multiplier to orient Y-axis.


M_clip

protected java.awt.Shape[] M_clip
Clipping shapes for the coordinate area clipping.


M_opposite

protected boolean[] M_opposite
Axis opposite status.


M_reverse

protected boolean[] M_reverse
Axis reverse status.


M_coreSize

protected transient float[] M_coreSize
Precomputed backplane size.

Constructor Detail

AxisFactory.AxisMetrics

public AxisFactory.AxisMetrics(float width,
                               float height)
Creates new chart metrics.

Parameters:
width - chart width, in millimeters
height - chart height, in millimeters

AxisFactory.AxisMetrics

public AxisFactory.AxisMetrics(ChartAxes axes,
                               float width,
                               float height,
                               float[] titleSize,
                               float[] labelSize,
                               float[] markerSize,
                               float[] axisOffset,
                               float[] labelOffset,
                               float[] markerOffset,
                               float[] symbolOffset,
                               float[] majorEdge,
                               float[] minorEdge,
                               float[] rotSize)
Creates a new internal axis info bundle.

Parameters:
axes - chart axes
width - chart width, in millimeters
height - chart height, in millimeters
titleSize - title area size
labelSize - label area size
markerSize - marker area size
axisOffset - axis offsets
labelOffset - label offsets
markerOffset - marker offsets
symbolOffset - symbol offsets
majorEdge - major edge size
minorEdge - minor margin (see above)
rotSize - isometric area size
See Also:
init(com.davisor.graphics.chart.ChartAxes, float[], float[], float[], float[], float[], float[], float[], float[], float[], float[])
Method Detail

scale

public void scale(float xFactor,
                  float yFactor)
Scales all metrics components.

This implementation scales both X and Y dimensions separately with two calls to scale(int,float).

Overrides:
scale in class ChartFactory.ChartMetrics
Parameters:
xFactor - horizontal scalar factor
yFactor - vertical scalar factor
See Also:
scale(int,float)

scaleToSize

public void scaleToSize(java.lang.Number width,
                        java.lang.Number height)
Scales the metrics to make the chart meet given new size. The old width or height is kept if a corresponding new value is not given.

This implementation recomputes axis chart size by calling setSize(int,float) for not null given components. This will scale axis chart components in optimal, non-linear way. In particular, the chart core area size will be affected more than other components, to preserve any earlier delicate text component size computations.

Overrides:
scaleToSize in class ChartFactory.ChartMetrics
Parameters:
width - new chart width (may be null = keep the old width)
height - new chart height (may be null = keep the old height)
See Also:
ChartFactory.ChartMetrics.getSize(int)

toString

public java.lang.String toString()
Gets axis metrix XML representation.


computeCoreSize

protected void computeCoreSize(int dim)
Computes coordinate back area size. The size is whatever is left when 3D shear size and plot offsets are substracted from the total plot area size.

See Also:
getPlotSize(int), getRotSize(int)

init

protected void init(ChartAxes axes,
                    float[] titleSize,
                    float[] labelSize,
                    float[] markerSize,
                    float[] axisOffset,
                    float[] labelOffset,
                    float[] markerOffset,
                    float[] symbolOffset,
                    float[] majorEdge,
                    float[] minorEdge,
                    float[] rotSize)
Initializes metrics.

Parameters:
axes - chart axes
titleSize - title area size
labelSize - label area size
markerSize - marker area size
axisOffset - axis offsets
labelOffset - label offsets
markerOffset - marker offsets
symbolOffset - symbol offsets
majorEdge - major edge size
minorEdge - minor margin (see above)
rotSize - isometric area size

clip

public void clip(java.awt.Graphics g,
                 int clipIndex)
Controls which coordinate area clipping is enabled if any. Out of bounds index for the clipping area array results in disabling the clipping area.

Parameters:
clipIndex - determines which clipping area to enable
See Also:
computeClip(boolean)

computeClip

public void computeClip(boolean isometric)
Calculates the clipping area for the coordinate area.

Parameters:
isometric - flag for isometric mode calculations
See Also:
clip(Graphics,int)

getAxisSize

public float[] getAxisSize()
Gets the gaps between the axis stroke line center and the top/right edge of axis labels area. The gap sizes are the sum of label and axis offset sizes.

See Also:
setAxisSize(int, float, boolean)

getAxisSize

public float getAxisSize(int dim)
Gets the gap between the axis stroke line center and the top/right edge of axis labels area. The gap size is the sum of label and axis offset sizes.

Parameters:
dim - dimension index (X or Y)
See Also:
setAxisSize(int, float, boolean)

getAxisOffset

public float[] getAxisOffset()
Gets the gap between the axis stroke line center and edge. This is equal to half of the stroke line width.

See Also:
setAxisOffset(int, float, boolean)

getBackSize

public float[] getBackSize()
Gets back area size. The back area size is computed from current core size and plot offsets, and the result is returned in a new array.

See Also:
getCoreSize(), getPlotOffset()

getBottomMargin

public float getBottomMargin()
Gets the bottom margin area height. The height is the sum of the title, label, and axis area heights.

See Also:
getMajorMargin(int)

getCoreSize

public float[] getCoreSize()
Gets the core area size. Core area is the innermost area most chart visualizations are rendered into. Futhermore, chart coordinate system default origo lies at the bottom left corner of the core area.

See Also:
getBackSize(), ChartFactory.ChartMetrics.getSize(int)

getLabelSize

public float[] getLabelSize()
Gets the label size.


getLabelOffset

public float[] getLabelOffset()
Gets the gap between the axis stroke line center and the top/right edge of axis area.


getLeftMargin

public float getLeftMargin()
Gets the left margin area width. The width is the sum of the title, label, and axis area widths.

See Also:
getMajorMargin(int)

getMajorEdge

public float[] getMajorEdge()
Gets the major edge size.


getMajorMargin

public float getMajorMargin(int dim)
Gets the left/bottom margin area size. The size is the sum of the major edge, title, label, and axis area sizes.

See Also:
getAxisSize()

getMargins

public float getMargins(int dim)
Gets the plotting area margins size. The size is the sum of minor and major margin area sizes.

See Also:
getMajorMargin(int), getMinorMargin()

getMarkerSize

public float[] getMarkerSize()
Gets the marker label size.


getMarkerOffset

public float[] getMarkerOffset()
Gets the gap between markers and labels.


getMinorEdge

public float[] getMinorEdge()
Gets the minor edge size.


getMinorMargin

public float[] getMinorMargin()
Gets the right/top margin sizes. The sizes are the sum of the edge sizes and axis and plot offsets.


getMinorMargin

public float getMinorMargin(int dim)
Gets the right/top margin size. The size is the sum of the symbol size and edge size.

Parameters:
dim - dimension index (X or Y)
See Also:
getSymbolSize()

getOrigo

public float[] getOrigo()
Gets origo coordinates.


getPlotOffset

public float[] getPlotOffset()
Gets the plot offset.


getPlotSize

public float[] getPlotSize()
Gets plotting area size in a new array. The values in the returned array are guaranteed not to change even if this metrics instance is later modified.

See Also:
getPlotSize(int)

getPlotSize

public float getPlotSize(int dim)
Gets the plotting area area size. The size is whatever is left when the minor and major margin area sizes are substracted from the total chart size.

See Also:
getMajorMargin(int), getMinorMargin()

getRightMargin

public float getRightMargin()
Gets the right margin width. The width is the sum of the minor edge width and axis and label offset widths.

See Also:
getMinorMargin()

getRotSize

public float[] getRotSize()
Gets the isometric shear section size.

See Also:
getRotSize(int)

getRotSize

public float getRotSize(int dim)
Gets the plot size compensated with isometric shear section size. In particular, rotation section extending to the negative direction (left) is reduced from plot size, while rotation section extending to the positive direction (right) "folds" over the plot area, and takes no space.

Parameters:
dim - dimension index (X or Y)
See Also:
getRotSize(), getPlotSize(int)

getSymbolOffset

public float[] getSymbolOffset()
Gets the symbol offset.


getSymbolSize

public float[] getSymbolSize()
Gets the gap between the axis area and the left/bottom edge of minor edge. The gap size is the sum of symbol and axis offset sizes.

See Also:
setSymbolSize(int, float, boolean)

getSymbolSize

public float getSymbolSize(int dim)
Gets the gap between the axis area and the left/bottom edge of minor edge. The gap size is the sum of symbol and axis offset sizes.

Parameters:
dim - dimension index (X or Y)
See Also:
setSymbolSize(int, float, boolean)

getTitleOffset

public float[] getTitleOffset()
Gets the gap between the axis title and label areas.


getTitleSize

public float[] getTitleSize()
Gets the title size.


getTopMargin

public float getTopMargin()
Gets the top margin height. The height is the sum of the minor edge height and axis and label offset heights.

See Also:
getMinorMargin()

getXOrient

public float getXOrient()
Gets the multiplier that is used to orientate the X-axis.


getYOrient

public float getYOrient()
Gets the multiplier that is used to orientate the Y-axis.


isOpposite

public boolean isOpposite(int dim)
Tests if given axis is in opposite position.


modifySize

public void modifySize(int dim,
                       float change)
Changes chart size by modifying plot area size. Plot and chart size will change by the given amount, while plot offset will change so that it's relative size against plot size remains the same. Core size change will be a function of the other changes. No other metrics are is affected. In particular, no text area aspect ratio will change.

Parameters:
dim - dimension index (X or Y)
change - plot area size change

scale

public void scale(int dim,
                  float factor)
Applies linear scalar factor for given metrics dimension.

Overrides:
scale in class ChartFactory.ChartMetrics
Parameters:
dim - dimension index (X or Y)
factor - scalar factor
See Also:
scale(float,float)

setAxisOffset

public void setAxisOffset(int dim,
                          float axisOffset,
                          boolean keepPlot)
Sets the gap between the axis stroke line center and edge.

Changing axis offset has a symmetric effect on both sides of the plot area because axis offset width controls on axis line width on left and right side of the plot area, and axis offset height does the same on top and bottom side.

Parameters:
dim - dimension index (X or Y)
axisOffset - new axis size value
keepPlot - maintain plot area size by changing chart size
See Also:
getAxisOffset()

setAxisSize

public void setAxisSize(int dim,
                        float axisSize,
                        boolean keepPlot)
Sets the gap between the plot area outer edge and the labels area inner edge. The gap size is the sum of label and axis offsets. Axis offset is considered immutable, but label offset can change. Label offset is therefore set equal to axisSize - axisOffset. Note, that this may result negative label offset value.

Parameters:
dim - dimension index (X or Y)
axisSize - new axis size value
keepPlot - maintain plot area size by changing chart size
See Also:
setLabelOffset(int, float, boolean)

setCoreSize

public void setCoreSize(float[] coreSize)
Sets the axis core area size. Changing the core size affects the whole chart size, too.


setMajorEdge

public void setMajorEdge(int dim,
                         float majorEdge,
                         boolean keepPlot)
Sets major edge size.

Parameters:
dim - dimension index (X or Y)
majorEdge - new edge size value
keepPlot - maintain plot area size by changing chart size

setMinorEdge

public void setMinorEdge(int dim,
                         float minorEdge,
                         boolean keepPlot)
Sets minor edge size.

Parameters:
dim - dimension index (X or Y)
minorEdge - new edge size value
keepPlot - maintain plot area size by changing chart size

setLabelOffset

public void setLabelOffset(int dim,
                           float labelOffset,
                           boolean keepPlot)
Sets the gap between the axis stroke line outer edge and the label area inner edge.

Parameters:
dim - dimension index (X or Y)
labelOffset - new label offset value
keepPlot - maintain plot area size by changing chart size

setLabelSize

public void setLabelSize(int dim,
                         float labelSize,
                         boolean keepPlot)
Sets label size.

Parameters:
dim - dimension index (X or Y)
labelSize - new label size value
keepPlot - maintain plot area size by changing chart size

setMinorMargin

public void setMinorMargin(int dim,
                           float marginSize,
                           boolean keepPlot)
Sets the gap between plot area minor edge and chart outer edge. The gap size is the sum of the edge size and symbol size. Symbol size is considered immutable, but edge size can change. Edge size is therefore set equal to margin - symbolSize. Note, that this may result negative edge size value.

Parameters:
dim - dimension index (X or Y)
marginSize - new margin size value
keepPlot - maintain plot area size by changing chart size
See Also:
getSymbolSize()

setMarkerOffset

public void setMarkerOffset(int dim,
                            float markerOffset,
                            boolean keepPlot)
Sets the gap between the label area outer edge and the marker area inner edge.

Parameters:
dim - dimension index (X or Y)
markerOffset - new marker offset value
keepPlot - maintain plot area size by changing chart size

setMarkerSize

public void setMarkerSize(int dim,
                          float markerSize,
                          boolean keepPlot)
Sets marker size.

Parameters:
dim - dimension index (X or Y)
markerSize - new marker size value
keepPlot - maintain plot area size by changing chart size

setOrigo

public void setOrigo(float[] position)
Sets origo position.


setOrigo

public void setOrigo(int dim,
                     float position)
Sets origo position.


setPlotOffset

public void setPlotOffset(int dim,
                          float plotOffset)
Sets the plot offset width/height. Setting plot offset affects innermost area size.

Changing plot offset has a symmetric effect on both sides of the plot area because axis offset width controls on plot offset width on left and right side of the plot area, and plot offset height does the same on top and bottom side.

Parameters:
dim - dimension index (X or Y)
plotOffset - new plot offset value

setPlotOffset

public void setPlotOffset(float[] plotOffset,
                          boolean keepPlot)
Sets the plot offset width/height. Changing plot offset size changes chart or chart plot area size, too.

Parameters:
plotOffset - new plot offset values
keepPlot - maintain plot area size by changing chart size

setPlotOffset

public void setPlotOffset(int dim,
                          float plotOffset,
                          boolean keepPlot)
Sets the plot offset width/height. Changing plot offset size changes corresponding edge size with equal but opposite amount. In particular, if the new plot offset size is smaller than the previous offset value, edge size will grow by the same amount plot area shrinks, and vice versa.

Plot offset and edge sizes should never be negative. In particular, if plot offset grows more than the current edge size can shrink, edge size will become zero, and the extra size will either be taken away from current plot area size, or added to current total chart size, as controlled by the keepPlot argument.

Parameters:
dim - dimension index (X or Y)
plotOffset - new plot offset value
keepPlot - maintain plot area size by changing chart size

setRotSize

public void setRotSize(int dim,
                       float rotSize)
Sets the isometric shear section's height. Changing isometric size affects back and inner sizes.


setSize

public void setSize(java.awt.geom.Rectangle2D backArea)
Sets the size of the chart being manufactured.

Changing chart size changes also chart plot area size.

See Also:
setSize(int,float)

setSize

public void setSize(int dim,
                    float size)
Sets the chart image's total height in device coordinates. Changing chart size changes also chart plot area size, and possible other areas, too, as determined by sub-class implementations.

If chart core size would fall below 10% of the whole chart size, size reduction is applied on all chart areas.

Overrides:
setSize in class ChartFactory.ChartMetrics
Parameters:
dim - dimension index (X or Y)
size - new chart size value
See Also:
computeCoreSize(int)

setSymbolOffset

public void setSymbolOffset(int dim,
                            float symbolOffset,
                            boolean keepPlot)
Sets the gap between the axis offset area and minor edge.

Parameters:
dim - dimension index (X or Y)
symbolOffset - new symbol size value
keepPlot - maintain plot area size by changing chart size
See Also:
getSymbolOffset()

setSymbolSize

public void setSymbolSize(int dim,
                          float symbolSize,
                          boolean keepPlot)
Sets the symbol size width/height. Changing symbol size changes corresponding edge size with equal but opposite amount. In particular, if the new symbol size is smaller than the previous size value, edge size will grow by the same amount symbol area shrinks, and vice versa.

Symbol and edge sizes should never be negative. In particular, if symbol size grows more than the current edge size can shrink, edge size will become zero, and the extra size will either be taken away from current plot area size, or added to current total chart size, as controlled by the keepPlot argument.

Parameters:
dim - dimension index (X or Y)
symbolSize - new symbol size value
keepPlot - maintain plot area size by changing chart size

setTitleOffset

public void setTitleOffset(int dim,
                           float titleOffset,
                           boolean keepPlot)
Sets the gap between the label area outer edge and the title area inner edge.

Parameters:
dim - dimension index (X or Y)
titleOffset - new title offset value
keepPlot - maintain plot area size by changing chart size

setTitleSize

public void setTitleSize(int dim,
                         float titleSize,
                         boolean keepPlot)
Sets title size.

Parameters:
dim - dimension index (X or Y)
titleSize - new title size value
keepPlot - maintain plot area size by changing chart size

setXOrient

public void setXOrient(float ax)
Sets the multiplier that is used to orientate the X -axis.


setYOrient

public void setYOrient(float ay)
Sets the multiplier that is used to orientate the Y -axis.


x

public float x(float x)
Maps X device coordinate on X -axis according to current axis rendering preferences.

Currently only axis reversal is supported. Later versions will support logarithmic and discontinuous scales.

Parameters:
x - X -axis device coordinate
Returns:
mapped X -axis device coordinate
See Also:
y(float)

y

public float y(float y)
Maps Y device coordinate on Y -axis according to current axis rendering preferences.

Currently only axis reversal is supported. Later versions will support logarithmic and discontinuous scales.

Parameters:
y - Y -axis device coordinate
Returns:
mapped Y -axis device coordinate
See Also:
x(float)


Copyright © 2001-2004 Davisor Oy. All Rights Reserved.