|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--venice.ZVisualization
ZVisualization is a concrete implementation of Visualization interface.
ZVisualization uses Jazz zoomable user interface library as its backend.
Field Summary | |
private edu.umd.cs.jazz.util.ZCanvas |
mCanvas
jazz canvas which is a Swing component which can be placed to UI |
private edu.umd.cs.jazz.event.ZEventHandler |
mCurrentEventHandler
reference to the currently active event handler |
private int |
mCurrentMode
current mode of the visualization (one of Visualization.MODE...) |
private java.util.Hashtable |
mIndexById
Hashtable |
private boolean |
mInInteractiveMode
|
private edu.umd.cs.jazz.event.ZPanEventHandler |
mPanEventHandler
event handler which is active in panning mode |
private ZPackage |
mRootPackage
the root VPackage in which everything from the model is contained |
private VCompositeSelectionHandler |
mSelectionHandler
event handler which is active in selection mode |
private edu.umd.cs.jazz.ZLayerGroup |
mSelectionLayer
selection layer is used to draw the selection marquee |
private VSelectionListener |
mSelectionListener
a listener (e.g. the GUI) which is notified on selection changes |
private VZoomEventHandler |
mZoomEventHandler
event handler which is active in zooming mode |
private static boolean |
RELATIONSHIP_SPEEDUP_ENABLED
if this is set true, all relationships are put to the root package. |
private static java.awt.Cursor |
stNoneCursor
cursor which is used when visualization area has no active mode |
private static java.awt.Cursor |
stPanCursor
cursor which is used in panning mode |
private static java.awt.Cursor |
stSelectCursor
cursor which is used in select mode |
protected static ZVisualization |
stVisualizationReference
reference to instantiated visualization |
private static java.awt.Cursor |
stZoomCursor
cursor which is used in zooming mode |
private static double |
ZOOMSPACING
how much space is left to edges when zooming to an element |
private static int |
ZOOMTIME
animation length for zoomTo |
Fields inherited from interface venice.Visualization |
MODE_NONE, MODE_PAN, MODE_SELECT, MODE_ZOOM |
Constructor Summary | |
ZVisualization()
constructor which sets up all internal data structures. |
Method Summary | |
private void |
addToIndex(VModelElement inElement)
adds a VModelElement to the indexing hashtable with checks |
void |
addVRelationship(VRelationship inRelship)
Adds a relationship to the visualization. |
void |
addVRelationshipWithoutAddingOriginalReference(VRelationship inRelship)
Adds the given VRelationship to the visualization,
but does not add it as an original relationship to the source and
destination nodes. |
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. |
private void |
fireSelectionChanged()
|
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 |
private edu.umd.cs.jazz.util.ZBounds |
getSelectionBounds()
calculates bounds for current selection. |
javax.swing.JComponent |
getSwingComponent()
returns a Swing component representing the visualization. |
int |
getToolMode()
gets the current mode of the visualization area. |
static ZVisualization |
getZVisualizationInstance()
Returns the current instance of ZVisualization. |
private void |
initEventHandlers()
Initialize the event handlers |
void |
leaveNonInteractiveMode()
leaves non-interactive mode. |
void |
loadLayout(java.io.InputStream inoutStream)
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. |
private void |
removeFromIndex(java.lang.String outElement)
|
void |
removeVRelationship(VRelationship inRelship)
remove a relationship from the visualization. |
private boolean |
removeVRelationshipFromPackage(VPackage inPackage,
VRelationship inRel)
Removes the relationship from this package. |
void |
saveLayout(java.io.OutputStream inoutStream)
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. |
private void |
setupTestModel1()
sets up an test model for testing visualization subsystem and different graphical components. |
private void |
setupTestModel2()
sets up another test model for testing the subsystem |
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. |
private void |
zoomTo(edu.umd.cs.jazz.util.ZBounds myTargetBounds)
zooms to specified bounds. if bounds width or height is zero, returns without zooming to avoid odd effects. |
void |
zoomToSelection()
Zooms to the current selection on the visualization area. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private static final boolean RELATIONSHIP_SPEEDUP_ENABLED
private static final double ZOOMSPACING
private static final int ZOOMTIME
private static java.awt.Cursor stNoneCursor
private static java.awt.Cursor stPanCursor
private static java.awt.Cursor stSelectCursor
private static java.awt.Cursor stZoomCursor
private edu.umd.cs.jazz.util.ZCanvas mCanvas
private edu.umd.cs.jazz.event.ZEventHandler mCurrentEventHandler
private edu.umd.cs.jazz.event.ZPanEventHandler mPanEventHandler
private VZoomEventHandler mZoomEventHandler
private VCompositeSelectionHandler mSelectionHandler
private edu.umd.cs.jazz.ZLayerGroup mSelectionLayer
private java.util.Hashtable mIndexById
private ZPackage mRootPackage
private VSelectionListener mSelectionListener
private int mCurrentMode
protected static ZVisualization stVisualizationReference
private boolean mInInteractiveMode
Constructor Detail |
public ZVisualization()
Method Detail |
public static ZVisualization getZVisualizationInstance()
public void addVRelationship(VRelationship inRelship)
Commands
to
perform for example relationship grouping on parent level.
This means that the given VRelationship
must have
its source and destination set.addVRelationship
in interface Visualization
inRelship
- relationship to add to visualization.public void addVRelationshipWithoutAddingOriginalReference(VRelationship inRelship)
VRelationship
to the visualization,
but does not add it as an original relationship to the source and
destination nodes.addVRelationshipWithoutAddingOriginalReference
in interface Visualization
inRelship
- relationship to add to visualizationpublic VModelElement findElementById(java.lang.String inId)
Visualization
findElementById
in interface Visualization
venice.Visualization
inId
- ID of the model element to findpublic javax.swing.JMenu getDebugMenu()
Visualization
getDebugMenu
in interface Visualization
public VPackage getRootPackage()
Visualization
getRootPackage
in interface Visualization
public VModelElement[] getSelection()
Visualization
getSelection
in interface Visualization
venice.Visualization
public javax.swing.JComponent getSwingComponent()
Visualization
getSwingComponent
in interface Visualization
venice.Visualization
public int getToolMode()
Visualization
getToolMode
in interface Visualization
public void makeDefaultLayout()
Visualization
makeDefaultLayout
in interface Visualization
public VComponent newVComponent(java.lang.String inId)
Visualization
newVComponent
in interface Visualization
public VInterface newVInterface(java.lang.String inId)
Visualization
newVInterface
in interface Visualization
public VPackage newVPackage(java.lang.String inId)
Visualization
newVPackage
in interface Visualization
public VDependency newVDependency(java.lang.String inId)
Visualization
newVDependency
in interface Visualization
public VGeneralization newVGeneralization(java.lang.String inId)
Visualization
newVGeneralization
in interface Visualization
public VRealization newVRealization(java.lang.String inId)
Visualization
newVRealization
in interface Visualization
public void removeElement(java.lang.String inId)
Visualization
removeElement
in interface Visualization
public void removeVRelationship(VRelationship inRelship)
Visualization
removeVRelationship
in interface Visualization
private boolean removeVRelationshipFromPackage(VPackage inPackage, VRelationship inRel)
inPackage
- the from which to remove the relationshipinRel
- the relationships to removepublic void saveLayout(java.io.OutputStream inoutStream) throws java.io.IOException
Visualization
saveLayout
in interface Visualization
venice.Visualization
layoutStream
- a stream where to save to layout informationpublic void loadLayout(java.io.InputStream inoutStream) throws java.io.IOException
Visualization
loadLayout
in interface Visualization
venice.Visualization
layoutStream
- Layout stream which has been saved using
saveLayout-method.public void setSelection(VModelElement[] inSelection)
Visualization
setSelection
in interface Visualization
public void setSelectionListener(VSelectionListener inListener)
Visualization
setSelectionListener
in interface Visualization
venice.Visualization
inListener
- a reference to a VSelectionListener which will
receive notifications about changes in selection.public void setToolMode(int inMode)
Visualization
setToolMode
in interface Visualization
venice.Visualization
inMode
- one of constants beginning with a MODE_ keyword.public void setZoomVolume(int inDx)
Visualization
setZoomVolume
in interface Visualization
venice.Visualization
inDx
- FIXME: What is this reallypublic void zoomTo(VModelElement inElement)
Visualization
zoomTo
in interface Visualization
venice.Visualization
inElement
- the model element to be zoomed on.public void zoomToSelection()
Visualization
zoomToSelection
in interface Visualization
private void zoomTo(edu.umd.cs.jazz.util.ZBounds myTargetBounds)
private edu.umd.cs.jazz.util.ZBounds getSelectionBounds()
public void clear()
Visualization
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.
clear
in interface Visualization
private void fireSelectionChanged()
private void initEventHandlers()
private void setupTestModel1()
private void setupTestModel2()
private void addToIndex(VModelElement inElement)
private void removeFromIndex(java.lang.String outElement)
public void enterNonInteractiveMode()
Visualization
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.
enterNonInteractiveMode
in interface Visualization
public void leaveNonInteractiveMode()
Visualization
leaveNonInteractiveMode
in interface Visualization
public void printCurrentView()
Visualization
printCurrentView
in interface Visualization
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |