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

Class LineConnectionFigure

    • Field Detail

      • LINER_PROPERTY

        public static final java.lang.String LINER_PROPERTY
        The name of the JaveBeans property liner.
        See Also:
        Constant Field Values
    • Constructor Detail

      • LineConnectionFigure

        public LineConnectionFigure()
        Creates a new instance.
    • Method Detail

      • createHandles

        public java.util.Collection<Handle> createHandles(int detailLevel)
        Gets the handles of the figure. It returns the normal PolylineHandles but adds ChangeConnectionHandles at the start and end.
        Specified by:
        createHandles in interface Figure
        Overrides:
        createHandles in class LineFigure
        Parameters:
        detailLevel - The detail level of the handles. Usually this is 0 for bounding box handles and 1 for point handles. The value -1 is used by the SelectAreaTracker and the HandleTracker to highlight figures, over which the mouse pointer is hovering.
        Returns:
        a Collection of handles
        See Also:
        Handle
      • setConnectable

        public void setConnectable(boolean newValue)
        ConnectionFigures cannot be connected and always sets connectable to false.
        Overrides:
        setConnectable in class AbstractFigure
      • updateConnection

        public void updateConnection()
        Description copied from interface: ConnectionFigure
        Updates the start and end point of the figure and fires figureChanged events.
        Specified by:
        updateConnection in interface ConnectionFigure
      • validate

        public void validate()
      • canConnect

        public boolean canConnect(Connector start,
                                  Connector end)
        Description copied from interface: ConnectionFigure
        Returns true, if this ConnectionFigure can connect the specified Connectors. Implement this method to constrain the allowed connections between figures.
        Specified by:
        canConnect in interface ConnectionFigure
      • getEndFigure

        public Figure getEndFigure()
        Description copied from interface: ConnectionFigure
        Gets the end figure of the connection. This is a convenience method for doing getEndConnector().getOwner() and handling null cases.
        Specified by:
        getEndFigure in interface ConnectionFigure
      • getStartFigure

        public Figure getStartFigure()
        Description copied from interface: ConnectionFigure
        Gets the start figure of the connection. This is a convenience method for doing getStartConnector().getOwner() and handling null cases.
        Specified by:
        getStartFigure in interface ConnectionFigure
      • setEndConnector

        public void setEndConnector(Connector newEnd)
        Description copied from interface: ConnectionFigure
        Sets the end Connector of the connection. Set this to null to disconnect the end connection.
        Specified by:
        setEndConnector in interface ConnectionFigure
        Parameters:
        newEnd - the end Connector of the connection
      • setStartConnector

        public void setStartConnector(Connector newStart)
        Description copied from interface: ConnectionFigure
        Sets the start Connector of the connection. Set this to null to disconnect the start connection.
        Specified by:
        setStartConnector in interface ConnectionFigure
        Parameters:
        newStart - the start Connector of the connection
      • clone

        public LineConnectionFigure 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 BezierFigure
      • remap

        public void remap(java.util.Map<Figure,Figure> oldToNew,
                          boolean disconnectIfNotInMap)
        Description copied from interface: Figure
        After cloning a collection of figures, the ConnectionFigures contained in this collection still connect to the original figures instead of to the clones. Using This operation and providing a map, which maps from the original collection of figures to the new collection, connections can be remapped to the new figures.
        Specified by:
        remap in interface Figure
        Overrides:
        remap in class AbstractFigure
      • canConnect

        public boolean canConnect(Connector start)
        Description copied from interface: ConnectionFigure
        Checks if this ConnectionFigure can be connect to the specified Connector. This is used to provide an early feedback to the user, when he/she creates a new connection.
        Specified by:
        canConnect in interface ConnectionFigure
      • handleMouseClick

        public boolean handleMouseClick(java.awt.geom.Point2D.Double p,
                                        java.awt.event.MouseEvent evt,
                                        DrawingView view)
        Handles a mouse click.
        Specified by:
        handleMouseClick in interface Figure
        Overrides:
        handleMouseClick in class LineFigure
        Parameters:
        p - The location of the mouse event.
        evt - The mouse event.
        view - The drawing view which is the source of the mouse event.
        Returns:
        Returns true, if the event was consumed.
      • setLiner

        public void setLiner(Liner newValue)
        Description copied from interface: ConnectionFigure
        Set a Liner object which encapsulated a lineout algorithm for this figure. Typically, a Liner accesses the child components of this figure and arranges their graphical presentation.
        Specified by:
        setLiner in interface ConnectionFigure
        Parameters:
        newValue - encapsulation of a lineout algorithm.
      • lineout

        public void lineout()
        Description copied from interface: ConnectionFigure
        A "lineout" algorithm is used to define how the child components should be laid out in relation to each other. The task for layouting the child components for presentation is delegated to a Liner which can be plugged in at runtime.
        Specified by:
        lineout in interface ConnectionFigure
      • getLiner

        public Liner getLiner()
        Description copied from interface: ConnectionFigure
        Get a Liner object which encapsulated a lineout algorithm for this figure. Typically, a Liner accesses the child components of this figure and arranges their graphical presentation.
        Specified by:
        getLiner in interface ConnectionFigure
        Returns:
        lineout strategy used by this figure
      • setStartPoint

        public void setStartPoint(java.awt.geom.Point2D.Double p)
        Description copied from class: BezierFigure
        Convenience method for setting the point coordinate of the start point. If the BezierFigure has not at least two nodes, nodes are added to the figure until the BezierFigure has at least two nodes.
        Specified by:
        setStartPoint in interface ConnectionFigure
        Overrides:
        setStartPoint in class BezierFigure
      • setPoint

        public void setPoint(int index,
                             java.awt.geom.Point2D.Double p)
        Description copied from class: BezierFigure
        Sets the point coordinate of control point 0 at the specified node.
        Specified by:
        setPoint in interface ConnectionFigure
        Overrides:
        setPoint in class BezierFigure
      • setEndPoint

        public void setEndPoint(java.awt.geom.Point2D.Double p)
        Description copied from class: BezierFigure
        Convenience method for setting the point coordinate of the end point. If the BezierFigure has not at least two nodes, nodes are added to the figure until the BezierFigure has at least two nodes.
        Specified by:
        setEndPoint in interface ConnectionFigure
        Overrides:
        setEndPoint in class BezierFigure
      • reverseConnection

        public void reverseConnection()

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.