|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Visualization represents a single visualization of some data. It's used by getting an instance of a class which implemenets the Visualization interface form the VisualizationFactory. After an instance has been acquired, one can add different VModelElements to the visualization (see subclasses of VModelElement).
Note that different VModelElement subclasses (e.g. VPackage) returned by the factory methods of this interface are compatible only with the particular visualization from whose instance they have been acquired.
Visualization supports a selection listener (a VSelectionListener) which is notified when the selection in the visualization area changes.
Field Summary | |
static int |
MODE_NONE
a constant describing that there is no active mode |
static int |
MODE_PAN
a constant describing panning mode (moving the visualization area) |
static int |
MODE_SELECT
a constant describing a mode where things can be selected. |
static int |
MODE_ZOOM
a constant describing a mode where the visualization can be zoomed. |
Method Summary | |
void |
addVRelationship(VRelationship inRelship)
Adds a relationship to the visualization. |
void |
addVRelationshipWithoutAddingOriginalReference(VRelationship inRelship)
Add the given relationship to the visualization. |
void |
clear()
Clears the visualization (drops everything from the root package). |
void |
enterNonInteractiveMode()
enters non-interactive mode. |
VModelElement |
findElementById(java.lang.String inId)
findElementById finds a model element stored in visualization subsystem data structures by its id. |
javax.swing.JMenu |
getDebugMenu()
getDebugMenu returns a menu which can be placed to a menubar. |
VPackage |
getRootPackage()
returns a reference to the root package of the visualization. |
VModelElement[] |
getSelection()
returns currently selected items in the visualization |
javax.swing.JComponent |
getSwingComponent()
returns a Swing component representing the visualization. |
int |
getToolMode()
gets the current mode of the visualization area. |
void |
leaveNonInteractiveMode()
leaves non-interactive mode. |
void |
loadLayout(java.io.InputStream layoutStream)
Load layout information from a stream |
void |
makeDefaultLayout()
constructs a default layout for the visualization. |
VComponent |
newVComponent(java.lang.String inId)
a factory method for generating new VComponents. |
VDependency |
newVDependency(java.lang.String inId)
a factory method for generating new VDependencies. |
VGeneralization |
newVGeneralization(java.lang.String inId)
a factory method for generating new VGeneralizations. |
VInterface |
newVInterface(java.lang.String inId)
a factory method for generating new VInterfaces. |
VPackage |
newVPackage(java.lang.String inId)
a factory method for generating new VPackages. |
VRealization |
newVRealization(java.lang.String inId)
a factory method for generating new VRealizations. |
void |
printCurrentView()
brings up a print dialog which user can use to send currently visible view to printer. |
void |
removeElement(java.lang.String inId)
removes element specified by inId from lookup structures. |
void |
removeVRelationship(VRelationship inRelship)
remove a relationship from the visualization. |
void |
saveLayout(java.io.OutputStream layoutStream)
Saves the layout information to an output stream. |
void |
setSelection(VModelElement[] inSelection)
sets the currently selected model elements in the visualization. |
void |
setSelectionListener(VSelectionListener inListener)
sets the object which receives notifications about selection changes. |
void |
setToolMode(int inMode)
sets the current operating mode of the visualization area. |
void |
setZoomVolume(int inDx)
sets the current speed of zooming |
void |
zoomTo(VModelElement inElement)
Zooms the visualization area to a particular element. zooms the visualization area so that inElement is as big as possible but still fully visible. |
void |
zoomToSelection()
Zooms to the current selection on the visualization area. |
Field Detail |
public static final int MODE_NONE
public static final int MODE_PAN
public static final int MODE_SELECT
public static final int MODE_ZOOM
Method Detail |
public void addVRelationship(VRelationship inRelship)
VRelationship
must have
its source and destination set. If they are not set,
the relationship will not be added. Also adds a reference
of the given relationship to both its source and destination
node.inRelship
- relationship to add to visualization.public void addVRelationshipWithoutAddingOriginalReference(VRelationship inRelship)
inRelship
- relationship to add to visualization.public VModelElement findElementById(java.lang.String inId)
inId
- ID of the model element to findpublic javax.swing.JMenu getDebugMenu()
public VPackage getRootPackage()
public VModelElement[] getSelection()
public javax.swing.JComponent getSwingComponent()
public int getToolMode()
public void loadLayout(java.io.InputStream layoutStream) throws java.io.IOException
layoutStream
- Layout stream which has been saved using
saveLayout-method.public void makeDefaultLayout()
public void removeElement(java.lang.String inId)
public VComponent newVComponent(java.lang.String inId)
public VDependency newVDependency(java.lang.String inId)
public VGeneralization newVGeneralization(java.lang.String inId)
public VInterface newVInterface(java.lang.String inId)
public VPackage newVPackage(java.lang.String inId)
public VRealization newVRealization(java.lang.String inId)
public void removeVRelationship(VRelationship inRelship)
public void saveLayout(java.io.OutputStream layoutStream) throws java.io.IOException
layoutStream
- a stream where to save to layout informationpublic void setSelection(VModelElement[] inSelection)
public void setSelectionListener(VSelectionListener inListener)
inListener
- a reference to a VSelectionListener which will
receive notifications about changes in selection.public void setToolMode(int inMode)
inMode
- one of constants beginning with a MODE_ keyword.public void setZoomVolume(int inDx)
inDx
- FIXME: What is this reallypublic void zoomTo(VModelElement inElement)
inElement
- the model element to be zoomed on.public void zoomToSelection()
public void clear()
Note that VPackages which were in the visualization lose their childs so don't rely on getVChildren() after clearing the visualization. In general, the VModelElement instances in the visualization should not be used after the visualization has been cleared.
public void enterNonInteractiveMode()
In non-interactive mode processing speed is gained by not updating the visualization area constantly.
Non-interactive mode should be entered before doing heavy tasks like setting up the initial view.
No user interaction should be allowed during non-interactive mode.
public void leaveNonInteractiveMode()
public void printCurrentView()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |