本文整理汇总了Java中org.jgraph.JGraph.setCloneable方法的典型用法代码示例。如果您正苦于以下问题:Java JGraph.setCloneable方法的具体用法?Java JGraph.setCloneable怎么用?Java JGraph.setCloneable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jgraph.JGraph
的用法示例。
在下文中一共展示了JGraph.setCloneable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CircleLaneView
import org.jgraph.JGraph; //导入方法依赖的package包/类
public CircleLaneView( FrontEndModel frontEndModel ) throws GUIException
{
super( new BorderLayout() );
setName( "CircleLane " + VERSION );
GraphApparence apparenceMgr = new CircleLaneApparence();
model = frontEndModel.getCircleLaneModel();
model.attach( apparenceMgr );
graph = new JGraph( model );
layoutMgr = new CircleLaneLayout( graph );
graph.setModel( model );
graph.setSelectNewCells(false);
graph.setEditable(false);
graph.setCloneable( false );
graph.setDropEnabled( false );
graph.setConnectable( false );
graph.setDisconnectable( false );
graph.addGraphSelectionListener( graphSelectionListener );
add( new JScrollPane( graph ) );
}
示例2: setupGraph
import org.jgraph.JGraph; //导入方法依赖的package包/类
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;
}
示例3: initGraph
import org.jgraph.JGraph; //导入方法依赖的package包/类
private void initGraph()
{
GraphModel model = new MiddlePanelGraphModel();
graph = new JGraph(model);
// Make Ports Visible by Default
graph.setPortsVisible(true);
// Use the Grid (but don't make it Visible)
graph.setGridEnabled(true);
// Set the Grid Size to 10 Pixel
graph.setGridSize(6);
// Set the Tolerance to 2 Pixel
graph.setTolerance(2);
// Accept edits if click on background
graph.setInvokesStopCellEditing(true);
// Allows control-drag
graph.setCloneable(false);
// Jump to default port on connect
graph.setJumpToDefaultPort(false);
graph.setDoubleBuffered(true);
graph.setSizeable(true);
MiddlePanelJGraphViewFactory graphViewFactory = new MiddlePanelJGraphViewFactory();
graph.getGraphLayoutCache().setFactory(graphViewFactory);
graph.setDropEnabled(true);
graph.setDragEnabled(true);
graph.setEditable(false);
graph.setMoveable(true);
MiddlePanelMarqueeHandler marqueeHandler = new MiddlePanelMarqueeHandler();//this);
graph.setMarqueeHandler(marqueeHandler);
graph.setBackground( graphBackgroundColor);
}
示例4: dmGraphToJGraph
import org.jgraph.JGraph; //导入方法依赖的package包/类
/**
* Converts a DMGraph object to a JGraph object. This method assumes that
* the scale and coordinates are given separately, though in fact they can
* also be given within the VertexInstances in the graph.
*
* @param g DMGraph to be converted.
* @param coordinates double[][] representing the vertex coordinates.
* @param scale double[] representing vertex scales.
* @param featureType Integer representing the feature type for display.
* @param featureIndex Integer representing the feature index to display.
* @return JGraph that corresponds to the provided DMGraph.
* @throws Exception
*/
public static JGraph dmGraphToJGraph(DMGraph g, double[][] coordinates,
double[] scale, int featureType, int featureIndex)
throws Exception {
DefaultGraphModel dgm = new DefaultGraphModel();
JGraph jg = new JGraph(dgm);
jg.setCloneable(true);
jg.setInvokesStopCellEditing(true);
jg.setJumpToDefaultPort(true);
DefaultGraphCell[] cells =
new DefaultGraphCell[g.vertices.size() + g.getNumberOfEdges()];
String cellName = "";
for (int vertexIndex = 0; vertexIndex < g.size(); vertexIndex++) {
// First we extract the cell name;
switch (featureType) {
case (DataMineConstants.NOMINAL): {
cellName = g.vertices.data.get(vertexIndex).sAttr[
featureIndex];
break;
}
case (DataMineConstants.INTEGER): {
cellName = (new Integer(g.vertices.data.get(
vertexIndex).iAttr[featureIndex])).toString();
break;
}
case (DataMineConstants.FLOAT): {
cellName = (new Float(g.vertices.data.get(
vertexIndex).fAttr[featureIndex])).toString();
break;
}
}
// We create the appropriate cell.
cells[vertexIndex] = createCell(cellName,
coordinates[vertexIndex][0], coordinates[vertexIndex][1],
scale[vertexIndex] * 10);
((VertexInstance) (g.vertices.data.get(vertexIndex))).jgVertex =
cells[vertexIndex];
}
for (int vertexIndex = 0; vertexIndex < g.size(); vertexIndex++) {
DMGraphEdge edge = g.edges[vertexIndex];
while (edge != null) {
if (edge.first < edge.second) {
cells[g.vertices.size() + vertexIndex] =
createWeightedEdge(cells[edge.first],
cells[edge.second], edge.weight);
}
edge = edge.next;
}
}
insertCellArray(jg, cells);
return jg;
}
示例5: DBWizardEREditor
import org.jgraph.JGraph; //导入方法依赖的package包/类
/** Creates new form DBWizardEREditor */
public DBWizardEREditor()
{
initComponents();
ApplicationContext.getInstance().getRandomiserInstances();
ApplicationContext.getInstance().getRandomiserTypes();
alDBTableGenerator = new ArrayList<DBTableGenerator>();
hmDBTableGenerator = new HashMap<String, DBTableGenerator>();
hmPorts = new HashMap<Object, Object>();
GraphModel model = new DefaultGraphModel();
GraphLayoutCache view = new GraphLayoutCache(model, new DBGraphCellViewFactory());
//GraphLayoutCache view = new GraphLayoutCache(model, new DefaultCellViewFactory());
graph = new JGraph(model, view);
graph.setSizeable(true);
graph.setMarqueeHandler(createMarqueeHandler());
// Make Ports Visible by Default
graph.setPortsVisible(true);
// Use the Grid (but don't make it Visible)
graph.setGridEnabled(true);
// Set the Grid Size to 10 Pixel
graph.setGridSize(10);
// Set the Tolerance to 2 Pixel
graph.setTolerance(2);
// Accept edits if click on background
graph.setInvokesStopCellEditing(true);
// Allows control-drag
graph.setCloneable(true);
// Jump to default port on connect
graph.setJumpToDefaultPort(true);
setLayout(new BorderLayout());
toolbar = createToolBar();
add(toolbar, BorderLayout.NORTH);
add(new JScrollPane(graph), BorderLayout.CENTER);
popupDB = new DBPopup(this);
}