public Graph getGraph(){ return new GraphImp(this.graph, ids); }
private void createSubFolders(File f) { if (!f.exists()) { createSubFolders(new File(f.getParent())); try { f.createNewFile(); } catch (IOException ioe) { ioe.printStackTrace(); } } }
public GraphAttribute createAttribute(String name, Object value, Graph graph ){ GraphAttribute ga=new GraphAttributeImp(name,value,((GraphImp)graph).getGraph(),ids); return ga; }
public String[] getPath() { try { return ids.gm.getModelPath(this. getName()); } catch (ingenias.exception.NotFound nf) { nf.printStackTrace(); } return null; }
public GraphEntity findEntity(String sourceTaskID) { GraphEntity[] entities; try { entities = getEntities(); GraphEntity found=null; for (GraphEntity ge:entities){ if (ge.getID().equalsIgnoreCase(sourceTaskID)) found=ge; } return found; } catch (NullEntity e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; }
public Vector<GraphRelationship> getAllRelationships(){ HashSet<GraphRelationship> result=new HashSet<GraphRelationship>(); Graph[] g=null; g = browser.getGraphs(); for (int k=0;k<g.length;k++){ HashSet rel=this.getRelationshipsFromAGraph(((GraphImp)g[k]).getGraph()); result.addAll(rel); } return new Vector<GraphRelationship>(result); }
/** * Gets the graph attribute of the BrowserImp object * *@param id Description of Parameter *@return The graph value */ public Graph getGraph(String id) { ingenias.editor.GraphManager gm = ids.gm; ingenias.editor.ModelJGraph mg = (ingenias.editor.ModelJGraph) gm.getModel(id); if (mg != null) { return new GraphImp(mg, ids); } else { return null; } }
public Vector getAllRelationships(String relType){ HashSet<GraphRelationship> result=new HashSet<GraphRelationship>(); Graph[] g=null; g = browser.getGraphs(); for (int k=0;k<g.length;k++){ HashSet<GraphRelationship> rel=this.getRelationshipsFromAGraph(((GraphImp)g[k]).getGraph()); for (GraphRelationship gr:rel){ if (gr.getType().equalsIgnoreCase(relType)) result.add(gr); } } return new Vector<GraphRelationship>(result); }
/** * Obtains all existing graphs * *@return The graphs value */ public Graph[] getGraphs() { ingenias.editor.GraphManager gm = ids.gm; Vector models = gm.getUOModels(); Graph[] gs = new Graph[models.size()]; Iterator it = models.iterator(); int k = 0; while (it.hasNext()) { ingenias.editor.ModelJGraph model = (ingenias.editor.ModelJGraph) it.next(); gs[k] = new GraphImp(model,ids); k++; } return gs; }
public GraphAttribute createAttribute(String name, GraphCollection value, Graph graph ){ GraphAttribute ga=new GraphAttributeImp(name,((GraphCollectionImp)value).getValue(),((GraphImp)graph).getGraph(),ids); return ga; }
private DefaultGraphCell findEntity(String id){ Vector<ModelJGraph> graphs = this.ids.gm.getUOModels(); int k=0; boolean found=false; DefaultGraphCell result=null; while (result==null && k<graphs.size()){ result=findEntity(id,new GraphImp(graphs.elementAt(k), ids)); k++; } return result; }
public GraphCollection createCollection(Vector<GraphEntity> elements, Graph g) throws InvalidColection{ if (elements.size()>0){ TypedVector tv=new TypedVector(((GraphEntityImp)elements.firstElement()).getEntity().getClass()); for (int k=0;k<elements.size();k++){ tv.add(((GraphEntityImp)elements.elementAt(k)).getEntity()); } return new GraphCollectionImp(tv,((GraphImp)g).getGraph(),ids); } throw new InvalidColection("Collection used is empty"); }
GraphImp gimp=new GraphImp(ndiagram,ids);
npath=path; ids.gm.addModel(npath, name, ndiagram); GraphImp gimp=new GraphImp(ndiagram,ids);