com.swfm.mica.editors
Class MiLayerAttributes

java.lang.Object
  extended bycom.swfm.mica.model.MiModelEntity
      extended bycom.swfm.mica.editors.MiLayerAttributes
All Implemented Interfaces:
MiiActionHandler, MiiActionTypes, MiiCommandHandler, MiiCommandManager, MiiModelEntity, MiiModelTypes, MiiPropertyTypes, MiiTypes

public class MiLayerAttributes
extends MiModelEntity
implements MiiTypes, MiiCommandHandler, MiiCommandManager

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

Field Summary
static java.lang.String Mi_ADD_NEW_LAYER_BEHIND_COMMAND_NAME
           
static java.lang.String Mi_ADD_NEW_LAYER_INFRONT_COMMAND_NAME
           
static java.lang.String Mi_CONNECT_TO_ABLE_COMMAND_NAME
           
static java.lang.String Mi_EDITABLE_COMMAND_NAME
           
static com.swfm.mica.editors.MiLayerEditability Mi_LAYER_ALWAYS_EDITABLE
           
static java.lang.String Mi_LAYER_ALWAYS_EDITABLE_NAME
           
static java.lang.String Mi_LAYER_ATTRIBUTES_RESOURCE_NAME
           
static java.lang.String Mi_LAYER_BACKGROUND_COLOR_NAME
           
static java.lang.String Mi_LAYER_BACKGROUND_COLOR_NAME_NSP
           
static java.lang.String Mi_LAYER_CONNECT_TO_ABLE_NAME
           
static java.lang.String Mi_LAYER_CURRENT_NAME
           
static java.lang.String Mi_LAYER_EDITABILITY_NAME
           
static com.swfm.mica.editors.MiLayerEditability Mi_LAYER_EDITABLE_WHEN_CURRENT
           
static java.lang.String Mi_LAYER_EDITABLE_WHEN_CURRENT_NAME
           
static com.swfm.mica.editors.MiLayerEditability Mi_LAYER_LOCKED
           
static java.lang.String Mi_LAYER_LOCKED_NAME
           
static java.lang.String Mi_LAYER_NAME_NAME
           
static com.swfm.mica.editors.MiLayerEditability Mi_LAYER_NEVER_EDITABLE
           
static java.lang.String Mi_LAYER_NEVER_EDITABLE_NAME
           
static java.lang.String Mi_LAYER_NUMBER_OF_SHAPES_NAME
           
static java.lang.String Mi_LAYER_NUMBER_OF_SHAPES_NAME_NSP
           
static java.lang.String Mi_LAYER_OVERRIDE_SHAPE_COLORS_NAME
           
static java.lang.String Mi_LAYER_OVERRIDE_SHAPE_COLORS_NAME_NSP
           
static java.lang.String Mi_LAYER_PRINTABLE_NAME
           
static java.lang.String Mi_LAYER_SHAPE_COLOR_NAME
           
static java.lang.String Mi_LAYER_SHAPE_COLOR_NAME_NSP
           
static java.lang.String Mi_LAYER_SNAP_TO_ABLE_NAME
           
static java.lang.String Mi_LAYER_VISIBLE_NAME
           
static java.lang.String Mi_NOT_CONNECT_TO_ABLE_COMMAND_NAME
           
static java.lang.String Mi_NOT_EDITABLE_COMMAND_NAME
           
static java.lang.String Mi_NOT_PRINTABLE_COMMAND_NAME
           
static java.lang.String Mi_NOT_SNAP_TO_ABLE_COMMAND_NAME
           
static java.lang.String Mi_PRINTABLE_COMMAND_NAME
           
static java.lang.String Mi_SNAP_TO_ABLE_COMMAND_NAME
           
           
Constructor Summary
MiLayerAttributes()
           
