flowgraph.java

来自「JGraph扩展应用。自定义Renderer,自定义视图View实现自定义工作流」· Java 代码 · 共 39 行

JAVA
39
字号
/**
 * 
 */
package flow.graph.gui.graph;

import org.jgraph.JGraph;
import org.jgraph.graph.GraphLayoutCache;
import org.jgraph.graph.GraphModel;

/**
 * @author Administrator
 *
 */
public class FlowGraph extends JGraph{
	// Construct the Graph using the Model as its Data Source
	public FlowGraph(GraphModel model) {
		this(model, null);
	}

	// Construct the Graph using the Model as its Data Source
	public FlowGraph(GraphModel model, GraphLayoutCache cache) {
		super(model, cache);
		// Make Ports Visible by Default
		setPortsVisible(true);
		// Use the Grid (but don't make it Visible)
		setGridEnabled(true);
		// Set the Grid Size to 10 Pixel
		setGridSize(6);
		// Set the Tolerance to 2 Pixel
		setTolerance(2);
		// Accept edits if click on background
		setInvokesStopCellEditing(true);
		// Allows control-drag
		setCloneable(true);
		// Jump to default port on connect
		setJumpToDefaultPort(true);
	}	
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?