Exemplo n.º 1
0
 public VarBadge(SuperNode superNode) {
   // mWorkSpace = ws;
   mSuperNode = superNode;
   // Initialize the entry list
   SuperNode parentNode = mSuperNode;
   mEntryList.clear();
   while (parentNode != null) {
     Vector<VarDef> varDefList = parentNode.getVarDefList();
     for (VarDef varDef : varDefList) {
       mEntryList.add(
           new Entry(
               parentNode,
               false,
               varDef.getConcreteSyntax(),
               varDef.getFormattedSyntax(),
               TextFormat.fillWithAttributes(varDef.getFormattedSyntax()).getSecond()));
     }
     parentNode = parentNode.getParentNode();
   }
   // Initialize size and location
   setSize(new Dimension(1, 1));
   setLocation(
       superNode.getVariableBadge().getPosition().getXPos(),
       superNode.getVariableBadge().getPosition().getYPos());
 }
Exemplo n.º 2
0
  public void update(Observable o, Object obj) {
    // mLogger.message("VarBadge.update(" + obj + ")");

    // Clear the entry list
    mEntryList.clear();
    // Recompute the entry list
    SuperNode parentNode = mSuperNode;
    while (parentNode != null) {
      for (VarDef varDef : parentNode.getVarDefList()) {
        String varName = varDef.getName();
        // if (!containsEntryFor(varName)) {
        mEntryList.add(
            new Entry(
                parentNode,
                false,
                varDef.getConcreteSyntax(),
                varDef.getFormattedSyntax(),
                TextFormat.fillWithAttributes(varDef.getFormattedSyntax()).getSecond()));
        // }

      }
      parentNode = parentNode.getParentNode();
    }
  }