/** * Inserts the <code>cells</code> and connections into the model, and * absorbs the local attributes. This implementation sets the inserted cells * visible and selects the new roots depending on graph.selectNewCells. */ public void insert(Object[] roots, Map attributes, ConnectionSet cs, ParentMap pm, UndoableEdit[] e) { Object[] visible = null; if (isPartial() && showsInsertedCells) { List tmp = DefaultGraphModel.getDescendants(graphModel, roots); tmp.removeAll(visibleSet); if (!tmp.isEmpty()) visible = tmp.toArray(); } // Absorb local attributes GraphLayoutCacheEdit edit = createLocalEdit(roots, attributes, visible, null); if (edit != null) e = augment(e, edit); graphModel.insert(roots, attributes, cs, pm, e); }
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 // 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); 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 // 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); 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 // 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); 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 // 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); 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 // 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); 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 // 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); 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 // 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); 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 // 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); 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 // 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); 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; }
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; }