Class RMEditorProxGuide


  • public class RMEditorProxGuide
    extends java.lang.Object
    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 Detail

      • RMEditorProxGuide

        public RMEditorProxGuide()
    • Method Detail

      • 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

        public static void clearGuidelines​(RMEditor anEditor)
        Empties the guideline list and marks the old guideline region for repaint
      • markGuidelinesDirty

        public static void markGuidelinesDirty​(RMEditor anEditor)
        Runs through the guideline list and asks the editor to repaint the enclosing rect.
      • paintProximityGuides

        public static void paintProximityGuides​(RMEditor anEditor,
                                                java.awt.Graphics2D g)
        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

        public static java.util.List<RMShape> getCandidateShapes​(RMEditor anEditor)
        Returns the list of shapes to be included in the proximity check.
      • createGuidelines

        public static void createGuidelines​(RMEditor anEditor)
        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,
                                            java.util.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

        public static RMPoint pointSnappedToProximityGuides​(RMEditor anEditor,
                                                            RMPoint aPoint)
        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.