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 TypeMethodDescriptionvoid
activate()
Activate window - load diagram content if needed.void
activateDocument
(com.nomagic.magicdraw.ui.editorwindows.EditorWindow old, boolean activationTrackingEnabled) void
Closes the windowvoid
createContainer
(com.jidesoft.document.DocumentPane documentPane, com.nomagic.magicdraw.ui.ProgressBarEditorWindowZoomToolbar zoomToolbar, com.nomagic.magicdraw.ui.presentationmode.ProgressBarEditorWindowPresentationModeToolbar presentationModeToolbar) void
createToolbars
(Map<String, Object> options) Created some toolbars using given optionsvoid
customizePopupMenu
(JPopupMenu popupMenu) void
void
void
Disable or enable the toolbar according to the checkout state of the diagram.static void
executeWithLockedRepaint
(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.DiagramFrame
Deprecated.com.jidesoft.document.DocumentComponent
com.nomagic.magicdraw.ui.DrawArea
Get draw area of the window.getID
(AbstractDiagramPresentationElement document) com.dassault_systemes.modeler.magic.ui.editorwindow.EditorWindowOptions
com.nomagic.magicdraw.ui.DiagramWindowPanel
getPanel()
Returns the panel on which diagram is drawn.Project of activatable componentReturns cursor of the treegetTitle()
long
void
boolean
boolean
boolean
void
void
void
Restore window state from diagram view optionsvoid
void
void
setContainer
(JPanel container) void
void
setEnableLoadOnActivation
(boolean enableLoadOnActivation) Set load content on activation statevoid
setFireEvents
(boolean fireEvents) void
Sets cursor for documentation and treevoid
setVisible
(boolean visible) void
Remembers all view options/parameters upon close, so it's state could be restored when the diagram is opened again.void
toFront()
void
void
useBufferImage
(boolean use) void
handles window activation eventvoid
handles event invoked after window closingvoid
void
void
void
Methods 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:
getTitle
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
updateRepresentation
public void updateRepresentation()- Specified by:
updateRepresentation
in 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:
enabledDisabledToolbar
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
setDocument
- Specified by:
setDocument
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
setVisible
public void setVisible(boolean visible) - Specified by:
setVisible
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
getContainer
@CheckForNull public com.nomagic.magicdraw.ui.DiagramFrame getContainer()- Specified by:
getContainer
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
setContainer
- Specified by:
setContainer
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
dropContainer
public void dropContainer()- Overrides:
dropContainer
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
windowActivated
handles window activation event- Specified by:
windowActivated
in interfaceWindowListener
- Parameters:
e
- Window event to handle- See Also:
-
windowClosed
handles event invoked after window closing- Specified by:
windowClosed
in interfaceWindowListener
- Parameters:
e
- Window event to handle- See Also:
-
closeWindow
public void closeWindow()Closes the window- Overrides:
closeWindow
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
windowDeactivated
- Specified by:
windowDeactivated
in interfaceWindowListener
-
windowDeiconified
- Specified by:
windowDeiconified
in interfaceWindowListener
-
windowIconified
- Specified by:
windowIconified
in interfaceWindowListener
-
windowOpened
- Specified by:
windowOpened
in interfaceWindowListener
-
toFront
public void toFront()- Specified by:
toFront
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
getFocusableComponent
- Specified by:
getFocusableComponent
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
setBounds
- Specified by:
setBounds
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
getBounds
- Specified by:
getBounds
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
hideWindow
public void hideWindow()- Specified by:
hideWindow
in 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:
getDiagramPresentationElement
in 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:
getSpecificCursor
in interfacecom.nomagic.ui.CursorOwner
-
setSpecificCursor
Sets cursor for documentation and tree- Specified by:
setSpecificCursor
in interfacecom.nomagic.ui.CursorOwner
-
getCurrentCursor
- Specified by:
getCurrentCursor
in interfacecom.nomagic.ui.CursorOwner
-
isVisible
public boolean isVisible()- Specified by:
isVisible
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
createToolbars
Description copied from class:com.nomagic.magicdraw.ui.editorwindows.EditorWindow
Created some toolbars using given options- Specified by:
createToolbars
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
- Parameters:
options
- toolbar options
-
isEnableLoadOnActivation
public boolean isEnableLoadOnActivation()- Specified by:
isEnableLoadOnActivation
in 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:
setEnableLoadOnActivation
in 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:
activate
in 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:
storeOptions
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
restoreOptions
public void restoreOptions()Restore window state from diagram view options- Specified by:
restoreOptions
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
getProject
Description copied from interface:com.nomagic.magicdraw.ui.Activatable
Project of activatable component- Specified by:
getProject
in interfacecom.nomagic.magicdraw.ui.Activatable
- Returns:
- project
-
scaleForHiDPI
public void scaleForHiDPI()- Specified by:
scaleForHiDPI
in 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:
openDocument
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
getDocument
- Specified by:
getDocument
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
getDocumentComponent
public com.jidesoft.document.DocumentComponent getDocumentComponent()- Specified by:
getDocumentComponent
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
activateDocument
public void activateDocument(@CheckForNull com.nomagic.magicdraw.ui.editorwindows.EditorWindow old, boolean activationTrackingEnabled) - Specified by:
activateDocument
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
deactivateDocument
public void deactivateDocument()- Specified by:
deactivateDocument
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
getWindowActivationTime
public long getWindowActivationTime()- Specified by:
getWindowActivationTime
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
repaintWindow
public void repaintWindow()- Specified by:
repaintWindow
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
isUseBufferImage
public boolean isUseBufferImage()- Specified by:
isUseBufferImage
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
useBufferImage
public void useBufferImage(boolean use) - Specified by:
useBufferImage
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
getOptions
public com.dassault_systemes.modeler.magic.ui.editorwindow.EditorWindowOptions getOptions()- Specified by:
getOptions
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
getID
- Specified by:
getID
in 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:
createContainer
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
setFireEvents
public void setFireEvents(boolean fireEvents) - Overrides:
setFireEvents
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
customizePopupMenu
- Overrides:
customizePopupMenu
in classcom.nomagic.magicdraw.ui.editorwindows.EditorWindow<AbstractDiagramPresentationElement>
-
getAbstractDiagramPresentationElement()