MiLayerAttributes(MiPart layer)
           
 
Method Summary
 java.awt.Color getBackgroundColor()
           
 boolean getCanBeCurrent()
           
 com.swfm.mica.editors.MiLayerEditability getEditability()
           
 MiPart getLayer()
           
 java.lang.String getName()
           
 int getNumberOfShapes()
           
 boolean getOverrideShapeColors()
           
 MiPropertyDescriptions getPropertyDescriptions()
          Gets the descriptions of all of the properties.
 java.lang.String getPropertyValue(java.lang.String name)
          Gets the textual value of the property with the given name.
 java.awt.Color getShapeColor()
           
 boolean isConnectToAble()
           
 boolean isCurrent()
           
 boolean isEditable()
           
 boolean isPrintable()
           
 boolean isSnapToAble()
           
 boolean isVisible()
           
 void processCommand(java.lang.String cmd)
          Processes the given command.
 void registerCommandDependentWidget(MiPart widget, java.lang.String cmd)
          Registers the given widget and the command it generates.
 void setBackgroundColor(java.awt.Color c)
           
 void setCanBeCurrent(boolean flag)
           
 void setCommandLabel(java.lang.String command, java.lang.String label)
          Sets the label of the widget that generates the given command.
 void setCommandOptions(java.lang.String command, Strings options)
          Sets the values of the multi-state widget that generates the given command.
 void setCommandPropertyValue(java.lang.String command, java.lang.String propertyName, java.lang.String propertyValue)
          Sets the given property to the given value for all parts that generates the given command.
 void setCommandSensitivity(java.lang.String command, boolean flag)
          Sets whether the given command can be processed at this time.
 void setCommandSensitivity(java.lang.String command, boolean flag, java.lang.String statusHelpMsg)
          Sets whether the given command can be processed at this time.
 void setCommandState(java.lang.String command, boolean flag)
          Sets the state of the boolean widget that generates the given command.
 void setCommandState(java.lang.String command, java.lang.String state)
          Sets the state of the multi-state widget that generates the given command.
 void setCommandVisibility(java.lang.String command, boolean flag)
          Sets whether the given command is to be visible to the user.
 void setConnectToAble(boolean flag)
           
 void setCurrent(boolean flag)
           
 void setDeletable(boolean flag)
           
 void setEditability(com.swfm.mica.editors.MiLayerEditability e)
           
 void setEditable(boolean flag)
           
 void setName(java.lang.String name)
           
 void setOverrideShapeColors(boolean flag)
           
 void setPrintable(boolean flag)
           
 void setPropertyValue(java.lang.String name, java.lang.String value)
          Sets the property with the given name to the given value.
 void setShapeColor(java.awt.Color c)
           
 void setSnapToAble(boolean flag)
           
 void setVisible(boolean flag)
           
 void unRegisterWidgetGeneratedCommand(MiPart widget, java.lang.String cmd)
          UnRegisters the given widget and the command it generates.
 void updateCommandManagerState()
           
 
Methods inherited from class com.swfm.mica.model.MiModelEntity
appendModelChangeHandler, appendModelEntity, appendModelRelation, appendPropertyChangeHandler, copy, copy, createModelEntity, createModelRelation, deepCopy, deepCopy, deleteSelf, dispatchModelChangeEvent, dispatchPropertyChange, dispatchPropertyChangeEvent, dump, dump, equals, equalsProperties, getChild, getChildren, getDefaultPropertyValue, getEditingPermissions, getIgnoreCase, getIndexOfModelEntity, getLocation, getModelChangeHandler, getModelEntities, getModelEntity, getModelEntity, getModelRelations, getNumberOfModelChangeHandlers, getNumberOfModelEntities, getNumberOfPropertyChangeHandlers, getParent, getPropertiesAreOrdered, getPropertyChangeHandler, getPropertyNames, getTitle, getType, getUserData, hasUserData, insertModelEntity, insertModelRelation, isObservedProperty, isToCopyEntitysRelationsWhenDeepCopyEntity, processAction, removeAllModelEntities, removeAllModelRelations, removeAllProperties, removeModelChangeHandler, removeModelEntity, removeModelRelation, removeProperty, removePropertyChangeHandler, removeSelf, replaceSelf, setIgnoreCase, setLocation, setModelChangeEventDispatchingEnabled, setParent, setPropertiesAreOrdered, setPropertiesToDefaultValues, setPropertyChangeEventDispatchingEnabled, setPropertyDescriptions, setTitle, setToCopyEntitysRelationsWhenDeepCopyEntity, setType, toString, toString, validateModelEntity, validateModelRelation, validatePropertyValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Mi_LAYER_ATTRIBUTES_RESOURCE_NAME

public static final java.lang.String Mi_LAYER_ATTRIBUTES_RESOURCE_NAME
See Also:
Constant Field Values

Mi_LAYER_NAME_NAME

public static final java.lang.String Mi_LAYER_NAME_NAME
See Also:
Constant Field Values

Mi_LAYER_CURRENT_NAME

public static final java.lang.String Mi_LAYER_CURRENT_NAME
See Also:
Constant Field Values

Mi_LAYER_SNAP_TO_ABLE_NAME

public static final java.lang.String Mi_LAYER_SNAP_TO_ABLE_NAME
See Also:
Constant Field Values

Mi_LAYER_CONNECT_TO_ABLE_NAME

public static final java.lang.String Mi_LAYER_CONNECT_TO_ABLE_NAME
See Also:
Constant Field Values

Mi_LAYER_VISIBLE_NAME

public static final java.lang.String Mi_LAYER_VISIBLE_NAME
See Also:
Constant Field Values

Mi_LAYER_PRINTABLE_NAME

public static final java.lang.String Mi_LAYER_PRINTABLE_NAME
See Also:
Constant Field Values

Mi_LAYER_OVERRIDE_SHAPE_COLORS_NAME

public static final java.lang.String Mi_LAYER_OVERRIDE_SHAPE_COLORS_NAME
See Also:
Constant Field Values

Mi_LAYER_NUMBER_OF_SHAPES_NAME

public static final java.lang.String Mi_LAYER_NUMBER_OF_SHAPES_NAME
See Also:
Constant Field Values

Mi_LAYER_BACKGROUND_COLOR_NAME

public static final java.lang.String Mi_LAYER_BACKGROUND_COLOR_NAME
See Also:
Constant Field Values

Mi_LAYER_SHAPE_COLOR_NAME

public static final java.lang.String Mi_LAYER_SHAPE_COLOR_NAME
See Also:
Constant Field Values

Mi_LAYER_OVERRIDE_SHAPE_COLORS_NAME_NSP

public static final java.lang.String Mi_LAYER_OVERRIDE_SHAPE_COLORS_NAME_NSP
See Also:
Constant Field Values

Mi_LAYER_NUMBER_OF_SHAPES_NAME_NSP

public static final java.lang.String Mi_LAYER_NUMBER_OF_SHAPES_NAME_NSP
See Also:
Constant Field Values

Mi_LAYER_BACKGROUND_COLOR_NAME_NSP

public static final java.lang.String Mi_LAYER_BACKGROUND_COLOR_NAME_NSP
See Also:
Constant Field Values

Mi_LAYER_SHAPE_COLOR_NAME_NSP

public static final java.lang.String Mi_LAYER_SHAPE_COLOR_NAME_NSP
See Also:
Constant Field Values

Mi_LAYER_EDITABILITY_NAME

public static final java.lang.String Mi_LAYER_EDITABILITY_NAME
See Also:
Constant Field Values

Mi_LAYER_LOCKED_NAME

public static final java.lang.String Mi_LAYER_LOCKED_NAME
See Also:
Constant Field Values

Mi_LAYER_ALWAYS_EDITABLE_NAME

public static final java.lang.String Mi_LAYER_ALWAYS_EDITABLE_NAME
See Also:
Constant Field Values

Mi_LAYER_NEVER_EDITABLE_NAME

public static final java.lang.String Mi_LAYER_NEVER_EDITABLE_NAME
See Also:
Constant Field Values

Mi_LAYER_EDITABLE_WHEN_CURRENT_NAME

public static final java.lang.String Mi_LAYER_EDITABLE_WHEN_CURRENT_NAME
See Also:
Constant Field Values

Mi_EDITABLE_COMMAND_NAME

public static final java.lang.String Mi_EDITABLE_COMMAND_NAME
See Also:
Constant Field Values

Mi_NOT_EDITABLE_COMMAND_NAME

public static final java.lang.String Mi_NOT_EDITABLE_COMMAND_NAME
See Also:
Constant Field Values

Mi_PRINTABLE_COMMAND_NAME

public static final java.lang.String Mi_PRINTABLE_COMMAND_NAME
See Also:
Constant Field Values

Mi_NOT_PRINTABLE_COMMAND_NAME

public static final java.lang.String Mi_NOT_PRINTABLE_COMMAND_NAME
See Also:
Constant Field Values

Mi_CONNECT_TO_ABLE_COMMAND_NAME

public static final java.lang.String Mi_CONNECT_TO_ABLE_COMMAND_NAME
See Also:
Constant Field Values

Mi_NOT_CONNECT_TO_ABLE_COMMAND_NAME

public static final java.lang.String Mi_NOT_CONNECT_TO_ABLE_COMMAND_NAME
See Also:
Constant Field Values

Mi_SNAP_TO_ABLE_COMMAND_NAME

public static final java.lang.String Mi_SNAP_TO_ABLE_COMMAND_NAME
See Also:
Constant Field Values

