Documentation of 'CH.ifa.draw.standard.AbstractFigure' Java class
AbstractFigure
CH.ifa.draw.standard

Class AbstractFigure

    • Method Detail

      • moveBy

        public void moveBy(int dx,
                           int dy)
        Moves the figure by the given offset.
        Specified by:
        moveBy in interface Figure
      • displayBox

        public void displayBox(java.awt.Point origin,
                               java.awt.Point corner)
        Changes the display box of a figure. Clients usually call this method. It changes the display box and announces the corresponding change.
        Specified by:
        displayBox in interface Figure
        Parameters:
        origin - the new origin
        corner - the new corner
        See Also:
        displayBox(java.awt.Point, java.awt.Point)
      • basicDisplayBox

        public abstract void basicDisplayBox(java.awt.Point origin,
                                             java.awt.Point corner)
        Sets the display box of a figure. This is the method that subclassers override. Clients usually call displayBox.
        Specified by:
        basicDisplayBox in interface Figure
        Parameters:
        origin - the new origin
        corner - the new corner
        See Also:
        displayBox(java.awt.Point, java.awt.Point)
      • handles

        public abstract java.util.Vector handles()
        Returns the handles of a Figure that can be used to manipulate some of its attributes.
        Specified by:
        handles in interface Figure
        Returns:
        a Vector of handles
        See Also:
        Handle
      • size

        public java.awt.Dimension size()
        Gets the size of the figure. A convenience method.
        Specified by:
        size in interface Figure
      • isEmpty

        public boolean isEmpty()
        Checks if the figure is empty. The default implementation returns true if the width or height of its display box is < 3
        Specified by:
        isEmpty in interface Figure
        See Also:
        Figure.isEmpty()
      • findFigureInside

        public Figure findFigureInside(int x,
                                       int y)
        Returns the figure that contains the given point. In contrast to containsPoint it returns its innermost figure that contains the point.
        Specified by:
        findFigureInside in interface Figure
        See Also:
        containsPoint(int, int)
      • containsPoint

        public boolean containsPoint(int x,
                                     int y)
        Checks if a point is inside the figure.
        Specified by:
        containsPoint in interface Figure
      • includes

        public boolean includes(Figure figure)
        Checks whether the given figure is contained in this figure.
        Specified by:
        includes in interface Figure
      • decompose

        public FigureEnumeration decompose()
        Decomposes a figure into its parts. It returns a Vector that contains itself.
        Specified by:
        decompose in interface Figure
        Returns:
        an Enumeration for a Vector with itself as the only element.
      • addToContainer

        public void addToContainer(FigureChangeListener c)
        Sets the Figure's container and registers the container as a figure change listener. A figure's container can be any kind of FigureChangeListener. A figure is not restricted to have a single container.
        Specified by:
        addToContainer in interface Figure
      • release

        public void release()
        A figure is released from the drawing. You never call this method directly. Release notifies its listeners.
        Specified by:
        release in interface Figure
        See Also:
        Figure.release()
      • invalidate

        public void invalidate()
        Invalidates the figure. This method informs the listeners that the figure's current display box is invalid and should be refreshed.
        Specified by:
        invalidate in interface Figure
      • willChange

        public void willChange()
        Informes that a figure is about to change something that affects the contents of its display box.
        Specified by:
        willChange in interface Figure
        See Also:
        Figure.willChange()
      • center

        public java.awt.Point center()
        Gets the center of a figure. A convenice method that is rarely overridden.
        Specified by:
        center in interface Figure
      • canConnect

        public boolean canConnect()
        Checks if this figure can be connected. By default AbstractFigures can be connected.
        Specified by:
        canConnect in interface Figure
      • connectionInsets

        public java.awt.Insets connectionInsets()
        Returns the connection inset. The connection inset defines the area where the display box of a figure can't be connected. By default the entire display box can be connected.
        Specified by:
        connectionInsets in interface Figure
      • connectorAt

        public Connector connectorAt(int x,
                                     int y)
        Returns the Figures connector for the specified location. By default a ChopBoxConnector is returned.
        Specified by:
        connectorAt in interface Figure
        See Also:
        ChopBoxConnector
      • connectorVisibility

        public void connectorVisibility(boolean isVisible)
        Sets whether the connectors should be visible. By default they are not visible and
        Specified by:
        connectorVisibility in interface Figure
      • getAttribute

        public java.lang.Object getAttribute(java.lang.String name)
        Returns the named attribute or null if a a figure doesn't have an attribute. By default figures don't have any attributes getAttribute returns null.
        Specified by:
        getAttribute in interface Figure
      • setAttribute

        public void setAttribute(java.lang.String name,
                                 java.lang.Object value)
        Sets the named attribute to the new value. By default figures don't have any attributes and the request is ignored.
        Specified by:
        setAttribute in interface Figure
      • clone

        public java.lang.Object clone()
        Clones a figure. Creates a clone by using the storable mechanism to flatten the Figure to stream followed by resurrecting it from the same stream.
        Specified by:
        clone in interface Figure
        Overrides:
        clone in class java.lang.Object
        See Also:
        Figure.clone()
      • read

        public void read(StorableInput dr)
                  throws java.io.IOException
        Reads the Figure from a StorableInput.
        Specified by:
        read in interface Storable
        Throws:
        java.io.IOException

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.