com.swfm.mica.widgets
Class MiChangeAttributesSelectionGraphics

java.lang.Object
  extended bycom.swfm.mica.widgets.MiChangeAttributesSelectionGraphics
All Implemented Interfaces:
MiiSelectionGraphics, MiiTypes

public class MiChangeAttributesSelectionGraphics
extends java.lang.Object
implements MiiSelectionGraphics, MiiTypes

This class implements the MiiSelectionGraphics interface. As such it is responsible for the making the appearance of a graphics part when the part is 'selected' different from when it is 'not selected'.

This class implements the MiiSelectionGraphics interface. This implementation changes the attributes of the selected parts. By default this sets the fore and background colors of the selected part unless the part is text, in which case just the foreground color is changed. The default color is 'red'.

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

Field Summary
     
Constructor Summary
MiChangeAttributesSelectionGraphics()
          Constructs a new MiBoxSelectionGraphics.
 
Method Summary
 boolean getApplyToAttachments()
          Get whether to apply the attributes to attachments of selected items.
 boolean getApplyToSelectedItems()
          Get whether to apply the attributes to the actual selected items.
 boolean getApplyToSelectedItemsParts()
          Get whether to apply the attributes to parts of selected items.
 MiAttributes getAttributes()
          Get the attributes used to apply to selected parts.
 MiAttributes getTextAttributes()
          Get the attributes used to apply to selected text items
 void select(MiEditor editor, MiPart obj, boolean flag)
          This method tells this selection graphics appearance manager whether the given part in the given editor is selected.
 void select(MiEditor editor, MiPart obj, boolean flag, boolean inAttachment)
           
 void setApplyToAttachments(boolean flag)
          Sets whether to apply the attributes to attachments of selected items.
 void setApplyToSelectedItems(boolean flag)
          Sets whether to apply the attributes to the actual selected items.
 void setApplyToSelectedItemsParts(boolean flag)
          Sets whether to apply the attributes to parts of selected items.
 void setAttributes(MiAttributes attributes)
          Set the attributes used to apply to selected parts.
 void setTextAttributes(MiAttributes attributes)
          Set the attributes used to apply to selected text items.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MiChangeAttributesSelectionGraphics

public MiChangeAttributesSelectionGraphics()
Constructs a new MiBoxSelectionGraphics.

Method Detail

setAttributes

public void setAttributes(MiAttributes attributes)
Set the attributes used to apply to selected parts.

Parameters:
attributes - the attributes

getAttributes

public MiAttributes getAttributes()
Get the attributes used to apply to selected parts.

Returns:
the attributes

setTextAttributes

public void setTextAttributes(MiAttributes attributes)
Set the attributes used to apply to selected text items.

Parameters:
attributes - the attributes

getTextAttributes

public MiAttributes getTextAttributes()
Get the attributes used to apply to selected text items

Returns:
the attributes

setApplyToSelectedItems

public void setApplyToSelectedItems(boolean flag)
Sets whether to apply the attributes to the actual selected items. True by default.


getApplyToSelectedItems

public boolean getApplyToSelectedItems()
Get whether to apply the attributes to the actual selected items.

Returns:
true if applied to items

setApplyToAttachments

public void setApplyToAttachments(boolean flag)
Sets whether to apply the attributes to attachments of selected items. True by default.


getApplyToAttachments

public boolean getApplyToAttachments()
Get whether to apply the attributes to attachments of selected items.

Returns:
true if applied to attachments

setApplyToSelectedItemsParts

public void setApplyToSelectedItemsParts(boolean flag)
Sets whether to apply the attributes to parts of selected items. False by default.


getApplyToSelectedItemsParts

public boolean getApplyToSelectedItemsParts()
Get whether to apply the attributes to parts of selected items.

Returns:
true if applied to parts

select

public void select(MiEditor editor,
                   MiPart obj,
                   boolean flag)
This method tells this selection graphics appearance manager whether the given part in the given editor is selected. This implementation draws a rectangle around the selected part unless the part is a line, in which case the line is rendered with a change of the line borderLook attribute.

Specified by:
select in interface MiiSelectionGraphics
Parameters:
editor - the editor
flag - true if the part is now selected.
obj - the part whose selection state has changed.

select

public void select(MiEditor editor,
                   MiPart obj,
                   boolean flag,
                   boolean inAttachment)