|
NetCharts Pro | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnetcharts.pro.common.NFBaseClass
netcharts.pro.common.rectangular.NFAxis
public class NFAxis
The NFAxis object has a tremendous amount of flexibility for manipulating the rectangular axes found in several of the NetCharts rendering engines. Below is an example use:
NFBarchart bc = new NFBarchart(); // axis NFAxis left = new NFAxis(); left.setScale(0,100,25); left.setTextFont(sansserif); left.setTextColor(Color.gray.brighter()); left.setTicFormat(new NFFormat(NFFormat.FLOAT, "%.3f")); NFAxis right = new NFAxis(); right.setTextFont(sansserif); right.setTextColor(Color.blue); right.setScale(0,20,2); NFAxis bottom = new NFAxis(); bottom.setTextFont(sansserif); bottom.setTicLayoutMode(NFAxis.AUTO); bc.setLeftAxis(left); bc.setBottomAxis(bottom); bc.setRightAxis(right);
Field Summary | |
---|---|
static int |
AUTO
autoskipstagger tic labels |
static int |
AUTOSKIP
autoskip tic labels |
static int |
AUTOSTAGGER
autostagger tic labels |
static java.util.Hashtable |
axisLayoutDirectionMap
axisLayoutDirectionMap hashtable |
static java.util.Hashtable |
axisModeMap
axisModeMap hashtable |
static int |
CENTER
Rotate the label around the center |
static int |
LEFT
Rotate the label around the left most character |
static int |
LINEAR
linear axis mode |
static int |
LOG
logarithmic axis mode |
static int |
NORMAL
no skip/stagger |
static int |
NORMAL_LAYOUT
normal axes layout direction |
static int |
OUTWARD
outward axes layout direction |
static int |
RIGHT
Rotate the label around the right most character |
static int |
SKIP
skip tic labels |
static int |
SKIPSTAGGER
skip and stagger tic labels |
static int |
STAGGER
stagger tic labels |
static java.util.Hashtable |
ticLabelRotationPointMap
ticLabelRotationPoint hashtable |
static java.util.Hashtable |
ticModeMap
ticModeMap hashtable |
Constructor Summary | |
---|---|
NFAxis()
Constructs a default rectangular axis |
|
NFAxis(java.util.Hashtable state,
java.lang.String side)
Constructs a rectangular axis using CDL parameters |
|
NFAxis(java.util.Hashtable state,
java.lang.String side,
int modifier)
Constructs a rectangular axis using CDL parameters |
|
NFAxis(int size,
int gap)
Constructs a rectangular axis for use when multiple axes are used on the same side. |
Method Summary | |
---|---|
void |
addScaleSet(double min,
double max,
double step,
double percent)
Adds a scale to a set of scales. |
java.lang.Object |
clone()
Does a deep copy of this axis object |
NFVector |
getActiveLabels()
Gets a list of NFActiveLabels for popup/drilldown on tic labels. |
NFRange |
getAutoScaleRange(NFGraph chart)
Get the current range of an autoscaled axis. |
NFAxisMargin |
getAxisMargins()
Gets the padding to add before and after the plot area of a graph. |
double |
getAxisScaleBase()
Gets the logarithmic base for the axis if in LOG mode. |
int |
getAxisScaleMode()
Gets the axis scale mode. |
java.util.Vector |
getCDLVector()
NFAxis is a compound object representing multiple CDL parameters. |
java.util.Vector |
getCDLVector(java.util.Vector v)
NFAxis is a compound object representing multiple CDL parameters. |
boolean |
getDrawMinorTics()
Gets tic layout mode skip count. |
int |
getGap()
Gets the gap in pixels between this axis and the next in the series. |
int |
getLayoutDirection()
Gets the layout direction for the axis series. |
boolean |
getLayoutDirectionModified()
Returns whether the layout direction has been modified. |
java.awt.Color |
getLineColor()
Gets the axis line color |
java.awt.Color |
getMajorTicColor()
Gets the major tic color |
java.awt.Color |
getMinorTicColor()
Gets the minor tic color |
int |
getModifier()
Get the modifier. |
NFAxisRange |
getScale()
Gets the scale of this axis |
NFVector |
getScaleSets()
Gets a vector of NFAxisRange objects representing multiple scales in this axis. |
NFRange |
getScrollRange()
Gets the scroll range. |
java.lang.String |
getSide()
Gets the side this axis represents |
int |
getSize()
Gets the size of axis relative to other axes in the series. |
int |
getSkipCount()
Gets tic layout mode skip count. |
int |
getStaggerLevels()
Gets tic layout stagger levels |
java.awt.Color |
getTextColor()
Gets the text color for this axis to be applied to tic labels. |
java.awt.Font |
getTextFont()
Gets the text font for this axis to be applied to tic labels. |
NFFormat |
getTicFormat()
Gets the axis tic label numerical formatting. |
NFModalLabel |
getTicLabel()
Gets the axis tic label style. |
int |
getTicLabelRotationPoint()
Gets the tic label rotation point. |
NFVector |
getTicLabels()
Gets the list of string values to be used for each tic label. |
int |
getTicLayoutMode()
Gets the tic layout mode. |
int |
getTicLength()
Gets the length of the tics. |
NFVector |
getTicLocations()
Gets the axis tic locations. |
NFActiveLabel |
getTitleActiveLabel()
Gets the NFActiveLabel for popup/drilldown on the axis title |
NFLabel |
getTitleLabel()
Gets the label element for the axis title. |
NFRegion |
getTitleRegion()
Get the background element for the axis title |
boolean |
getZoom()
Gets whether this axis should allow zooming. |
void |
setActiveLabels(NFVector activeLabels)
Set the active labels for popup/drilldown on tic labels. |
void |
setAutoScaleRange()
Turns autoscaling on. |
void |
setAutoScrollRange()
Turns on scrolling. |
void |
setAxisMargins(NFAxisMargin margins)
Sets the padding to add before and after the plot area of a graph. |
void |
setAxisScaleBase(double axisScaleBase)
Sets the logarithmic base for the axis if in LOG mode. |
void |
setAxisScaleMode(int axisScaleMode)
Sets the axis scale mode. |
void |
setDrawMinorTics(boolean drawMinorTics)
If true (default) minor tics are drawn appropriately. |
void |
setGap(int gap)
Sets the gap in pixels between this axis and the next in the series. |
void |
setLayoutDirection(int direction)
Sets the layout direction for the axis series. |
void |
setLineColor(java.awt.Color lineColor)
Sets the axis line color |
void |
setMajorTicColor(java.awt.Color majorTicColor)
Sets the major tic color |
void |
setMinorTicColor(java.awt.Color minorTicColor)
Sets the minor tic color |
void |
setModifier(int modifier)
Set the modifier. |
void |
setScale(double min,
double max,
double step)
Sets the scale of this axis |
void |
setScale(NFAxisRange scale)
Sets the scale of this axis. |
void |
setScaleSets(NFVector scaleSets)
Sets a vector of NFAxisRange objects representing multiple scales in this axis. |
void |
setScrollRange(double scrollMin,
double scrollMax)
Sets the scroll range. |
void |
setScrollRange(NFRange scrollRange)
Sets the scroll range. |
void |
setSide(java.lang.String side)
Sets the side this axis represents |
void |
setSize(int size)
Sets the size of axis relative to other axes in the series. |
void |
setSkipCount(int skipCount)
Sets tic layout mode skip count. |
void |
setStaggerLevels(int staggerLevels)
Sets tic layout stagger levels |
void |
setTextColor(java.awt.Color color)
Sets the text color for this axis to be applied to tic labels. |
void |
setTextFont(java.awt.Font font)
Sets the text font for this axis to be applied to tic labels. |
void |
setTicFormat(NFFormat format)
Sets the axis tic label numerical formatting. |
void |
setTicLabel(NFModalLabel ticLabel)
Sets the axis tic label style. |
void |
setTicLabelRotationPoint(int labelRotationPoint)
Sets the tic label rotation point. |
void |
setTicLabels(NFVector ticLabels)
Sets a list of string values to be used for each tic label. |
void |
setTicLayoutMode(int layoutMode)
Sets the tic layout mode. |
void |
setTicLength(int ticLength)
Sets the length of the tics. |
void |
setTicLocations(NFVector ticLocations)
Sets the axis tic locations. |
void |
setTitleActiveLabel(NFActiveLabel titleActiveLabel)
Sets the NFActiveLabel for popup/drilldown on the axis title |
void |
setTitleLabel(NFLabel titleLabel)
Sets the label element for the axis title. |
void |
setTitleRegion(NFRegion titleRegion)
Set the background element for the axis title |
void |
setZoom(boolean zoom)
Sets whether this axis should allow zooming. |
Methods inherited from class netcharts.pro.common.NFBaseClass |
---|
getModified, getUserObject, setModified, setUserObject |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NORMAL
public static final int SKIP
public static final int STAGGER
public static final int SKIPSTAGGER
public static final int AUTOSKIP
public static final int AUTOSTAGGER
public static final int AUTO
public static final int LINEAR
public static final int LOG
public static final int NORMAL_LAYOUT
public static final int OUTWARD
public static java.util.Hashtable ticModeMap
public static java.util.Hashtable axisModeMap
public static final int RIGHT
public static final int LEFT
public static final int CENTER
public static java.util.Hashtable ticLabelRotationPointMap
public static java.util.Hashtable axisLayoutDirectionMap
Constructor Detail |
---|
public NFAxis()
public NFAxis(int size, int gap)
size
- Percentage size of the axisgap
- Pixel gap between this axis and the next one in the seriespublic NFAxis(java.util.Hashtable state, java.lang.String side)
state
- Hashtable containing CDL parameters.side
- One of "Left", "Right", "Bottom", or "Top"public NFAxis(java.util.Hashtable state, java.lang.String side, int modifier)
state
- Hashtable containing CDL parameters.side
- One of "Left", "Right", "Bottom", or Top"modifier
- "nth" axis in the series starting from 1Method Detail |
---|
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class NFBaseClass
java.lang.CloneNotSupportedException
public void setSide(java.lang.String side)
If the value passed is not a valid side an IllegalArgumentException will be thrown.
side
- One of "Left", "Right", "Bottom", or "Top"public java.lang.String getSide()
getSide
in interface NFDataMapper
public void setSize(int size)
size
- Percentage size of the axispublic int getSize()
public void setGap(int gap)
gap
- Pixel gap between this axis and the next one in the seriespublic int getGap()
pixel
- gap between this axis and the next one in the series. Return 0
if not defined.public void setLayoutDirection(int direction)
direction
- the direction of the layoutpublic int getLayoutDirection()
direction
- of the layout in the series. Return 0
if not defined.public boolean getLayoutDirectionModified()
true
if the layout direction has been modified, false
otherwise.public void setTextFont(java.awt.Font font)
font
- Tic label text fontpublic java.awt.Font getTextFont()
public void setTextColor(java.awt.Color color)
color
- Tic label colorpublic java.awt.Color getTextColor()
public void setAxisScaleMode(int axisScaleMode)
LOG, LINEAR
If the mode is not LOG or LINEAR an IllegalArgumentException will be thrown.
If the mode is LOG but the scale min or max is set to zero an IllegalArgumentException will be thrown since log(0) is undefined.
axisScaleMode
- One of LOG, LINEAR
public int getAxisScaleMode()
LOG, LINEAR
or LINEAR if not defined.public void setAxisScaleBase(double axisScaleBase)
axisScaleBase
- Logarithmic base. (For example, for base 2, pass 2.0).public int getTicLength()
public void setTicLength(int ticLength)
ticLength
- The length of the tics, or -1 to indicate they will be sized automatically.public boolean getZoom()
public void setZoom(boolean zoom)
zoom
- Whether this axis should allow zooming.public double getAxisScaleBase()
public void setLineColor(java.awt.Color lineColor)
lineColor
- Axis line color.public java.awt.Color getLineColor()
public void setTicLocations(NFVector ticLocations)
If the vector contains elements that are not numeric objects or Date objects, an IllegalArgumentException will be thrown.
ticLocations.
- NFVector of numeric or date/time information.public NFVector getTicLocations()
public void setTicLabel(NFModalLabel ticLabel)
ticLabel
- public NFModalLabel getTicLabel()
public void setTicFormat(NFFormat format)
format
- NFFormat object describing how automatically generated
labels are to be formatted.public NFFormat getTicFormat()
public void setTicLabels(NFVector ticLabels)
ticLabels
- Vector of strings.public NFVector getTicLabels()
public void setActiveLabels(NFVector activeLabels)
If the vector contains elements that are not NFActiveLabel objects, an IllegalArgumentException will be thrown.
activeLabels
- Vector of NFActiveLabelspublic NFVector getActiveLabels()
activeLabels
- or null if not defined.public void setTitleLabel(NFLabel titleLabel)
titleLabel
- Title label objectpublic NFLabel getTitleLabel()
public void setTitleRegion(NFRegion titleRegion)
titleRegion
- NFRegion objectpublic NFRegion getTitleRegion()
public void setTitleActiveLabel(NFActiveLabel titleActiveLabel)
titleActiveLabel
- ActiveLabel objectpublic NFActiveLabel getTitleActiveLabel()
public void setTicLayoutMode(int layoutMode)
NORMAL - No explicit layout AUTO - Automatically skips or staggers labels that overlap AUTOSTAGGER - Automatically staggers labels that overlap AUTOSKIP - Automatically skips labels that overlap SKIP - Explicitly skip labels using the given skip count STAGGER - Explicitly stagger labels using the given stagger levels SKIPSTAGGER - Explicitly skip or stagger labels given skip count and stagger levels.
layoutMode.
- One of NORMAL, AUTO, AUTOSTAGGER, AUTOSKIP, SKIP, STAGGER, SKIPSTAGGER
public int getTicLayoutMode()
public void setTicLabelRotationPoint(int labelRotationPoint)
RIGHT - The label is rotated around its right most character LEFT - The label is rotated around its left most character CENTER - The label is rotated around its center (this is the default)
labelRotationPoint.
- One of RIGHT, LEFT, CENTER
public int getTicLabelRotationPoint()
RIGHT - The label is rotated around its right most character LEFT - The label is rotated around its left most character CENTER - The label is rotated around its center (this is the default)
public void setSkipCount(int skipCount)
skipCount
- Number of labels to skip if in SKIP or SKIPSTAGGER mode.public int getSkipCount()
public void setDrawMinorTics(boolean drawMinorTics)
drawMinorTics
- If false, do not draw the minor ticspublic boolean getDrawMinorTics()
public void setStaggerLevels(int staggerLevels)
staggerLevels
- Number of levels to stagger labels if in STAGGER or SKIPSTAGGER mode.
If
- the stagger levels are < 0, then an exception will be thrown.public int getStaggerLevels()
public void setAutoScrollRange()
public void setScrollRange(double scrollMin, double scrollMax)
scrollMin
- Minimum end of data viewport.scrollMax
- Maximum end of data viewport.public void setScrollRange(NFRange scrollRange)
scrollRange
- Sets the minimum and maximum end of the data viewport.public NFRange getScrollRange()
public void setAutoScaleRange()
public NFRange getAutoScaleRange(NFGraph chart)
chart
- This chart object having the autoscaled axis
public void setScale(double min, double max, double step)
min
- Minimum viewable axis value.max
- Maximum viewable axis valuestep
- Tic step size.public void setScale(NFAxisRange scale)
scale
- Contains the minimum, maximum, and tic step values.public NFAxisRange getScale()
scale
- or null if autoscaling turned on.public void addScaleSet(double min, double max, double step, double percent)
min
- Minimum value of the scale.max
- Maximum value of the scale.step
- Tic step value for this scale.percent
- Percentage of overall axis this axis scale should use.public NFVector getScaleSets()
public void setScaleSets(NFVector scaleSets)
scaleSet
- public void setAxisMargins(NFAxisMargin margins)
margins
- NFAxisMargin object specifying the padding to
add before and after the plot area of a graph.public NFAxisMargin getAxisMargins()
public void setMajorTicColor(java.awt.Color majorTicColor)
majorTicColor
- major tic color.public java.awt.Color getMajorTicColor()
public void setMinorTicColor(java.awt.Color minorTicColor)
minorTicColor
- minor tic color.public java.awt.Color getMinorTicColor()
public void setModifier(int modifier)
modifier
- public int getModifier()
getModifier
in interface NFDataMapper
modifier
- or 0 if not defined.public java.util.Vector getCDLVector()
public java.util.Vector getCDLVector(java.util.Vector v)
v
- vector to append NFKeyValue objects to.
|
NetCharts Pro | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Visual Mining, Inc. | Copyright © Visual Mining, Inc. 1996 - 2011 |
Last Modified: Jun 28, 2011 |