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

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

public abstract IDiagramViewManager

Interface to manage view related to diagrams. This class can be used with Plug-in only.


Field Summary
static String BACKGROUND_COLOR
          Property key for background color.
static String BORDER_COLOR
          Property key for rect's line color.
static String LINE_COLOR
          Property key for line color.
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.
abstract  IDiagram autoCreateClassDiagram(IClass clazz, boolean isDetail)
          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 diagram in the selected 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 a property of a Presentation.
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> property)
          Set properties of Views.
abstract  void setViewProperty(IPresentation presentation, String key, Object value)
          Set a property of a Presentation.
abstract  void showInDiagramEditor(IPresentation presentation)
          Show and select the presentation in the center of the Diagram Editor.
abstract  int toDeviceCoordX(double xInWorldCoord)
          Convert a X value of the world(Model) coordinate system to the X value of the device(GUI) coordinate system.
abstract  int 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(int xInDeviceCoord)
          Convert a X value of the device(GUI) coordinate system to the X value of the world(Model) coordinate system.
abstract  double toWorldCoordY(int 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 background color. The value of this property is a java.awt.Color object.


BORDER_COLOR

static final String BORDER_COLOR
Property key for rect's line color. The value of this property is a java.awt.Color object.


LINE_COLOR

static final String LINE_COLOR
Property key for line color. 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 a property of a Presentation. Change the view property of the presentation on diagram editor temporarily. e.g The view will be changed if you set the background color property. The original color is displayed if the diagram editor is reopened because the original color of the presentation is still stored in the presentation.

Parameters:
presentation - Presentation
key - Key
value - Value
Throws:
InvalidUsingException
See Also:
BACKGROUND_COLOR, BORDER_COLOR, LINE_COLOR, USER_ICON

setViewProperties

abstract void setViewProperties(IPresentation[] presentations,
                                Map<String,Object> property)
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 a property of a Presentation.

Parameters:
presentation - Presentation
key - Key
Returns:
properties Properties
Throws:
InvalidUsingException
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 - the target Presentation
Throws:
InvalidUsingException

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 diagram in the selected Diagram Editor.

Returns:
IDiagram

getCurrentDiagramEditorBoundsRect

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

Returns:
Rectangle2D
Since:
6.6.4

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

abstract IDiagram autoCreateClassDiagram(IClass clazz,
                                         boolean isDetail)
Deprecated. 

class diagram automatically.

Parameters:
clazz - auto create class.
isDetail - Output detail is true.
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(int 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(int 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 GUI coordinate system
Returns:
Y value of the world(Model) coordinate system

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

toDeviceCoordX

abstract int 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 int 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

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