Ejemplo n.º 1
0
 public void testCreate() {
   CanSystemConnectionMemo memo = new CanSystemConnectionMemo();
   memo.setTrafficController(new TestTrafficController());
   CbusSensorManager m = new CbusSensorManager(memo);
   m.provideSensor(memo.getSystemPrefix() + "SX0A;+N15E6");
   memo.dispose();
 }
Ejemplo n.º 2
0
 public void testAction() {
   // load dummy TrafficController
   TrafficControllerScaffold tcs = new TrafficControllerScaffold();
   CanSystemConnectionMemo memo = new CanSystemConnectionMemo();
   memo.setTrafficController(tcs);
   // f.initComponents(memo);
   new ConfigToolPane();
   Assert.assertNotNull("exists", tcs);
 }
Ejemplo n.º 3
0
  public void initComponents(CanSystemConnectionMemo memo) {
    this.memo = memo;

    memo.getTrafficController().addCanListener(this);

    // add GUI components
    setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.Y_AXIS));

    treePane = new TreePane();

    treePane.initComponents(
        (MimicNodeStore) memo.get(MimicNodeStore.class),
        (Connection) memo.get(Connection.class),
        (NodeID) memo.get(NodeID.class),
        new ActionLoader(
            (MimicNodeStore) memo.get(MimicNodeStore.class),
            (MemoryConfigurationService) memo.get(MemoryConfigurationService.class)));
    add(treePane);

    treePane.addTreeSelectionListener(
        new TreeSelectionListener() {
          public void valueChanged(TreeSelectionEvent e) {
            JTree tree = (JTree) e.getSource();
            DefaultMutableTreeNode node =
                (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();

            if (node == null) {
              return;
            }

            if (node.getUserObject() instanceof NodeTreeRep.SelectionKey) {
              ((NodeTreeRep.SelectionKey) node.getUserObject()).select(node);
            }
          }
        });
  }
Ejemplo n.º 4
0
 public void dispose() {
   memo.getTrafficController().removeCanListener(this);
 }