com.sas.graphics.components
Class NoteModel

com.sas.graphics.components.NoteModel

public class NoteModel

The NoteModel class encapsulates the set of user specified properties that pertain to chart titles and footnotes.

The chart models will contain NoteModels for titles and footnotes which you may access to specify a desired appearance.

Usage

Set the bar chart's title 1 text:
 BarChart barChart = ;
 BarChartModel barChartModel = barChart.getBarChartModel();
 NoteModel title1 = barChartModel.getTitle1();
 title1.setText("Total sales this year!");
 
or you could take the fast approach:
 barChart.getBarChartModel().getTitle1().setText("Total sales this year!");
 

Behavior

NoteModel simply bundles a set of text properties in the form of a TextStyle and the text desired to display with those properties. There is a NoteModel used to display each title (4) and footnote (2).

Since:
SAS 9.1
See Also:
GraphStyle, ModelBase, AdvancedTextStyle, TextStyle

Constructor Summary
NoteModel()
          Default constructor.
NoteModel(java.lang.String newText)
          Constructor with specified text.
NoteModel(java.lang.String newText, TextStyle newTextStyle)
          Constructor with specified text and associated font.
 
Method Summary
 void apply(NoteModel 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 NoteModel.
 java.lang.String getText()
          Returns the user specified text string that is to be displayed.
 TextStyle getTextStyle()
          Returns the visual attributes used to render the text.
 int hashCode()
          Computes the hash code for this NoteModel.
 void setText(java.lang.String newText)
          Sets the text string that is to be displayed.
 void setTextStyle(TextStyle newTextStyle)
          Sets the visual attributes used to render the text.
 
Methods inherited from class com.sas.graphics.components.ModelBase
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, setContainedModel
 

Constructor Detail

NoteModel

public NoteModel()
Default constructor.


NoteModel

public NoteModel(java.lang.String newText)
Constructor with specified text.

Parameters:
newText - the text string value for this note.

NoteModel

public NoteModel(java.lang.String newText,
                 TextStyle newTextStyle)
Constructor with specified text and associated font.

Parameters:
newText - the text value
newTextStyle - the text style attributes
Method Detail

apply

public void apply(NoteModel theOtherObject)
Utility method to convey properties contained in "theOtherObject" to this object.

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.

Parameters:
theOtherObject - properties applied to this instance

setText

public void setText(java.lang.String newText)
Sets the text string that is to be displayed. Assigning null is acceptable and will have the affect of causing the note to not be displayed.

Parameters:
newText - String to be displayed
See Also:
getText()

getText

public java.lang.String getText()
Returns the user specified text string that is to be displayed. null will be returned if the text has not been designated.

Returns:
the user specified text string
See Also:
setText(java.lang.String)

setTextStyle

public void setTextStyle(TextStyle newTextStyle)
                  throws java.lang.IllegalArgumentException
Sets the visual attributes used to render the text.

Parameters:
newTextStyle - the text attributes
Throws:
java.lang.IllegalArgumentException - is thrown for null parameter.
See Also:
setTextStyle(com.sas.graphics.components.TextStyle)

getTextStyle

public TextStyle getTextStyle()
Returns the visual attributes used to render the text.

Returns:
the visual attributes of the text.
See Also:
setTextStyle(com.sas.graphics.components.TextStyle)

equals

public boolean equals(java.lang.Object obj)
Determines whether another object is equal to this NoteModel.

The result is true if and only if the argument is not null and is a NoteModel object that has the same property values as this object.

Overrides:
equals in class ModelBase
Parameters:
obj - the object to test for equality with this NoteModel
Returns:
true if the objects are the same; false otherwise.

hashCode

public int hashCode()
Computes the hash code for this NoteModel.

Overrides:
hashCode in class ModelBase
Returns:
a hash code value for this object.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.