com.swfm.mica.core
Class MiBoxSelectionGraphics

java.lang.Object
  extended bycom.swfm.mica.core.MiBoxSelectionGraphics
All Implemented Interfaces:
MiiSelectionGraphics, MiiTypes

public class MiBoxSelectionGraphics
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 implementation draws a rectangle around the selected part unless the part is a line, in which case the line is rendered with a change to the line borderLook attribute.

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

Field Summary
     
Constructor Summary
MiBoxSelectionGraphics()
          Constructs a new MiBoxSelectionGraphics.
 
Method Summary
 MiAttributes getAttributes()
          Get the attributes used for the box displayed around a selected part.
 MiMargins getMargins()
          Get the margins to use for the box displayed around a selected part.
 MiSize getMinimumBoxWidthAndHeight()
          Get the minimum width and height to use for the box displayed around a selected part.
 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 setAttributes(MiAttributes attributes)
          Set the attributes to use for the box displayed around a selected part.
 void setMargins(MiMargins margins)
          Set the margins to use for the box displayed around a selected part.
 void setMinimumBoxWidthAndHeight(MiSize size)
          Set the minimum width and height to use for the box displayed around a selected part.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MiBoxSelectionGraphics

public MiBoxSelectionGraphics()
Constructs a new MiBoxSelectionGraphics.

Method Detail

setAttributes

public void setAttributes(MiAttributes attributes)
Set the attributes to use for the box displayed around a selected part.

Parameters:
attributes - the attributes of the box

getAttributes

public MiAttributes getAttributes()
Get the attributes used for the box displayed around a selected part.

Returns:
the attributes of the box

setMargins

public void setMargins(MiMargins margins)
Set the margins to use for the box displayed around a selected part. This is the distance between the bounds of the selected part and the box.

Parameters:
margins - the margins around the part

getMargins

public MiMargins getMargins()
Get the margins to use for the box displayed around a selected part.

Returns:
the margins around the part

setMinimumBoxWidthAndHeight

public void setMinimumBoxWidthAndHeight(MiSize size)
Set the minimum width and height to use for the box displayed around a selected part. This is useful for selecting zero width or height parts when the margins are close to or equal to zero.

Parameters:
size - the min size of box around the part

getMinimumBoxWidthAndHeight

public MiSize getMinimumBoxWidthAndHeight()
Get the minimum width and height to use for the box displayed around a selected part. This is useful for selecting zero width or height parts when the margins are close to or equal to zero.

Returns:
the min size of box around the part

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.