use of org.openlcb.Message 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);
}
use of org.openlcb.Message in project JMRI by JMRI.
the class TreePaneDemo method testAfterMessage.
@Test
public void testAfterMessage() {
Assume.assumeFalse(GraphicsEnvironment.isHeadless());
frame.setTitle("After Message");
Message msg = new ProducerIdentifiedMessage(nid2, eventA, EventState.Unknown);
store.put(msg, null);
}
use of org.openlcb.Message in project JMRI by JMRI.
the class OpenLcbCanSendPane method sendVerifyNodeGlobal.
public void sendVerifyNodeGlobal(java.awt.event.ActionEvent e) {
Message m = new VerifyNodeIDNumberMessage(srcNodeID);
connection.put(m, null);
}
use of org.openlcb.Message in project JMRI by JMRI.
the class OpenLcbCanSendPane method sendDatagramPerformed.
public void sendDatagramPerformed(java.awt.event.ActionEvent e) {
Message m = new DatagramMessage(srcNodeID, destNodeID(), jmri.util.StringUtil.bytesFromHexString(datagramContentsField.getText()));
connection.put(m, null);
}
use of org.openlcb.Message in project JMRI by JMRI.
the class OpenLcbCanSendPane method sendRequestEvents.
public void sendRequestEvents(java.awt.event.ActionEvent e) {
Message m = new IdentifyEventsMessage(srcNodeID, destNodeID());
connection.put(m, null);
}
Aggregations