com.ibm.richtext.textpanel
Class TextPanelSettings

java.lang.Object
  |
  +--com.ibm.richtext.textpanel.TextPanelSettings
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public final class TextPanelSettings
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

This class contains settings used when constructing an MTextPanel. The settings controled by this class include:

Some settings are dependent on others. Scroll bars are visible only if the text is scrollable. Also, text which is not editable if it is not selectable.

See Also:
MTextPanel, Serialized Form

Constructor Summary
TextPanelSettings()
          Create a TextPanelSettings instance with all settings set to true.
 
Method Summary
 void addDefaultValues(AttributeMap map)
          Add the key-value pairs in the given AttributeMap to the default values.
 java.lang.Object clone()
          Return a new TextPanelSettings instance with the same settings as this.
 boolean equals(java.lang.Object rhs)
          Compare this to another Object.
 AttributeMap getDefaultValues()
          Return the AttributeMap of default values for certain keys.
 boolean getEditable()
          Return the editable setting, which determines whether text in an MTextPanel can be edited.
 boolean getScrollable()
          Return the scrollable setting, which determines whether text in an MTextPanel can be scrolled.
 boolean getScrollBarsVisible()
          Return the scrollBarsVisible setting, which determines whether scroll bars in an MTextPanel are visible.
 boolean getSelectable()
          Return the selectable setting, which determines whether text in an MTextPanel can be selected.
 boolean getWraps()
          Return the wraps setting, which determines whether lines of text wrap to the length of the MTextPanel, or only at paragraph separators.
 int hashCode()
          Return the hash code for this Object.
 void setEditable(boolean editable)
          Set the editable setting.
 void setScrollable(boolean scrollable)
          Set the scrollable setting.
 void setScrollBarsVisible(boolean vis)
          Set the scrollBarsVisible setting.
 void setSelectable(boolean selectable)
          Set the selectable setting.
 void setWraps(boolean wraps)
          Set the wraps setting.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextPanelSettings

public TextPanelSettings()
Create a TextPanelSettings instance with all settings set to true.
Method Detail

clone

public java.lang.Object clone()
Return a new TextPanelSettings instance with the same settings as this.
Overrides:
clone in class java.lang.Object
Returns:
a new TextPanelSettings instance

getScrollable

public boolean getScrollable()
Return the scrollable setting, which determines whether text in an MTextPanel can be scrolled.
Returns:
the scrollable setting

setScrollable

public void setScrollable(boolean scrollable)
Set the scrollable setting.
Parameters:
scrollable - the scrollable setting. If false, the scrollBarsVisible setting is also set to false.

getScrollBarsVisible

public boolean getScrollBarsVisible()
Return the scrollBarsVisible setting, which determines whether scroll bars in an MTextPanel are visible.
Returns:
the scrollBarsVisible setting

setScrollBarsVisible

public void setScrollBarsVisible(boolean vis)
Set the scrollBarsVisible setting.
Parameters:
vis - the scrollBarsVisible setting. If true, the scrollable setting is also set to true.

getSelectable

public boolean getSelectable()
Return the selectable setting, which determines whether text in an MTextPanel can be selected.
Returns:
the selectable setting

setSelectable

public void setSelectable(boolean selectable)
Set the selectable setting.
Parameters:
selectable - the selectable setting. If false, the editable setting is also set to false.

getEditable

public boolean getEditable()
Return the editable setting, which determines whether text in an MTextPanel can be edited.
Returns:
the editable setting

setEditable

public void setEditable(boolean editable)
Set the editable setting.
Parameters:
selectable - the selectable setting. If true, the selectable setting is also set to true.

getWraps

public boolean getWraps()
Return the wraps setting, which determines whether lines of text wrap to the length of the MTextPanel, or only at paragraph separators.
Returns:
the wraps setting

setWraps

public void setWraps(boolean wraps)
Set the wraps setting.
Parameters:
wraps - the wraps setting

getDefaultValues

public AttributeMap getDefaultValues()
Return the AttributeMap of default values for certain keys. When a key in this AttributeMap is not specified, its value is taken from this AttributeMap.
Returns:
the AttributeMap of default values
See Also:
MTextPanel.getDefaultValues()

addDefaultValues

public void addDefaultValues(AttributeMap map)
Add the key-value pairs in the given AttributeMap to the default values. If a key does not appear in the given AttributeMap, its value in the default value map is unchanged.
Parameters:
map - an AttributeMap containing new default values

equals

public boolean equals(java.lang.Object rhs)
Compare this to another Object. This is equal to another Object if the other Object is a TextPanelSettings instance with the same settings as this one.
Overrides:
equals in class java.lang.Object
Parameters:
rhs - the Object to compare to

hashCode

public int hashCode()
Return the hash code for this Object.
Overrides:
hashCode in class java.lang.Object
Returns:
the hash code for this Object


Copyright (c) 1998-2000 IBM Corporation and others.