Graph[] gs = this.getGraphs(); HashSet<GraphEntity> entities = new HashSet<GraphEntity>(); for (int k = 0; k < gs.length; k++) {
public Graph findFirstEntityOccurrence(String id){ Graph[] gs=this.getGraphs(); boolean found=false; Graph result=null; for (int k=0;k<gs.length && result==null;k++){ GraphEntity[] entities; try { entities = gs[k].getEntities(); for (int j=0;j<entities.length && result==null;j++){ if (entities[j].getID().equalsIgnoreCase(id)){ result=gs[k]; } } } catch (NullEntity e) { // TODO Auto-generated catch block e.printStackTrace(); } } return result; }
public void actionPerformed(ActionEvent e) { StringBuffer result=new StringBuffer(); result.append("Diagrams found:<ul>"); Graph[] graphs=bimp.getGraphs(); for (int k=0;k<graphs.length;k++){ GraphEntity[] ges; try { ges = graphs[k].getEntities(); boolean found=false; for (int j=0;j<ges.length &&!found;j++){ found=ges[j].getID().equals(ent.getId()); } if (found){ result.append("<li><a href=\"http://app/"+graphs[k].getName()+"/"+ent.getId()+"\">"+graphs[k].getName()+"</a>"); } } catch (NullEntity e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } result.append("</ul>"); resources.getSearchDiagramPanel().setText(result.toString()); resources.focusSearchPane(); } });