com.sas.graphics.components
Class DataTipModel

com.sas.graphics.components.DataTipModel

public class DataTipModel

A DataTipModel encapsulates the set of display properties applicable to the Graph's data tip. The data tip is an interactive window that appears as the mouse cursor moves over the graph's data elements and displays in textual form the data represented by the data element. The information presented in the data tip depends upon the type of graph and what data is being represented by the graph. Additional variables and control over what is visible in the data tip can be controlled by specifying setDataTipVariable() variables in the graph's TableDataModel object.

Since:
SAS 9.1

Method Summary
 void apply(DataTipModel 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 DataTipModel.
 java.awt.Color getBackgroundColor()
          Returns the interior color of the DatatTip's window.
 int getContent()
          Returns the content of the data tip panel with respect to the Variables set in chart specific setDataTipVariables.
 int getHorizontalJustification()
          Returns the horizontal justification of the data tip window with respect to the mouse cursor.
 com.sas.measures.BaseDistance getHorizontalOffset()
          Returns the horizontal offset of the DataTip window from the mouse cursor.
 TextStyle getTextStyle()
          Returns the visual attributes used to render the text.
 com.sas.measures.BaseDistance getVerticalOffset()
          Returns the vertical offset of the DataTip window from the mouse cursor.
 int hashCode()
          Computes the hash code for this DataTipModel.
 boolean isVisible()
          Get whether or not the text is displayed.
 void setBackgroundColor(java.awt.Color newColor)
          Sets the interior color of the DatatTip's window.
 void setContent(int newMode)
          Specifies the content of the data tip with respect to the Variables specified in the chart specific setDataTipVariable method.
 void setHorizontalJustification(int newJustification)
          Set the horizontal justification of the data tip window with respect to the mouse cursor.
 void setHorizontalOffset(com.sas.measures.BaseDistance newOffset)
          Set the horizontal offset of the DataTip window from the mouse cursor.
 void setTextStyle(TextStyle newTextStyle)
          Sets the visual attributes used to render the text.
 void setVerticalOffset(com.sas.measures.BaseDistance newOffset)
          Set the vertical offset of the DataTip window from the mouse cursor.
 void setVisible(boolean newVisible)
          Set whether or not the text is displayed.
 
Methods inherited from class com.sas.graphics.components.ModelBase
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, setContainedModel
 

Method Detail

apply

public void apply(DataTipModel 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

setVisible

public void setVisible(boolean newVisible)
Set whether or not the text is displayed.

Parameters:
newVisible - true means text is displayed
See Also:
isVisible()

isVisible

public boolean isVisible()
Get whether or not the text is displayed.

Returns:
boolean true means text is displayed
See Also:
setVisible(boolean)

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)

setBackgroundColor

public void setBackgroundColor(java.awt.Color newColor)
                        throws java.lang.IllegalArgumentException
Sets the interior color of the DatatTip's window. The default value is java.awt.SystemColor.window;

Parameters:
newColor - the color of the DatatTip's window interior
Throws:
java.lang.IllegalArgumentException - is thrown for null parameter.
See Also:
getBackgroundColor()

getBackgroundColor

public java.awt.Color getBackgroundColor()
Returns the interior color of the DatatTip's window.

Returns:
the interior color of the DatatTip's window.
See Also:
setBackgroundColor(java.awt.Color)

setHorizontalJustification

public void setHorizontalJustification(int newJustification)
                                throws java.lang.IllegalArgumentException
Set the horizontal justification of the data tip window with respect to the mouse cursor. The default value is javax.swing.SwingConstants.CENTER.
 Valid values are 
    javax.swing.SwingConstants.LEFT,
    javax.swing.SwingConstants.CENTER,
    javax.swing.SwingConstants.RIGHT
 

Parameters:
newJustification - new Justification setting to be applied
Throws:
java.lang.IllegalArgumentException - if an invalid value is passed in.
See Also:
getHorizontalJustification()

getHorizontalJustification

public int getHorizontalJustification()
Returns the horizontal justification of the data tip window with respect to the mouse cursor.

Returns:
the justification setting
See Also:
setHorizontalJustification(int)

setHorizontalOffset

public void setHorizontalOffset(com.sas.measures.BaseDistance newOffset)
                         throws java.lang.IllegalArgumentException
Set the horizontal offset of the DataTip window from the mouse cursor. The default value is 0 centimeters.

Parameters:
newOffset - the horizontal offset from the mouse cursor.
Throws:
java.lang.IllegalArgumentException - if newOffset is null.
See Also:
getHorizontalOffset()

getHorizontalOffset

public com.sas.measures.BaseDistance getHorizontalOffset()
Returns the horizontal offset of the DataTip window from the mouse cursor.

Returns:
the vertical offset of the DataTip window from the mouse cursor.
See Also:
setHorizontalOffset(com.sas.measures.BaseDistance)

setVerticalOffset

public void setVerticalOffset(com.sas.measures.BaseDistance newOffset)
                       throws java.lang.IllegalArgumentException
Set the vertical offset of the DataTip window from the mouse cursor. The default value is 0.5 centimeters.

Parameters:
newOffset - the vertical offset from the mouse cursor.
Throws:
java.lang.IllegalArgumentException - if newOffset is null.
See Also:
getVerticalOffset()

getVerticalOffset

public com.sas.measures.BaseDistance getVerticalOffset()
Returns the vertical offset of the DataTip window from the mouse cursor.

Returns:
the vertical offset of the DataTip window from the mouse cursor.
See Also:
setVerticalOffset(com.sas.measures.BaseDistance)

equals

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

The result is true if and only if the argument is not null and is a DataTipModel 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 DataTipModel
Returns:
true if the objects are the same; false otherwise.

setContent

public void setContent(int newMode)
Specifies the content of the data tip with respect to the Variables specified in the chart specific setDataTipVariable method. Valid values are GraphConstants.DATA_TIP_APPEND and GraphConstants.DATA_TIP_REPLACE. Anything else will throw and IllegalArgumentException. GraphConstants.DATA_TIP_APPEND - appends these variables to the chart variables defined for the chart. GraphConstants.DATA_TIP_REPLACE - only displays the variables defined in the setDataTipVariable();

Parameters:
newMode - content mode for data tip
Throws:
java.lang.IllegalArgumentException - if an invalid parameter is passed in.
See Also:
getContent()

getContent

public int getContent()
Returns the content of the data tip panel with respect to the Variables set in chart specific setDataTipVariables.

Returns:
what to put in the displayed data tip

hashCode

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

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



Copyright © 2009 SAS Institute Inc. All Rights Reserved.