Package org.contikios.cooja.dialogs

Examples of org.contikios.cooja.dialogs.TableColumnAdjuster


    /* Coffee configuration is already loaded statically */

    filesTable = new JTable(tableModel);
    filesTable.setFillsViewportHeight(true);
    filesTable.setFont(new Font("Monospaced", Font.PLAIN, 12));
    TableColumnAdjuster adjuster = new TableColumnAdjuster(filesTable);
    adjuster.setDynamicAdjustment(true);
    adjuster.packColumns();
  }
View Full Code Here


    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(150);
    add(BorderLayout.NORTH, searchField);
    add(BorderLayout.CENTER, splitPane);

    TableColumnAdjuster adjuster = new TableColumnAdjuster(dataTable);
    adjuster.setDynamicAdjustment(true);
    adjuster.packColumns();

    radioMedium.addRadioMediumObserver(radioMediumObserver = new Observer() {
      public void update(Observable obs, Object obj) {
        RadioConnection conn = radioMedium.getLastConnection();
        if (conn == null) {
View Full Code Here

        simulation.getCooja().signalMoteHighlight(d.mote);
      }
    });

    /* Automatically update column widths */
    final TableColumnAdjuster adjuster = new TableColumnAdjuster(logTable, 0);
    adjuster.packColumns();
    logTable.getColumnModel().getColumn(COLUMN_DATA).setWidth(400);

    /* Popup menu */
    JPopupMenu popupMenu = new JPopupMenu();
    bufferMenu.addMenuListener(new MenuListener() {
      public void menuSelected(MenuEvent e) {
        updateBufferMenu();
      }
      public void menuDeselected(MenuEvent e) {
      }
      public void menuCanceled(MenuEvent e) {
      }
    });
    popupMenu.add(bufferMenu);
    parserMenu.addMenuListener(new MenuListener() {
      public void menuSelected(MenuEvent e) {
        updateParserMenu();
      }
      public void menuDeselected(MenuEvent e) {
      }
      public void menuCanceled(MenuEvent e) {
      }
    });
    popupMenu.add(parserMenu);
    popupMenu.addSeparator();
    JMenu copyClipboard = new JMenu("Copy to clipboard");
    copyClipboard.add(new JMenuItem(copyAllAction));
    copyClipboard.add(new JMenuItem(copyAction));
    popupMenu.add(copyClipboard);
    popupMenu.add(new JMenuItem(clearAction));
    popupMenu.addSeparator();
    popupMenu.add(new JMenuItem(saveAction));
    popupMenu.addSeparator();
    JMenu focusMenu = new JMenu("Show in");
    focusMenu.add(new JMenuItem(showInAllAction));
    focusMenu.addSeparator();
    focusMenu.add(new JMenuItem(timeLineAction));
    focusMenu.add(new JMenuItem(radioLoggerAction));
    focusMenu.add(new JMenuItem(bufferListenerAction));
    popupMenu.add(focusMenu);
    popupMenu.addSeparator();
    colorCheckbox = new JCheckBoxMenuItem("Mote-specific coloring");
    popupMenu.add(colorCheckbox);
    colorCheckbox.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        backgroundColors = colorCheckbox.isSelected();
        repaint();
      }
    });
    inverseFilterCheckbox = new JCheckBoxMenuItem("Inverse filter");
    popupMenu.add(inverseFilterCheckbox);
    inverseFilterCheckbox.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        inverseFilter = inverseFilterCheckbox.isSelected();
        if (inverseFilter) {
          filterLabel.setText("Exclude:");
        } else {
          filterLabel.setText("Filter:");
        }
        setFilter(getFilter());
        repaint();
      }
    });
    hideReadsCheckbox = new JCheckBoxMenuItem("Hide READs", hideReads);
    popupMenu.add(hideReadsCheckbox);
    hideReadsCheckbox.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        hideReads = hideReadsCheckbox.isSelected();
        setFilter(getFilter());
        repaint();
      }
    });

    withStackTraceCheckbox = new JCheckBoxMenuItem("Capture stack traces", withStackTrace);
    popupMenu.add(withStackTraceCheckbox);
    withStackTraceCheckbox.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        withStackTrace = withStackTraceCheckbox.isSelected();
        setFilter(getFilter());
        repaint();
      }
    });

    logTable.setComponentPopupMenu(popupMenu);

    /* Column width adjustment */
    java.awt.EventQueue.invokeLater(new Runnable() {
      public void run() {
        /* Make sure this happens *after* adding history */
        adjuster.setDynamicAdjustment(true);
        adjuster.setAdjustColumn(COLUMN_DATA, false);
      }
    });

    logUpdateAggregator.start();
    simulation.getEventCentral().addMoteCountListener(logOutputListener = new MoteCountListener() {
View Full Code Here

        simulation.getCooja().signalMoteHighlight(d.ev.getMote());
      }
    });

    /* Automatically update column widths */
    final TableColumnAdjuster adjuster = new TableColumnAdjuster(logTable);
    adjuster.packColumns();

    /* Popup menu */

    JPopupMenu popupMenu = new JPopupMenu();
    /*
    JMenu copyClipboard = new JMenu("Copy to clipboard");
    copyClipboard.add(new JMenuItem(copyAllAction));
    copyClipboard.add(new JMenuItem(copyAllMessagesAction));
    copyClipboard.add(new JMenuItem(copyAction));
    popupMenu.add(copyClipboard);
    popupMenu.add(new JMenuItem(clearAction));
    popupMenu.addSeparator();
    popupMenu.add(new JMenuItem(saveAction));
    appendCheckBox = new JCheckBoxMenuItem(appendAction);
    popupMenu.add(appendCheckBox);
    popupMenu.addSeparator();
    */
    JMenu focusMenu = new JMenu("Show in");
    focusMenu.add(new JMenuItem(showInAllAction));
    focusMenu.addSeparator();
    focusMenu.add(new JMenuItem(timeLineAction));
    focusMenu.add(new JMenuItem(radioLoggerAction));
    popupMenu.add(focusMenu);
    /*
    popupMenu.addSeparator();
    colorCheckbox = new JCheckBoxMenuItem("Mote-specific coloring");
    popupMenu.add(colorCheckbox);
    colorCheckbox.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        backgroundColors = colorCheckbox.isSelected();
        repaint();
      }
    });
    hideDebugCheckbox = new JCheckBoxMenuItem("Hide \"DEBUG: \" messages");
    popupMenu.add(hideDebugCheckbox);
    hideDebugCheckbox.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        hideDebug = hideDebugCheckbox.isSelected();
        setFilter(getFilter());
        repaint();
      }
    });
    inverseFilterCheckbox = new JCheckBoxMenuItem("Inverse filter");
    popupMenu.add(inverseFilterCheckbox);
    inverseFilterCheckbox.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        inverseFilter = inverseFilterCheckbox.isSelected();
        if (inverseFilter) {
          filterLabel.setText("Exclude:");
        } else {
          filterLabel.setText("Filter:");
        }
        setFilter(getFilter());
        repaint();
      }
    });


    logTable.setComponentPopupMenu(popupMenu);
*/
    /* Fetch log output history */
    LogOutputEvent[] history = simulation.getEventCentral().getLogOutputHistory();
    if (history.length > 0) {
      for (LogOutputEvent historyEv: history) {
        if (!hasHours && historyEv.getTime() > TIME_HOUR) {
          hasHours = true;
          repaintTimeColumn();
        }
        LogData data = new LogData(historyEv);
        logs.add(data);
      }
      java.awt.EventQueue.invokeLater(new Runnable() {
        public void run() {
          model.fireTableDataChanged();
          logTable.scrollRectToVisible(
              new Rectangle(0, logTable.getHeight() - 2, 1, logTable.getHeight()));
        }
      });
    }

    /* Column width adjustment */
    java.awt.EventQueue.invokeLater(new Runnable() {
      public void run() {
        /* Make sure this happens *after* adding history */
        adjuster.setDynamicAdjustment(true);
      }
    });

    /* Start observing motes for new log output */
    logUpdateAggregator.start();
