com.change_vision.jude.api.inf.view
Interface IDiagramViewManager

com.change_vision.jude.api.inf.view.IDiagramViewManager

public abstract IDiagramViewManager

Interface to manage Astah diagram view. This class can be used with plugin only.


Field Summary
static String BACKGROUND_COLOR
          Property key for color that highlights background.
static String BORDER_COLOR
          Property key for color that highlights border.
static String LINE_COLOR
          Property key for color that highlights line.
static String USER_ICON
          Property key for user icon.
 
Method Summary
abstract  void addDiagramEditorSelectionListener(IDiagramEditorSelectionListener listener)
          Add IDiagramEditorSelectionListener to receive the event.
abstract  void addDropTargetListener(DiagramDropTargetListener listener)
          Add DiagramDropTargetListener when models are dropped on the diagram.
abstract  void addEntitySelectionListener(IEntitySelectionListener listener)
          Add IEntitySelectionListener to receive the event.
 IDiagram autoCreateClassDiagram(IClass clazz)
          Deprecated.  
abstract  void clearAllViewProperties(IPresentation presentation)
          Clear All View Properties.
abstract  void clearAllViewProperties(IDiagram dgm)
          Clear All View Properties.
abstract  void close(IDiagram diagram)
          Close the specified diagram.
abstract  void closeAll()
          Close all Diagram Editors.
abstract  void closeCurrentDiagramEditor()
          Close the current diagram editor.
abstract  IDiagram getCurrentDiagram()
          Get the selected diagram in the Diagram Editor.
abstract  Rectangle2D getCurrentDiagramEditorBoundsRect()
          Get the Rectangle2D of the selected Diagram Editor.
abstract  IDiagram[] getOpenDiagrams()
          Get the diagrams opened in editors.
abstract  IElement[] getSelectedElements()
          Get the selected models on the current Diagram Editor.
abstract  IPresentation[] getSelectedPresentations()
          Get the selected presentations on the current Diagram Editor.
abstract  Map<String,Object> getViewProperties(IPresentation presentation)
          Get View Properties.
abstract  Object getViewProperty(IPresentation presentation, String key)
          Get View Property.
abstract  double getZoomFactor()
          Get the zoom factor of the Diagram Editor.
abstract  void layoutAll()
          Deprecated.  
abstract  void layoutSelected()
          Deprecated.  
abstract  void open(IDiagram diagram)
          Open specified diagram in Diagram Editor.
abstract  void pan(double vectorX, double vectorY)
          Move the display position in the Diagram Editor.
abstract  void removeDiagramEditorSelectionListener(IDiagramEditorSelectionListener listener)
          Remove IDiagramEditorSelectionListener to receive the event.
abstract  void removeEntitySelectionListener(IEntitySelectionListener listener)
          Remove IEntitySelectionListener.
abstract  void select(IPresentation presentation)
          Select the specified presentation in current Diagram Editor.
abstract  void select(IPresentation[] presentations)
          Select the specified presentations in current Diagram Editor.
abstract  void selectAll()
          Select all presentations in current Diagram Editor.
abstract  void setViewProperties(IPresentation[] presentations, Map<String,Object> properties)
          Set properties of Views.
abstract  void setViewProperty(IPresentation presentation, String key, Object value)
          Set View Property for Presentation.
abstract  void showInDiagramEditor(IPresentation presentation)
          Show and select the presentation in the center of the Diagram Editor.
abstract  double toDeviceCoordX(double xInWorldCoord)
          Convert a X value of the world(Model) coordinate system to the X value of the device(GUI) coordinate system.
abstract  double toDeviceCoordY(double yInWorldCoord)
          Convert a Y value of the world(Model) coordinate system to the Y value of the device(GUI) coordinate system.
abstract  Point2D toWorldCoord(int x, int y)
          Get the model (WorldCoord) position from absolute position on a screen.
abstract  double toWorldCoordX(double xInDeviceCoord)
          Convert a X value of the device(GUI) coordinate system to the X value of the world(Model) coordinate system.
abstract  double toWorldCoordY(double yInDeviceCoord)
          Convert a Y value of the device(GUI) coordinate system to the Y value of the world(Model) coordinate system.
