congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
GraphEntity.getID
Code IndexAdd Tabnine to your IDE (free)

How to use
getID
method
in
ingenias.generator.browser.GraphEntity

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

origin: net.sf.ingenias/editor

public GraphEntity findEntity(String id){
  GraphEntity[] ents=this.getAllEntities();
  boolean found=false;
  int k=0;
  for (k=0;k<ents.length &&!found;k++){
    found=ents[k].getID().equals(id);
  }
  if (found)
    return ents[k-1];
  else 
    return null;
}
origin: net.sf.phat/phat-generator

private String getSymptomEvoName(GraphEntity symptom) {
  String result = Utils.getAttributeByName(symptom, "SymptomEvoField");
  if (result.equals("")) {
    logger.log(Level.WARNING, "There are not Symptom Evolution Diagram for symptom {0}",
        new Object[]{symptom.getID()});
    return null;
  } else {
    //return "new "+Utils.replaceBadChars(result)+"(agent,"+Utils.replaceBadChars(symptom.getID())+")";
    return result;
  }
}
origin: net.sf.phat/phat-generator

  private static String getVarValue(GraphEntity task, String varRel, String value) {
    GraphEntity ge = Utils.getTargetEntity(task, varRel);
    String resultValue = value.equals("null") ? "null" : "\"" + value + "\"";
    if (ge != null) {
      String varValue = "getParent().getMetadata(\"" + Utils.replaceBadChars(ge.getID()) + "\")";
      return varValue + " != null ? " + varValue + " : " + resultValue;
    }
    return resultValue;
  }
}
origin: net.sf.phat/phat-generator

public static String getFieldValue(GraphEntity task, String fieldName, String def, boolean mandatory) {
  GraphAttribute at = null;
  try {
    at = task.getAttributeByName(fieldName);
  } catch (NotFound ex) {
  }
  if (at == null || at.getSimpleValue().equals("")) {
    if (mandatory) {
      logger.log(Level.SEVERE, "Attribute {0} of {1} is empty!",
          new Object[]{fieldName, task.getID()});
      System.exit(0);
    } else {
      logger.log(Level.WARNING, "Attribute {0} of {1} is empty!",
          new Object[]{fieldName, task.getID()});
      return def;
    }
  }
  return Utils.getValue(at);
}
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

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

public static Vector<GraphEntity> getProfilesTypeOf(String humanId, String profileType, Browser browser) {
  Vector<GraphEntity> result = new Vector<GraphEntity>();
  try {
    GraphEntity[] entities = browser.getAllEntities();
    for (GraphEntity adl : entities) {
      if (adl.getType().equalsIgnoreCase(profileType)) {
        GraphEntity human = Utils.getTargetEntity(adl, "ProfileOf");
        if (human != null && human.getID().equals(humanId)) {
          result.add(adl);
        }
      }
    }
  } catch (Throwable ex) {
    ex.printStackTrace();
  }
  return result;
}
origin: net.sf.ingenias/editor

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

public static GraphEntity getTargetEntity(GraphEntity ge, String relationType, GraphRelationship[] rel) {
  try {
    for (GraphRelationship gr : rel) {
      if (gr.getType().equals(relationType)) {
        GraphRole sRole = getSourceRole(gr.getRoles());
        GraphRole gRole = getTargetRole(gr.getRoles());
        if (sRole != null && sRole.getPlayer().getID().equals(ge.getID())
            && gRole != null && !gRole.getPlayer().getID().equals(ge.getID())) {
          return gRole.getPlayer();
        }
      }
    }
  } catch (Throwable ex) {
    ex.printStackTrace();
  }
  return null;
}
origin: net.sf.phat/phat-generator

public static GraphEntity getProfileTypeOf(String humanId, String profileType, Browser browser) {
  GraphEntity result = null;
  try {
    GraphEntity[] entities = browser.getAllEntities();
    for (GraphEntity adl : entities) {
      if (adl.getType().equalsIgnoreCase(profileType)) {
        GraphEntity human = Utils.getTargetEntity(adl, "ProfileOf");
        if (human != null && human.getID().equals(humanId)) {
          return adl;
        }
      }
    }
  } catch (Throwable ex) {
    ex.printStackTrace();
  }
  return result;
}
origin: net.sf.phat/phat-generator

