Class RMEditorProxGuide
java.lang.Object
com.inductiveautomation.rm.editor.RMEditorProxGuide
This class offers some methods to provide "proximity guides" for RMEditor. This feature draws lines indicating when
dragged shapes share alignments with some of their neighboring shapes (and also snaps to these alignments, too).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
clearGuidelines
(RMEditor anEditor) Empties the guideline list and marks the old guideline region for repaintstatic void
createGuidelines
(RMEditor anEditor) Calculate guidelines for the bounds of the selected shapes against all other superselected shapes.static void
createGuidelines
(RMEditor anEditor, RMShape parent, RMRect bounds, List candidateShapes) Recalculates all the proximity guides and marks dirty region in editor for old & new guide regions.getCandidateShapes
(RMEditor anEditor) Returns the list of shapes to be included in the proximity check.static boolean
Returns whether proximity guides are enabled.static void
markGuidelinesDirty
(RMEditor anEditor) Runs through the guideline list and asks the editor to repaint the enclosing rect.static void
paintProximityGuides
(RMEditor anEditor, Graphics2D g) Called by the editor to paint all the guidelines in the guideline liststatic RMPoint
pointSnappedToProximityGuides
(RMEditor anEditor, RMPoint aPoint) Returns the given point snapped to relevant proximity guides.static RMPoint
pointSnappedToProximityGuides
(RMEditor anEditor, RMPoint aPoint, RMSelectTool.DragMode aDragMode) Returns the given point snapped to relevant proxity guides for a given drag mode.static void
setEnabled
(boolean aFlag) Sets whether proximity guides are enabled.static void
setIncludesSuperselectedShape
(boolean aFlag) If this flag is set, the bounds of the parent shape are also checked for proximity.
-
Constructor Details
-
RMEditorProxGuide
public RMEditorProxGuide()
-
-
Method Details
-
isEnabled
public static boolean isEnabled()Returns whether proximity guides are enabled. -
setEnabled
public static void setEnabled(boolean aFlag) Sets whether proximity guides are enabled. -
clearGuidelines
Empties the guideline list and marks the old guideline region for repaint -
markGuidelinesDirty
Runs through the guideline list and asks the editor to repaint the enclosing rect. -
paintProximityGuides
Called by the editor to paint all the guidelines in the guideline list -
setIncludesSuperselectedShape
public static void setIncludesSuperselectedShape(boolean aFlag) If this flag is set, the bounds of the parent shape are also checked for proximity. -
getCandidateShapes
Returns the list of shapes to be included in the proximity check. -
createGuidelines
Calculate guidelines for the bounds of the selected shapes against all other superselected shapes. -
createGuidelines
public static void createGuidelines(RMEditor anEditor, RMShape parent, RMRect bounds, List candidateShapes) Recalculates all the proximity guides and marks dirty region in editor for old & new guide regions. Guides are calculated between the bounds rectangle and each of the candidateShapes, within the parent RMShape. -
pointSnappedToProximityGuides
Returns the given point snapped to relevant proximity guides. -
pointSnappedToProximityGuides
public static RMPoint pointSnappedToProximityGuides(RMEditor anEditor, RMPoint aPoint, RMSelectTool.DragMode aDragMode) Returns the given point snapped to relevant proxity guides for a given drag mode.
-