NetCharts Pro

netcharts.pro.common
Class NFAxisMap

java.lang.Object
  extended by netcharts.pro.common.NFBaseClass
      extended by netcharts.pro.common.NFAxisMap
All Implemented Interfaces:
java.lang.Cloneable, NFCDLGenerator

public class NFAxisMap
extends NFBaseClass
implements NFCDLGenerator

The Axis map object is used to identify how each dimension of a data element is translated into screen coordinates. For example consider the X/Y coordinate (10,15). Using the NFAxisMap object, we can instruct the rendering engine that the X coordinate should be mapped to the top axis scale, and the Y axis should be mapped to the left axis scale. If top axis scale ranges from 0 - 10 and the left axis scale ranges from 0 - 100, the point will be drawn at the far right side of the chart, about 15% of the way up from the bottom axis.

The NFAxis Map object also provides developers the ability to map to multiple axes on any given side by specifying the axis and the index to the axis on a given side (from 1 - N axes per side).

Some implementations of this object also allow the use of PIXEL or PERCENT. PIXEL indicates that the dimension value should be mapped using pixels relative to the upper left corner of the drawing area. PERCENTAGE means that the dimension value should be mapped as a percentage of the overall width/height of the chart.


Field Summary
static java.util.Hashtable axisSideMap
          The set of allowed axis sides.
static int BOTTOM
          BOTTOM
static int LEFT
          LEFT
static int PERCENT
          PERCENT - only valid in legends and notes
static int PIXEL
          PIXEL - only valid in legends and notes
static int RIGHT
          RIGHT
static int TOP
          TOP
static int XAXIS
          X Axis
static int YAXIS
          Y Axis
 
Constructor Summary
NFAxisMap()
          Constructs a default axis map
NFAxisMap(int xAxisMap, int yAxisMap)
          Constructs an axis map using constants to define which scales should be used to translate data values.
NFAxisMap(NFDataMapper xAxis, NFDataMapper yAxis)
          Constructs an axis map using axis objects to define which scales should be used to translate data values.
 
Method Summary
 java.lang.String getCDL()
          Generate CDL parameters representing this axis map
 void getCDL(java.lang.StringBuffer sb)
          Append CDL parameters representing this axis map to the given StringBuffer.
 NFDataMapper getXAxis()
          Deprecated. Please use only in case when you have manually set xAxis with setter method. In case when chart is initialized from CDL, use: NFDataChart.getXAxis(NFDataSet set) method chart.getXAxis(dataSet);
 int getXAxisMap()
          Get the scale that the X dimension should be translated with.
 int getXAxisMapIndex()
          Set the index of the x axis side.
 NFDataMapper getYAxis()
          Deprecated. Please use only in case when you have manually set yAxis with setter method. In case when chart is initialized from CDL, use: NFDataChart.getYAxis(NFDataSet set) method chart.getYAxis(dataSet);
 int getYAxisMap()
          Get the scale that the X dimension should be translated with.
 int getYAxisMapIndex()
          Set the index of the y axis side.
 void setCDL(java.lang.String cdl)
          Configures this object from a CDL parameter representation.
 void setXAxis(NFDataMapper xAxis)
          Set the axis object that the X dimension should be translated with.
 void setXAxisMap(int xAxisMap)
          Set the scale that the X dimension should be translated with using a constant.
 void setXAxisMapIndex(int xAxisMapIndex)
          Set the index of the x axis side.
 void setYAxis(NFDataMapper yAxis)
          Set the axis object that the Y dimension should be translated with.
 void setYAxisMap(int yAxisMap)
          Set the scale that the Y dimension should be translated with using a constant.
 void setYAxisMapIndex(int yAxisMapIndex)
          Set the index of the y axis side.
 java.lang.String toString()
          Returns a new String object representing this axis map.
 
Methods inherited from class netcharts.pro.common.NFBaseClass
clone, getModified, getUserObject, setModified, setUserObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

axisSideMap

public static java.util.Hashtable axisSideMap
The set of allowed axis sides. Consists of LEFT, RIGHT, TOP, BOTTOM, PIXEL, PERCENT.


XAXIS

public static final int XAXIS
X Axis

See Also:
Constant Field Values

YAXIS

public static final int YAXIS
Y Axis

See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
BOTTOM


TOP

public static final int TOP
TOP


LEFT

public static final int LEFT
LEFT


RIGHT

public static final int RIGHT
RIGHT


PIXEL

public static final int PIXEL
PIXEL - only valid in legends and notes


PERCENT

public static final int PERCENT
PERCENT - only valid in legends and notes

Constructor Detail

NFAxisMap

public NFAxisMap()
Constructs a default axis map


NFAxisMap

public NFAxisMap(int xAxisMap,
                 int yAxisMap)
Constructs an axis map using constants to define which scales should be used to translate data values.

