/** * Constructs a graph layout cache. */ public GraphLayoutCache() { this(new DefaultGraphModel(), new DefaultCellViewFactory()); }
private void initializeJPanel() { initiate = true; graph.setGraphLayoutCache(new GraphLayoutCache(new DefaultGraphModel(), new DefaultCellViewFactory(), true)); graph.setEditable(false); for (K key : stateKeys) stateCells.put(key, createCell(key, new Point2D(0, 0))); for (K key : stateKeys) createStateTransitionDiagram(key); graph.getGraphLayoutCache().insert(stateCells.values().toArray()); JGraphFacade facade = new JGraphFacade(graph.getGraphLayoutCache()); facade.setEdgePromotion(false); JGraphTreeLayout layout = new JGraphTreeLayout(); layout.run(facade); Map<?, ?> map = facade.createNestedMap(true, true); graph.getGraphLayoutCache().edit(map); }
GraphModel model = new DefaultGraphModel(); graph.setModel(model);
private void initializeJPanel() { initiate = true; graph.setGraphLayoutCache(new GraphLayoutCache(new DefaultGraphModel(), new DefaultCellViewFactory(), true)); graph.setEditable(false); for (int i = 0; i < numberOfStates; i++) { isStateEmpty(stateMachine.states.get(i)); } stateCells = new DefaultGraphCell[numberOfStates]; State<E> parent = getParentState(); stateCells[stateCellIndex] = createCell(parent.getStateEnum().toString(), new Point2d(0, 0), stateCellIndex); stateCellIndex++; createStateMachineDiagram(parent); graph.getGraphLayoutCache().insert(stateCells); JGraphFacade facade = new JGraphFacade(graph.getGraphLayoutCache()); facade.setEdgePromotion(false); JGraphTreeLayout layout = new JGraphTreeLayout(); layout.run(facade); Map<?, ?> map = facade.createNestedMap(true, true); graph.getGraphLayoutCache().edit(map); createDefaultArrows(); createArrowsForStateTransitions(); }
private void initializeJPanel() { initiate = true; graph.setGraphLayoutCache(new GraphLayoutCache(new DefaultGraphModel(), new DefaultCellViewFactory(), true)); graph.setEditable(false); for (int i = 0; i < numberOfStates; i++) { isStateEmpty(stateMachine.states.get(i)); } stateCells = new DefaultGraphCell[numberOfStates]; State<E> parent = getParentState(); stateCells[stateCellIndex] = createCell(parent.getStateEnum().toString(), new Point2D(0, 0), stateCellIndex); stateCellIndex++; createStateMachineDiagram(parent); graph.getGraphLayoutCache().insert(stateCells); JGraphFacade facade = new JGraphFacade(graph.getGraphLayoutCache()); facade.setEdgePromotion(false); JGraphTreeLayout layout = new JGraphTreeLayout(); layout.run(facade); Map<?, ?> map = facade.createNestedMap(true, true); graph.getGraphLayoutCache().edit(map); createDefaultArrows(); createArrowsForStateTransitions(); }
marquee = mh; if (model == null) { model = new DefaultGraphModel(); setModel(model); addSampleData(model);