Upload
baldwin-morrison
View
217
Download
0
Tags:
Embed Size (px)
Citation preview
Graph Visualization Plug-in Graph Visualization Plug-in for Eclipsefor Eclipse
Gong Jun
CCIS Northeastern Univ
10/2003
How To Finish your How To Finish your Project within Four WeeksProject within Four Weeks
What You Already HaveWhat You Already Have
A detailed project description.Source codes of a half implemented Eclipse
plug-in.An extended DJ package.
– Parse the Selector Language– Generate a list of StrategyExpressions and a list of
NodeSubsetExpressions.
Lab exercises
What You Need to DoWhat You Need to Do
Add a syntax sensitive Selector Language Editor to this plug-in.
Add traversal highlighting functionality to the Class Diagram Editor.
Write your own class dictionary of the Selector Language.
Eclipse Platform OverviewEclipse Platform Overview
The definition from the official website:– Eclipse is a kind of universal tool platform -
an open extensible IDE for anything and nothing in particular.
The Java compiler itself is a plug-in!!!
Eclipse Platform OverviewEclipse Platform Overview
Eclipse Platform OverviewEclipse Platform Overview
Plugin.xml
Plug-inManifest
file
Plugin_name.jar
Plug-in
Eclipse core
…
What’s Inside plug-in.xmlWhat’s Inside plug-in.xml
Function is added to the system using a common extension model.
Extension points – well-defined function points in the system
that can be extended by plug-insWhen a plug-in contributes an
implementation for an extension point, we say that it adds an extension to the platform.
ExampleExample
Selector Language EditorSelector Language Editor
A simple extension to org.eclipse.ui.texteditor
Add syntax rules.– Syntax coloring is provided in the platform
text framework using a model of damage, repair, and reconciling
Do Lab exercise 18.
GEF MVC ArchitectureGEF MVC Architecture
MVC: Model-View-Controller.Model: represents the data being displayedView: responsible for rendering the dataController: responsible for handling user
input, making changes on the model if necessary, and refreshing the view.
GEF MVC ArchitectureGEF MVC Architecture
MVC ExampleMVC Example
5
Class Diagram EditorClass Diagram Editor
Model ---- model– BasicSubpart, ClassDiagramModel, Connector
BasicSubpart
ClassDiagramModel Connector
Class Diagram EditorClass Diagram Editor
View ---- figure– ClassFigure, PolylineConnection
Anchor. Can be black boxes for this project.
Class Diagram EditorClass Diagram Editor
Controller ---- EditPart– ClassEditPart, ConnectorEditPart
Installed EditPolicies.
EditParte
ClassDiagramModelClassDiagramModel
A list of all the ClassDiagramModels in the diagram will be given to you.
getSourceConnections() method.getTargetConnections() method.isSelected() method.setSelected(boolean b) method.How to have the list of all the connectors?
Construct DJ Class GraphConstruct DJ Class Graph
Create a new class graph.– Be sure to use:
edu.neu.ccs.demeter.aplib.cd.ClassGraph
addConstructionEdge (String source, String name, String target) addAlternationEdge(String source,
String target) addInheritanceEdge(String source,
String target)
Construct DJ TraversalConstruct DJ Traversal
Class Graph + Strategy = Traversal.Be sure to use:
edu.neu.ccs.demeter.aplib.Traversal
getEdgeSets() getNodeSets()
Show The PathShow The Path
What you get from getEdgeSets() and getNodeSets() are lists of names.
Rescan the ClassDiagramModel list, when a selected ClassDiagramModel is met, setSelect().
If it’s not NodeSubsetLanguage, also scan the Connector list, do the same thing.
The HooksThe Hooks
public static ClassGraph createClassGraph(List nodeList)
public static String highlightTraversal (ClassGraph cg, List nodeList, String strategy, boolean is_nodeset)
public static String RefreshStrategy(String name)
public static boolean isNodeSet(String name)
Good Luck!Good Luck!
The End