Class DefaultFigureCollection

    • Constructor Detail

      • DefaultFigureCollection

        public DefaultFigureCollection()
      • DefaultFigureCollection

        public DefaultFigureCollection​(Figure[] figures)
    • Method Detail

      • isSelected

        public boolean isSelected()
        Description copied from interface: Figure
        Tests if the figure is selected.
        Specified by:
        isSelected in interface Figure
        Overrides:
        isSelected in class AbstractFigure
        Returns:
        true, if so.
      • setSelected

        public void setSelected​(boolean selected)
        Description copied from interface: Figure
        Sets the selected state.
        Specified by:
        setSelected in interface Figure
        Overrides:
        setSelected in class AbstractFigure
        Parameters:
        selected - The selected state.
      • isCollection

        public boolean isCollection()
        Description copied from interface: Figure
        Tests if this figure is a figure collection.
        Specified by:
        isCollection in interface Figure
        Returns:
        true, if so.
      • dispose

        public void dispose()
        Description copied from interface: Figure
        Disposes this figure. Indicates that it will no longer be used.
        Specified by:
        dispose in interface Figure
        Overrides:
        dispose in class AbstractFigure
      • createHandles

        public Handle[] createHandles​(int selectionStage)
        Description copied from class: AbstractFigure
        The default implementation returns an empty array. Clients should override in order to create an array of handles suitable for the given selection stage.
        Specified by:
        createHandles in interface Figure
        Overrides:
        createHandles in class AbstractFigure
        Parameters:
        selectionStage - The selection stage. 1 <= selectionLevel <= AbstractFigure.getMaxSelectionStage()
        Returns:
        The array of handles.
      • isCloseTo

        public boolean isCloseTo​(Point2D point,
                                 AffineTransform m2v)
        Description copied from interface: Figure
        Tests if the given point is "close to" this figure.
        Specified by:
        isCloseTo in interface Figure
        Parameters:
        point - Point in model coordinates.
        m2v - Current model-to-view transformation.
        Returns:
        true, if the point is close to this figure.
      • contains

        public boolean contains​(Figure figure)
        Description copied from class: AbstractFigure
        The default implementation returns false.
        Specified by:
        contains in interface Figure
        Overrides:
        contains in class AbstractFigure
        Parameters:
        figure - A figure.
        Returns:
        Always false.
      • getFigure

        public Figure getFigure​(int index)
        Description copied from class: AbstractFigure
        The default implementation throws an [@code IllegalStateException}.
        Specified by:
        getFigure in interface Figure
        Overrides:
        getFigure in class AbstractFigure
        Parameters:
        index - The child index.
        Returns:
        Does never return normally.
      • getFigures

        public Figure[] getFigures​(Shape shape)
        Description copied from class: AbstractFigure
        The default implementation returns an empty array.
        Specified by:
        getFigures in interface Figure
        Overrides:
        getFigures in class AbstractFigure
        Parameters:
        shape - The shape defining the area in which the figures must be contained.
        Returns:
        Always an empty array.
      • addFigureImpl

        protected boolean addFigureImpl​(int index,
                                        Figure figure)
        Description copied from class: AbstractFigure
        The default implementation throws an [@code IllegalStateException}.
        Overrides:
        addFigureImpl in class AbstractFigure
        Parameters:
        index - The index.
        figure - The figure.
        Returns:
        Does never return normally.
      • removeFigureImpl

        protected boolean removeFigureImpl​(Figure figure)
        Description copied from class: AbstractFigure
        The default implementation throws an [@code IllegalStateException}.
        Overrides:
        removeFigureImpl in class AbstractFigure
        Parameters:
        figure - The figure.
        Returns:
        Does never return normally.
      • getBounds

        public Rectangle2D getBounds()
        Specified by:
        getBounds in interface Figure
        Returns:
        The figure bounds in model coordinates.
      • move

        public void move​(double dx,
                         double dy)
        Description copied from interface: Figure
        Moves the figure by the given delta in model coordinates.
        Specified by:
        move in interface Figure
        Overrides:
        move in class AbstractFigure
        Parameters:
        dx - Delta X in model coordinates.
        dy - Delta Y in model coordinates.
      • scale

        public void scale​(Point2D refPoint,
                          double sx,
                          double sy)
        Description copied from interface: Figure
        Scales the figure by the given scale factors.
        Specified by:
        scale in interface Figure
        Overrides:
        scale in class AbstractFigure
        Parameters:
        refPoint - The reference point in model coordinates.
        sx - Scale X factor.
        sy - Scale Y factor.
      • rotate

        public void rotate​(Point2D point,
                           double theta)
        Description copied from interface: Figure
        Rotates the figure by the given angle.
        Specified by:
        rotate in interface Figure
        Overrides:
        rotate in class AbstractFigure
        Parameters:
        point - The reference point in model coordinates.
        theta - The rotation angle in degree.
      • draw

        public void draw​(Rendering rendering)
        Description copied from interface: Figure
        Draws this figure using the given rendering.
        Specified by:
        draw in interface Figure
        Parameters:
        rendering - The rendering used to draw the figure.
      • setMemento

        public void setMemento​(Object memento)
        Description copied from class: AbstractFigure
        The default implementation does nothing. Clients should override in order to evaluate the passed in memento. object.
        Specified by:
        setMemento in interface Restorable
        Overrides:
        setMemento in class AbstractFigure
        Parameters:
        memento - A memento object.
      • computeBounds

        protected Rectangle2D computeBounds()