Interface DiagramSurface
@OpenApi
public interface DiagramSurface
Interface for some component that is used for diagram displaying.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddPainter(AbstractDiagramSurfacePainter painter) Registers given painter.voidaddPainter(DiagramSurfacePainter painter) Registers given painter.Returns diagram cursor.static DiagramSurfacegetDiagramSurface(PresentationElement element) Returns active diagram surface for this presentation element.Returns all registered painters.com.nomagic.magicdraw.ui.zoom.ZoomgetZoom()booleanisLocked()booleanvoidvoidvoidUnregisters given painter.voidremovePainter(DiagramSurfacePainter painter) Unregisters given painter.voidrepaint()Repaints the diagram surface.voidRepaints the given rectangle of the diagram surface.voidScrolls diagram surface to make given part of diagram visible.voidscrollToVisible(int x, int y) Scrolls diagram surface to make given point of diagram visible.voidvoidsetBufferDirty(boolean dirty) voidSets diagram cursor.voidsetUseBuffer(boolean use)
-
Method Details
-
repaint
@OpenApi void repaint()Repaints the diagram surface. -
repaint
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
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
Sets diagram cursor.- Parameters:
cursor- a new cursor for diagram.- See Also:
-
getCursor
Returns diagram cursor.- Returns:
- current diagram cursor.
- See Also:
-
setBackground
-
getBackground
Color getBackground() -
setUseBuffer
void setUseBuffer(boolean use) -
isUseBuffer
boolean isUseBuffer() -
setBufferDirty
void setBufferDirty(boolean dirty) -
recalculateScrollPosition
-
isLocked
boolean isLocked() -
addPainter
Registers given painter.- Parameters:
painter- the given painter
-
addPainter
Registers given painter.- Parameters:
painter- the given painter
-
removePainter
Unregisters given painter.- Parameters:
painter- the given painter
-
removePainter
Unregisters given painter.- Parameters:
painter- the given painter
-
getPainters
Returns all registered painters.- Returns:
- list of registered painters
-
paintPainters
-
getScrollPosition
Point getScrollPosition() -
getDiagramSurface
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
-