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); }
setDataDomain(domain); GraphLayoutCache view = new GraphLayoutCache(model, new DefaultCellViewFactory()); graph.setGraphLayoutCache(view);
public ModelJGraph(ModelDataEntity mde,String nombre,Model m,BasicMarqueeHandler mh, ObjectManager om){ super(m,mh); this.setGraphLayoutCache(new GraphLayoutCache(m,getGraphLayoutCache().getFactory(),true)); this.mde=mde; this.name=nombre; this.setId(name); this.setAntiAliased(true); this.om=om; if (om==null) throw new RuntimeException("IDEState is null in Model JGraph"); creaToolBar(); this.setBackground(Color.white); this.setTransferHandler(new CustomTransferHandler(om,this)); // this.setTransferHandler(new RelationshipEntityTransferHandler()); lc=new ListenerContainer(m,this.getGraphLayoutCache(),this); naryEdgeLocation = new ChangeNARYEdgeLocation(this); changeEntityLocation= new ChangeEntityLocation(this); setGridSize(1.0); if (enabledAllListeners){ createListeners(); } final ModelJGraph self=this; }
setModel(model); if (layoutCache == null) layoutCache = new GraphLayoutCache(model, new DefaultCellViewFactory()); setGraphLayoutCache(layoutCache);
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(); }