Tabnine Logo
GraphRelationship
Code IndexAdd Tabnine to your IDE (free)

How to use
GraphRelationship
in
ingenias.generator.browser

Best Java code snippets using ingenias.generator.browser.GraphRelationship (Showing top 20 results out of 315)

origin: net.sf.phat/phat-generator

public static Vector<GraphEntity> getRelatedElementsVectorInSameDiagram(
    GraphEntity agent, String relationshipname, String role)
    throws NullEntity {
  GraphRelationship[] rels = agent.getRelationships();
  Vector related = new Vector();
  for (GraphRelationship gr : rels) {
    if (gr.getType().toLowerCase()
        .equals(relationshipname.toLowerCase())) {
      GraphRole[] roles = gr.getRoles();
      for (int k = 0; k < roles.length; k++) {
        if (roles[k].getName().toLowerCase()
            .equals(role.toLowerCase())) {
          related.add(roles[k].getPlayer());
        }
      }
    }
  }
  return new Vector(new HashSet(related));
}
origin: net.sf.ingenias/editor

for (int l=0;l<relationships2.size() && !found;l++){
  GraphRelationship gr2=relationships2.elementAt(l);
  found=found || gr2.getID().equals(gr1.getID());
  differences.add("relationship "+gr1.getID()+":"+gr1.getType()+" does not exist");
origin: net.sf.phat/phat-generator

GraphRelationship gr = (GraphRelationship) enumeration
    .nextElement();
String[] path = gr.getGraph().getPath();
boolean found = false;
for (int k = 0; k < path.length && !found; k++) {
    && gr.getType().toLowerCase()
    .equals(relationshipname.toLowerCase())) {
  GraphRole[] roles = gr.getRoles();
  for (int k = 0; k < roles.length; k++) {
    if (roles[k].getName().toLowerCase()
origin: net.sf.phat/phat-generator

GraphEntity source = null;
GraphEntity target = null;
System.out.println("\trel=" + progTrans.getID() + ":" + progTrans.getType());
for (GraphRole gRole : progTrans.getRoles()) {
  System.out.println("\t\trole="
      + gRole.getID() + ":"
origin: net.sf.phat/phat-generator

public static GraphEntity getTargetEntity(GraphEntity ge, String relationType) {
  try {
    System.out.println("Relations:");
    for (GraphRelationship gr : ge.getRelationships()) {
      System.out.println("\t" + gr.getType());
      if (gr.getType().equals(relationType)) {
        GraphEntity result = getTargetEntity(ge, gr);
        if (result != null) {
          return result;
        }
      }
    }
  } catch (Throwable ex) {
    ex.printStackTrace();
  }
  return null;
}
origin: net.sf.phat/phat-generator

public static Vector<GraphRole> getRolesFromRelationship(
    GraphRelationship rel, String role) {
  Vector<GraphRole> related = new Vector<GraphRole>();
  GraphRole[] roles = rel.getRoles();
  for (int k = 0; k < roles.length; k++) {
    if (roles[k].getName().toLowerCase().equals(role.toLowerCase())) {
      related.add(roles[k]);
    }
  }
  return related;
}
origin: net.sf.ingenias/editor

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;		
}
origin: net.sf.phat/phat-generator

GraphEntity source = null;
GraphEntity target = null;
System.out.println("\trel=" + gr.getID() + ":" + gr.getType());
for (GraphRole gRole : gr.getRoles()) {
  System.out.println("\t\trole=" + gRole.getID() + ":" + gRole.getName()
      + ":" + gRole.getPlayer().getID() + ":" + gRole.getPlayer().getType());
origin: net.sf.phat/phat-generator

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());
}
origin: net.sf.phat/phat-generator

public static boolean isTargetOfAnyRelationship(GraphEntity ge)
    throws NullEntity {
  for (GraphRelationship gr : ge.getRelationships()) {
    for (GraphRole gRole : gr.getRoles()) {
      if (gRole.getPlayer().getID().equals(ge.getID())
          && gRole.getName().endsWith("target")) {
        return true;
      }
    }
  }
  return false;
}
origin: net.sf.phat/phat-generator

GraphRelationship gr = (GraphRelationship) enumeration
    .nextElement();
if (gr.getType().toLowerCase()
    .equals(relationshipname.toLowerCase())) {
  GraphRole[] roles = gr.getRoles();
  for (int k = 0; k < roles.length; k++) {
    if (roles[k].getName().toLowerCase()
origin: net.sf.phat/phat-generator

public static GraphEntity getSourceEntity(GraphEntity ge, String relationType) {
  try {
    for (GraphRelationship gr : ge.getRelationships()) {
      if (gr.getType().equals(relationType)) {
        return getSourceEntity(ge, gr);
      }
    }
  } catch (Throwable ex) {
    ex.printStackTrace();
  }
  return null;
}
origin: net.sf.phat/phat-generator

public static GraphEntity getTargetEntity(GraphEntity ge, GraphRelationship gr)
    throws NullEntity {
  GraphRole gRole = getTargetRole(gr.getRoles());
  System.out.println("Roles:");
  for (GraphRole r : gr.getRoles()) {
    System.out.println("-" + r.getName() + "->" + r.getPlayer().getID());
  }
  System.out.println("gRole = " + gRole.getPlayer().getID());
  if (gRole != null && !gRole.getPlayer().getID().equals(ge.getID())) {
    return gRole.getPlayer();
  }
  return null;
}
origin: net.sf.phat/phat-generator

GraphRelationship gr = (GraphRelationship) enumeration
    .nextElement();
if (gr.getType().toLowerCase()
    .equals(relationshipname.toLowerCase())) {
  GraphRole[] roles = gr.getRoles();
  for (int k = 0; k < roles.length; k++) {
    if (roles[k].getName().toLowerCase()
origin: net.sf.ingenias/editor

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);
}
origin: net.sf.phat/phat-generator

public static GraphEntity getSourceEntity(GraphEntity ge, GraphRelationship gr) {
  GraphRole gRole = getSourceRole(gr.getRoles());
  try {
    if (gRole != null && gRole.getPlayer().getID() != ge.getID()) {
      return gRole.getPlayer();
    }
  } catch (NullEntity e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
  return null;
}
origin: net.sf.phat/phat-generator

GraphRelationship gr = (GraphRelationship) enumeration
    .nextElement();
if (gr.getType().toLowerCase()
    .equals(relationshipname.toLowerCase())) {
  GraphRole[] roles = gr.getRoles();
  for (int k = 0; k < roles.length; k++) {
    if (roles[k].getName().toLowerCase()
origin: net.sf.phat/phat-generator

if (stats.containsKey(grels[k].getType())){
  Integer old=(Integer)stats.get(grels[k].getType());
  stats.put(grels[k].getType(),new Integer(old.intValue()+1));
  stats.put(grels[k].getType(),new Integer(1));
origin: net.sf.phat/phat-generator

GraphRelationship gr = (GraphRelationship) enumeration
    .nextElement();
if (gr.getType().toLowerCase()
    .equals(relationshipname.toLowerCase())) {
  GraphRole[] roles = gr.getRoles();
  for (int k = 0; k < roles.length; k++) {
    if (roles[k].getName().toLowerCase()
origin: net.sf.phat/phat-generator

if (gr.getType().equals(PROGRAM_TRANSITION_REL)) {
  processProgTransition(gr, repProgBehav);
ingenias.generator.browserGraphRelationship

Most used methods

  • getType
  • getID
  • getRoles
  • getGraph

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • getContentResolver (Context)
  • setContentView (Activity)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • JOptionPane (javax.swing)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now