Class mxEdgeHandler

java.lang.Object
com.mxgraph.swing.handler.mxCellHandler
com.mxgraph.swing.handler.mxEdgeHandler
Direct Known Subclasses:
mxElbowEdgeHandler

public class mxEdgeHandler extends mxCellHandler
  • Field Details

    • cloneEnabled

      protected boolean cloneEnabled
    • p

      protected Point[] p
    • error

      protected transient String error
    • gridEnabledEvent

      protected transient boolean gridEnabledEvent
      Workaround for alt-key-state not correct in mouseReleased.
    • constrainedEvent

      protected transient boolean constrainedEvent
      Workaround for shift-key-state not correct in mouseReleased.
    • marker

      protected mxCellMarker marker
  • Constructor Details

  • Method Details

    • setCloneEnabled

      public void setCloneEnabled(boolean cloneEnabled)
    • isCloneEnabled

      public boolean isCloneEnabled()
    • isIgnoredEvent

      protected boolean isIgnoredEvent(MouseEvent e)
      No flip event is ignored.
      Overrides:
      isIgnoredEvent in class mxCellHandler
    • isFlipEvent

      protected boolean isFlipEvent(MouseEvent e)
    • validateConnection

      public String validateConnection(Object source, 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.
    • isSource

      public boolean isSource(int index)
      Returns true if the current index is 0.
    • isTarget

      public boolean isTarget(int index)
      Returns true if the current index is the last index.
    • isHandleVisible

      protected boolean isHandleVisible(int index)
      Hides the middle handle if the edge is not bendable.
      Overrides:
      isHandleVisible in class mxCellHandler
    • isCellBendable

      protected boolean isCellBendable()
    • createHandles

      protected Rectangle[] createHandles()
      Description copied from class: mxCellHandler
      Creates the rectangles that define the handles.
      Overrides:
      createHandles in class mxCellHandler
    • getHandleFillColor

      protected Color getHandleFillColor(int index)
      Description copied from class: mxCellHandler
      Returns the color to be used to fill the handle at the specified index.
      Overrides:
      getHandleFillColor in class mxCellHandler
    • getIndexAt

      public int getIndexAt(int x, int y)
      Description copied from class: mxCellHandler
      Returns the index of the handle at the given location.
      Overrides:
      getIndexAt in class mxCellHandler
      Parameters:
      x -
      y -
      Returns:
      Returns the inde of the handle at the given location.
    • createHandle

      protected Rectangle createHandle(Point center)
    • createHandle

      protected Rectangle createHandle(Point center, int size)
    • createPoints

      protected Point[] createPoints(mxCellState s)
    • createPreview

      protected JComponent createPreview()
      Description copied from class: mxCellHandler
      Creates the preview for this handler.
      Overrides:
      createPreview in class mxCellHandler
    • convertPoint

      protected mxPoint convertPoint(mxPoint point, boolean gridEnabled)
      Parameters:
      point -
      gridEnabled -
      Returns:
      Returns the scaled, translated and grid-aligned point.
    • getPreviewBounds

      protected Rectangle getPreviewBounds()
      Returns:
      Returns the bounds of the preview.
    • mousePressed

      public void mousePressed(MouseEvent e)
      Description copied from class: mxCellHandler
      Processes the given event.
      Overrides:
      mousePressed in class mxCellHandler
    • mouseDragged

      public void mouseDragged(MouseEvent e)
      Description copied from class: mxCellHandler
      Processes the given event.
      Overrides:
      mouseDragged in class mxCellHandler
    • mouseReleased

      public void mouseReleased(MouseEvent e)
      Description copied from class: mxCellHandler
      Processes the given event.
      Overrides:
      mouseReleased in class mxCellHandler
    • reset

      public void reset()
      Extends the implementation to reset the current error and marker.
      Overrides:
      reset in class mxCellHandler
    • movePoint

      protected void movePoint(Object edge, int pointIndex, mxPoint point)
      Moves the edges control point with the given index to the given point.
    • connect

      protected void connect(Object edge, Object terminal, boolean isSource, boolean isClone)
      Connects the given edge to the given source or target terminal.
      Parameters:
      edge -
      terminal -
      isSource -
    • moveLabelTo

      protected void moveLabelTo(mxCellState edgeState, double x, double y)
      Moves the label to the given position.
    • getCursor

      protected Cursor getCursor(MouseEvent e, int index)
      Description copied from class: mxCellHandler
      Returns the cursor for the given event and handle.
      Overrides:
      getCursor in class mxCellHandler
    • getSelectionColor

      public Color getSelectionColor()
      Description copied from class: mxCellHandler
      Returns the color used to draw the selection border. This implementation returns null.
      Overrides:
      getSelectionColor in class mxCellHandler
    • getSelectionStroke

      public Stroke getSelectionStroke()
      Description copied from class: mxCellHandler
      Returns the stroke used to draw the selection border. This implementation returns null.
      Overrides:
      getSelectionStroke in class mxCellHandler
    • paint

      public void paint(Graphics g)
      Description copied from class: mxCellHandler
      Paints the visible handles of this handler.
      Overrides:
      paint in class mxCellHandler