Documentation of 'com.mxgraph.swing.handler.mxConnectionHandler' Java class
mxConnectionHandler
com.mxgraph.swing.handler

Class mxConnectionHandler

  • All Implemented Interfaces:
    java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener


    public class mxConnectionHandler
    extends mxMouseAdapter
    Connection handler creates new connections between cells. This control is used to display the connector icon, while the preview is used to draw the line. mxEvent.CONNECT fires between begin- and endUpdate in mouseReleased. The cell property contains the inserted edge, the event and target properties contain the respective arguments that were passed to mouseReleased.
    • Field Detail

      • CONNECT_CURSOR

        public static java.awt.Cursor CONNECT_CURSOR
    • Constructor Detail

      • mxConnectionHandler

        public mxConnectionHandler(mxGraphComponent graphComponent)
        Parameters:
        graphComponent -
    • Method Detail

      • isConnecting

        public boolean isConnecting()
        Returns true if the source terminal has been clicked and a new connection is currently being previewed.
      • isActive

        public boolean isActive()
      • isHighlighting

        public boolean isHighlighting()
        Returns true if no connectIcon is specified and handleEnabled is false.
      • isEnabled

        public boolean isEnabled()
      • setEnabled

        public void setEnabled(boolean value)
      • isKeepOnTop

        public boolean isKeepOnTop()
      • setKeepOnTop

        public void setKeepOnTop(boolean value)
      • setConnectIcon

        public void setConnectIcon(javax.swing.ImageIcon value)
      • getConnecIcon

        public javax.swing.ImageIcon getConnecIcon()
      • setHandleEnabled

        public void setHandleEnabled(boolean value)
      • isHandleEnabled

        public boolean isHandleEnabled()
      • setHandleSize

        public void setHandleSize(int value)
      • getHandleSize

        public int getHandleSize()
      • setCreateTarget

        public void setCreateTarget(boolean value)
      • isCreateTarget

        public boolean isCreateTarget()
      • setSelect

        public void setSelect(boolean value)
      • isSelect

        public boolean isSelect()
      • reset

        public void reset()
      • createTargetVertex

        public java.lang.Object createTargetVertex(java.awt.event.MouseEvent e,
                                                   java.lang.Object source)
      • isValidSource

        public boolean isValidSource(java.lang.Object cell)
      • isValidTarget

        public boolean isValidTarget(java.lang.Object cell)
        Returns true. The call to mxGraph.isValidTarget is implicit by calling mxGraph.getEdgeValidationError in validateConnection. This is an additional hook for disabling certain targets in this specific handler.
      • validateConnection

        public java.lang.String validateConnection(java.lang.Object source,
                                                   java.lang.Object target)
        Returns the error message or an empty string if the connection for the given source target pair is not valid. Otherwise it returns null.
      • mousePressed

        public void mousePressed(java.awt.event.MouseEvent e)
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
        Overrides:
        mousePressed in class mxMouseAdapter
      • start

        public void start(java.awt.event.MouseEvent e,
                          mxCellState state)
      • mouseMoved

        public void mouseMoved(java.awt.event.MouseEvent e)
        Specified by:
        mouseMoved in interface java.awt.event.MouseMotionListener
        Overrides:
        mouseMoved in class mxMouseAdapter
      • mouseDragged

        public void mouseDragged(java.awt.event.MouseEvent e)
        Specified by:
        mouseDragged in interface java.awt.event.MouseMotionListener
        Overrides:
        mouseDragged in class mxMouseAdapter
      • mouseReleased

        public void mouseReleased(java.awt.event.MouseEvent e)
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
        Overrides:
        mouseReleased in class mxMouseAdapter
      • setBounds

        public void setBounds(java.awt.Rectangle value)
      • removeListener

        public void removeListener(mxEventSource.mxIEventListener listener,
                                   java.lang.String eventName)
        Removes the given event listener for the specified event name.
      • paint

        public void paint(java.awt.Graphics g)

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.