Search in sources :

Example 6 with JMRIClientSystemConnectionMemo

use of jmri.jmrix.jmriclient.JMRIClientSystemConnectionMemo in project JMRI by JMRI.

the class PacketGenActionTest method testMemoCtor.

@Test
public void testMemoCtor() {
    Assume.assumeFalse(GraphicsEnvironment.isHeadless());
    PacketGenAction action = new PacketGenAction(new JMRIClientSystemConnectionMemo());
    Assert.assertNotNull("exists", action);
}
Also used : JMRIClientSystemConnectionMemo(jmri.jmrix.jmriclient.JMRIClientSystemConnectionMemo) Test(org.junit.Test)

Example 7 with JMRIClientSystemConnectionMemo

use of jmri.jmrix.jmriclient.JMRIClientSystemConnectionMemo in project JMRI by JMRI.

the class JMRIClientMonActionTest method testCtor.

@Test
public void testCtor() {
    Assume.assumeFalse(GraphicsEnvironment.isHeadless());
    JMRIClientMonAction action = new JMRIClientMonAction(new JMRIClientSystemConnectionMemo());
    Assert.assertNotNull("exists", action);
}
Also used : JMRIClientSystemConnectionMemo(jmri.jmrix.jmriclient.JMRIClientSystemConnectionMemo) Test(org.junit.Test)

Example 8 with JMRIClientSystemConnectionMemo

use of jmri.jmrix.jmriclient.JMRIClientSystemConnectionMemo in project JMRI by JMRI.

the class ConnectionConfig method checkInitDone.

@Override
protected void checkInitDone() {
    super.checkInitDone();
    if (adapter.getSystemConnectionMemo() != null) {
        transmitPrefixField.setText(((JMRIClientSystemConnectionMemo) adapter.getSystemConnectionMemo()).getTransmitPrefix());
        transmitPrefixField.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                ((JMRIClientSystemConnectionMemo) adapter.getSystemConnectionMemo()).setTransmitPrefix(transmitPrefixField.getText());
                transmitPrefixField.setText(((JMRIClientSystemConnectionMemo) adapter.getSystemConnectionMemo()).getTransmitPrefix());
            }
        });
        transmitPrefixField.addFocusListener(new FocusListener() {

            @Override
            public void focusLost(FocusEvent e) {
                ((JMRIClientSystemConnectionMemo) adapter.getSystemConnectionMemo()).setTransmitPrefix(transmitPrefixField.getText());
                transmitPrefixField.setText(((JMRIClientSystemConnectionMemo) adapter.getSystemConnectionMemo()).getTransmitPrefix());
            }

            @Override
            public void focusGained(FocusEvent e) {
            }
        });
    }
}
Also used : ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) FocusListener(java.awt.event.FocusListener) FocusEvent(java.awt.event.FocusEvent) JMRIClientSystemConnectionMemo(jmri.jmrix.jmriclient.JMRIClientSystemConnectionMemo)

Aggregations

JMRIClientSystemConnectionMemo (jmri.jmrix.jmriclient.JMRIClientSystemConnectionMemo)8 Test (org.junit.Test)5 JMRIClientTrafficController (jmri.jmrix.jmriclient.JMRIClientTrafficController)2 Before (org.junit.Before)2 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 FocusEvent (java.awt.event.FocusEvent)1 FocusListener (java.awt.event.FocusListener)1