|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object visad.AxisScale
public class AxisScale
Class which defines the scales displayed along the spatial axes of a display. Each ScalarMap that has a DisplayScalar of the X, Y, or Z axis will have a non-null AxisScale.
ScalarMap.getAxisScale()
,
Serialized FormField Summary | |
---|---|
static int |
PRIMARY
identifier for primary label side of axis |
static int |
QUATERNARY
identifier for quaternary label side of axis |
static int |
SECONDARY
identifier for secondary label side of axis |
static int |
TERTIARY
identifier for tertiary label side of axis |
static int |
X_AXIS
X_AXIS identifier |
static int |
Y_AXIS
Y_AXIS identifier |
static int |
Z_AXIS
Z_AXIS identifier |
Constructor Summary | |
---|---|
AxisScale(ScalarMap map)
Construct a new AxisScale for the given ScalarMap |
Method Summary | |
---|---|
void |
createStandardLabels(double max,
double min,
double base,
double increment)
Creates a hashtable that will draw text labels starting at the starting point specified using the increment field. |
int |
getAxis()
Get axis that the scale will be displayed on. |
int |
getAxisOrdinal()
Get the position of this AxisScale on the Axis (first, second, third). |
boolean |
getBaseLineVisible()
Determine whether the base line for the scale should be visible |
Color |
getColor()
Get the color of this axis scale. |
Font |
getFont()
Get the font used for rendering the labels |
boolean |
getGridLinesVisible()
Get the visibility of the grid lines |
String |
getLabel()
Deprecated. Get the label of the AxisScale. |
boolean |
getLabelAllTicks()
Return whether all major ticks are to be labeled. |
VisADTriangleArray |
getLabelArray()
Get the labels rendered with a font to pass to the renderer. |
boolean |
getLabelBothSides()
See if both sides are labeled |
int |
getLabelSize()
Gets the size of the labels. |
Hashtable |
getLabelTable()
Get the Hashtable used for labels |
double |
getMajorTickSpacing()
This method returns the major tick spacing. |
double |
getMinorTickSpacing()
This method returns the minor tick spacing. |
NumberFormat |
getNumberFormat()
Get the formatting for labels. |
VisADLineArray |
getScaleArray()
Get the Scale to pass to the renderer. |
boolean |
getScreenBased()
return screenBased mode |
int |
getSide()
Get the alignment for the axis |
boolean |
getSnapToBox()
Determine whether this property is set. |
int |
getTickOrientation()
Get the orientation for the ticks along the axis |
boolean |
getTicksVisible()
See if ticks are visible |
String |
getTitle()
Get the title of the AxisScale. |
boolean |
isLabelRelief()
Checks if is label has relief. |
boolean |
isVisible()
Get the visibility of the AxisScale |
boolean |
makeScale()
Create the scale. |
boolean |
makeScale(boolean twoD,
double xmin,
double ymin,
double zmin,
double xmax,
double ymax,
double zmax,
double scale,
double offset,
double line,
double[] dataRange)
inner logic of makeScale with no references to display, displayRenderer or scalarMap, allwoing more flexible placement of scales |
boolean |
makeScreenBasedScale(double xmin,
double ymin,
double xmax,
double ymax,
double XTMIN,
double YTMIN,
double XTMAX,
double YTMAX)
Create the scale for screen based. |
void |
setAutoComputeTicks(boolean b)
Allow the AxisScale to automatically compute the desired majorTickSpacing based on the range of the ScalarMap. |
void |
setBaseLineVisible(boolean visible)
Set visibility of base line. |
void |
setColor(Color color)
Set the color of this axis scale. |
void |
setColor(float[] color)
Set the color of this axis scale. |
void |
setFont(Font font)
Set the font used for rendering the labels |
void |
setFont(HersheyFont font)
Set the font used for rendering the labels |
void |
setGridLinesVisible(boolean show)
Set the visibility of the grid lines; Grid lines are placed at major tick marks. |
void |
setLabel(String label)
Deprecated. Set the label to be used for this axis. The default is the ScalarName of the ScalarMap. |
void |
setLabelAllTicks(boolean labelAll)
Set whether all major ticks should be labeled. |
void |
setLabelBothSides(boolean both)
Set whether both sides are labeled. |
void |
setLabelRelief(boolean labelRelief)
Sets the label relief. |
void |
setLabelSize(int size)
Sets the size of the labels. |
void |
setLabelTable(Hashtable labels)
Used to specify what label will be drawn at any given value. |
void |
setMajorTicks(double[] majorTicks)
Set major tick marks. |
void |
setMajorTickSpacing(double spacing)
Set major tick mark spacing. |
void |
setMinorTicks(double[] minorTicks)
Set minor tick marks. |
void |
setMinorTickSpacing(double spacing)
Set minor tick mark spacing. |
void |
setNumberFormat(NumberFormat format)
Set the formatting for all labels |
void |
setScreenBased(boolean sb)
set screenBased mode true indicates axis is stationary relative to screen |
void |
setSide(int side)
Set side for axis (PRIMARY, SECONDARY) |
void |
setSnapToBox(boolean b)
Toggle whether the scale is along the box edge or not |
void |
setTickBase(double base)
Sets the base value for tick marks. |
void |
setTickOrientation(int orient)
Set orientation of tick marks along the axis line. |
void |
setTicksVisible(boolean visible)
Set whether ticks are visible |
void |
setTitle(String title)
Set the title to be used for this axis. |
void |
setVisible(boolean visible)
Set the visibility of the AxisScale |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int X_AXIS
public static final int Y_AXIS
public static final int Z_AXIS
public static final int PRIMARY
public static final int SECONDARY
public static final int TERTIARY
public static final int QUATERNARY
Constructor Detail |
---|
public AxisScale(ScalarMap map) throws VisADException
map
- ScalarMap to monitor. Must be mapped to one of
Display.XAxis, Display.YAxis, Display.ZAxis
VisADException
- bad ScalarMap or other VisAD problemMethod Detail |
---|
public int getAxisOrdinal()
public void setLabel(String label)
label
- label to be usedsetTitle(String)
public String getLabel()
getTitle()
public void setTitle(String title)
title
- title to be usedpublic String getTitle()
public int getAxis()
public VisADLineArray getScaleArray()
public VisADTriangleArray getLabelArray()
public void setScreenBased(boolean sb)
public boolean getScreenBased()
public boolean makeScreenBasedScale(double xmin, double ymin, double xmax, double ymax, double XTMIN, double YTMIN, double XTMAX, double YTMAX) throws VisADException
VisADException
public boolean makeScale() throws VisADException
VisADException
public boolean makeScale(boolean twoD, double xmin, double ymin, double zmin, double xmax, double ymax, double zmax, double scale, double offset, double line, double[] dataRange) throws VisADException
VisADException
public Color getColor()
public void setColor(Color color)
color
- Color to usepublic void setColor(float[] color)
color
- array of red, green, and blue values in
the range (0.0 - 1.0). color must be float[3].public void setMajorTickSpacing(double spacing)
setAutoComputeTicks
with a true
value.
spacing
- spacing between major tick marks (must be > 0)getMajorTickSpacing()
,
setAutoComputeTicks(boolean)
public void setMajorTicks(double[] majorTicks)
majorTicks
- the tick valuespublic void setMinorTicks(double[] minorTicks)
minorTicks
- the tick valuespublic double getMajorTickSpacing()
setMajorTickSpacing(double)
public void setMinorTickSpacing(double spacing)
setAutoComputeTicks
with a true
value.
spacing
- spacing between minor tick marks (must be > 0)getMinorTickSpacing()
,
setAutoComputeTicks(boolean)
public double getMinorTickSpacing()
setMinorTickSpacing(double)
public void setAutoComputeTicks(boolean b)
b
- if true, have majorTickSpacing automatically computed.public void createStandardLabels(double max, double min, double base, double increment)
IllegalArgumentException
- if min > max, or increment is
greater than max-minsetLabelTable(java.util.Hashtable)
public void setLabelTable(Hashtable labels) throws VisADException
labels
- map of value/label pairs
VisADException
- invalid hashtablegetLabelTable()
public Hashtable getLabelTable()
public void setFont(Font font)
font
- new font to usepublic void setFont(HersheyFont font)
font
- new font to usepublic Font getFont()
public void setBaseLineVisible(boolean visible)
visible
- true to display (default), false to turn offpublic boolean getBaseLineVisible()
public void setSnapToBox(boolean b)
b
- true to snap to the boxpublic boolean getSnapToBox()
public void setLabelSize(int size)
Font
is not being used. If a Font
is being used and you call setLabelSize(), a new Font
is
created using the old Font
name and style, but with the
new size.
size
- font size to usesetFont(java.awt.Font)
public int getLabelSize()
public void setTickBase(double base)
setMajorTickSpacing
or setMinorTickSpacing
have been called.
base
- base value for drawing tick marks. For example, if
your scale ranges from -4 to 18 and you set the
major tick spacing to 5, you will get ticks at
-4, 1, 6, 11, and 16 by default. If you set the tick
base value to 0, you will get ticks at 0, 5, 10, 15.public void setSide(int side)
side
- side for axis to appear onpublic int getSide()
public void setTickOrientation(int orient)
orient
- (PRIMARY or SECONDARY)public int getTickOrientation()
public void setNumberFormat(NumberFormat format)
format
- format stringpublic NumberFormat getNumberFormat()
public void setVisible(boolean visible)
visible
- true to display the AxisScalepublic boolean isVisible()
public void setGridLinesVisible(boolean show)
show
- true to display the grid linespublic boolean getGridLinesVisible()
public void setLabelBothSides(boolean both)
both
- true to label both sidespublic boolean getLabelBothSides()
public void setTicksVisible(boolean visible)
visible
- true to show tickspublic boolean getTicksVisible()
public void setLabelAllTicks(boolean labelAll)
createStandardLabels
or setLabelTable
labelAll
- true to label all (major) ticks. OverriddengetLabelAllTicks()
,
createStandardLabels(double, double, double, double)
,
setLabelTable(Hashtable)
public boolean getLabelAllTicks()
public boolean isLabelRelief()
public void setLabelRelief(boolean labelRelief)
labelRelief
- the new label relief
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |