Search in sources :

Example 6 with NodeID

use of org.openlcb.NodeID in project JMRI by JMRI.

the class OpenLcbLocoAddressTest method testEqualsWrongType.

public void testEqualsWrongType() {
    OpenLcbLocoAddress a = new OpenLcbLocoAddress(new NodeID(new byte[] { 1, 2, 3, 4, 5, 6 }));
    Assert.assertTrue(!a.equals("foo"));
    Assert.assertTrue(!"foo".equals(a));
}
Also used : NodeID(org.openlcb.NodeID)

Example 7 with NodeID

use of org.openlcb.NodeID in project JMRI by JMRI.

the class TreePaneDemo method setUp.

@Before
public void setUp() throws Exception {
    store = new MimicNodeStore(connection, nid1);
    Message msg = new ProducerIdentifiedMessage(nid1, eventA, EventState.Unknown);
    store.put(msg, null);
    // build the TreePane, but don't put it in a frame (yet).
    pane = new TreePane();
    pane.initComponents(store, null, null, new NodeTreeRep.SelectionKeyLoader() {

        @Override
        public NodeTreeRep.SelectionKey cdiKey(String name, NodeID node) {
            return new NodeTreeRep.SelectionKey(name, node) {

                @Override
                public void select(DefaultMutableTreeNode rep) {
                    System.out.println("Making special fuss over: " + rep + " for " + name + " on " + node);
                }
            };
        }
    });
    if (GraphicsEnvironment.isHeadless()) {
        // don't bother setting up a frame in headless.
        return;
    }
    // Test is really popping a window before doing all else
    frame = new JFrame();
    frame.setTitle("TreePane Test");
    frame.add(pane);
    frame.pack();
    frame.setMinimumSize(new java.awt.Dimension(200, 200));
    frame.setVisible(true);
}
Also used : MimicNodeStore(org.openlcb.MimicNodeStore) SimpleNodeIdentInfoReplyMessage(org.openlcb.SimpleNodeIdentInfoReplyMessage) Message(org.openlcb.Message) ProducerIdentifiedMessage(org.openlcb.ProducerIdentifiedMessage) ProtocolIdentificationReplyMessage(org.openlcb.ProtocolIdentificationReplyMessage) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) ProducerIdentifiedMessage(org.openlcb.ProducerIdentifiedMessage) TreePane(org.openlcb.swing.networktree.TreePane) JFrame(javax.swing.JFrame) NodeTreeRep(org.openlcb.swing.networktree.NodeTreeRep) NodeID(org.openlcb.NodeID) Before(org.junit.Before)

Aggregations

NodeID (org.openlcb.NodeID)7 MimicNodeStore (org.openlcb.MimicNodeStore)2 FlowLayout (java.awt.FlowLayout)1 InetAddress (java.net.InetAddress)1 NetworkInterface (java.net.NetworkInterface)1 SocketException (java.net.SocketException)1 BoxLayout (javax.swing.BoxLayout)1 JButton (javax.swing.JButton)1 JCheckBox (javax.swing.JCheckBox)1 JFrame (javax.swing.JFrame)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 JSeparator (javax.swing.JSeparator)1 JTextField (javax.swing.JTextField)1 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)1 ClientActions (jmri.jmrix.openlcb.swing.ClientActions)1 GridLayout2 (jmri.util.javaworld.GridLayout2)1 Before (org.junit.Before)1 Connection (org.openlcb.Connection)1 Message (org.openlcb.Message)1