Package com.grt192.mechanism.breakaway

Examples of com.grt192.mechanism.breakaway.GRTBreakawayRobotBase


  protected void notifyLeftSwitch(boolean pressed) {
    for (int i = 0; i < switchListeners.size(); i++) {
      if (pressed)
        ((JagSwitchListener) switchListeners.elementAt(i))
            .leftSwitchPressed(new JagSwitchEvent(this,
                JagSwitchEvent.LEFT_PRESSED, "leftSwitch"));
      else
        ((JagSwitchListener) switchListeners.elementAt(i))
            .leftSwitchReleased(new JagSwitchEvent(this,
                JagSwitchEvent.LEFT_RELEASED, "leftSwitch"));
    }
  }
View Full Code Here


  protected void notifyRightSwitch(boolean pressed) {
    for (int i = 0; i < switchListeners.size(); i++) {
      if (pressed)
        ((JagSwitchListener) switchListeners.elementAt(i))
            .rightSwitchPressed(new JagSwitchEvent(this,
                JagSwitchEvent.RIGHT_PRESSED, "rightSwitch"));
      else
        ((JagSwitchListener) switchListeners.elementAt(i))
            .rightSwitchReleased(new JagSwitchEvent(this,
                JagSwitchEvent.RIGHT_RELEASED, "rightSwitch"));
    }
  }
View Full Code Here

        }
    }

    private void notifyListeners(boolean present) {
        for (int i = 0; i < lineStateListeners.size(); i++) {
                ((LineTrackerListener) lineStateListeners.elementAt(i)).lineStateChange(new LineTraceEvent(this, present));
        }
    }
View Full Code Here

    }

    protected void notifyLeftXAxisChange() {
        for (int i = 0; i < joystickListeners.size(); i++) {
            ((XboxJoystickListener) joystickListeners.elementAt(i)).leftXAxisMoved(
                    new XboxJoystickEvent(this,
                    XboxJoystickEvent.DEFAULT,
                    getState("leftXValue")));
        }
    }
View Full Code Here

    }

    protected void notifyLeftYAxisChange() {
        for (int i = 0; i < joystickListeners.size(); i++) {
            ((XboxJoystickListener) joystickListeners.elementAt(i)).leftYAxisMoved(
                    new XboxJoystickEvent(this,
                    XboxJoystickEvent.DEFAULT,
                    getState("leftYValue")));
        }
//        System.out.println(getState("l"))
    }
View Full Code Here

//        System.out.println(getState("l"))
    }
      protected void notifyRightXAxisChange() {
        for (int i = 0; i < joystickListeners.size(); i++) {
            ((XboxJoystickListener) joystickListeners.elementAt(i)).rightXAxisMoved(
                    new XboxJoystickEvent(this,
                    XboxJoystickEvent.DEFAULT,
                    getState("rightXValue")));
        }
    }
View Full Code Here

    }

    protected void notifyRightYAxisChange() {
        for (int i = 0; i < joystickListeners.size(); i++) {
            ((XboxJoystickListener) joystickListeners.elementAt(i)).rightYAxisMoved(
                    new XboxJoystickEvent(this,
                    XboxJoystickEvent.DEFAULT,
                    getState("rightYValue")));
        }
    }
View Full Code Here

    }

    protected void notifyTriggerChange() {
        for (int i = 0; i < joystickListeners.size(); i++) {
            ((XboxJoystickListener) joystickListeners.elementAt(i)).triggerMoved(
                    new XboxJoystickEvent(this,
                    XboxJoystickEvent.DEFAULT,
                    getState("triggerValue")));
        }
    }
View Full Code Here


  private void notifyPadChange() {
        for (int i = 0; i < joystickListeners.size(); i++) {
            ((XboxJoystickListener) joystickListeners.elementAt(i)).padMoved(
                    new XboxJoystickEvent(this,
                    XboxJoystickEvent.DEFAULT,
                    getState("padValue")));
        }
  }
View Full Code Here

    public static final int PORT = 192;

    public static void main(String[] args) {

        //new client
        final LoggerModel lms = new LoggerModel();

        //new connection to client
        GRTClientSocket gcs = new GRTClientSocket(IP, PORT);
        gcs.start();
        gcs.addSocketListener(lms);

        //new panel
        LoggerUI lu = new LoggerUI(lms);

        JFrame vars = new JFrame("vars");
        vars.setLayout(new BorderLayout());
        VariableUI v = new VariableUI(lms);
        vars.add(v,BorderLayout.CENTER);
        vars.setSize(500, 500);
        vars.setVisible(true);


        //new frame
        final JFrame j = new JFrame("Logger UI");
        //menu bar and co.
        JMenuBar bar = new JMenuBar();
        JMenu file = new JMenu("File");
        JMenu log = new JMenu("Log");



        //add item to log
        JMenuItem write = new JMenuItem("Write to file");
        log.add(write);
        JMenuItem getVers = new JMenuItem("Print version");
        log.add(getVers);

        //ad menu bar to frame
        j.setJMenuBar(bar);
        bar.add(file);
        bar.add(log);
       
        write.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                lms.writeLogs();
            }
        });

        getVers.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                int i = lms.getLastVersion();
                JOptionPane.showMessageDialog(j, i);
            }
        });

        j.setSize(500, 500);
        j.add(lu, BorderLayout.CENTER);
        j.setVisible(true);
        j.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        j.addWindowListener(new WindowAdapter() {

            public void windowClosing(WindowEvent e) {
                lms.writeLogs();
                System.exit(0);
            }
        });

    }
View Full Code Here

TOP

Related Classes of com.grt192.mechanism.breakaway.GRTBreakawayRobotBase

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.