View Full Code Here

    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(150);
    add(BorderLayout.NORTH, searchField);
    add(BorderLayout.CENTER, splitPane);

    TableColumnAdjuster adjuster = new TableColumnAdjuster(dataTable);
    adjuster.setDynamicAdjustment(true);
    adjuster.packColumns();

    radioMedium.addRadioMediumObserver(radioMediumObserver = new Observer() {
      @Override
      public void update(Observable obs, Object obj) {
        RadioConnection conn = radioMedium.getLastConnection();
View Full Code Here

        simulation.getCooja().signalMoteHighlight(d.mote);
      }
    });

    /* Automatically update column widths */
    final TableColumnAdjuster adjuster = new TableColumnAdjuster(logTable, 0);
    adjuster.packColumns();
    logTable.getColumnModel().getColumn(COLUMN_DATA).setWidth(400);

    /* Popup menu */
    JPopupMenu popupMenu = new JPopupMenu();
    bufferMenu.addMenuListener(new MenuListener() {
      @Override
      public void menuSelected(MenuEvent e) {
        updateBufferMenu();
      }
      @Override
      public void menuDeselected(MenuEvent e) {
      }
      @Override
      public void menuCanceled(MenuEvent e) {
      }
    });
    popupMenu.add(bufferMenu);
    parserMenu.addMenuListener(new MenuListener() {
      @Override
      public void menuSelected(MenuEvent e) {
        updateParserMenu();
      }
      @Override
      public void menuDeselected(MenuEvent e) {
      }
      @Override
      public void menuCanceled(MenuEvent e) {
      }
    });
    popupMenu.add(parserMenu);
    popupMenu.addSeparator();
    JMenu copyClipboard = new JMenu("Copy to clipboard");
    copyClipboard.add(new JMenuItem(copyAllAction));
    copyClipboard.add(new JMenuItem(copyAction));
    popupMenu.add(copyClipboard);
    popupMenu.add(new JMenuItem(clearAction));
    popupMenu.addSeparator();
    popupMenu.add(new JMenuItem(saveAction));
    popupMenu.addSeparator();
    JMenu focusMenu = new JMenu("Show in");
    focusMenu.add(new JMenuItem(showInAllAction));
    focusMenu.addSeparator();
    focusMenu.add(new JMenuItem(timeLineAction));
    focusMenu.add(new JMenuItem(radioLoggerAction));
    focusMenu.add(new JMenuItem(bufferListenerAction));
    popupMenu.add(focusMenu);
    popupMenu.addSeparator();
    colorCheckbox = new JCheckBoxMenuItem("Mote-specific coloring");
    popupMenu.add(colorCheckbox);
    colorCheckbox.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        backgroundColors = colorCheckbox.isSelected();
        repaint();
      }
    });
    inverseFilterCheckbox = new JCheckBoxMenuItem("Inverse filter");
    popupMenu.add(inverseFilterCheckbox);
    inverseFilterCheckbox.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        inverseFilter = inverseFilterCheckbox.isSelected();
        if (inverseFilter) {
          filterLabel.setText("Exclude:");
        } else {
          filterLabel.setText("Filter:");
        }
        setFilter(getFilter());
        repaint();
      }
    });
    hideReadsCheckbox = new JCheckBoxMenuItem("Hide READs", hideReads);
    popupMenu.add(hideReadsCheckbox);
    hideReadsCheckbox.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        hideReads = hideReadsCheckbox.isSelected();
        setFilter(getFilter());
        repaint();
      }
    });

    withStackTraceCheckbox = new JCheckBoxMenuItem("Capture stack traces", withStackTrace);
    popupMenu.add(withStackTraceCheckbox);
    withStackTraceCheckbox.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        withStackTrace = withStackTraceCheckbox.isSelected();
        setFilter(getFilter());
        repaint();
      }
    });

    logTable.setComponentPopupMenu(popupMenu);

    /* Column width adjustment */
    java.awt.EventQueue.invokeLater(new Runnable() {
      @Override
      public void run() {
        /* Make sure this happens *after* adding history */
        adjuster.setDynamicAdjustment(true);
        adjuster.setAdjustColumn(COLUMN_DATA, false);
      }
    });

    logUpdateAggregator.start();
    simulation.getEventCentral().addMoteCountListener(logOutputListener = new MoteCountListener() {
View Full Code Here

TOP

Related Classes of org.contikios.cooja.dialogs.TableColumnAdjuster

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.