|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.graphics.components.AdvancedTextStyle
public class AdvancedTextStyle
The AdvancedTextStyle extends TextStyle to support rotatable text in graphs. Properties include: baseline angle, font, visibility, color, justification, frame and shadow.
Graphs contain various models that use AdvancedTextStyle such as the bar chart's OutsideBarLabel which denotes the attributes to be applied to these labels. The angle is in degrees where 0 degrees would be considered at 3:00 on an analog clock. The angle will be pivoted about the text's anchor whose location may vary based upon what is displaying the text. The angle value is specified in degrees and is normalized to the 0-360 range when set.
BarChart barChart = new BarChart(); AdvancedTextStyle barLabelTextStyle = new AdvancedTextStyle(); barLabelTextStyle.apply(barChart.getGraphModel().getOutsideBarLabelTextStyle()); barLabelTextStyle.setBaselineAngle(60); barChart.getGraphModel().setOutsideBarLabelTextStyle(barLabelTextStyle); barChart.getGraphModel().setOutsideBarLabelContent(GraphConstants.DATA_LABEL_CATEGORY);
The apply() method is a convenience to convey the properties from one AdvancedTextStyle to another.
TextStyle
,
GraphStyle
,
ModelBase
Constructor Summary | |
---|---|
AdvancedTextStyle()
A AdvancedTextStyle encapsulates the set of display properties applicable to text used in graphs that support some baseline angle specification for rotating the text. |
|
AdvancedTextStyle(java.awt.Font newFont,
java.awt.Color newColor,
int newJustification,
boolean newVisible,
double newBaselineAngle)
Constructor allowing specification of Font, color, justification and visibility. |
Method Summary | |
---|---|
void |
apply(AdvancedTextStyle theOtherObject)
Utility method to convey properties contained in "theOtherObject" to this object. |
boolean |
equals(java.lang.Object obj)
Determines whether another object is equal to this AdvancedTextStyle . |
double |
getBaselineAngle()
Get the baseline angle for the text. |
int |
hashCode()
Computes the hash code for this AdvancedTextStyle . |
void |
setBaselineAngle(double newAngle)
Set the baseline angle for the text. |
Methods inherited from class com.sas.graphics.components.TextStyle |
---|
apply, getColor, getFont, getJustification, getRowSelectionFontStlye, getRowSelectionTextColorStlye, getShadowStyle, isVisible, setColor, setFont, setJustification, setRowSelectionFontStyle, setRowSelectionTextColorStyle, setShadowStyle, setVisible |
Methods inherited from class com.sas.graphics.components.ModelBase |
---|
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, setContainedModel |
Constructor Detail |
---|
public AdvancedTextStyle()
public AdvancedTextStyle(java.awt.Font newFont, java.awt.Color newColor, int newJustification, boolean newVisible, double newBaselineAngle)
null
then it is ignored,
the default font is ("TimesRoman",PLAIN,12).
If newColor is null
then it is ignored,
the default color is SystemColor.textText.
If newJustification is invalid then it is ignored,
the default color is javax.swing.SwingConstants.CENTER.
If newVisible is true then the text will be visible when displayed.
For newBaselineAngle, if the graph property allows rotating text,
sets the baseline angle for the text.
newFont
- the text font, null
is ignorednewColor
- the text color, null
is ignorednewJustification
- the text justification, invalid value are ignorednewVisible
- the text visibility, true means visiblenewBaselineAngle
- the text angle of rotation, default is 0 degreesMethod Detail |
---|
public void apply(AdvancedTextStyle theOtherObject)
Note: Contained "models" (i.e. properties that are subclasses of ModelBase) will in turn be called on to convey their properties to the like contained models in the other object. In that respect this can be considered a "tree" type copy.
Also Note: This is a deep copy. Thus after the copy, mutable properties will not be shared by the two instances.
theOtherObject
- properties applied to this instancepublic void setBaselineAngle(double newAngle)
newAngle
- angle for text baselinegetBaselineAngle()
public double getBaselineAngle()
setBaselineAngle(double)
public boolean equals(java.lang.Object obj)
AdvancedTextStyle
.
The result is true
if and only if the argument is not
null
and is a AdvancedTextStyle
object that has the same
property values as this object.
equals
in class TextStyle
obj
- the object to test for equality with this
AdvancedTextStyle
true
if the objects are the same;
false
otherwise.public int hashCode()
AdvancedTextStyle
.
hashCode
in class TextStyle
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |