com.swfm.mica.core
Class MiAttributes

java.lang.Object
  extended bycom.swfm.mica.core.MiGeneralAttributes
      extended bycom.swfm.mica.core.MiAttributes
All Implemented Interfaces:
java.lang.Cloneable, MiiAttributeTypes, MiiCopyable, MiiNames, MiiPropertyTypes, MiiTypes

public class MiAttributes
extends MiGeneralAttributes
implements MiiTypes, MiiAttributeTypes, MiiPropertyTypes, MiiNames

Instances of this class contain a number of attributes (about 64 at this writing). There are a large number of methods to get and set the values of these attributes.

Instances can be mutable or immutable (the default). If immutable, then values of attributes cannot be set directly. Instead, the methods to set the values of attributes return a new instance of MiAttributes, a copy of the original but with a particular attribute value modified.

In order to set the value of a _mutable_ attribute use the setStaticXXX methods.

A number of the advanced methods use attribute 'indexes'. See the MiiAttributeTypes file for a list of attribute indexes.

Version:
%I% %G%
Author:
Michael L. Davis

Field Summary
         
Constructor Summary
MiAttributes()
          Constructs a new immutable MiAttributes.
MiAttributes(boolean isImmutable)
          Constructs a new MiAttributes.
 
Method Summary
 java.lang.String cacheToString()
          For debugging, return the number and a description of all of the attributes created so far.
 MiAttributes complexXor(MiAttributes mask, MiAttributes paint)
          For each att == mask.att, replace with paint.att
 MiAttributes copy()
          Makes and returns a copy of this MiAttributes.
 MiAttributes copyAttribute(MiAttributes from, int which)
          Copies the value of the specific attribute specified by the given index from the 'from' attributes and returns the resultant attributes.
 MiiPartRenderer getAfterRenderer()
           
 java.awt.AlphaComposite getAlphaCompositeRenderMode()
           
 java.lang.String getAttributeValue(java.lang.String name)
          Gets the value of the attribute with the given name as a text string.
 java.awt.Color getBackgroundColor()
           
 java.awt.Image getBackgroundImage()
           
 MiiDeviceRenderer getBackgroundRenderer()
           
 java.awt.Image getBackgroundTile()
           
 MiiHelpInfo getBalloonHelp()
           
 MiiPartRenderer getBeforeRenderer()
           
 java.awt.Color getBlackColor()
           
 java.awt.Color getBorderHiliteColor()
           
 double getBorderHiliteWidth()
           
 int getBorderLook()
           
 MiiDeviceRenderer getBorderRenderer()
           
 java.awt.Color getColor()
           
 java.awt.Color getColorAttribute(int which)
          Gets the value of the attribute specified by the given index.
 int getContextCursor()
           
 MiiContextMenu getContextMenu()
           
 java.awt.Color getDarkColor()
           
static MiAttributes getDefaultAttributes()
           
 MiiHelpInfo getDialogHelp()
           
 MiFont getFont()
           
 int getFontHorizontalJustification()
           
 java.lang.String getFontName()
           
 int getFontPointSize()
           
 int getFontVerticalJustification()
           
 boolean getHasBorderHilite()
           
 boolean getHasShadow()
           
 java.awt.Image getImageAttribute(int which)
          Gets the value of the attribute specified by the given index.
 int getIndexOfAttributeName(java.lang.String name)
          Gets the index of the attribute with the given name.
 java.awt.Color getLightColor()
           
 double getLineEndSize()
           
 MiiLineEndsRenderer getLineEndsRenderer()
           
 boolean getLineEndsSizeFnOfLineWidth()
           
 int getLineEndStyle()
           
 double getLineStartSize()
           
 int getLineStartStyle()
           
 int getLineStyle()
           
 double getLineWidth()
           
 double getMaximumHeight()
           
 double getMaximumWidth()
           
 double getMinimumHeight()
           
 double getMinimumWidth()
           
 java.lang.String getNameOfAttribute(int index)
          Gets the name of the attribute specified by the given index.
 int getNumberOfCachedAttributes()
          Gets the number of attributes in the cache that stores reusable, immutable MiAttributes.
 MiPropertyDescriptions getPropertyDescriptions()
          Gets the descriptions of all of the properties.
 java.awt.Color getShadowColor()
           
 int getShadowDirection()
           
 double getShadowLength()
           
 MiiShadowRenderer getShadowRenderer()
           
 MiiHelpInfo getStatusHelp()
           
 MiiHelpInfo getToolHintHelp()
           
 MiPartAnimator getVisibilityAnimator()
           
 java.awt.Color getWhiteColor()
           
 int getWriteMode()
           
 java.awt.Color getXorColor()
           
 boolean hasAttribute(java.lang.String name)
          Gets whether an attribute with the given name exists.
 boolean hasFixedAspectRatio()
           
 boolean hasFixedHeight()
           
 boolean hasFixedWidth()
           
 MiAttributes inheritFrom(MiAttributes from)
           
 MiAttributes inheritFromAll(MiAttributes from)
           
 boolean isAcceptingEnterKeyFocus()
           
 boolean isAcceptingKeyboardFocus()
           
 boolean isAcceptingMouseFocus()
           
 boolean isAcceptingTabKeys()
           
 boolean isAppearanceChange(MiAttributes other)
          Gets whether any appearance attributes are different between this and the given 'other' attributes.
 boolean isCopyable()
           
 boolean isCopyableAsPartOfCopyable()
           
 boolean isDeletable()
           
 boolean isFontBold()
           
 boolean isFontItalic()
           
 boolean isGeometricChange(MiAttributes other)
          Gets whether any geometric attributes are different between this and the given 'other' attributes.
 boolean isMovable()
           
 boolean isPickable()
           
 boolean isPrintable()
           
 boolean isSavable()
           
 boolean isSelectable()
           
 boolean isSnappable()
           
 boolean isUngroupable()
           
 MiAttributes overrideFrom(MiAttributes from)
           
 MiAttributes setAcceptingEnterKeyFocus(boolean b)
           
 MiAttributes setAcceptingKeyboardFocus(boolean b)
           
 MiAttributes setAcceptingMouseFocus(boolean b)
           
 MiAttributes setAcceptingTabKeys(boolean b)
           
 MiAttributes setAfterRenderer(MiiPartRenderer r)
           
 MiAttributes setAlphaCompositeRenderMode(java.awt.AlphaComposite c)
           
 void setAttributeForObject(MiPart part, int which, boolean value)
           
 void setAttributeForObject(MiPart part, int which, double value)
           
 void setAttributeForObject(MiPart part, int which, int value)
           
 void setAttributeForObject(MiPart part, int which, java.lang.Object object)
           
 void setAttributeForObject(MiPart part, java.lang.String name, java.lang.String value)
           
 void setAttributeValue(MiPart part, java.lang.String name, boolean value)
           
 void setAttributeValue(MiPart part, java.lang.String name, double value)
           
 void setAttributeValue(MiPart part, java.lang.String name, int value)
           
 void setAttributeValue(MiPart part, java.lang.String name, java.lang.Object value)
           
 void setAttributeValue(MiPart part, java.lang.String name, java.lang.String value)
           
 MiAttributes setAttributeValue(java.lang.String name, java.lang.String value)
           
 MiAttributes setBackgroundColor(java.awt.Color c)
           
 MiAttributes setBackgroundColor(java.lang.String name)
           
 MiAttributes setBackgroundImage(java.awt.Image i)
           
 MiAttributes setBackgroundRenderer(MiiDeviceRenderer r)
           
 MiAttributes setBackgroundTile(java.awt.Image i)
           
 MiAttributes setBalloonHelp(MiiHelpInfo msg)
           
 MiAttributes setBalloonHelpMessage(java.lang.String msg)
           
 MiAttributes setBeforeRenderer(MiiPartRenderer r)
           
 MiAttributes setBlackColor(java.awt.Color c)
           
 MiAttributes setBorderHiliteColor(java.awt.Color c)
           
 MiAttributes setBorderHiliteWidth(double w)
           
 MiAttributes setBorderLook(int look)
           
 MiAttributes setBorderRenderer(MiiDeviceRenderer r)
           
 MiAttributes setColor(java.awt.Color c)
           
 MiAttributes setColor(java.lang.String name)
           
 MiAttributes setContextCursor(int cursor)
           
 MiAttributes setContextMenu(MiiContextMenu menu)
           
 MiAttributes setCopyable(boolean b)
           
 MiAttributes setCopyableAsPartOfCopyable(boolean b)
           
 MiAttributes setDarkColor(java.awt.Color c)
           
static void setDefaultAttributes(MiAttributes atts)
           
 MiAttributes setDeletable(boolean b)
           
 MiAttributes setDialogHelp(MiiHelpInfo msg)
           
 MiAttributes setDialogHelpMessage(java.lang.String msg)
           
 MiAttributes setFixedAspectRatio(boolean b)
           
 MiAttributes setFixedHeight(boolean b)
           
 MiAttributes setFixedWidth(boolean b)
           
 MiAttributes setFont(MiFont f)
           
 MiAttributes setFontBold(boolean flag)
           
 MiAttributes setFontHorizontalJustification(int j)
           
 MiAttributes setFontItalic(boolean flag)
           
 MiAttributes setFontName(java.lang.String name)
           
 MiAttributes setFontPointSize(int size)
           
 MiAttributes setFontVerticalJustification(int j)
           
 MiAttributes setHasBorderHilite(boolean flag)
           
 MiAttributes setHasShadow(boolean flag)
           
 MiAttributes setLightColor(java.awt.Color c)
           
 MiAttributes setLineEndSize(double size)
           
 MiAttributes setLineEndsRenderer(MiiLineEndsRenderer r)
           
 MiAttributes setLineEndsSizeFnOfLineWidth(boolean flag)
           
 MiAttributes setLineEndStyle(int style)
           
 MiAttributes setLineStartSize(double size)
           
 MiAttributes setLineStartStyle(int style)
           
 MiAttributes setLineStyle(int style)
           
 MiAttributes setLineWidth(double w)
           
 MiAttributes setMaximumHeight(double height)
           
 MiAttributes setMaximumWidth(double width)
           
 MiAttributes setMinimumHeight(double height)
           
 MiAttributes setMinimumWidth(double width)
           
 MiAttributes setMovable(boolean b)
           
 MiAttributes setPickable(boolean b)
           
 MiAttributes setPrintable(boolean b)
           
 MiAttributes setSavable(boolean b)
           
 MiAttributes setSelectable(boolean b)
           
 MiAttributes setShadowColor(java.awt.Color c)
           
 MiAttributes setShadowDirection(int d)
           
 MiAttributes setShadowLength(double w)
           
 MiAttributes setShadowRenderer(MiiShadowRenderer r)
           
 MiAttributes setSnappable(boolean b)
           
 void setStaticAttribute(int which, java.awt.Color color)
          Sets the attribute specified by the given index to the specified value.
 void setStaticAttribute(int which, java.awt.Image image)
          Sets the attribute specified by the given index to the specified value.
 void setStaticBackgroundColor(java.awt.Color c)
          Sets the background color attribute to the given value.
 void setStaticBorderLook(int look)
          Sets the border look attribute to the given value.
 void setStaticColor(java.awt.Color c)
          Sets the foreground color attribute to the given value.
 MiAttributes setStatusHelp(MiiHelpInfo msg)
           
 MiAttributes setStatusHelpMessage(java.lang.String msg)
           
 MiAttributes setToolHintHelp(MiiHelpInfo msg)
           
 MiAttributes setToolHintMessage(java.lang.String msg)
           
 MiAttributes setVisibilityAnimator(MiPartAnimator animator)
           
 MiAttributes setWhiteColor(java.awt.Color c)
           
 MiAttributes setWriteMode(int wmode)
           
 MiAttributes setXorColor(java.awt.Color c)
           
 
Methods inherited from class com.swfm.mica.core.MiGeneralAttributes
dump, equals, getAttribute, getAttributeValueAsObject, getBooleanAttribute, getDoubleAttribute, getIndexOfAttribute, getIntegerAttribute, getModifiedAttributes, getModifiedAttributes, getModifiedAttributes, getModifiedAttributes, getModifiedAttributes, getNumberOfAttributes, getNumUsing, hashCode, inheritFrom, inheritFromAll, initializeAsInheritedAttributes, initializeAsOverrideAttributes, isImmutable, isInheritedAttribute, makeCopy, overrideFrom, overrideFromPermanent, overrideFromPermanent2, setIsImmutable, setIsInheritedAttribute, setStaticAttribute, setStaticAttribute, setStaticAttribute, setStaticAttribute, setStaticAttributeValue, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MiAttributes

public MiAttributes()
Constructs a new immutable MiAttributes.


MiAttributes

public MiAttributes(boolean isImmutable)
Constructs a new MiAttributes.

Parameters:
isImmutable - true if immutable
Method Detail

cacheToString

public java.lang.String cacheToString()
For debugging, return the number and a description of all of the attributes created so far.

Specified by:
cacheToString in class MiGeneralAttributes
Returns:
a textual description of the attribute cache

setDefaultAttributes

public static void setDefaultAttributes(MiAttributes atts)

getDefaultAttributes

public static MiAttributes getDefaultAttributes()

getIndexOfAttributeName

public int getIndexOfAttributeName(java.lang.String name)
Gets the index of the attribute with the given name.

Returns:
the index or -1, if no such attribute

getNameOfAttribute

public java.lang.String getNameOfAttribute(int index)
Gets the name of the attribute specified by the given index. This name may have spaces in it.

Specified by:
getNameOfAttribute in class MiGeneralAttributes
Parameters:
index - the index of an attribute
Returns:
the name of the attribute

hasAttribute

public boolean hasAttribute(java.lang.String name)
Gets whether an attribute with the given name exists.

Overrides:
hasAttribute in class MiGeneralAttributes
Returns:
true if such an attribute exists.

copy

public MiAttributes copy()
Makes and returns a copy of this MiAttributes.

Returns:
the copy

setStaticAttribute

public void setStaticAttribute(int which,
                               java.awt.Color color)
Sets the attribute specified by the given index to the specified value. This method, like all setStaticXXX methods, are to be used with mutable MiAttributes only.

Parameters:
which - the index of the attribute
color - the new value of the attribute
Throws:
java.lang.IllegalArgumentException - invalid color attribute index
java.lang.RuntimeException - attempt to modify immutable attributes

getColorAttribute

public java.awt.Color getColorAttribute(int which)
Gets the value of the attribute specified by the given index.

Returns:
the value of the attribute

setStaticAttribute

public void setStaticAttribute(int which,
                               java.awt.Image image)
Sets the attribute specified by the given index to the specified value. This method, like all setStaticXXX methods, are to be used with mutable MiAttributes only.

Parameters:
which - the index of the attribute
image - the new value of the attribute
Throws:
java.lang.IllegalArgumentException - invalid image attribute index
java.lang.RuntimeException - attempt to modify immutable attributes

getImageAttribute

public java.awt.Image getImageAttribute(int which)
Gets the value of the attribute specified by the given index.

Returns:
the value of the attribute

setAttributeForObject

public void setAttributeForObject(MiPart part,
                                  int which,
                                  java.lang.Object object)

setAttributeForObject

public void setAttributeForObject(MiPart part,
                                  int which,
                                  int value)

setAttributeForObject

public void setAttributeForObject(MiPart part,
                                  int which,
                                  double value)

setAttributeForObject

public void setAttributeForObject(MiPart part,
                                  int which,
                                  boolean value)

setAttributeForObject

public void setAttributeForObject(MiPart part,
                                  java.lang.String name,
                                  java.lang.String value)

setAttributeValue

public void setAttributeValue(MiPart part,
                              java.lang.String name,
                              java.lang.Object value)

setAttributeValue

public void setAttributeValue(MiPart part,
                              java.lang.String name,
                              int value)

setAttributeValue

public void setAttributeValue(MiPart part,
                              java.lang.String name,
                              double value)

setAttributeValue

public void setAttributeValue(MiPart part,
                              java.lang.String name,
                              boolean value)

setAttributeValue

public void setAttributeValue(MiPart part,
                              java.lang.String name,
                              java.lang.String value)

setAttributeValue

public MiAttributes setAttributeValue(java.lang.String name,
                                      java.lang.String value)

getAttributeValue

public java.lang.String getAttributeValue(java.lang.String name)
Gets the value of the attribute with the given name as a text string. This will be object.toString() for object-value attributes, MiiTypes.Mi_NULL_VALUE_NAME for null valued object-value attributes, otherwise it will be the value in text format.

Overrides:
getAttributeValue in class MiGeneralAttributes
Returns:
the value as a string

overrideFrom

public MiAttributes overrideFrom(MiAttributes from)

inheritFrom

public MiAttributes inheritFrom(MiAttributes from)

inheritFromAll

public MiAttributes inheritFromAll(MiAttributes from)

copyAttribute

public MiAttributes copyAttribute(MiAttributes from,
                                  int which)
Copies the value of the specific attribute specified by the given index from the 'from' attributes and returns the resultant attributes.

Parameters:
from - the attributes from which we will get new value of an attribute
which - the index of the attribute to copy
Returns:
the resultant attributes

setStaticColor

public void setStaticColor(java.awt.Color c)
Sets the foreground color attribute to the given value. This method, like all setStaticXXX methods, are to be used with mutable MiAttributes only.

Throws:
java.lang.RuntimeException - attempt to modify immutable attributes

setStaticBackgroundColor

public void setStaticBackgroundColor(java.awt.Color c)
Sets the background color attribute to the given value. This method, like all setStaticXXX methods, are to be used with mutable MiAttributes only.

Throws:
java.lang.RuntimeException - attempt to modify immutable attributes

setStaticBorderLook

public void setStaticBorderLook(int look)
Sets the border look attribute to the given value. This method, like all setStaticXXX methods, are to be used with mutable MiAttributes only.

Throws:
java.lang.RuntimeException - attempt to modify immutable attributes

isDeletable

public boolean isDeletable()

isMovable

public boolean isMovable()

isCopyable

public boolean isCopyable()

isCopyableAsPartOfCopyable

public boolean isCopyableAsPartOfCopyable()

isSelectable

public boolean isSelectable()

isUngroupable

public boolean isUngroupable()

hasFixedWidth

public boolean hasFixedWidth()

hasFixedHeight

public boolean hasFixedHeight()

hasFixedAspectRatio

public boolean hasFixedAspectRatio()

isPickable

public boolean isPickable()

isAcceptingMouseFocus

public boolean isAcceptingMouseFocus()

isAcceptingKeyboardFocus

public boolean isAcceptingKeyboardFocus()

isAcceptingEnterKeyFocus

public boolean isAcceptingEnterKeyFocus()

isAcceptingTabKeys

public boolean isAcceptingTabKeys()

isPrintable

public boolean isPrintable()

isSavable

public boolean isSavable()

isSnappable

public boolean isSnappable()

setDeletable

public MiAttributes setDeletable(boolean b)

setMovable

public MiAttributes setMovable(boolean b)

setCopyable

public MiAttributes setCopyable(boolean b)

setCopyableAsPartOfCopyable

public MiAttributes setCopyableAsPartOfCopyable(boolean b)

setSelectable

public MiAttributes setSelectable(boolean b)

setFixedWidth

public MiAttributes setFixedWidth(boolean b)

setFixedHeight

public MiAttributes setFixedHeight(boolean b)

setFixedAspectRatio

public MiAttributes setFixedAspectRatio(boolean b)

setPickable

public MiAttributes setPickable(boolean b)

setAcceptingMouseFocus

public MiAttributes setAcceptingMouseFocus(boolean b)

setAcceptingKeyboardFocus

public MiAttributes setAcceptingKeyboardFocus(boolean b)

setAcceptingEnterKeyFocus

public MiAttributes setAcceptingEnterKeyFocus(boolean b)

setAcceptingTabKeys

public MiAttributes setAcceptingTabKeys(boolean b)

setPrintable

public MiAttributes setPrintable(boolean b)

setSavable

public MiAttributes setSavable(boolean b)

setSnappable

public MiAttributes setSnappable(boolean b)

getColor

public java.awt.Color getColor()

getBackgroundColor

public java.awt.Color getBackgroundColor()

getBackgroundImage

public java.awt.Image getBackgroundImage()

getWhiteColor

public java.awt.Color getWhiteColor()

getLightColor

public java.awt.Color getLightColor()

getDarkColor

public java.awt.Color getDarkColor()

getBlackColor

public java.awt.Color getBlackColor()

getXorColor

public java.awt.Color getXorColor()

getAlphaCompositeRenderMode

public java.awt.AlphaComposite getAlphaCompositeRenderMode()

getBackgroundTile

public java.awt.Image getBackgroundTile()

getLineWidth

public double getLineWidth()

getLineStyle

public int getLineStyle()

getLineStartStyle

public int getLineStartStyle()

getLineEndStyle

public int getLineEndStyle()

getLineStartSize

public double getLineStartSize()

getLineEndSize

public double getLineEndSize()

getLineEndsSizeFnOfLineWidth

public boolean getLineEndsSizeFnOfLineWidth()

getFont

public MiFont getFont()

getWriteMode

public int getWriteMode()

getToolHintHelp

public MiiHelpInfo getToolHintHelp()

getBalloonHelp

public MiiHelpInfo getBalloonHelp()

getStatusHelp

public MiiHelpInfo getStatusHelp()

getDialogHelp

public MiiHelpInfo getDialogHelp()

getContextMenu

public MiiContextMenu getContextMenu()

getContextCursor

public int getContextCursor()

getMinimumWidth

public double getMinimumWidth()

getMinimumHeight

public double getMinimumHeight()

getMaximumWidth

public double getMaximumWidth()

getMaximumHeight

public double getMaximumHeight()

getBorderLook

public int getBorderLook()

getHasBorderHilite

public boolean getHasBorderHilite()

getBorderHiliteColor

public java.awt.Color getBorderHiliteColor()

getBorderHiliteWidth

public double getBorderHiliteWidth()

getHasShadow

public boolean getHasShadow()

getShadowColor

public java.awt.Color getShadowColor()

getShadowLength

public double getShadowLength()

getShadowDirection

public int getShadowDirection()

getBeforeRenderer

public MiiPartRenderer getBeforeRenderer()

getAfterRenderer

public MiiPartRenderer getAfterRenderer()

getShadowRenderer

public MiiShadowRenderer getShadowRenderer()

getLineEndsRenderer

public MiiLineEndsRenderer getLineEndsRenderer()

getBackgroundRenderer

public MiiDeviceRenderer getBackgroundRenderer()

getBorderRenderer

public MiiDeviceRenderer getBorderRenderer()

getVisibilityAnimator

public MiPartAnimator getVisibilityAnimator()

setColor

public MiAttributes setColor(java.awt.Color c)

setColor

public MiAttributes setColor(java.lang.String name)

setBackgroundColor

public MiAttributes setBackgroundColor(java.awt.Color c)

setBackgroundColor

public MiAttributes setBackgroundColor(java.lang.String name)

setWhiteColor

public MiAttributes setWhiteColor(java.awt.Color c)

setLightColor

public MiAttributes setLightColor(java.awt.Color c)

setDarkColor

public MiAttributes setDarkColor(java.awt.Color c)

setBlackColor

public MiAttributes setBlackColor(java.awt.Color c)

setXorColor

public MiAttributes setXorColor(java.awt.Color c)

setAlphaCompositeRenderMode

public MiAttributes setAlphaCompositeRenderMode(java.awt.AlphaComposite c)

setBackgroundImage

public MiAttributes setBackgroundImage(java.awt.Image i)

setBackgroundTile

public MiAttributes setBackgroundTile(java.awt.Image i)

setLineWidth

public MiAttributes setLineWidth(double w)

setLineStyle

public