Mi_NOT_SNAP_TO_ABLE_COMMAND_NAME

public static final java.lang.String Mi_NOT_SNAP_TO_ABLE_COMMAND_NAME
See Also:
Constant Field Values

Mi_ADD_NEW_LAYER_BEHIND_COMMAND_NAME

public static final java.lang.String Mi_ADD_NEW_LAYER_BEHIND_COMMAND_NAME
See Also:
Constant Field Values

Mi_ADD_NEW_LAYER_INFRONT_COMMAND_NAME

public static final java.lang.String Mi_ADD_NEW_LAYER_INFRONT_COMMAND_NAME
See Also:
Constant Field Values

Mi_LAYER_LOCKED

public static final com.swfm.mica.editors.MiLayerEditability Mi_LAYER_LOCKED

Mi_LAYER_ALWAYS_EDITABLE

public static final com.swfm.mica.editors.MiLayerEditability Mi_LAYER_ALWAYS_EDITABLE

Mi_LAYER_EDITABLE_WHEN_CURRENT

public static final com.swfm.mica.editors.MiLayerEditability Mi_LAYER_EDITABLE_WHEN_CURRENT

Mi_LAYER_NEVER_EDITABLE

public static final com.swfm.mica.editors.MiLayerEditability Mi_LAYER_NEVER_EDITABLE
Constructor Detail

MiLayerAttributes

public MiLayerAttributes()

MiLayerAttributes

public MiLayerAttributes(MiPart layer)
Method Detail

getLayer

public MiPart getLayer()

setName

public void setName(java.lang.String name)
Specified by:
setName in interface MiiModelEntity
Overrides:
setName in class MiModelEntity

getName

public java.lang.String getName()
Specified by:
getName in interface MiiModelEntity
Overrides:
getName in class MiModelEntity

setCanBeCurrent

public void setCanBeCurrent(boolean flag)

getCanBeCurrent

public boolean getCanBeCurrent()

setCurrent

public void setCurrent(boolean flag)

isCurrent

public boolean isCurrent()

setSnapToAble

public void setSnapToAble(boolean flag)

isSnapToAble

public boolean isSnapToAble()

setConnectToAble

public void setConnectToAble(boolean flag)

isConnectToAble

public boolean isConnectToAble()

setVisible

public void setVisible(boolean flag)

isVisible

public boolean isVisible()

setPrintable

public void setPrintable(boolean flag)

isPrintable

public boolean isPrintable()

setOverrideShapeColors

public void setOverrideShapeColors(boolean flag)

getOverrideShapeColors

public boolean getOverrideShapeColors()

setShapeColor

public void setShapeColor(java.awt.Color c)

getShapeColor

public java.awt.Color getShapeColor()

setBackgroundColor

public void setBackgroundColor(java.awt.Color c)

getBackgroundColor

public java.awt.Color getBackgroundColor()

setEditability

public void setEditability(com.swfm.mica.editors.MiLayerEditability e)

getEditability

public com.swfm.mica.editors.MiLayerEditability getEditability()

setEditable

public void setEditable(boolean flag)

isEditable

public boolean isEditable()

setDeletable

public void setDeletable(boolean flag)

updateCommandManagerState

public void updateCommandManagerState()

getNumberOfShapes

public int getNumberOfShapes()

setPropertyValue

public void setPropertyValue(java.lang.String name,
                             java.lang.String value)
Sets the property with the given name to the given value.

Specified by:
setPropertyValue in interface MiiModelEntity
Overrides:
setPropertyValue in class MiModelEntity
Parameters:
name - the name of an property
value - the value of the property

getPropertyValue

public java.lang.String getPropertyValue(java.lang.String name)
Gets the textual value of the property with the given name. If the value is null then MiiTypes.Mi_NULL_VALUE_NAME is returned.

Specified by:
getPropertyValue in interface MiiModelEntity
Overrides:
getPropertyValue in class MiModelEntity
Parameters:
name - the name of a property
Returns:
the string value of the property

getPropertyDescriptions

public MiPropertyDescriptions getPropertyDescriptions()
Gets the descriptions of all of the properties. These can be used to see if an property is different from the default value or if a proposed value is valid or to get a list of all of the valid values of a property.

Specified by:
getPropertyDescriptions in interface MiiModelEntity
Overrides:
getPropertyDescriptions in class MiModelEntity
Returns:
the list of property descriptions

processCommand

