Class Connection

java.lang.Object
com.nomagic.magicdraw.ui.pathicon.Connection

@OpenApiAll public final class Connection extends Object
Constants defining the kind of connection using for painting the path icons
  • Field Details

  • Constructor Details

    • Connection

      public Connection()
  • Method Details

    • drawConnection

      public static Point drawConnection(Graphics2D g, int type, int x, int y, int x2, int y2, int preferredSize, @CheckForNull Shape boundingShape, boolean useCorrecting)
      Method for Path end shape drawing.
      Parameters:
      g - graphics context.
      type - path end draw style.
      x - from point.
      y - from point.
      x2 - to point.
      y2 - to point.
      preferredSize - preferred size of path end shape.
      boundingShape - client bounding shape.
      useCorrecting - use correcting in case the link end symbol covers specified bounds.
      Returns:
      Point where path line should begin.
      See Also:
    • drawConnection

      public static Point drawConnection(Graphics2D g, int type, int x, int y, int x2, int y2, int preferredSize, @CheckForNull Rectangle shapeBounds)
      Method for Path end shape drawing.
      Parameters:
      g - graphics context
      type - path end draw style
      x - from point
      y - from point
      x2 - to point
      y2 - to point
      preferredSize - preferred size of path end shape
      shapeBounds - client shape bounds
      Returns:
      Point where path line should begin
      See Also:
    • drawConnection

      public static Point drawConnection(Graphics2D g, com.nomagic.magicdraw.ui.pathicon.PathIcon icon, boolean left, int x, int y, int x2, int y2, int size, @CheckForNull Shape boundingShape, boolean fixOverlapping, Function<ResizableIcon,ResizableIcon> iconTransformer)
      Paints connection end.
      Parameters:
      g - graphics context.
      icon - icon of the end.
      left - left connection.
      x - x coordinate of the intersection with the shape point.
      y - y coordinate of the intersection with the shape point.
      x2 - x coordinate of the next link segment point.
      y2 - y coordinate of the next link segment point.
      size - size of the icon.
      boundingShape - bounding shape.
      fixOverlapping - if true then correcting of the link end shape covering client or supplier shape should be used.
      Returns:
      connection point from which link must be painted.
    • drawConnection

      public static Point drawConnection(Graphics2D g, com.nomagic.magicdraw.ui.pathicon.PathIcon icon, boolean left, int x, int y, int x2, int y2, int size, @CheckForNull Rectangle shapeBounds, Function<ResizableIcon,ResizableIcon> iconTransformer)
    • drawConnection

      public static Point drawConnection(Graphics2D g, ResizableIcon icon, int x, int y, int x2, int y2, int size, @CheckForNull Rectangle shapeBounds, Function<ResizableIcon,ResizableIcon> iconTransformer)