Package com.nomagic.magicdraw.ui
Class DiagramWindow
java.lang.Object
com.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
com.nomagic.magicdraw.ui.DiagramWindow
- All Implemented Interfaces:
com.jidesoft.document.DocumentComponentListener,com.nomagic.magicdraw.ui.Activatable,DiagramPresentationElementGetter,com.nomagic.ui.CursorOwner,HiDPIScalableComponent,FocusListener,WindowListener,EventListener
@OpenApi
public class DiagramWindow
extends com.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
implements DiagramPresentationElementGetter
This class is base class for diagram-specific windows.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDiagramWindow(com.nomagic.magicdraw.ui.DiagramWindowPanel panel) Constructs window with a specified panel. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Activate window - load diagram content if needed.voidactivateDocument(com.nomagic.magicdraw.ui.editorwindows.EditorWindow old, boolean activationTrackingEnabled) voidCloses the windowvoidcreateContainer(com.jidesoft.document.DocumentPane documentPane, com.nomagic.magicdraw.ui.ProgressBarEditorWindowZoomToolbar zoomToolbar, com.nomagic.magicdraw.ui.presentationmode.ProgressBarEditorWindowPresentationModeToolbar presentationModeToolbar) voidcreateToolbars(Map<String, Object> options) Created some toolbars using given optionsvoidcustomizePopupMenu(JPopupMenu popupMenu) voidvoidvoidDisable or enable the toolbar according to the checkout state of the diagram.static voidexecuteWithLockedRepaint(Runnable run, com.nomagic.magicdraw.ui.DiagramWindowPanel diagramWindowPanel) Executes given runnable while not repainting a diagram window panel.Returns the diagram of this window.Gets the type of the class.com.nomagic.magicdraw.ui.DiagramFrameDeprecated.com.jidesoft.document.DocumentComponentcom.nomagic.magicdraw.ui.DrawAreaGet draw area of the window.getID(AbstractDiagramPresentationElement document) com.dassault_systemes.modeler.magic.ui.editorwindow.EditorWindowOptionscom.nomagic.magicdraw.ui.DiagramWindowPanelgetPanel()Returns the panel on which diagram is drawn.Project of activatable componentReturns cursor of the treegetTitle()longvoidbooleanbooleanbooleanvoidvoidvoidRestore window state from diagram view optionsvoidvoidvoidsetContainer(JPanel container) voidvoidsetEnableLoadOnActivation(boolean enableLoadOnActivation) Set load content on activation statevoidsetFireEvents(boolean fireEvents) voidSets cursor for documentation and treevoidsetVisible(boolean visible) voidRemembers all view options/parameters upon close, so it's state could be restored when the diagram is opened again.voidtoFront()voidvoiduseBufferImage(boolean use) voidhandles window activation eventvoidhandles event invoked after window closingvoidvoidvoidvoidMethods inherited from class com.nomagic.magicdraw.ui.editorwindows.EditorWindow
createToolbarsForAllWindows, documentComponentActivated, documentComponentClosed, documentComponentClosing, documentComponentDeactivated, documentComponentDocked, documentComponentFloated, documentComponentMoved, documentComponentMoving, documentComponentOpened, executeWithoutEventFiring, firePropertyChange, focusGained, focusLost, getDocument, getID, getLocation, getLocationOnScreen, isFloating, isHiDPIScaled, isWindowClosed, renameDocumentComponent, requestFocus, setHiDPIScaled, setLocation, setMoveListener, setWindowClosed, windowClosing
-
Field Details
-
CREATE_TOOLBAR
- See Also:
-
CREATE_PALETTE
- See Also:
-
CLASS_TYPE_SUFFIX
- See Also:
-
-
Constructor Details
-
DiagramWindow
public DiagramWindow(com.nomagic.magicdraw.ui.DiagramWindowPanel panel) Constructs window with a specified panel.- Parameters:
panel- the panel to set.
-
-
Method Details
-
getTitle
- Specified by:
getTitlein classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
updateRepresentation
public void updateRepresentation()- Specified by:
updateRepresentationin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
enabledDisabledToolbar
public void enabledDisabledToolbar()Disable or enable the toolbar according to the checkout state of the diagram.- Specified by:
enabledDisabledToolbarin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
setDocument
- Specified by:
setDocumentin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
setVisible
public void setVisible(boolean visible) - Specified by:
setVisiblein classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
getContainer
@CheckForNull public com.nomagic.magicdraw.ui.DiagramFrame getContainer()- Specified by:
getContainerin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
setContainer
- Specified by:
setContainerin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
dropContainer
public void dropContainer()- Overrides:
dropContainerin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
windowActivated
handles window activation event- Specified by:
windowActivatedin interfaceWindowListener- Parameters:
e- Window event to handle- See Also:
-
windowClosed
handles event invoked after window closing- Specified by:
windowClosedin interfaceWindowListener- Parameters:
e- Window event to handle- See Also:
-
closeWindow
public void closeWindow()Closes the window- Overrides:
closeWindowin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
windowDeactivated
- Specified by:
windowDeactivatedin interfaceWindowListener
-
windowDeiconified
- Specified by:
windowDeiconifiedin interfaceWindowListener
-
windowIconified
- Specified by:
windowIconifiedin interfaceWindowListener
-
windowOpened
- Specified by:
windowOpenedin interfaceWindowListener
-
toFront
public void toFront()- Specified by:
toFrontin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
getFocusableComponent
- Specified by:
getFocusableComponentin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
setBounds
- Specified by:
setBoundsin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
getBounds
- Specified by:
getBoundsin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
hideWindow
public void hideWindow()- Specified by:
hideWindowin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
getClassType
Gets the type of the class.- Returns:
- the type of the class - a
String
-
getDrawArea
@CheckForNull public com.nomagic.magicdraw.ui.DrawArea getDrawArea()Get draw area of the window. This method returns the draw area panel from DiagramWindowPanel.- Returns:
- current draw area
-
getDiagramPresentationElement
@CheckForNull @OpenApi @Deprecated public DiagramPresentationElement getDiagramPresentationElement()Deprecated.Returns the diagram view of this window. This method returns the diagram view from DiagramWindowPanel.- Specified by:
getDiagramPresentationElementin interfaceDiagramPresentationElementGetter- Returns:
- current diagram view.
-
getAbstractDiagramPresentationElement
@OpenApi @CheckForNull public AbstractDiagramPresentationElement getAbstractDiagramPresentationElement()Returns the diagram of this window. This method returns the diagram from DiagramWindowPanel.- Returns:
- diagram
-
getPanel
public com.nomagic.magicdraw.ui.DiagramWindowPanel getPanel()Returns the panel on which diagram is drawn.- Returns:
- the diagram drawing panel.
-
getSpecificCursor
Returns cursor of the tree- Specified by:
getSpecificCursorin interfacecom.nomagic.ui.CursorOwner
-
setSpecificCursor
Sets cursor for documentation and tree- Specified by:
setSpecificCursorin interfacecom.nomagic.ui.CursorOwner
-
getCurrentCursor
- Specified by:
getCurrentCursorin interfacecom.nomagic.ui.CursorOwner
-
isVisible
public boolean isVisible()- Specified by:
isVisiblein classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
createToolbars
Description copied from class:com.nomagic.magicdraw.ui.editorwindows.EditorWindowCreated some toolbars using given options- Specified by:
createToolbarsin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>- Parameters:
options- toolbar options
-
isEnableLoadOnActivation
public boolean isEnableLoadOnActivation()- Specified by:
isEnableLoadOnActivationin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>- Returns:
- true if diagram should load content on activation
-
setEnableLoadOnActivation
public void setEnableLoadOnActivation(boolean enableLoadOnActivation) Set load content on activation state- Specified by:
setEnableLoadOnActivationin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>- Parameters:
enableLoadOnActivation- true if diagram should load content on activation
-
activate
public void activate()Activate window - load diagram content if needed.- Specified by:
activatein interfacecom.nomagic.magicdraw.ui.Activatable
-
storeOptions
public void storeOptions()Remembers all view options/parameters upon close, so it's state could be restored when the diagram is opened again.- Specified by:
storeOptionsin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
restoreOptions
public void restoreOptions()Restore window state from diagram view options- Specified by:
restoreOptionsin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
getProject
Description copied from interface:com.nomagic.magicdraw.ui.ActivatableProject of activatable component- Specified by:
getProjectin interfacecom.nomagic.magicdraw.ui.Activatable- Returns:
- project
-
scaleForHiDPI
public void scaleForHiDPI()- Specified by:
scaleForHiDPIin interfaceHiDPIScalableComponent
-
executeWithLockedRepaint
public static void executeWithLockedRepaint(Runnable run, @CheckForNull com.nomagic.magicdraw.ui.DiagramWindowPanel diagramWindowPanel) Executes given runnable while not repainting a diagram window panel.- Parameters:
run- runnable to executediagramWindowPanel- diagram window panel which must be repainted after this runnable completing
-
openDocument
public void openDocument()- Specified by:
openDocumentin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
getDocument
- Specified by:
getDocumentin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
getDocumentComponent
public com.jidesoft.document.DocumentComponent getDocumentComponent()- Specified by:
getDocumentComponentin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
activateDocument
public void activateDocument(@CheckForNull com.nomagic.magicdraw.ui.editorwindows.EditorWindow old, boolean activationTrackingEnabled) - Specified by:
activateDocumentin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
deactivateDocument
public void deactivateDocument()- Specified by:
deactivateDocumentin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
getWindowActivationTime
public long getWindowActivationTime()- Specified by:
getWindowActivationTimein classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
repaintWindow
public void repaintWindow()- Specified by:
repaintWindowin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
isUseBufferImage
public boolean isUseBufferImage()- Specified by:
isUseBufferImagein classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
useBufferImage
public void useBufferImage(boolean use) - Specified by:
useBufferImagein classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
getOptions
public com.dassault_systemes.modeler.magic.ui.editorwindow.EditorWindowOptions getOptions()- Specified by:
getOptionsin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
getID
- Specified by:
getIDin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
createContainer
public void createContainer(com.jidesoft.document.DocumentPane documentPane, com.nomagic.magicdraw.ui.ProgressBarEditorWindowZoomToolbar zoomToolbar, com.nomagic.magicdraw.ui.presentationmode.ProgressBarEditorWindowPresentationModeToolbar presentationModeToolbar) - Overrides:
createContainerin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
setFireEvents
public void setFireEvents(boolean fireEvents) - Overrides:
setFireEventsin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
customizePopupMenu
- Overrides:
customizePopupMenuin classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
getAbstractDiagramPresentationElement()