21
Graph Visualization Graph Visualization Plug-in for Eclipse Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your How To Finish your Project within Four Project within Four Weeks Weeks

Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project within Four Weeks

Embed Size (px)

Citation preview

Page 1: Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project within Four Weeks

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

Page 2: Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project 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

Page 3: Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project within Four Weeks

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.

Page 4: Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project within Four Weeks

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!!!

Page 5: Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project within Four Weeks

Eclipse Platform OverviewEclipse Platform Overview

Page 6: Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project within Four Weeks

Eclipse Platform OverviewEclipse Platform Overview

Plugin.xml

Plug-inManifest

file

Plugin_name.jar

Plug-in

Eclipse core

Page 7: Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project within Four Weeks

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.

Page 8: Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project within Four Weeks

ExampleExample

Page 9: Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project within Four Weeks

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.

Page 10: Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project within Four Weeks

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.

Page 11: Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project within Four Weeks

GEF MVC ArchitectureGEF MVC Architecture

Page 12: Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project within Four Weeks

MVC ExampleMVC Example

5

Page 13: Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project within Four Weeks

Class Diagram EditorClass Diagram Editor

Model ---- model– BasicSubpart, ClassDiagramModel, Connector

BasicSubpart

ClassDiagramModel Connector

Page 14: Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project within Four Weeks

Class Diagram EditorClass Diagram Editor

View ---- figure– ClassFigure, PolylineConnection

Anchor. Can be black boxes for this project.

Page 15: Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project within Four Weeks

Class Diagram EditorClass Diagram Editor

Controller ---- EditPart– ClassEditPart, ConnectorEditPart

Installed EditPolicies.

EditParte

Page 16: Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project within Four Weeks

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?

Page 17: Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project within Four Weeks

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)

Page 18: Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project within Four Weeks

Construct DJ TraversalConstruct DJ Traversal

Class Graph + Strategy = Traversal.Be sure to use:

edu.neu.ccs.demeter.aplib.Traversal

getEdgeSets() getNodeSets()

Page 19: Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project within Four Weeks

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.

Page 20: Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project within Four Weeks

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)

Page 21: Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project within Four Weeks

Good Luck!Good Luck!

The End