|
JMSLTM Numerical Library 5.0.1 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.imsl.chart.AbstractChartNode
public abstract class AbstractChartNode
The base class of all of the nodes in both the 2D and 3D chart trees.
Field Summary | |
---|---|
static int |
AUTOSCALE_DATA
Flag used to indicate that autoscaling is to be done by scanning the data nodes. |
static int |
AUTOSCALE_DENSITY
Flag used to indicate that autoscaling is to adjust the "Density" attribute. |
static int |
AUTOSCALE_NUMBER
Flag used to indicate that autoscaling is to adjust the "Number" attribute. |
static int |
AUTOSCALE_OFF
Flag used to indicate that autoscaling is turned off. |
static int |
AUTOSCALE_WINDOW
Flag used to indicate that autoscaling is to be done by using the "Window" attribute. |
static int |
AXIS_X
Flag to indicate x-axis. |
static int |
AXIS_Y
Flag to indicate y-axis. |
static int |
AXIS_Z
Flag to indicate z-axis. |
static int |
LABEL_TYPE_NONE
Flag used to indicate the an element is not to be labeled. |
static int |
LABEL_TYPE_TITLE
Flag used to indicate that an element is to be labeled with the value of its title attribute. |
static int |
LABEL_TYPE_X
Flag used to indicate that an element is to be labeled with the value of its x-coordinate. |
static int |
LABEL_TYPE_Y
Flag used to indicate that an element is to be labeled with the value of its y-coordinate. |
static int |
LABEL_TYPE_Z
Flag used to indicate that an element is to be labeled with the value of its y-coordinate. |
static long |
serialVersionUID
|
static int |
TRANSFORM_CUSTOM
Flag used to indicate that the axis using a custom transformation. |
static int |
TRANSFORM_LINEAR
Flag used to indicate that the axis uses linear scaling. |
static int |
TRANSFORM_LOG
Flag used to indicate that the axis uses logarithmic scaling. |
Constructor Summary | |
---|---|
AbstractChartNode(AbstractChartNode parent)
|
Method Summary | |
---|---|
protected List |
clone(List in,
Map hashClonedNode)
Returns a deep copy of a vector of ChartNode's. |
protected Object |
clone(Map hashClonedNode)
Returns a deep-copy clone of this node. |
protected Map |
clone(Map hashIn,
Map hashClonedNode)
Returns a deep copy of a Hashtable. |
protected Object |
clone(Object value,
Map hashClonedNode)
Returns a deep copy of an Object. |
AbstractChartNode |
getAbstractParent()
Returns the parent of this node. |
Object |
getAttribute(String name)
Gets an attribute. |
int |
getAutoscaleInput()
Returns the value of the "AutoscaleInput" attribute. |
int |
getAutoscaleMinimumTimeInterval()
Returns the value of the "AutoscaleMinimumTimeInterval" attribute. |
int |
getAutoscaleOutput()
Returns the value of the "AutoscaleOutput" attribute. |
boolean |
getBooleanAttribute(String name,
boolean defaultValue)
Convenience routine to get a Boolean-valued attribute. |
protected List |
getChildList()
Returns the children of this node. |
Color |
getColorAttribute(String name)
Convenience routine to get a Color-valued attribute. |
Transform |
getCustomTransform()
Returns the value of the "CustomTransform" attribute. |
int |
getDensity()
Returns the value of the "Density" attribute. |
double |
getDoubleAttribute(String name,
double defaultValue)
Convenience routine to get a Double-valued attribute. |
Color |
getFillColor()
Returns the value of the "FillColor" attribute. |
Font |
getFont()
Convenience routine which gets a Font object based on the
"FontName", "FontStyle" and "FontSize" attributes. |
String |
getFontName()
Returns the value of the "FontName" attribute. |
int |
getFontSize()
Returns the value of the "FontSize" attribute. |
int |
getFontStyle()
Returns the value of the "FontStyle" attribute. |
Image |
getImage()
Returns the value of the "Image" attribute. |
int |
getIntegerAttribute(String name,
int defaultValue)
Convenience routine to get an Integer-valued attribute. |
int |
getLabelType()
Returns the value of the "LabelType" attribute. |
Color |
getLightColor()
Returns the value of the "LightColor" attribute. |
Color |
getLineColor()
Returns the value of the "LineColor" attribute. |
double |
getLineWidth()
Returns the value of the "LineWidth" attribute. |
Locale |
getLocale()
Returns the value of the "Locale" attribute. |
Color |
getMarkerColor()
Returns the value of the "MarkerColor" attribute. |
double |
getMarkerSize()
Returns the value of the "MarkerSize" attribute. |
String |
getName()
Returns the value of the "Name" attribute. |
int |
getNumber()
Returns the value of the "Number" attribute. |
boolean |
getPaint()
Returns the value of the "Paint" attribute. |
String |
getStringAttribute(String name)
Convenience routine to get a String-valued attribute. |
Color |
getTextColor()
Returns the value of the "TextColor" attribute. |
Format |
getTextFormat()
Returns the value of the "TextFormat" attribute. |
double |
getTickLength()
Returns the value of the "TickLength" attribute. |
int |
getTransform()
Returns the value of the "Transform" attribute. |
double[] |
getX()
Returns the value of the "X" attribute. |
double[] |
getY()
Returns the value of the "Y" attribute. |
boolean |
isAncestorOf(AbstractChartNode node)
Returns true if this node is an ancestor of the argument node. |
boolean |
isAttributeSet(String name)
Determines if an attribute is defined (may have been inherited). |
boolean |
isAttributeSetAtThisNode(String name)
Determines if an attribute is defined in this node (not inherited). |
static boolean |
isBitSet(int flag,
int mask)
Returns true if the bit set in flag is set in mask. |
static Color |
parseColor(String nameColor)
Returns a color specified by name or a red-green-blue triple. |
void |
remove()
Removes the node from its parents list of children. |
void |
setAttribute(String name,
Object value)
Sets an attribute. |
void |
setAutoscaleInput(int value)
Sets the value of the "AutoscaleInput" attribute. |
void |
setAutoscaleMinimumTimeInterval(int value)
Sets the value of the "AutoscaleMinimumTimeInterval" attribute. |
void |
setAutoscaleOutput(int value)
Sets the value of the "AutoscaleOutput" attribute. |
void |
setCustomTransform(Transform value)
Sets the value of the "CustomTransform" attribute. |
void |
setDensity(int value)
Sets the value of the "Density" attribute. |
void |
setFillColor(Color color)
Sets the value of the "FillColor" attribute. |
void |
setFillColor(String color)
Sets the "FillColor" attribute to a color specified by name. |
void |
setFont(Font font)
Sets the value of the font attributes. |
void |
setFontName(String value)
Sets the value of the "FontName" attribute. |
void |
setFontSize(int value)
Sets the value of the "FontSize" attribute. |
void |
setFontStyle(int value)
Sets the value of the "FontStyle" attribute. |
void |
setImage(ImageIcon value)
Sets the value of the "Image" attribute. |
void |
setLabelType(int type)
Sets the value of the "LabelType" attribute. |
void |
setLightColor(Color color)
Sets the value of the "LightColor" attribute. |
void |
setLightColor(String color)
Sets the value of the "LightColor" attribute to a color specified by name. |
void |
setLineColor(Color color)
Sets the value of the "LineColor" attribute. |
void |
setLineColor(String color)
Sets the value of the "LineColor" attribute. |
void |
setLineWidth(double value)
Sets the value of the "LineWidth" attribute. |
void |
setLocale(Locale value)
Sets the value of the "Locale" attribute. |
void |
setMarkerColor(Color color)
Sets the value of the "MarkerColor" attribute. |
void |
setMarkerColor(String color)
Sets the value of the "MarkerColor" attribute to a color specified by name. |
void |
setMarkerSize(double size)
Sets the value of the "MarkerSize" attribute. |
void |
setName(String value)
Sets the value of the "Name" attribute. |
void |
setNumber(int value)
Sets the value of the "Number" attribute. |
void |
setPaint(boolean value)
Sets the value of the "Paint" attribute. |
void |
setTextColor(Color color)
Sets the value of the "TextColor" attribute. |
void |
setTextColor(String color)
Sets the value of the "TextColor" attribute to a color specified by name. |
void |
setTextFormat(Format value)
Sets the value of the "TextFormat" attribute. |
void |
setTextFormat(String value)
Sets the value of the "TextFormat" attribute. |
void |
setTickLength(double tickLength)
Sets the value of the "TickLength" attribute. |
void |
setTransform(int value)
Sets the value of the "Transform" attribute. |
void |
setX(Object value)
Sets the value of the "X" attribute. |
void |
setY(Object value)
Sets the value of the "Y" attribute. |
String |
toString()
Returns the name of this ChartNode |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int AUTOSCALE_DATA
setAutoscaleInput(int)
,
Constant Field Valuespublic static final int AUTOSCALE_DENSITY
setAutoscaleOutput(int)
,
Constant Field Valuespublic static final int AUTOSCALE_NUMBER
setAutoscaleOutput(int)
,
Constant Field Valuespublic static final int AUTOSCALE_OFF
setAutoscaleInput(int)
,
setAutoscaleOutput(int)
,
Constant Field Valuespublic static final int AUTOSCALE_WINDOW
setAutoscaleInput(int)
,
setAutoscaleOutput(int)
,
Constant Field Valuespublic static final int AXIS_X
public static final int AXIS_Y
public static final int AXIS_Z
public static final int LABEL_TYPE_NONE
setLabelType(int)
,
Constant Field Valuespublic static final int LABEL_TYPE_TITLE
setLabelType(int)
,
Constant Field Valuespublic static final int LABEL_TYPE_X
setLabelType(int)
,
Constant Field Valuespublic static final int LABEL_TYPE_Y
setLabelType(int)
,
Constant Field Valuespublic static final int LABEL_TYPE_Z
setLabelType(int)
,
Constant Field Valuespublic static final long serialVersionUID
public static final int TRANSFORM_CUSTOM
setTransform(int)
,
Constant Field Valuespublic static final int TRANSFORM_LINEAR
setTransform(int)
,
Constant Field Valuespublic static final int TRANSFORM_LOG
setTransform(int)
,
Constant Field ValuesConstructor Detail |
---|
public AbstractChartNode(AbstractChartNode parent)
Method Detail |
---|
protected final List clone(List in, Map hashClonedNode)
protected Object clone(Map hashClonedNode)
protected Object clone(Hashtable hashClonedNode) { AxisXY t = (AxisXY)super.clone(hashClonedNode); t.axisX = (Axis1D)axisX.clone(hashClonedNode); t.axisY = (Axis1D)axisY.clone(hashClonedNode); return t; }
hashClonedNode
- Hashtable
of nodes that have
already been cloned. We need to clone each ChartNode
exactly once even if multiple references to it exist
in the graphics tree. In this hashtable
keys are existing ChartNode objects and
values are their clones.protected final Map clone(Map hashIn, Map hashClonedNode)
protected Object clone(Object value, Map hashClonedNode)
If other non-immutable object types are used in the tree then the nodes where they are defined should override this function to handle the cloning. The new function calls super.clone(value, hashClonedNode) for values handled here.
public AbstractChartNode getAbstractParent()
AbstractChartNode
object which contains this node's parent. This is
null in the case of the root node of the chart tree, since
that node has no parent.public Object getAttribute(String name)
name
- a String
which contains the name of the attributepublic int getAutoscaleInput()
int
value of the "AutoscaleInput" attribute.public int getAutoscaleMinimumTimeInterval()
int
value of the "AutoscaleMinimumTimeInterval" attribute.public int getAutoscaleOutput()
int
value of the "AutoscaleOutput" attribute.public boolean getBooleanAttribute(String name, boolean defaultValue)
name
- a String
which contains the name of
the attributedefaultValue
- the boolean
default value of the attribute
boolean
value of the attribute, if defined
and if its value is of type Boolean. Otherwise defaultValue
is returned.protected final List getChildList()
List
array which contains the
children of this node.
It may be null.public Color getColorAttribute(String name)
name
- a String
which contains the name
of the attribute.
Color
value of the attribute, if
defined and if its value is of type Color. Otherwise, a default
color value is returned.public Transform getCustomTransform()
Transform
which contains the value of
the "Transform" attributepublic int getDensity()
int
value of the "Density" attribute, if defined.
Otherwise, a default value of zero is returned.public double getDoubleAttribute(String name, double defaultValue)
name
- a String
which contains the name of
the attributedefaultValue
- the double
default value of the attribute.
double
value of the attribute, if defined
and if its value is of type Double. Otherwise defaultValue
is returned.public Color getFillColor()
Color
value of the "FillColor" attribute, if defined.
Otherwise, a default color value is returned.public Font getFont()
Font
object based on the
"FontName", "FontStyle" and "FontSize" attributes. There
is no "Font" attribute.
Font
public String getFontName()
String
value of the "FontName" attribute, if defined.
Otherwise, the empty string is returned.public int getFontSize()
int
value of the "FontSize" attribute, if defined.
Otherwise, 10 is returned.Font
public int getFontStyle()
int
value of the "FontStyle" attribute, if defined.
Otherwise, java.awt.Font.PLAIN is returned.Font
public Image getImage()
Image
value of the "Image" attributepublic int getIntegerAttribute(String name, int defaultValue)
name
- a String
which contains the name of
the attribute.defaultValue
- the int
default value of the attribute
int
value of the attribute, if defined
and if its value is of type Integer. Otherwise defaultValue
is returned.public int getLabelType()
LABEL_TYPE_NONE
is returned.
int
value of the "LabelType" attribute.public Color getLightColor()
Color
value of the "LightColor" attribute, if defined.
Otherwise, a default color value is returned.public Color getLineColor()
LineColor
value of the "LineColor" attribute, if defined.
Otherwise, a default color value is returned.public double getLineWidth()
double
value of the "LineWidth" attribute, if defined.
Otherwise, the default value of one is returned.public Locale getLocale()
Locale
value of the "Locale" attribute, if defined.
Otherwise, a default value is returned.public Color getMarkerColor()
Color
which contains the "MarkerColor" valuepublic double getMarkerSize()
double
value of the "MarkerSize" attribute, if defined.
Otherwise, a default of 1.0 is returned.public String getName()
String
value of the "Name" attribute, if defined.
Otherwise, the empty string is returned.public int getNumber()
int
value of the "Number" attribute, if defined.
Otherwise, zero is returned.public boolean getPaint()
boolean
value of the "Paint" attribute, if defined.
Otherwise, true is returned.public String getStringAttribute(String name)
name
- a String
which contains the name of
the attribute.
String
value of the attribute, if defined
and if its value is of type String.public Color getTextColor()
Color
value of the "TextColor" attribute, if defined.
Otherwise, a default color value is returned.public Format getTextFormat()
Format
value of the "TextFormat" attribute, if defined.
Otherwise, a default format is returned. The default
is a NumberFomat that allows exactly two digits
after the decimal.public double getTickLength()
double
value of the "TickLength" attribute, if defined.
Otherwise, 1.0 is returned.public int getTransform()
int
which contains the value of
the "Transform" attributepublic double[] getX()
double
array which contains the value of the "X" attributepublic double[] getY()
double
array which contains the value of the "Y" attributepublic boolean isAncestorOf(AbstractChartNode node)
node
- a AbstractChartNode
object
boolean
, true if this node is an
ancestor of the argument, nodepublic boolean isAttributeSet(String name)
name
- a String
which contains the name of the attribute
boolean
, true if the attribute is defined
for this node. The definition may have been inherited from
its parent node.public boolean isAttributeSetAtThisNode(String name)
name
- a String
which contains the name of the
attribute
boolean
, true if the attribute is defined
in this node. The definition must have been set directly in
this node, not just inherited from its parent node.public static boolean isBitSet(int flag, int mask)
flag
- the int
which contains the bit to be tested
against maskmask
- the int
which is used as the mask
boolean
, true if the bit set in flag is set in maskpublic static Color parseColor(String nameColor)
nameColor
- is the name of a color (this name is not case sensitive)
or a comma separated list of red, green, blue values all in the range
0 to 255. For example, "red" or "255,0,0".
Color
.
IllegalArgumentException
- is thrown if the color name is not known.public void remove()
public void setAttribute(String name, Object value)
name
- a String
which contains the name
of the attribute to be setvalue
- an Object
which contains the value
of the attributepublic void setAutoscaleInput(int value)
value
- "AutoscaleInput" value. Legal values are
AUTOSCALE_OFF | Do not do autoscaling. |
AUTOSCALE_DATA | Use the data values. This is the default. |
AUTOSCALE_WINDOW | Use the "Window" attribute value. |
public void setAutoscaleMinimumTimeInterval(int value)
value
- "AutoscaleMinimumTimeInterval" value. Legal values are:
MILLISECOND | Millisecond |
SECOND | Second |
MINUTE | Minute |
HOUR_OF_DAY | Hour |
DAY_OF_WEEK | Day |
WEEK_OF_YEAR | Week |
MONTH | Month |
YEAR | Year |
MILLISECOND
.GregorianCalendar
public void setAutoscaleOutput(int value)
value
- "AutoscaleOutput" value. Legal values are
bitwise-or combinations of the following:
AUTOSCALE_OFF | Do not do autoscaling. |
AUTOSCALE_WINDOW | Change the "Window" attribute value. |
AUTOSCALE_NUMBER | Change the "Number" attribute value. |
AUTOSCALE_DENSITY | Change the "Density" attribute value. |
public void setCustomTransform(Transform value)
value
- an object implementing the Transform interface.TRANSFORM_CUSTOM
public void setDensity(int value)
value
- int
"Density" value which specifies
the number of minor tick marks per major tick mark.public void setFillColor(Color color)
color
- Color
"FillColor" valuepublic void setFillColor(String color)
color
- String
name of a color.parseColor(java.lang.String)
public void setFont(Font font)
font
- Font
object whose components are
used to set three different attributes.Font
public void setFontName(String value)
value
- a String
which contains the "FontName" valueFont
public void setFontSize(int value)
value
- an int
"FontSize" valueFont
public void setFontStyle(int value)
value
- an int
"FontStyle" value.Font
public void setImage(ImageIcon value)
value
- ImageIcon
value.public void setLabelType(int type)
type
- the int
"LabelType" valueLABEL_TYPE_NONE
,
LABEL_TYPE_X
,
LABEL_TYPE_Y
,
LABEL_TYPE_TITLE
public void setLightColor(Color color)
color
- a Color
which contains the "LightColor" valuepublic void setLightColor(String color)
color
- String
name of a color.parseColor(java.lang.String)
public void setLineColor(Color color)
color
- the LineColor
valuepublic void setLineColor(String color)
color
- the LineColor
valuepublic void setLineWidth(double value)
value
- the double
"LineWidth" valuepublic void setLocale(Locale value)
value
- the Locale
valuepublic void setMarkerColor(Color color)
color
- a Color
which contains the "MarkerColor" valuepublic void setMarkerColor(String color)
color
- String
name of a color.parseColor(java.lang.String)
public void setMarkerSize(double size)
size
- a double
which specifies the "MarkerSize" valuepublic void setName(String value)
value
- a String
which contains the "Name" valueFont
public void setNumber(int value)
value
- the int
"Number" valuepublic void setPaint(boolean value)
value
- the boolean
"Paint" value. If false, this node
and its children are not drawn.public void setTextColor(Color color)
color
- a Color
which contains the "TextColor" valuepublic void setTextColor(String color)
color
- String
name of a color.parseColor(java.lang.String)
public void setTextFormat(Format value)
value
- a Format
which contains the "TextFormat" valuepublic void setTextFormat(String value)
The TextFormat attribute is normally a Format
object,
but, as a convenience, it can be set as a String. The following special values
are defined. In this table, "locale" is the value of the locale attribute.
value | Attribute |
"Date(SHORT)" | DateFormat.getDateInstance( DateFormat.SHORT, locale) |
"Date(MEDIUM)" | DateFormat.getDateInstance( DateFormat.MEDIUM, locale) |
"Date(LONG)" | DateFormat.getDateInstance( DateFormat.LONG, locale) |
"Currency" | DateFormat.getCurrencyInstance(locale) |
"Number" | DateFormat.getNumberInstance(locale) |
"Percent" | DateFormat.getPercentInstance(locale) |
If the value does not match one of these special cases then an interpretation
as a DecimalFormat
object is attempted. If this fails then
an interpretation as a SimpleDateFormat
object is attempted.
value
- a String
which contains the "TextFormat" valuepublic void setTickLength(double tickLength)
tickLength
- a double which contains the "TickLength" valuepublic void setTransform(int value)
value
- The "Transform" value. Legal values are
TRANSFORM_LINEAR (the default), TRANSFORM_LOG and TRANSFORM_CUSTOM.TRANSFORM_LINEAR
,
TRANSFORM_LOG
,
TRANSFORM_CUSTOM
public void setX(Object value)
value
- an Object
which contains the "X" valuepublic void setY(Object value)
value
- the Object
which contains the "Y" valuepublic String toString()
ChartNode
toString
in class Object
String
, the name of this ChartNode
|
JMSLTM Numerical Library 5.0.1 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |