Пример #1
0
 void updateColor() {
   if (gNode.isInitial()) {
     setBackground(Color.yellow);
     setBorder(BorderFactory.createLineBorder(Color.yellow, 1));
     //  two pixels wide
   } else {
     setBackground(Color.white);
     setBorder(BorderFactory.createLineBorder(Color.black, 1));
   }
 }
Пример #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());
 }