public static Collection<GraphEntity> getTargetsEntity(GraphEntity ge, String relationType) {
  List<GraphEntity> result = new ArrayList<>();
  try {
    for (GraphRelationship gr : ge.getRelationships()) {
      if (gr.getType().equals(relationType)) {
        for (GraphRole gRole : getTargetsRole(gr.getRoles())) {
          if (gRole != null && gRole.getPlayer().getID() != ge.getID()) {
            result.add(gRole.getPlayer());
          }
        }
      }
    }
  } catch (Throwable ex) {
    ex.printStackTrace();
  }
  return 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

public static Collection<GraphEntity> getSourcesEntity(GraphEntity ge, String relationType) {
  List<GraphEntity> result = new ArrayList<GraphEntity>();
  try {
    for (GraphRelationship gr : ge.getRelationships()) {
      if (gr.getType().equals(relationType)) {
        for (GraphRole gRole : getSourcesRole(gr.getRoles())) {
          if (gRole != null && gRole.getPlayer().getID() != ge.getID()) {
            result.add(gRole.getPlayer());
          }
        }
      }
    }
  } catch (Throwable ex) {
    ex.printStackTrace();
  }
  return result;
}
origin: net.sf.phat/phat-generator

private void generateCondTransitions(GraphEntity activity, Repeat repFather) {
  for (GraphEntity previousIf : Utils.getSourcesEntity(activity, TRUE_FLOW_REL)) {
    if (previousIf.getType().equals(IF_FLOW_CONTROL_TYPE)) {
      propagateCond(activity, previousIf, "new CompositeAndCondition("
          + Utils.replaceBadChars(previousIf.getID()) + ")", repFather);
    }
  }
  for (GraphEntity previousIf : Utils.getSourcesEntity(activity, FALSE_FLOW_REL)) {
    if (previousIf.getType().equals(IF_FLOW_CONTROL_TYPE)) {
      propagateCond(activity, previousIf, "new NegateCondition(new CompositeAndCondition("
          + Utils.replaceBadChars(previousIf.getID()) + "))", repFather);
    }
  }
}
origin: net.sf.phat/phat-generator

public static String getValue(GraphAttribute attribute) {
  if (attribute.isCollectionValue()) {
    try {
      return replaceBadChars(attribute.getCollectionValue().getElementAt(0).getID());
    } catch (NullEntity ex) {
      Logger.getLogger(TaskGenerator.class.getName()).log(Level.SEVERE, null, ex);
    }
  }
  if(attribute.isEntityValue()) {
    return replaceBadChars(attribute.getSimpleValue());
  }
  return attribute.getSimpleValue();
}

origin: net.sf.phat/phat-generator

private void registerFirstProgState(Graph deviceBehavDiag, Repeat repFather) {
  GraphEntity ge = Utils.getFirstEntity(deviceBehavDiag, PROGRAM_STATE);
  if (ge == null) {
    logger.log(Level.SEVERE, "The diagram {0} is empty or doesn't know "
        + "which entity is the first one!",
        new Object[]{deviceBehavDiag.getID()});
    System.exit(0);
  }
  Repeat repFirst = new Repeat("firstProgState");
  repFather.add(repFirst);
  repFirst.add(new Var("psID", Utils.replaceBadChars(ge.getID())));
}
origin: net.sf.phat/phat-generator

private void generateDirectTransitions(GraphEntity activity, Repeat repFather) {
  for (GraphEntity previousAct : Utils.getSourcesEntity(activity, NEXT_ACTIVITY_REL)) {
    if (previousAct.getType().equals(ACTIVITY_TYPE)) {
      // registers a transition between activities without any
      // condition
      Repeat rep2 = new Repeat("regTrans");
      repFather.add(rep2);
      rep2.add(new Var("actSource", Utils.replaceBadChars(previousAct.getID())));
      rep2.add(new Var("actTarget", Utils.replaceBadChars(activity.getID())));
    }
  }
}
origin: net.sf.phat/phat-generator

  private Repeat createNewProgState(GraphEntity progState) {
    Repeat progStateRep = new Repeat("progStates");
    System.out.println("\t\tProgState: " + progState.getID() + ":" + progState.getType());
    progStateRep.add(new Var("psID", Utils.replaceBadChars(progState.getID())));
    progStateRep.add(new Var("psType", Utils.replaceBadChars(progState.getType())));
    progStateRep.add(new Var("psDesc", Utils.getAttributeByName(progState, "Description")));
    return progStateRep;
  }
}
origin: net.sf.phat/phat-generator

  public void generateAgents(Sequences seq) throws NullEntity, NotFound {
    new ADLsGenerator(browser).generateADLClasses(seq);
    for (Graph diagram : Utils.getGraphsByType(HUMAN_PROFILE_SPEC_DIAGRAM,
        browser)) {
      for (GraphEntity actor : Utils.getEntities(diagram, "Human")) {
        Repeat rep = new Repeat("actors");
        seq.addRepeat(rep);

        rep.add(new Var("aName", Utils.replaceBadChars(actor.getID())));
        String humanId = actor.getID();

        
        new InteractionDiagramGenerator(browser).generateEventProcessor(humanId, rep);
        PDGenerator.linkPDManager(humanId, rep, browser);
        new PDGenerator(browser).generatePD(seq, actor);

      }
    }
  }
}
origin: net.sf.phat/phat-generator

private void generateCondition(Graph adlSpec, Repeat repFather) throws NullEntity {
  for (GraphEntity condition : adlSpec.getEntities()) {
    if (condition.getType().equals(IF_FLOW_CONTROL_TYPE)) {
      Collection<GraphEntity> conds = Utils.getTargetsEntity(condition, IF_FLOW_COND_REL);
      String condSentence = ConditionGenerator.generateAndCondition(conds);
      String condId = Utils.replaceBadChars(condition.getID());
      Repeat conditions = new Repeat("conditions");
      repFather.add(conditions);
      conditions.add(new Var("condId", condId));
      conditions.add(new Var("condInst", condSentence));
    }
  }
}
ingenias.generator.browserGraphEntitygetID

Popular methods of GraphEntity

  • getType
  • getAllAttrs
  • getAllRelationships
  • getAttributeByName
  • getRelationships

Popular in Java

  • Reactive rest calls using spring rest template
  • putExtra (Intent)
  • onCreateOptionsMenu (Activity)
  • startActivity (Activity)
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • JTextField (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Option (scala)
  • Best IntelliJ 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