Parameters:
xAxisMap - One of BOTTOM, TOP, PIXEL, PERCENT Note that Pixel and Percent mapping currently only apply to NoteSets.
yAxisMap - One of LEFT, RIGHT, PIXEL, PERCENT Note that Pixel and Percent mapping currently only apply to NoteSets.

NFAxisMap

public NFAxisMap(NFDataMapper xAxis,
                 NFDataMapper yAxis)
Constructs an axis map using axis objects to define which scales should be used to translate data values.

Method Detail

setXAxis

public void setXAxis(NFDataMapper xAxis)
Set the axis object that the X dimension should be translated with.

Parameters:
xAxis - Axis object that will be used to map the X dimension.

getXAxis

public NFDataMapper getXAxis()
Deprecated. Please use only in case when you have manually set xAxis with setter method. In case when chart is initialized from CDL, use: NFDataChart.getXAxis(NFDataSet set) method chart.getXAxis(dataSet);

Get the axis object that the X dimension should be translated with.

Returns:
the axis object that will be used to map the X dimension or null if not defined.

setYAxis

public void setYAxis(NFDataMapper yAxis)
Set the axis object that the Y dimension should be translated with.

Parameters:
yAxis - Axis object that will be used to map the Y dimension.

getYAxis

public NFDataMapper getYAxis()
Deprecated. Please use only in case when you have manually set yAxis with setter method. In case when chart is initialized from CDL, use: NFDataChart.getYAxis(NFDataSet set) method chart.getYAxis(dataSet);

Get the axis object that the Y dimension should be translated with.

Returns:
the axis object that will be used to map the Y dimension or null if not defined.

setXAxisMap

public void setXAxisMap(int xAxisMap)
Set the scale that the X dimension should be translated with using a constant.

If the value passed is not a valid border type an IllegalArgumentException will be thrown.

Parameters:
xAxisMap - One of BOTTOM, TOP, PIXEL, PERCENT Note that Pixel and Percent mapping currently only apply to NoteSets.

getXAxisMap

public int getXAxisMap()
Get the scale that the X dimension should be translated with.

Returns:
one of BOTTOM, TOP, PIXEL, PERCENT or BOTTOM if not defined. Note that Pixel and Percent mapping currently only apply to NoteSets.

setXAxisMapIndex

public void setXAxisMapIndex(int xAxisMapIndex)
Set the index of the x axis side.

Parameters:
xAxisMapIndex - The side axis to map to. Axes are indexed from 1 to N axes on each particular side (bottom,top).

getXAxisMapIndex

public int getXAxisMapIndex()
Set the index of the x axis side.

Returns:
the index of the axis to use on this side.

setYAxisMap

public void setYAxisMap(int yAxisMap)
Set the scale that the Y dimension should be translated with using a constant.

If the value passed is not a valid border type an IllegalArgumentException will be thrown.

Parameters:
yAxisMap - One of LEFT, RIGHT, PIXEL, PERCENT Note that Pixel and Percent mapping currently only apply to NoteSets.

getYAxisMap

public int getYAxisMap()
Get the scale that the X dimension should be translated with.

Returns:
one of LEFT, RIGHT, PIXEL, PERCENT or LEFT if not defined. Note that Pixel and Percent mapping currently only apply to NoteSets.

setYAxisMapIndex

public void setYAxisMapIndex(int yAxisMapIndex)
Set the index of the y axis side.

Parameters:
yAxisMapIndex - The side axis to map to. Axes are indexed from 1 to N axes on each particular side (left,right).

getYAxisMapIndex

public int getYAxisMapIndex()
Set the index of the y axis side.

Returns:
the index of the axis to use on this side.

setCDL

public void setCDL(java.lang.String cdl)
Configures this object from a CDL parameter representation.

Specified by:
setCDL in interface NFCDLGenerator
Parameters:
cdl - CDL in the form: (BOTTOM, LEFT)

toString

public java.lang.String toString()
Returns a new String object representing this axis map.

Specified by:
toString in interface NFCDLGenerator
Overrides:
toString in class java.lang.Object
Returns:
A new String object in the same form as that given by getCDL().

getCDL

public java.lang.String getCDL()
Generate CDL parameters representing this axis map

Specified by:
getCDL in interface NFCDLGenerator
Returns:
CDL in the form: (BOTTOM,LEFT)

getCDL

public void getCDL(java.lang.StringBuffer sb)
Append CDL parameters representing this axis map to the given StringBuffer.

Parameters:
sb - Target buffer to append the CDL parameters
includeParens - If true, this will cause the parameters to be delimited with parenthesis.

NetCharts Pro


Visual Mining, Inc.
2099 Gaither Rd.
Suite 220
Rockville, MD 20850
800.308.0731
301.947.8293 FAX

Copyright © Visual Mining, Inc. 1996 - 2011
All Rights Reserved.

NetCharts Pro TM is a registered trademark of Visual Mining, Inc. Other brands and their products are trademarks of their respective holders.

Last Modified: Jun 28, 2011