public void processCommand(java.lang.String cmd)
Description copied from interface: MiiCommandHandler
Processes the given command.

Specified by:
processCommand in interface MiiCommandHandler

registerCommandDependentWidget

public void registerCommandDependentWidget(MiPart widget,
                                           java.lang.String cmd)
Registers the given widget and the command it generates. This permits (de)sensitization of the widget by the setCommandSensitivity method.

Specified by:
registerCommandDependentWidget in interface MiiCommandManager
Parameters:
widget - the widget that generates the command
cmd - the command
See Also:
processCommand(java.lang.String)

unRegisterWidgetGeneratedCommand

public void unRegisterWidgetGeneratedCommand(MiPart widget,
                                             java.lang.String cmd)
UnRegisters the given widget and the command it generates. Either the given widget or the given command may be null.

Specified by:
unRegisterWidgetGeneratedCommand in interface MiiCommandManager
Parameters:
widget - the widget that generates the command
cmd - the command
See Also:
processCommand(java.lang.String)

setCommandVisibility

public void setCommandVisibility(java.lang.String command,
                                 boolean flag)
Sets whether the given command is to be visible to the user. This method typically (hides)shows the widgets that have been associated with the command.

Specified by:
setCommandVisibility in interface MiiCommandManager
Parameters:
command - the command
flag - true if the user can now see the command (whether sensitive or not)
See Also:
registerCommandDependentWidget(com.swfm.mica.core.MiPart, java.lang.String), processCommand(java.lang.String)

setCommandSensitivity

public void setCommandSensitivity(java.lang.String command,
                                  boolean flag)
Sets whether the given command can be processed at this time. Otherwise, possibly based on the current state of the application, the given command cannot/should not be processed at this time. This method typically (de)sensitizes the widgets that have been associated with the command (see registerCommandDependentWidget).

Specified by:
setCommandSensitivity in interface MiiCommandManager
Parameters:
command - the command
flag - true if the system can now process the command
See Also:
registerCommandDependentWidget(com.swfm.mica.core.MiPart, java.lang.String), processCommand(java.lang.String)

setCommandSensitivity

public void setCommandSensitivity(java.lang.String command,
                                  boolean flag,
                                  java.lang.String statusHelpMsg)
Sets whether the given command can be processed at this time. Otherwise, possibly based on the current state of the application, the given command cannot/should not be processed at this time. This method typically (de)sensitizes the widgets that have been associated with the command (see registerCommandDependentWidget). This method is designed to display a status bar message that describes why a particular widget is desensitized.

Specified by:
setCommandSensitivity in interface MiiCommandManager
Parameters:
command - the command
flag - true if the system can now process the command
statusHelpMsg - the new status bar message
See Also:
registerCommandDependentWidget(com.swfm.mica.core.MiPart, java.lang.String), processCommand(java.lang.String)

setCommandState

public void setCommandState(java.lang.String command,
                            boolean flag)
Sets the state of the boolean widget that generates the given command. This is used for initializing toggle buttons.

Specified by:
setCommandState in interface MiiCommandManager
Parameters:
command - the command
flag - true if the two state widget is to be 'set'.

setCommandState

public void setCommandState(java.lang.String command,
                            java.lang.String state)
Sets the state of the multi-state widget that generates the given command. This is used for initializing widgets like combo boxes and lists.

Specified by:
setCommandState in interface MiiCommandManager
Parameters:
command - the command
state - the current state, one of many.

setCommandLabel

public void setCommandLabel(java.lang.String command,
                            java.lang.String label)
Sets the label of the widget that generates the given command. This is used for initializing widgets like labels and menubar buttons, push button etc.

Specified by:
setCommandLabel in interface MiiCommandManager
Parameters:
command - the command
label - the new label

setCommandOptions

public void setCommandOptions(java.lang.String command,
                              Strings options)
Sets the values of the multi-state widget that generates the given command. This is used for setting the possible values of widgets like combo boxes and lists.

Specified by:
setCommandOptions in interface MiiCommandManager
Parameters:
command - the command
options - the new contents of the widget

setCommandPropertyValue

public void setCommandPropertyValue(java.lang.String command,
                                    java.lang.String propertyName,
                                    java.lang.String propertyValue)
Sets the given property to the given value for all parts that generates the given command. This is used for, say, changing the status help message on a widget that may only be situationally and temporarily desensitized.

Specified by:
setCommandPropertyValue in interface MiiCommandManager
Parameters:
command - the command
propertyName - the property name
propertyValue - the value