📄 flowgraph.java
字号:
/**
*
*/
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -