/** * Makes the specified cell visible or invisible depending on the flag * passed in. Note the cell really is a cell, not a cell view. * NOTE: Your GraphLayoutCache must be <code>partial</code> (set * <code>partial</code> to <code>true</code> in the constructor) * in order to use the visibility functionality of expand/collapse, * setVisible, etc. * * @param cell * the cell whose visibility is to be changed * @param visible * <code>true</code> if cell is to be made visible */ public void setVisible(Object cell, boolean visible) { setVisible(new Object[] { cell }, visible); }
/** * Changes the visibility state of the cells passed in. Note that the arrays * must contain cells, not cell views. * NOTE: Your GraphLayoutCache must be <code>partial</code> (set * <code>partial</code> to <code>true</code> in the constructor) * in order to use the visibility functionality of expand/collapse, * setVisible, etc. * * @param visible * cells to be made visible * @param invisible * cells to be made invisible */ public void setVisible(Object[] visible, Object[] invisible) { setVisible(visible, invisible, null); }
/** * Makes the specified cells visible or invisible depending on the flag * passed in. Note the cells really are cells, not cell views. * NOTE: Your GraphLayoutCache must be <code>partial</code> (set * <code>partial</code> to <code>true</code> in the constructor) * in order to use the visibility functionality of expand/collapse, * setVisible, etc. * * @param cells * the cells whose visibility is to be changed * @param visible * <code>true</code> if the cells are to be made visible */ public void setVisible(Object[] cells, boolean visible) { if (visible) setVisible(cells, null); else setVisible(null, cells); }
/** * Changes the visibility state of the cells passed in. Note that the arrays * must contain cells, not cell views. * NOTE: Your GraphLayoutCache must be <code>partial</code> (set * <code>partial</code> to <code>true</code> in the constructor) * in order to use the visibility functionality of expand/collapse, * setVisible, etc. * * @param visible * cells to be made visible * @param invisible * cells to be made invisible * @param cs * a <code>ConnectionSet</code> describing the new state of * edge connections in the graph */ public void setVisible(Object[] visible, Object[] invisible, ConnectionSet cs) { setVisible(visible, invisible, null, cs); }
public void run(){ graph.getGraphLayoutCache().setVisible(vertex, true); } };
public void run(){ graph.getGraphLayoutCache().setVisible(nEdge, true); } };
/** * Shows the specified cells with all children if <code>descandants</code> * is true. * NOTE: Your GraphLayoutCache must be <code>partial</code> (set * <code>partial</code> to <code>true</code> in the constructor) * in order to use the visibility functionality of expand/collapse, * setVisible, etc. */ public void showCells(Object[] cells, boolean descandants) { if (cells != null && cells.length > 0) { if (descandants) cells = DefaultGraphModel.getDescendants(getModel(), cells) .toArray(); setVisible(cells, true); } }
/** * Hides the specified cells with all children if <code>descandants</code> * is true. * NOTE: Your GraphLayoutCache must be <code>partial</code> (set * <code>partial</code> to <code>true</code> in the constructor) * in order to use the visibility functionality of expand/collapse, * setVisible, etc. */ public void hideCells(Object[] cells, boolean descandants) { if (cells != null && cells.length > 0) { if (descandants) cells = DefaultGraphModel.getDescendants(getModel(), cells) .toArray(); setVisible(cells, false); } }
private void showAllChildren(final DefaultGraphCell vertex) { Vector<Object> toShow = new Vector<Object>(); for (DefaultGraphCell o : getChildren(vertex)) { glc.setVisible(o, true); glc.setVisible(o, true); glc.setVisible(o, true);
.isEmpty()) { graph.getGraphLayoutCache().setVisible(cell, false);
setVisible(toShow.toArray(), (toHide != null) ? toHide.toArray() : null, cs);
public DefaultGraphCell insert(Point point, String entity) throws InvalidEntity { // CellView information is not available after creating the cell. // Create a Map that holds the attributes for the Vertex Map map = new Hashtable(); // Snap the Point to the Grid point = convert(this.snap(new Point(point))); // Construct Vertex with no Label DefaultGraphCell vertex; Dimension size; vertex=this.createCell(entity); size=this.getDefaultSize((Entity)vertex.getUserObject()); // Add a Bounds Attribute to the Map GraphConstants.setBounds(map, new Rectangle(point, size)); // Construct a Map from cells to Maps (for insert) Hashtable attributes = new Hashtable(); // Associate the Vertex with its Attributes attributes.put(vertex, map); // Insert the Vertex and its Attributes this.getModel().insert(new Object[] {vertex},attributes , null, null, null); Entity newEntity=(Entity) vertex.getUserObject(); if (prefs.getModelingLanguage()==Preferences.ModelingLanguage.UML) newEntity.getPrefs(null).setView(ViewPreferences.ViewType.UML); if (prefs.getModelingLanguage()==Preferences.ModelingLanguage.INGENIAS) newEntity.getPrefs(null).setView(ViewPreferences.ViewType.INGENIAS); getGraphLayoutCache().setVisible(vertex,true);// makes the cell visible because // the graphlayoutcache has partial set to true return vertex; }
public DefaultGraphCell insert(Point point, String entity) throws InvalidEntity { // CellView information is not available after creating the cell. // Create a Map that holds the attributes for the Vertex Map map = new Hashtable(); // Snap the Point to the Grid point = convert(this.snap(new Point(point))); // Construct Vertex with no Label DefaultGraphCell vertex; Dimension size; vertex=this.createCell(entity); size=this.getDefaultSize((Entity)vertex.getUserObject()); // Add a Bounds Attribute to the Map GraphConstants.setBounds(map, new Rectangle(point, size)); // Construct a Map from cells to Maps (for insert) Hashtable attributes = new Hashtable(); // Associate the Vertex with its Attributes attributes.put(vertex, map); // Insert the Vertex and its Attributes this.getModel().insert(new Object[] {vertex},attributes , null, null, null); Entity newEntity=(Entity) vertex.getUserObject(); if (prefs.getModelingLanguage()==Preferences.ModelingLanguage.UML) newEntity.getPrefs(null).setView(ViewPreferences.ViewType.UML); if (prefs.getModelingLanguage()==Preferences.ModelingLanguage.INGENIAS) newEntity.getPrefs(null).setView(ViewPreferences.ViewType.INGENIAS); getGraphLayoutCache().setVisible(vertex,true);// makes the cell visible because // the graphlayoutcache has partial set to true return vertex; }
public DefaultGraphCell insert(Point point, String entity) throws InvalidEntity { // CellView information is not available after creating the cell. // Create a Map that holds the attributes for the Vertex Map map = new Hashtable(); // Snap the Point to the Grid point = convert(this.snap(new Point(point))); // Construct Vertex with no Label DefaultGraphCell vertex; Dimension size; vertex=this.createCell(entity); size=this.getDefaultSize((Entity)vertex.getUserObject()); // Add a Bounds Attribute to the Map GraphConstants.setBounds(map, new Rectangle(point, size)); // Construct a Map from cells to Maps (for insert) Hashtable attributes = new Hashtable(); // Associate the Vertex with its Attributes attributes.put(vertex, map); // Insert the Vertex and its Attributes this.getModel().insert(new Object[] {vertex},attributes , null, null, null); Entity newEntity=(Entity) vertex.getUserObject(); if (prefs.getModelingLanguage()==Preferences.ModelingLanguage.UML) newEntity.getPrefs(null).setView(ViewPreferences.ViewType.UML); if (prefs.getModelingLanguage()==Preferences.ModelingLanguage.INGENIAS) newEntity.getPrefs(null).setView(ViewPreferences.ViewType.INGENIAS); getGraphLayoutCache().setVisible(vertex,true);// makes the cell visible because // the graphlayoutcache has partial set to true return vertex; }
public DefaultGraphCell insert(Point point, String entity) throws InvalidEntity { // CellView information is not available after creating the cell. // Create a Map that holds the attributes for the Vertex Map map = new Hashtable(); // Snap the Point to the Grid point = convert(this.snap(new Point(point))); // Construct Vertex with no Label DefaultGraphCell vertex; Dimension size; vertex=this.createCell(entity); size=this.getDefaultSize((Entity)vertex.getUserObject()); // Add a Bounds Attribute to the Map GraphConstants.setBounds(map, new Rectangle(point, size)); // Construct a Map from cells to Maps (for insert) Hashtable attributes = new Hashtable(); // Associate the Vertex with its Attributes attributes.put(vertex, map); // Insert the Vertex and its Attributes this.getModel().insert(new Object[] {vertex},attributes , null, null, null); Entity newEntity=(Entity) vertex.getUserObject(); if (prefs.getModelingLanguage()==Preferences.ModelingLanguage.UML) newEntity.getPrefs(null).setView(ViewPreferences.ViewType.UML); if (prefs.getModelingLanguage()==Preferences.ModelingLanguage.INGENIAS) newEntity.getPrefs(null).setView(ViewPreferences.ViewType.INGENIAS); getGraphLayoutCache().setVisible(vertex,true);// makes the cell visible because // the graphlayoutcache has partial set to true return vertex; }
public DefaultGraphCell insert(Point point, String entity) throws InvalidEntity { // CellView information is not available after creating the cell. // Create a Map that holds the attributes for the Vertex Map map = new Hashtable(); // Snap the Point to the Grid point = convert(this.snap(new Point(point))); // Construct Vertex with no Label DefaultGraphCell vertex; Dimension size; vertex=this.createCell(entity); size=this.getDefaultSize((Entity)vertex.getUserObject()); // Add a Bounds Attribute to the Map GraphConstants.setBounds(map, new Rectangle(point, size)); // Construct a Map from cells to Maps (for insert) Hashtable attributes = new Hashtable(); // Associate the Vertex with its Attributes attributes.put(vertex, map); // Insert the Vertex and its Attributes this.getModel().insert(new Object[] {vertex},attributes , null, null, null); Entity newEntity=(Entity) vertex.getUserObject(); if (prefs.getModelingLanguage()==Preferences.ModelingLanguage.UML) newEntity.getPrefs(null).setView(ViewPreferences.ViewType.UML); if (prefs.getModelingLanguage()==Preferences.ModelingLanguage.INGENIAS) newEntity.getPrefs(null).setView(ViewPreferences.ViewType.INGENIAS); getGraphLayoutCache().setVisible(vertex,true);// makes the cell visible because // the graphlayoutcache has partial set to true return vertex; }
public DefaultGraphCell insert(Point point, String entity) throws InvalidEntity { // CellView information is not available after creating the cell. // Create a Map that holds the attributes for the Vertex Map map = new Hashtable(); // Snap the Point to the Grid point = convert(this.snap(new Point(point))); // Construct Vertex with no Label DefaultGraphCell vertex; Dimension size; vertex=this.createCell(entity); size=this.getDefaultSize((Entity)vertex.getUserObject()); // Add a Bounds Attribute to the Map GraphConstants.setBounds(map, new Rectangle(point, size)); // Construct a Map from cells to Maps (for insert) Hashtable attributes = new Hashtable(); // Associate the Vertex with its Attributes attributes.put(vertex, map); // Insert the Vertex and its Attributes this.getModel().insert(new Object[] {vertex},attributes , null, null, null); Entity newEntity=(Entity) vertex.getUserObject(); if (prefs.getModelingLanguage()==Preferences.ModelingLanguage.UML) newEntity.getPrefs(null).setView(ViewPreferences.ViewType.UML); if (prefs.getModelingLanguage()==Preferences.ModelingLanguage.INGENIAS) newEntity.getPrefs(null).setView(ViewPreferences.ViewType.INGENIAS); getGraphLayoutCache().setVisible(vertex,true);// makes the cell visible because // the graphlayoutcache has partial set to true return vertex; }
public DefaultGraphCell insert(Point point, String entity) throws InvalidEntity { // CellView information is not available after creating the cell. // Create a Map that holds the attributes for the Vertex Map map = new Hashtable(); // Snap the Point to the Grid point = convert(this.snap(new Point(point))); // Construct Vertex with no Label DefaultGraphCell vertex; Dimension size; vertex=this.createCell(entity); size=this.getDefaultSize((Entity)vertex.getUserObject()); // Add a Bounds Attribute to the Map GraphConstants.setBounds(map, new Rectangle(point, size)); // Construct a Map from cells to Maps (for insert) Hashtable attributes = new Hashtable(); // Associate the Vertex with its Attributes attributes.put(vertex, map); // Insert the Vertex and its Attributes this.getModel().insert(new Object[] {vertex},attributes , null, null, null); Entity newEntity=(Entity) vertex.getUserObject(); if (prefs.getModelingLanguage()==Preferences.ModelingLanguage.UML) newEntity.getPrefs(null).setView(ViewPreferences.ViewType.UML); if (prefs.getModelingLanguage()==Preferences.ModelingLanguage.INGENIAS) newEntity.getPrefs(null).setView(ViewPreferences.ViewType.INGENIAS); getGraphLayoutCache().setVisible(vertex,true);// makes the cell visible because // the graphlayoutcache has partial set to true return vertex; }
public DefaultGraphCell insert(Point point, String entity) throws InvalidEntity { // CellView information is not available after creating the cell. // Create a Map that holds the attributes for the Vertex Map map = new Hashtable(); // Snap the Point to the Grid point = convert(this.snap(new Point(point))); // Construct Vertex with no Label DefaultGraphCell vertex; Dimension size; vertex=this.createCell(entity); size=this.getDefaultSize((Entity)vertex.getUserObject()); // Add a Bounds Attribute to the Map GraphConstants.setBounds(map, new Rectangle(point, size)); // Construct a Map from cells to Maps (for insert) Hashtable attributes = new Hashtable(); // Associate the Vertex with its Attributes attributes.put(vertex, map); // Insert the Vertex and its Attributes this.getModel().insert(new Object[] {vertex},attributes , null, null, null); Entity newEntity=(Entity) vertex.getUserObject(); if (prefs.getModelingLanguage()==Preferences.ModelingLanguage.UML) newEntity.getPrefs(null).setView(ViewPreferences.ViewType.UML); if (prefs.getModelingLanguage()==Preferences.ModelingLanguage.INGENIAS) newEntity.getPrefs(null).setView(ViewPreferences.ViewType.INGENIAS); getGraphLayoutCache().setVisible(vertex,true);// makes the cell visible because // the graphlayoutcache has partial set to true return vertex; }
public DefaultGraphCell insert(Point point, String entity) throws InvalidEntity { // CellView information is not available after creating the cell. // Create a Map that holds the attributes for the Vertex Map map = new Hashtable(); // Snap the Point to the Grid point = convert(this.snap(new Point(point))); // Construct Vertex with no Label DefaultGraphCell vertex; Dimension size; vertex=this.createCell(entity); size=this.getDefaultSize((Entity)vertex.getUserObject()); // Add a Bounds Attribute to the Map GraphConstants.setBounds(map, new Rectangle(point, size)); // Construct a Map from cells to Maps (for insert) Hashtable attributes = new Hashtable(); // Associate the Vertex with its Attributes attributes.put(vertex, map); // Insert the Vertex and its Attributes this.getModel().insert(new Object[] {vertex},attributes , null, null, null); Entity newEntity=(Entity) vertex.getUserObject(); if (prefs.getModelingLanguage()==Preferences.ModelingLanguage.UML) newEntity.getPrefs(null).setView(ViewPreferences.ViewType.UML); if (prefs.getModelingLanguage()==Preferences.ModelingLanguage.INGENIAS) newEntity.getPrefs(null).setView(ViewPreferences.ViewType.INGENIAS); getGraphLayoutCache().setVisible(vertex,true);// makes the cell visible because // the graphlayoutcache has partial set to true return vertex; }