InstanceListModel(ASDGrammar grammar, String word) {
   ArrayList instanceList = grammar.lookupWord(word);
   for (Iterator it = instanceList.iterator(); it.hasNext(); ) {
     ASDGrammarNode n = (ASDGrammarNode) it.next();
     String instance = (String) n.instance();
     this.addElement(instance);
   }
 }
Ejemplo n.º 2
0
 ASDEditNode(ASDGrammarNode grammarNode, Container given) {
   super(" " + grammarNode.word() + " " + grammarNode.instance() + " ");
   gNode = grammarNode;
   context = given;
   addMouseListener((MouseListener) this);
   popupListener = new PopupListener(new EditNodeMenu(this));
   addMouseListener(popupListener);
   addChangeListener((ChangeListener) this);
   addMouseMotionListener((MouseMotionListener) this);
   if (grammarNode.isInitial()) {
     setBackground(Color.yellow);
     setBorder(BorderFactory.createLineBorder(Color.yellow, 1));
     //  two pixels wide
   } else {
     setBackground(Color.white);
     setBorder(BorderFactory.createLineBorder(Color.black, 1));
   }
   if (grammarNode.isFinal()) initializeRightLabel(grammarNode.phraseType());
 }