Interface DiagramSurface


@OpenApi public interface DiagramSurface
Interface for some component that is used for diagram displaying.
  • Method Details

    • repaint

      @OpenApi void repaint()
      Repaints the diagram surface.
    • repaint

      @OpenApi void repaint(Rectangle rect)
      Repaints the given rectangle of the diagram surface.
      Parameters:
      rect - the rectangle to repaint.
    • getZoom

      com.nomagic.magicdraw.ui.zoom.Zoom getZoom()
    • getVisibleRect

      Rectangle getVisibleRect()
    • scrollRectToVisible

      @OpenApi void scrollRectToVisible(Rectangle r)
      Scrolls diagram surface to make given part of diagram visible.
      Parameters:
      r - make this part of the diagram visible.
    • scrollToVisible

      @OpenApi void scrollToVisible(int x, int y)
      Scrolls diagram surface to make given point of diagram visible.
      Parameters:
      x - the x coordinate of the visible point.
      y - the y coordinate of the visible point.
    • setCursor

      @OpenApi void setCursor(@CheckForNull Cursor cursor)
      Sets diagram cursor.
      Parameters:
      cursor - a new cursor for diagram.
      See Also:
    • getCursor

      @OpenApi Cursor getCursor()
      Returns diagram cursor.
      Returns:
      current diagram cursor.
      See Also:
    • setBackground

      void setBackground(Color c)
    • getBackground

      Color getBackground()
    • setUseBuffer

      void setUseBuffer(boolean use)
    • isUseBuffer

      boolean isUseBuffer()
    • setBufferDirty

      void setBufferDirty(boolean dirty)
    • recalculateScrollPosition

      void recalculateScrollPosition(Point pt)
    • isLocked

      boolean isLocked()
    • addPainter

      @OpenApi void addPainter(DiagramSurfacePainter painter)
      Registers given painter.
      Parameters:
      painter - the given painter
    • addPainter

      @OpenApi void addPainter(AbstractDiagramSurfacePainter painter)
      Registers given painter.
      Parameters:
      painter - the given painter
    • removePainter

      @OpenApi void removePainter(DiagramSurfacePainter painter)
      Unregisters given painter.
      Parameters:
      painter - the given painter
    • removePainter

      @OpenApi void removePainter(AbstractDiagramSurfacePainter painter)
      Unregisters given painter.
      Parameters:
      painter - the given painter
    • getPainters

      @OpenApi List<DiagramSurfacePainter> getPainters()
      Returns all registered painters.
      Returns:
      list of registered painters
    • paintPainters

      void paintPainters(Graphics g)
    • getScrollPosition

      Point getScrollPosition()
    • getDiagramSurface

      @CheckForNull static DiagramSurface getDiagramSurface(PresentationElement element)
      Returns active diagram surface for this presentation element. DiagramSurface is null if diagram of this element is not opened in any editor.
      Returns:
      diagram surface or null if diagram is not opened