void AutoConnectGraph() { if (!graphEx.getGraphNodeList().isGraphComplete()) { graphEx.autoConnectGraph(); repaint(); } }
if (!graphEx.getGraphNodeList().isGraphComplete()) { final JMenuItem connectItem = new JMenuItem("Connect Graph", null); connectItem.setHorizontalTextPosition(JMenuItem.RIGHT);
public boolean InitGraph() throws GraphException { if (graphNodeList.isGraphComplete()) { AssignAllParameters(); ProductSetUIHandler productSetHandler = new ProductSetUIHandler(graph, graphNodeList); SubGraphHandler subGraphHandler = new SubGraphHandler(graph, graphNodeList); try { recreateGraphContext(); graphNodeList.updateGraphNodes(graphContext); //todo recreateGraphContext(); } catch (Exception e) { e.printStackTrace(); throw new GraphException(e.getMessage()); } finally { subGraphHandler.restore(); productSetHandler.restore(); } return true; } return false; }
/** * Handle mouse released event * * @param e the mouse event */ public void mouseReleased(MouseEvent e) { checkPopup(e); if (connectingSourceFromHead) { final GraphNode n = findNode(e.getPoint()); if (n != null && selectedNode != n) { connectSourceTargetNode.connectOperatorSource(n.getID()); } } else if (connectingSourceFromTail) { final GraphNode n = findNode(e.getPoint()); if (n != null && selectedNode != n) { n.connectOperatorSource(connectSourceTargetNode.getID()); } } connectingSourceFromHead = false; connectingSourceFromTail = false; connectSourceTargetNode = null; if (graphEx.getGraphNodeList().isGraphComplete()) { graphEx.notifyConnection(); } repaint(); }