abstract  void unselectAll()
          Unselect all presentations in current Diagram Editor.
abstract  void zoom(double zoomFactor, boolean keepCenter)
          Set the zoom factor to the Diagram Editor.
 

Field Detail

BACKGROUND_COLOR

static final String BACKGROUND_COLOR
Property key for color that highlights background. The value of this property is a java.awt.Color object.


BORDER_COLOR

static final String BORDER_COLOR
Property key for color that highlights border. The value of this property is a java.awt.Color object.


LINE_COLOR

static final String LINE_COLOR
Property key for color that highlights line. The value of this property is a java.awt.Color object.


USER_ICON

static final String USER_ICON
Property key for user icon. The value of this property is a javax.swing.ImageIcon object.

Method Detail

setViewProperty

abstract void setViewProperty(IPresentation presentation,
                              String key,
                              Object value)
Set View Property for Presentation. Change the view property of the presentation on diagram editor temporarily. e.g The view changes if the background color property is set. The original color is displayed if the diagram editor is reopened because the color of the presentation changes temporarily and the original color is still stored in the presentation.

Parameters:
presentation - Presentation
key - Key
value - Value

setViewProperties

abstract void setViewProperties(IPresentation[] presentations,
                                Map<String,Object> properties)
Set properties of Views.

Parameters:
presentations - The array of Presentations
properties - Properties
Throws:
InvalidUsingException
Since:
8.4
See Also:
setViewProperty(IPresentation, String, Object)

getViewProperty

abstract Object getViewProperty(IPresentation presentation,
                                String key)
Get View Property.

Parameters:
presentation - Presentation
key - Key
Returns:
value Value
Since:
6.6

getViewProperties

abstract Map<String,Object> getViewProperties(IPresentation presentation)
Get View Properties.

Parameters:
presentation - Presentation
Returns:
properties Properties
Throws:
InvalidUsingException
Since:
8.4

clearAllViewProperties

abstract void clearAllViewProperties(IPresentation presentation)
Clear All View Properties.

Parameters:
presentation - Presentation to set properties

clearAllViewProperties

abstract void clearAllViewProperties(IDiagram dgm)
Clear All View Properties.

Parameters:
dgm - the target Diagram
Throws:
InvalidUsingException - InvalidUsingException occurs.

showInDiagramEditor

abstract void showInDiagramEditor(IPresentation presentation)
Show and select the presentation in the center of the Diagram Editor.

Parameters:
presentation - Presentation

getCurrentDiagram

abstract IDiagram getCurrentDiagram()
Get the selected diagram in the Diagram Editor.

Returns:
IDiagram

getSelectedPresentations

abstract IPresentation[] getSelectedPresentations()
Get the selected presentations on the current Diagram Editor.

Returns:
Selected presentations. This method returns an empty array if no diagram is opened or no presentation is selected

getSelectedElements

abstract IElement[] getSelectedElements()
Get the selected models on the current Diagram Editor.

Returns:
Selected models. This method returns an empty array if no diagram is opened or no element is selected
Since:
6.6

addEntitySelectionListener

abstract void addEntitySelectionListener(IEntitySelectionListener listener)
Add IEntitySelectionListener to receive the event.

Parameters:
listener - Listener of the IEntitySelectionEvent
Since:
6.6

removeEntitySelectionListener

abstract void removeEntitySelectionListener(IEntitySelectionListener listener)
Remove IEntitySelectionListener.

Parameters:
listener - Listener of the IEntitySelectionEvent
Since:
6.6

addDropTargetListener

abstract void addDropTargetListener(DiagramDropTargetListener listener)
Add DiagramDropTargetListener when models are dropped on the diagram.

Parameters:
listener - Listener for the drop event on the diagram

layoutAll

abstract void layoutAll()
Deprecated. 

Layout all presentations in the selected Diagram Editor.


layoutSelected

abstract void layoutSelected()
Deprecated. 

Layout selected presentations in the selected Diagram Editor. Only selected presentations are arranged.


autoCreateClassDiagram

IDiagram autoCreateClassDiagram(IClass clazz)
Deprecated. 

class diagram automatically.

Parameters:
clazz - auto create class.
Returns:
Created a diagram.
Throws:
InvalidEditingException - InvalidEditingException occurs.
Since:
6.7

getOpenDiagrams

abstract IDiagram[] getOpenDiagrams()
Get the diagrams opened in editors.

Returns:
Diagrams

open

abstract void open(IDiagram diagram)
Open specified diagram in Diagram Editor. The diagram is shown in the front if the diagram has already been open.

Parameters:
diagram - Diagram to be opened

closeCurrentDiagramEditor

abstract void closeCurrentDiagramEditor()
Close the current diagram editor.


close

abstract void close(IDiagram diagram)
Close the specified diagram.

Parameters:
diagram - Diagram to be closed

closeAll

abstract void closeAll()
Close all Diagram Editors.


select

abstract void select(IPresentation presentation)
Select the specified presentation in current Diagram Editor.

Parameters:
presentation - Presentation to be selected

select

abstract void select(IPresentation[] presentations)
Select the specified presentations in current Diagram Editor.

Parameters:
presentations - Presentations to be selected

selectAll

abstract void selectAll()
Select all presentations in current Diagram Editor.


unselectAll

abstract void unselectAll()
Unselect all presentations in current Diagram Editor.


toWorldCoordX

abstract double toWorldCoordX(double xInDeviceCoord)
Convert a X value of the device(GUI) coordinate system to the X value of the world(Model) coordinate system.

Parameters:
xInDeviceCoord - X value of the device(GUI) coordinate system
Returns:
X value of the world(Model) coordinate system

toWorldCoordY

abstract double toWorldCoordY(double yInDeviceCoord)
Convert a Y value of the device(GUI) coordinate system to the Y value of the world(Model) coordinate system.

Parameters:
yInDeviceCoord - Y value of the device(GUI) coordinate system
Returns:
Y value of the world(Model) coordinate system

toDeviceCoordX

abstract double toDeviceCoordX(double xInWorldCoord)
Convert a X value of the world(Model) coordinate system to the X value of the device(GUI) coordinate system.

Parameters:
xInWorldCoord - X value of the world(Model) coordinate system
Returns:
X value of the device(GUI) coordinate system

toDeviceCoordY

abstract double toDeviceCoordY(double yInWorldCoord)
Convert a Y value of the world(Model) coordinate system to the Y value of the device(GUI) coordinate system.

Parameters:
yInWorldCoord - Y value of the world(Model) coordinate system
Returns:
Y value of the device(GUI) coordinate system

addDiagramEditorSelectionListener

abstract void addDiagramEditorSelectionListener(IDiagramEditorSelectionListener listener)
Add IDiagramEditorSelectionListener to receive the event.

Parameters:
listener - Listener of the IDiagramEditorSelectionEvent
Since:
6.6.4

removeDiagramEditorSelectionListener

abstract void removeDiagramEditorSelectionListener(IDiagramEditorSelectionListener listener)
Remove IDiagramEditorSelectionListener to receive the event.

Parameters:
listener - Listener of the IDiagramEditorSelectionEvent
Since:
6.6.4

getCurrentDiagramEditorBoundsRect

abstract Rectangle2D getCurrentDiagramEditorBoundsRect()
Get the Rectangle2D of the selected Diagram Editor.

Returns:
Rectangle2D
Since:
6.6.4

toWorldCoord

abstract Point2D toWorldCoord(int x,
                              int y)
Get the model (WorldCoord) position from absolute position on a screen.

Returns:
model (WorldCoord) position
Since:
6.6.4

pan

abstract void pan(double vectorX,
                  double vectorY)
Move the display position in the Diagram Editor.

Parameters:
vectorX - vector X
vectorY - vector Y
Since:
6.9.0

zoom

abstract void zoom(double zoomFactor,
                   boolean keepCenter)
Set the zoom factor to the Diagram Editor.

Parameters:
zoomFactor - Zoom Factor (4.0 - 0.05)
keepCenter - true to keep the center position of the diagram.
Since:
6.9.0

getZoomFactor

abstract double getZoomFactor()
Get the zoom factor of the Diagram Editor. Return 0 if the diagram is not opened.

Returns:
Zoom Factor
Since:
6.9.0