Documentation of 'org.jhotdraw.draw.QuadTreeDrawing' Java class
QuadTreeDrawing
org.jhotdraw.draw

Class QuadTreeDrawing

    • Constructor Detail

      • QuadTreeDrawing

        public QuadTreeDrawing()
    • Method Detail

      • indexOf

        public int indexOf(Figure figure)
        Description copied from interface: CompositeFigure
        Returns the index of the specified child.

        This is a convenience method for calling getChildren().indexOf(index);.

        Specified by:
        indexOf in interface CompositeFigure
        Overrides:
        indexOf in class AbstractCompositeFigure
        Returns:
        The index of the child, or -1 if the specified figure is not a child of this CompositeFigure.
      • basicAdd

        public void basicAdd(int index,
                             Figure figure)
        Description copied from interface: CompositeFigure
        Adds a child to the figure at the specified index without firing events.

        This method can be used to reinsert a child figure which has been temporarily removed from this CompositeFigure (for example to reorder the sequence of the children) and to efficiently build a drawing from an InputFormat.

        Specified by:
        basicAdd in interface CompositeFigure
        Specified by:
        basicAdd in interface Drawing
        Overrides:
        basicAdd in class AbstractCompositeFigure
        figure - that is part of the drawing and should be removed
        See Also:
        Drawing.basicRemove(Figure)
      • basicRemoveChild

        public Figure basicRemoveChild(int index)
        Description copied from interface: CompositeFigure
        Removes the child at the specified index without firing events.

        This method can be used to temporarily remove a child from this CompositeFigure (for example to reorder the sequence of the children).

        Returns the removed child figure.

        Specified by:
        basicRemoveChild in interface CompositeFigure
        Overrides:
        basicRemoveChild in class AbstractCompositeFigure
      • draw

        public void draw(java.awt.Graphics2D g)
        Description copied from interface: Figure
        Draws the figure.
        Specified by:
        draw in interface Figure
        Overrides:
        draw in class AbstractCompositeFigure
        Parameters:
        g - The Graphics2D to draw to.
      • sort

        public java.util.List<Figure> sort(java.util.Collection<? extends Figure> c)
        Implementation note: Sorting can not be done for orphaned children.
      • draw

        public void draw(java.awt.Graphics2D g,
                         java.util.Collection<Figure> c)
      • getChildren

        public java.util.List<Figure> getChildren(java.awt.geom.Rectangle2D.Double bounds)
      • findFigureInside

        public Figure findFigureInside(java.awt.geom.Point2D.Double p)
        Description copied from interface: Figure
        Finds the innermost figure at the specified location.

        In case of a CompositeFigure, this method descends into its children and into its children's children until the innermost figure is found.

        This functionality is implemented using the Chain of Responsibility design pattern. A figure which is not composed of other figures returns itself if the point is contained by the figure. Composed figures pass the method call down to their children.

        Specified by:
        findFigureInside in interface Drawing
        Specified by:
        findFigureInside in interface Figure
        Overrides:
        findFigureInside in class AbstractCompositeFigure
        Parameters:
        p - A location on the drawing.
        Returns:
        Returns the innermost figure at the location, or null if the location is not contained in a figure.
      • getFiguresFrontToBack

        public java.util.List<Figure> getFiguresFrontToBack()
        Returns an iterator to iterate in Z-order front to back over the children.
      • findFigure

        public Figure findFigure(java.awt.geom.Point2D.Double p)
        Description copied from interface: Drawing
        Finds a top level Figure. Use this call for hit detection that should not descend into children of composite figures.

        Use Drawing.findFigureInside(java.awt.geom.Point2D.Double) If you need to descend into children of composite figures.

      • findFigureExcept

        public Figure findFigureExcept(java.awt.geom.Point2D.Double p,
                                       Figure ignore)
        Description copied from interface: Drawing
        Finds a top level Figure. Use this call for hit detection that should not descend into the figure's children.
      • findFigureExcept

        public Figure findFigureExcept(java.awt.geom.Point2D.Double p,
                                       java.util.Collection<? extends Figure> ignore)
        Description copied from interface: Drawing
        Finds a top level Figure. Use this call for hit detection that should not descend into the figure's children.
      • findFigureBehind

        public Figure findFigureBehind(java.awt.geom.Point2D.Double p,
                                       Figure figure)
        Description copied from interface: Drawing
        Finds a top level Figure which is behind the specified Figure.
      • findFigureBehind

        public Figure findFigureBehind(java.awt.geom.Point2D.Double p,
                                       java.util.Collection<? extends Figure> children)
        Description copied from interface: Drawing
        Finds a top level Figure which is behind the specified Figures.
      • findFigures

        public java.util.List<Figure> findFigures(java.awt.geom.Rectangle2D.Double r)
        Description copied from interface: Drawing
        Returns all figures that lie within or intersect the specified bounds. The figures are returned in Z-order from back to front.
      • findFiguresWithin

        public java.util.List<Figure> findFiguresWithin(java.awt.geom.Rectangle2D.Double bounds)
        Description copied from interface: Drawing
        Returns all figures that lie within the specified bounds. The figures are returned in Z-order from back to front.
      • clone

        public QuadTreeDrawing clone()
        Description copied from interface: Figure
        Returns a clone of the figure, with clones of all aggregated figures, such as children and decorators. The cloned figure does not clone the list of FigureListeners from its original.
        Specified by:
        clone in interface Figure
        Overrides:
        clone in class AbstractDrawing
      • drawCanvas

        public void drawCanvas(java.awt.Graphics2D g)
        Description copied from interface: Drawing
        Draws on the canvas area. The canvas is the background area onto which the drawing is drawn.

        By convention this method is only invoked by DrawingView.

        AttributeKeys defines a number of attribute keys which can be used to determine what to draw on the canvas.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.