com.swfm.mica.editors
Class MiSnapManager

java.lang.Object
  extended bycom.swfm.mica.editors.MiSnapManager
All Implemented Interfaces:
MiiNames, MiiTypes

public class MiSnapManager
extends java.lang.Object
implements MiiTypes, MiiNames

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

Field Summary
static java.lang.String Mi_PART_SNAP_ONLY_TO_MAJOR_GRID_RESOURCE
           
static java.lang.String Mi_PART_SPECIFIC_SNAP_GRID_SIZE_OVERRIDE_RESOURCE
           
     
Constructor Summary
MiSnapManager()
           
 
Method Summary
 void _setTargetEditor(MiEditor editor)
           
 void addGuide(com.swfm.mica.editors.MiGuide guide)
           
 void addGuidePoint(com.swfm.mica.editors.MiGuidePoint guidePoint)
           
 boolean applyHorizontalAdjustment(MiPoint point)
           
 boolean applyVerticalAdjustment(MiPoint point)
           
 boolean getApplySnapToDefaultSnapLocationsIfPartHasNoSnapMananger()
           
 MiDrawingGrid getGrid()
           
 boolean getKeepShapesWithinPageBounds()
           
 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.
 boolean getSnapTranslation(MiPart part, MiVector initialTranslation)
           
 boolean isEnabled()
           
 boolean isJustSnappingToMajorGrid()
           
 void setApplySnapToDefaultSnapLocationsIfPartHasNoSnapMananger(boolean flag)
           
 void setEnabled(boolean flag)
           
 void setGrid(MiDrawingGrid grid)
           
 void setHorizontalRuler(MiRuler ruler)
           
 void setJustSnappingToMajorGrid(boolean flag)
          otherwise snap to minor/finest grid
 void setKeepShapesWithinPageBounds(boolean flag)
           
 void setPropertyValue(java.lang.String name, java.lang.String value)
          Sets the property with the given name to the given value.
 void setVerticalRuler(MiRuler ruler)
           
 boolean snap(MiPart part)
           
 boolean snap(MiPoint point)
           
 boolean snap(MiPoint point, boolean snapToMajorGrid)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Mi_PART_SPECIFIC_SNAP_GRID_SIZE_OVERRIDE_RESOURCE

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

Mi_PART_SNAP_ONLY_TO_MAJOR_GRID_RESOURCE

public static final java.lang.String Mi_PART_SNAP_ONLY_TO_MAJOR_GRID_RESOURCE
See Also:
Constant Field Values
Constructor Detail

MiSnapManager

public MiSnapManager()
Method Detail

setEnabled

public void setEnabled(boolean flag)

isEnabled

public boolean isEnabled()

setJustSnappingToMajorGrid

public void setJustSnappingToMajorGrid(boolean flag)
otherwise snap to minor/finest grid


isJustSnappingToMajorGrid

public boolean isJustSnappingToMajorGrid()

setApplySnapToDefaultSnapLocationsIfPartHasNoSnapMananger

public void setApplySnapToDefaultSnapLocationsIfPartHasNoSnapMananger(boolean flag)

getApplySnapToDefaultSnapLocationsIfPartHasNoSnapMananger

public boolean getApplySnapToDefaultSnapLocationsIfPartHasNoSnapMananger()

setKeepShapesWithinPageBounds

public void setKeepShapesWithinPageBounds(boolean flag)

getKeepShapesWithinPageBounds

public boolean getKeepShapesWithinPageBounds()

_setTargetEditor

public void _setTargetEditor(MiEditor editor)

addGuidePoint

public void addGuidePoint(com.swfm.mica.editors.MiGuidePoint guidePoint)

addGuide

public void addGuide(com.swfm.mica.editors.MiGuide guide)

setGrid

public void setGrid(MiDrawingGrid grid)

getGrid

public MiDrawingGrid getGrid()

setHorizontalRuler

public void setHorizontalRuler(MiRuler ruler)

setVerticalRuler

public void setVerticalRuler(MiRuler ruler)

applyHorizontalAdjustment

public boolean applyHorizontalAdjustment(MiPoint point)

applyVerticalAdjustment

public boolean applyVerticalAdjustment(MiPoint point)

snap

public boolean snap(MiPoint point)

snap

public boolean snap(MiPoint point,
                    boolean snapToMajorGrid)

snap

public boolean snap(MiPart part)

getSnapTranslation

public boolean getSnapTranslation(MiPart part,
                                  MiVector initialTranslation)

setPropertyValue

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

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.

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.

Returns:
the list of property descriptions