public static GraphRelationship[] getRelatedElementsRels( GraphEntity element, String relationshipname) { Vector rels = element.getAllRelationships(); Enumeration enumeration = rels.elements(); Vector related = new Vector(); while (enumeration.hasMoreElements()) { GraphRelationship gr = (GraphRelationship) enumeration .nextElement(); if (gr.getType().toLowerCase() .equals(relationshipname.toLowerCase())) { related.add(gr); } } return toGRArray(related.toArray()); }
Vector rels = element.getAllRelationships(); Enumeration enumeration = rels.elements(); Vector<GraphRole> related = new Vector<GraphRole>();
GraphEntity agent, String relationshipname, String role) throws NullEntity { Vector rels = agent.getAllRelationships(); Enumeration enumeration = rels.elements(); Vector related = new Vector();
Vector rels = element.getAllRelationships(); Enumeration enumeration = rels.elements(); Vector related = new Vector();
Vector rels = element.getAllRelationships(); Enumeration enumeration = rels.elements(); Vector related = new Vector();
Vector rels = element.getAllRelationships(); Enumeration enumeration = rels.elements(); Hashtable related = new Hashtable();
Vector rels = element.getAllRelationships(); Enumeration enumeration = rels.elements(); Vector related = new Vector();
Vector rels = element.getAllRelationships(); Enumeration enumeration = rels.elements(); Vector related = new Vector();
public static GraphEntity getADL(String humanId, Browser browser) { GraphEntity result = null; try { GraphEntity[] entities = browser.getAllEntities(); for (GraphEntity adl : entities) { if (adl.getType().equalsIgnoreCase(ADLProfile_SPEC_DIAGRAM)) { Vector<GraphRelationship> rels = adl.getAllRelationships("ProfileOf"); for (GraphRelationship rel : rels) { GraphEntity connectedHuman = Utils.getTargetEntity(adl, rel); if (connectedHuman != null && connectedHuman.getID().equalsIgnoreCase(humanId)) { return adl; } } } } } catch (Throwable ex) { ex.printStackTrace(); } return result; } }
differences.addAll(fieldDifferences); if (!fieldDifferences.isEmpty()){ Vector<GraphRelationship> relationships1 = ent1.getAllRelationships(); Vector<GraphRelationship> relationships2 = ent2.getAllRelationships(); int j=0; allIncluded=allIncluded && relationships1.size()==relationships2.size();
Vector rels = element.getAllRelationships(); Enumeration enumeration = rels.elements(); Vector related = new Vector();
public static boolean containedInto(Browser bimp1, Browser bimp2){ GraphEntity[] entities = bimp1.getAllEntities(); boolean allIncluded=true; int k=0; while (allIncluded && k<entities.length){ GraphEntity ent1 = entities[k]; GraphEntity ent2 = bimp2.findEntity(ent1.getID()); allIncluded=allIncluded && ent2!=null; allIncluded = allIncluded && containedIntoAttributes(allIncluded, ent1, ent2); Vector<GraphRelationship> relationships1 = ent1.getAllRelationships(); Vector<GraphRelationship> relationships2 = ent2.getAllRelationships(); int j=0; allIncluded=allIncluded && relationships1.size()==relationships2.size(); while (allIncluded && j<relationships1.size()){ GraphRelationship gr1=relationships1.elementAt(j); boolean found=false; for (int l=0;l<relationships2.size() && !found;l++){ GraphRelationship gr2=relationships2.elementAt(l); found=found || (gr2.getID().equals(gr1.getID()) && containedIntoAttributes(allIncluded, gr1, gr2)); } allIncluded=allIncluded && found; j++; } k++; } return allIncluded; }
GraphEntity element, String relationshipname, String role) throws NullEntity { Vector rels = element.getAllRelationships(); Enumeration enumeration = rels.elements(); Vector related = new Vector();
private Vector<Graph> getPDDiagramsForActor(GraphEntity actor) { Vector<Graph> patientGraphs = new Vector<Graph>(); Vector<GraphRelationship> rels = actor.getAllRelationships("ProfileOf"); for (GraphRelationship rel : rels) { GraphEntity target; try { target = Utils.getSourceEntity(actor, rel); if (target.getType().equals("ParkinsonsProfile")) { GraphAttribute diagNameAtt = target.getAttributeByName("ParkinsonSpecDiag"); if (diagNameAtt != null && diagNameAtt.getSimpleValue() != null && browser.getGraph(diagNameAtt.getSimpleValue()) != null) { patientGraphs.add(browser.getGraph(diagNameAtt.getSimpleValue())); } } } catch (NotFound e) { // TODO Auto-generated catch block e.printStackTrace(); } } return patientGraphs; }
public void actionPerformed(ActionEvent e) { Log.getInstance().logERROR("Replacing"); try { Vector<GraphRelationship> rels = browser.findEntity(ent.getId()).getAllRelationships(); Entity newent = ConvertUtils.convert(state,ent.getId(), ent.getType(), current); for (int j=0;j<rels.size();j++){ ((GraphRelationshipImp)rels.elementAt(j)).getNAryEdge().replace(ent.getId(),newent); } Vector<ModelJGraph> models = state.gm.getUOModels(); for (int j=0;j<models.size();j++){ GraphModel mjg = models.elementAt(j).getModel(); for (int l=0;l<mjg.getRootCount();l++){ if (((DefaultGraphCell)mjg.getRootAt(l)).getUserObject().equals(ent)){ ((DefaultGraphCell)mjg.getRootAt(l)).setUserObject(newent); Log.getInstance().logERROR("Replaced in model "+models.elementAt(j).getName()); } } } } catch (Exception e1) { e1.printStackTrace(); Log.getInstance().log(e1.getMessage()); } } });