public void showDomain(CellDomainNode domainNode) {
   _topLabel.setText(">>> " + domainNode.getName() + " <<<");
   _domainNode = domainNode;
   _cellPanel.clear();
   _commandPanel.clear();
   updateDomain();
 }
 @Override
 public void frameArrived(MessageObjectFrame frame) {
   Object obj = frame.getObject();
   if (obj instanceof CellInfo[]) {
     _infos = (CellInfo[]) obj;
     _list.removeAll();
     int systemIndex = -1;
     TreeSet<String> sorted = new TreeSet<>();
     for (CellInfo cellInfo : _infos) {
       sorted.add(cellInfo.getCellName());
     }
     Iterator<String> it = sorted.iterator();
     for (int i = 0; it.hasNext(); i++) {
       String name = it.next();
       _list.add(name);
       if (name.equals("System")) {
         systemIndex = i;
       }
     }
     if (systemIndex > -1) {
       _cellPanel.showCell(_infos[systemIndex], _domainNode.getAddress());
       _commandPanel.showCell(_infos[systemIndex], _domainNode.getAddress() + ":System");
       _list.select("System");
     }
   }
 }
 @Override
 public void actionPerformed(ActionEvent event) {
   Object o = event.getSource();
   if (o == _updateButton) {
     updateDomain();
     _cellPanel.clear();
     _commandPanel.clear();
   } else if (o == _detailButton) {
     _cards.show(_cardPanel, "cell");
     _cellMode = "cell";
   } else if (o == _commandButton) {
     _cards.show(_cardPanel, "command");
     _cellMode = "command";
   }
 }
  @Override
  public void itemStateChanged(ItemEvent event) {
    ItemSelectable sel = event.getItemSelectable();
    Object[] obj = sel.getSelectedObjects();
    if ((obj == null) || (obj.length == 0)) {
      return;
    }

    String cellName = obj[0].toString();
    int i = 0;
    for (; (i < _infos.length) && (!_infos[i].getCellName().equals(cellName)); i++) {}
    if (i == _infos.length) {
      System.out.println("No more in list : " + cellName);
      return;
    }
    _cellPanel.showCell(_infos[i], _domainNode.getAddress());
    _commandPanel.showCell(_infos[i], _domainNode.getAddress() + ":" + cellName);
    _cards.show(_cardPanel, _cellMode);
  }
 public void clear() {
   _list.removeAll();
   _cellPanel.clear();
   _commandPanel.clear();
 }
Exemple #6
0
        public void connectionChanged(AsyncVehicleServer vehicle) {

          // When the connection is changed, update all subcomponents
          _cmdPanel.setVehicle(vehicle);
          _ctrlPanel.setVehicle(vehicle);
        }