org.jgraph.graph.GraphModel Java Examples

The following examples show how to use org.jgraph.graph.GraphModel. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GraphView.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
private JGraph setupGraph() {
    // Construct Model and Graph
    GraphModel model = new DefaultGraphModel();
    JGraph graph = new JGraph(model);

    // Control-drag should clone selection
    graph.setCloneable(true);

    // Enable edit without final RETURN keystroke
    graph.setInvokesStopCellEditing(true);

    // When over a cell, jump to its default port (we only have one, anyway)
    graph.setJumpToDefaultPort(true);

    return graph;
}
 
Example #2
Source File: ERDesignerGraph.java    From MogwaiERDesignerNG with GNU General Public License v3.0 5 votes vote down vote up
public ERDesignerGraph(Model aDBModel, GraphModel aModel,
                       GraphLayoutCache aLayoutCache) {
    super(aModel, aLayoutCache);
    model = aDBModel;

    setMoveIntoGroups(true);
    setMoveOutOfGroups(true);
}
 
Example #3
Source File: MicroarrayGraph.java    From chipster with MIT License 5 votes vote down vote up
public MicroarrayGraph(GraphModel model, GraphLayoutCache cache, GraphPanel graphPanel) {
	super(model, cache);

	this.model = model;
	this.graphPanel = graphPanel;
	this.setBackground(Color.WHITE);

	// Direct call to parents L&F update, see this.updateUI()
	super.updateUI();

	/*
	 * Regardles of the updateUI-call jus before the font size of graph cell is fixed only when the first cell is added. To handle
	 * situations when the font size is changed before importing any data we force the jgraph to initialise itself by inserting dummy
	 * vertex and removing it. This *should* happen before any repaint operation, and thus the vertex won't ever show.
	 */
	GroupVertex vertex = new GroupVertex(0, 0, null, this);
	getGraphLayoutCache().insert(vertex);
	getGraphLayoutCache().remove(new Object[] { vertex });

	// registers the graph object with the tooltip manager
	ToolTipManager.sharedInstance().registerComponent(this);
	
	model.addGraphModelListener(this);

	// start listening
	application.getDataManager().addDataChangeListener(this);
	application.addClientEventListener(this);
}
 
Example #4
Source File: GraphPanel.java    From chipster with MIT License 4 votes vote down vote up
protected GraphModel getGraphModel() {
	return model;
}