All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.sdnwiselab.sdnwise.controller.ControllerGui Maven / Gradle / Ivy

/* 
 * Copyright (C) 2015 SDN-WISE
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see .
 */
package com.github.sdnwiselab.sdnwise.controller;

import com.github.sdnwiselab.sdnwise.flowtable.FlowTableEntry;
import com.github.sdnwiselab.sdnwise.flowtable.FlowTableWindow;
import com.github.sdnwiselab.sdnwise.util.NodeAddress;
import java.awt.HeadlessException;
import java.text.ParseException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.DefaultCellEditor;
import javax.swing.JComboBox;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author sdwn
 */
public final class ControllerGui extends javax.swing.JFrame {

    private static final long serialVersionUID = 1L;

    private final transient Controller controller;
    private final JComboBox comboLoc;
    private final JComboBox comboOp;
    private final JComboBox comboSize;
    private final JComboBox comboOff;
    private final JComboBox comboActType;

    /**
     * Creates new form ControllerGui
     *
     * @param controller
     */
    public ControllerGui(Controller controller) {
        this.controller = controller;
        initComponents();

        comboLoc = new JComboBox<>();
        comboLoc.addItem("");
        comboLoc.addItem("PACKET");
        comboLoc.addItem("STATE_ARR");

        comboOp = new JComboBox<>();
        comboOp.addItem("");
        comboOp.addItem("==");
        comboOp.addItem("!=");
        comboOp.addItem(">");
        comboOp.addItem("<");
        comboOp.addItem(">=");
        comboOp.addItem("<=");

        comboSize = new JComboBox<>();
        comboSize.addItem(0);
        comboSize.addItem(1);
        comboSize.addItem(2);

        comboOff = new JComboBox<>();
        comboOff.addItem("");
        comboOff.addItem("0 - LEN");
        comboOff.addItem("1 - NET_ID");
        comboOff.addItem("2 - SRC_H");
        comboOff.addItem("3 - SRC_L");
        comboOff.addItem("4 - DST_H");
        comboOff.addItem("5 - DST_L");
        comboOff.addItem("6 - TYPE");
        comboOff.addItem("7 - TTL");
        comboOff.addItem("8 - NXHOP_H");
        comboOff.addItem("9 - NXHOP_L");
        comboOff.addItem("10 - DIST");
        comboOff.addItem("11 - BATT");
        comboOff.addItem("12 - NEIGH");

        comboActType = new JComboBox<>();
        comboActType.addItem("");
        comboActType.addItem("FORWARD UNICAST");
        comboActType.addItem("FORWARD_BROADCAST");
        comboActType.addItem("DROP");
        comboActType.addItem("MODIFY");
        comboActType.addItem("AGGREGATE");
        comboActType.addItem("FORWARD_UP");

        for (int i = 0; i < 4; i++) {
            this.jTableFlow.getColumnModel()
                    .getColumn((i * 4) + 2)
                    .setCellEditor(new DefaultCellEditor(comboLoc));

            this.jTableFlow.getColumnModel()
                    .getColumn((i * 4) + 0)
                    .setCellEditor(new DefaultCellEditor(comboOp));

            this.jTableFlow.getColumnModel()
                    .getColumn((i * 4) + 1)
                    .setCellEditor(new DefaultCellEditor(comboSize));

            this.jTableFlow.getColumnModel()
                    .getColumn((i * 4) + 3)
                    .setCellEditor(new DefaultCellEditor(comboOff));
        }

        this.jTableFlow.getColumnModel()
                .getColumn(18)
                .setCellEditor(new DefaultCellEditor(comboActType));

        this.jTableFlow.getColumnModel()
                .getColumn(20)
                .setCellEditor(new DefaultCellEditor(comboLoc));

        this.jTableFlow.getColumnModel()
                .getColumn(21)
                .setCellEditor(new DefaultCellEditor(comboOff));

        setIconImage(getToolkit().getImage(
                getClass().getResource("/sdn-wise_icon.png")));

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // //GEN-BEGIN:initComponents
    private void initComponents() {

        jFrameAdd = new javax.swing.JFrame();
        jPanel5 = new javax.swing.JPanel();
        jSpinnerValueH1 = new javax.swing.JSpinner();
        jComboBoxS1 = new javax.swing.JComboBox();
        jComboBoxSize1 = new javax.swing.JComboBox();
        jComboBoxOp1 = new javax.swing.JComboBox();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jSpinnerValueL1 = new javax.swing.JSpinner();
        jComboBoxOff1 = new javax.swing.JComboBox();
        jPanel6 = new javax.swing.JPanel();
        jSpinnerValueHA = new javax.swing.JSpinner();
        jComboBoxSA = new javax.swing.JComboBox();
        jLabel22 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jComboBoxMA = new javax.swing.JComboBox();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        jComboBoxOpA = new javax.swing.JComboBox();
        jSpinnerValueLA = new javax.swing.JSpinner();
        jComboBoxA = new javax.swing.JComboBox();
        jPanel7 = new javax.swing.JPanel();
        jSpinnerValueH2 = new javax.swing.JSpinner();
        jComboBoxS2 = new javax.swing.JComboBox();
        jComboBoxSize2 = new javax.swing.JComboBox();
        jComboBoxOp2 = new javax.swing.JComboBox();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jSpinnerValueL2 = new javax.swing.JSpinner();
        jComboBoxOff2 = new javax.swing.JComboBox();
        jPanel8 = new javax.swing.JPanel();
        jSpinnerValueH3 = new javax.swing.JSpinner();
        jComboBoxS3 = new javax.swing.JComboBox();
        jComboBoxSize3 = new javax.swing.JComboBox();
        jComboBoxOp3 = new javax.swing.JComboBox();
        jLabel29 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        jLabel31 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jSpinnerValueL3 = new javax.swing.JSpinner();
        jComboBoxOff3 = new javax.swing.JComboBox();
        jButtonConvert = new javax.swing.JButton();
        jSpinnerNetID = new javax.swing.JSpinner();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jSpinnerAddrL = new javax.swing.JSpinner();
        jSpinnerAddrH = new javax.swing.JSpinner();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jSpinnerBeacon = new javax.swing.JSpinner();
        jSpinnerRSSI = new javax.swing.JSpinner();
        jSpinnerReport = new javax.swing.JSpinner();
        jSpinnerTTL = new javax.swing.JSpinner();
        jButtonReadParams = new javax.swing.JButton();
        jButtonWriteParams = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTableFlow = new javax.swing.JTable();
        jButtonReadFlows = new javax.swing.JButton();
        jButtonRemoveFlow = new javax.swing.JButton();
        jButtonAddFlow = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTableAccepted = new javax.swing.JTable();
        jButtonAddAccepted = new javax.swing.JButton();
        jButtonRemoveAccepted = new javax.swing.JButton();
        jButtonReadAccepted = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();

        jFrameAdd.setTitle("SDN-WISE Rule Converter");
        jFrameAdd.setResizable(false);

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Window 1"));

        jSpinnerValueH1.setModel(new javax.swing.SpinnerNumberModel(0, 0, 255, 1));

        jComboBoxS1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "State", "Packet" }));

        jComboBoxSize1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "1", "2" }));

        jComboBoxOp1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "==", "!=", ">", "<", ">=", "<=" }));

        jLabel7.setText("Operation");

        jLabel8.setText("Size");

        jLabel9.setText("Packet/State");

        jLabel10.setText("Offset");

        jLabel11.setText("Value");

        jSpinnerValueL1.setModel(new javax.swing.SpinnerNumberModel(0, 0, 255, 1));

        jComboBoxOff1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "LEN                            ", "NET_ID                         ", "SRC_H                          ", "SRC_L                          ", "DST_H                          ", "DST_L                          ", "TYPE                           ", "TTL                            ", "NXHOP_H                        ", "NXHOP_L                        ", "DIST - 10                           ", "BATT - 11                           ", "NEIGH - 12", "13", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "100", "101", "102", "103", "104", "105", "106", "107", "108", "109", "110", "111", "112", "113", "114", "115", "116", "117", "118", "119", "120", "121", "122", "123", "124", "125", "126", "127", "128", "129", "130", "131", "132", "133", "134", "135", "136", "137", "138", "139", "140", "141", "142", "143", "144", "145", "146", "147", "148", "149", "150", "151", "152", "153", "154", "155", "156", "157", "158", "159", "160", "161", "162", "163", "164", "165", "166", "167", "168", "169", "170", "171", "172", "173", "174", "175", "176", "177", "178", "179", "180", "181", "182", "183", "184", "185", "186", "187", "188", "189", "190", "191", "192", "193", "194", "195", "196", "197", "198", "199", "200", "201", "202", "203", "204", "205", "206", "207", "208", "209", "210", "211", "212", "213", "214", "215", "216", "217", "218", "219", "220", "221", "222", "223", "224", "225", "226", "227", "228", "229", "230", "231", "232", "233", "234", "235", "236", "237", "238", "239", "240", "241", "242", "243", "244", "245", "246", "247", "248", "249", "250", "251", "252", "253", "254", "255", " " }));

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel10)
                            .addComponent(jLabel11))
                        .addGap(35, 35, 35)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jComboBoxOff1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addComponent(jSpinnerValueH1, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jSpinnerValueL1, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jComboBoxS1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel7)
                            .addComponent(jLabel8))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jComboBoxSize1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jComboBoxOp1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addContainerGap())
        );

        jPanel5Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jSpinnerValueH1, jSpinnerValueL1});

        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBoxOp1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBoxSize1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBoxS1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(jComboBoxOff1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jSpinnerValueH1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel11)
                    .addComponent(jSpinnerValueL1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("Action"));

        jSpinnerValueHA.setModel(new javax.swing.SpinnerNumberModel(0, 0, 255, 1));

        jComboBoxSA.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Packet", "State" }));

        jLabel22.setText("Multimatch");

        jLabel23.setText("Operation");

        jComboBoxMA.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "1" }));

        jLabel26.setText("Value");

        jLabel27.setText("Offset");

        jLabel28.setText("Packet/State");

        jComboBoxOpA.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Forward Unicast", "Forward Broadcast", "Drop", "Modify ", "Aggregate", "Forward Up" }));

        jSpinnerValueLA.setModel(new javax.swing.SpinnerNumberModel(0, 0, 255, 1));

        jComboBoxA.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "LEN                            ", "NET_ID                         ", "SRC_H                          ", "SRC_L                          ", "DST_H                          ", "DST_L                          ", "TYPE                           ", "TTL                            ", "NXHOP_H                        ", "NXHOP_L                        ", "DIST - 10                           ", "BATT - 11                           ", "NEIGH - 12", "13", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "100", "101", "102", "103", "104", "105", "106", "107", "108", "109", "110", "111", "112", "113", "114", "115", "116", "117", "118", "119", "120", "121", "122", "123", "124", "125", "126", "127", "128", "129", "130", "131", "132", "133", "134", "135", "136", "137", "138", "139", "140", "141", "142", "143", "144", "145", "146", "147", "148", "149", "150", "151", "152", "153", "154", "155", "156", "157", "158", "159", "160", "161", "162", "163", "164", "165", "166", "167", "168", "169", "170", "171", "172", "173", "174", "175", "176", "177", "178", "179", "180", "181", "182", "183", "184", "185", "186", "187", "188", "189", "190", "191", "192", "193", "194", "195", "196", "197", "198", "199", "200", "201", "202", "203", "204", "205", "206", "207", "208", "209", "210", "211", "212", "213", "214", "215", "216", "217", "218", "219", "220", "221", "222", "223", "224", "225", "226", "227", "228", "229", "230", "231", "232", "233", "234", "235", "236", "237", "238", "239", "240", "241", "242", "243", "244", "245", "246", "247", "248", "249", "250", "251", "252", "253", "254", "255", " " }));

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel23)
                            .addComponent(jLabel22)
                            .addComponent(jLabel28)
                            .addComponent(jLabel27))
                        .addGap(18, 18, 18))
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(jLabel26)
                        .addGap(54, 54, 54)))
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jComboBoxMA, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jComboBoxOpA, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                            .addComponent(jSpinnerValueHA, javax.swing.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jSpinnerValueLA, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(jComboBoxSA, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(jComboBoxA, 0, 166, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addGap(26, 26, 26)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jComboBoxMA, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel22)))
                    .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel23)
                        .addComponent(jComboBoxOpA, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBoxSA, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel28))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel27)
                    .addComponent(jComboBoxA, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jSpinnerValueHA, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel26)
                    .addComponent(jSpinnerValueLA, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(61, Short.MAX_VALUE))
        );

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder("Window 2"));

        jSpinnerValueH2.setModel(new javax.swing.SpinnerNumberModel(0, 0, 255, 1));

        jComboBoxS2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "State", "Packet" }));

        jComboBoxSize2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "1", "2" }));

        jComboBoxOp2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "==", "!=", ">", "<", ">=", "<=" }));

        jLabel12.setText("Operation");

        jLabel13.setText("Size");

        jLabel14.setText("Packet/State");

        jLabel15.setText("Offset");

        jLabel16.setText("Value");

        jSpinnerValueL2.setModel(new javax.swing.SpinnerNumberModel(0, 0, 255, 1));

        jComboBoxOff2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "LEN                            ", "NET_ID                         ", "SRC_H                          ", "SRC_L                          ", "DST_H                          ", "DST_L                          ", "TYPE                           ", "TTL                            ", "NXHOP_H                        ", "NXHOP_L                        ", "DIST - 10                           ", "BATT - 11                           ", "NEIGH - 12", "13", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "100", "101", "102", "103", "104", "105", "106", "107", "108", "109", "110", "111", "112", "113", "114", "115", "116", "117", "118", "119", "120", "121", "122", "123", "124", "125", "126", "127", "128", "129", "130", "131", "132", "133", "134", "135", "136", "137", "138", "139", "140", "141", "142", "143", "144", "145", "146", "147", "148", "149", "150", "151", "152", "153", "154", "155", "156", "157", "158", "159", "160", "161", "162", "163", "164", "165", "166", "167", "168", "169", "170", "171", "172", "173", "174", "175", "176", "177", "178", "179", "180", "181", "182", "183", "184", "185", "186", "187", "188", "189", "190", "191", "192", "193", "194", "195", "196", "197", "198", "199", "200", "201", "202", "203", "204", "205", "206", "207", "208", "209", "210", "211", "212", "213", "214", "215", "216", "217", "218", "219", "220", "221", "222", "223", "224", "225", "226", "227", "228", "229", "230", "231", "232", "233", "234", "235", "236", "237", "238", "239", "240", "241", "242", "243", "244", "245", "246", "247", "248", "249", "250", "251", "252", "253", "254", "255", " " }));

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel14)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jComboBoxS2, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel12)
                            .addComponent(jLabel13))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jComboBoxSize2, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jComboBoxOp2, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel15)
                            .addComponent(jLabel16))
                        .addGap(35, 35, 35)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jComboBoxOff2, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(jSpinnerValueH2, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jSpinnerValueL2)))))
                .addContainerGap())
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBoxOp2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel12))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBoxSize2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel13))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBoxS2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(jComboBoxOff2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jSpinnerValueH2)
                    .addComponent(jLabel16)
                    .addComponent(jSpinnerValueL2))
                .addGap(61, 61, 61))
        );

        jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder("Window 3"));

        jSpinnerValueH3.setModel(new javax.swing.SpinnerNumberModel(0, 0, 255, 1));

        jComboBoxS3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "State", "Packet" }));

        jComboBoxSize3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "1", "2" }));

        jComboBoxOp3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "==", "!=", ">", "<", ">=", "<=" }));

        jLabel29.setText("Operation");

        jLabel30.setText("Size");

        jLabel31.setText("Packet/State");

        jLabel32.setText("Offset");

        jLabel33.setText("Value");

        jSpinnerValueL3.setModel(new javax.swing.SpinnerNumberModel(0, 0, 255, 1));

        jComboBoxOff3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "LEN                            ", "NET_ID                         ", "SRC_H                          ", "SRC_L                          ", "DST_H                          ", "DST_L                          ", "TYPE                           ", "TTL                            ", "NXHOP_H                        ", "NXHOP_L                        ", "DIST - 10                           ", "BATT - 11                           ", "NEIGH - 12", "13", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "100", "101", "102", "103", "104", "105", "106", "107", "108", "109", "110", "111", "112", "113", "114", "115", "116", "117", "118", "119", "120", "121", "122", "123", "124", "125", "126", "127", "128", "129", "130", "131", "132", "133", "134", "135", "136", "137", "138", "139", "140", "141", "142", "143", "144", "145", "146", "147", "148", "149", "150", "151", "152", "153", "154", "155", "156", "157", "158", "159", "160", "161", "162", "163", "164", "165", "166", "167", "168", "169", "170", "171", "172", "173", "174", "175", "176", "177", "178", "179", "180", "181", "182", "183", "184", "185", "186", "187", "188", "189", "190", "191", "192", "193", "194", "195", "196", "197", "198", "199", "200", "201", "202", "203", "204", "205", "206", "207", "208", "209", "210", "211", "212", "213", "214", "215", "216", "217", "218", "219", "220", "221", "222", "223", "224", "225", "226", "227", "228", "229", "230", "231", "232", "233", "234", "235", "236", "237", "238", "239", "240", "241", "242", "243", "244", "245", "246", "247", "248", "249", "250", "251", "252", "253", "254", "255", " " }));

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel31)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jComboBoxS3, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel29)
                            .addComponent(jLabel30))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jComboBoxSize3, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jComboBoxOp3, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel32)
                            .addComponent(jLabel33))
                        .addGap(35, 35, 35)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jComboBoxOff3, 0, 157, Short.MAX_VALUE)
                            .addGroup(jPanel8Layout.createSequentialGroup()
                                .addComponent(jSpinnerValueH3, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jSpinnerValueL3, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addContainerGap())
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBoxOp3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel29))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBoxSize3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel30))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBoxS3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel31))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel32)
                    .addComponent(jComboBoxOff3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jSpinnerValueH3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel33)
                    .addComponent(jSpinnerValueL3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(61, Short.MAX_VALUE))
        );

        jButtonConvert.setText("Send");
        jButtonConvert.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonConvertActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jFrameAddLayout = new javax.swing.GroupLayout(jFrameAdd.getContentPane());
        jFrameAdd.getContentPane().setLayout(jFrameAddLayout);
        jFrameAddLayout.setHorizontalGroup(
            jFrameAddLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jFrameAddLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jFrameAddLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jFrameAddLayout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(jButtonConvert)
                        .addContainerGap())
                    .addGroup(jFrameAddLayout.createSequentialGroup()
                        .addGroup(jFrameAddLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jFrameAddLayout.createSequentialGroup()
                                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGroup(jFrameAddLayout.createSequentialGroup()
                                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                        .addGap(10, 10, 10))))
        );
        jFrameAddLayout.setVerticalGroup(
            jFrameAddLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jFrameAddLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jFrameAddLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jPanel7, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jFrameAddLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButtonConvert)
                .addContainerGap())
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("SDN-WISE");

        jSpinnerNetID.setModel(new javax.swing.SpinnerNumberModel(Byte.valueOf((byte)0), null, null, Byte.valueOf((byte)1)));

        jLabel1.setText("Node Address");

        jLabel2.setText("Network ID");

        jSpinnerAddrL.setModel(new javax.swing.SpinnerNumberModel(0, 0, 255, 1));

        jSpinnerAddrH.setModel(new javax.swing.SpinnerNumberModel(0, 0, 255, 1));

        jLabel3.setText("Beacon Period");

        jLabel4.setText("Report Period");

        jLabel5.setText("TTL Max");

        jLabel6.setText("RSSI Min");

        jSpinnerBeacon.setModel(new javax.swing.SpinnerNumberModel(0, 0, 65535, 1));

        jSpinnerRSSI.setModel(new javax.swing.SpinnerNumberModel(Short.valueOf((short)0), Short.valueOf((short)0), Short.valueOf((short)255), Short.valueOf((short)1)));

        jSpinnerReport.setModel(new javax.swing.SpinnerNumberModel(0, 0, 65535, 1));

        jSpinnerTTL.setModel(new javax.swing.SpinnerNumberModel(Short.valueOf((short)0), Short.valueOf((short)0), Short.valueOf((short)255), Short.valueOf((short)1)));

        jButtonReadParams.setLabel("Refresh");
        jButtonReadParams.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonReadParamsActionPerformed(evt);
            }
        });

        jButtonWriteParams.setText("Write Values");
        jButtonWriteParams.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonWriteParamsActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jSpinnerBeacon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel4)
                            .addComponent(jLabel5)
                            .addComponent(jLabel6))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jSpinnerRSSI)
                            .addComponent(jSpinnerTTL)
                            .addComponent(jSpinnerReport)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addGap(0, 196, Short.MAX_VALUE)
                        .addComponent(jButtonReadParams)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButtonWriteParams)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jSpinnerBeacon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jSpinnerReport, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(jSpinnerTTL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(jSpinnerRSSI, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 104, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonReadParams)
                    .addComponent(jButtonWriteParams))
                .addContainerGap())
        );

        jTabbedPane1.addTab("Parameters Configuration", jPanel1);

        jTableFlow.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null}
            },
            new String [] {
                "Operator", "Size", "Location", "Offset", "Value", "Value", "Operator", "Size", "Location", "Offset", "Value", "Value", "Operator", "Size", "Location", "Offset", "Value", "Value", "Type", "Multimatch", "Location", "Offset", "Value", "Value", "TTL", "Count"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.String.class, java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.String.class, java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.String.class, java.lang.Boolean.class, java.lang.String.class, java.lang.String.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.Integer.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTableFlow.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
        jScrollPane1.setViewportView(jTableFlow);

        jButtonReadFlows.setLabel("Refresh");
        jButtonReadFlows.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonReadFlowsActionPerformed(evt);
            }
        });

        jButtonRemoveFlow.setText("Remove");
        jButtonRemoveFlow.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonRemoveFlowActionPerformed(evt);
            }
        });

        jButtonAddFlow.setText("Add");
        jButtonAddFlow.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAddFlowActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addGap(0, 161, Short.MAX_VALUE)
                        .addComponent(jButtonReadFlows)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButtonRemoveFlow)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButtonAddFlow))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 196, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonAddFlow)
                    .addComponent(jButtonRemoveFlow)
                    .addComponent(jButtonReadFlows))
                .addContainerGap())
        );

        jTabbedPane1.addTab("WISE Flow Table", jPanel2);

        jTableAccepted.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "", ""
            }
        ));
        jTableAccepted.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jTableAccepted.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane2.setViewportView(jTableAccepted);

        jButtonAddAccepted.setText("Add");
        jButtonAddAccepted.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAddAcceptedActionPerformed(evt);
            }
        });

        jButtonRemoveAccepted.setText("Remove");
        jButtonRemoveAccepted.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonRemoveAcceptedActionPerformed(evt);
            }
        });

        jButtonReadAccepted.setLabel("Refresh");
        jButtonReadAccepted.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonReadAcceptedActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(jButtonReadAccepted)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButtonRemoveAccepted)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButtonAddAccepted))
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 366, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 196, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonAddAccepted)
                    .addComponent(jButtonRemoveAccepted)
                    .addComponent(jButtonReadAccepted))
                .addContainerGap())
        );

        jTabbedPane1.addTab("Accepted ID", jPanel3);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 386, Short.MAX_VALUE)
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 247, Short.MAX_VALUE)
        );

        jTabbedPane1.addTab("State Array", jPanel4);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTabbedPane1)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jSpinnerNetID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jSpinnerAddrH, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jSpinnerAddrL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jSpinnerNetID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jSpinnerAddrL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jSpinnerAddrH, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTabbedPane1)
                .addContainerGap())
        );

        pack();
    }// //GEN-END:initComponents

    private void jButtonReadParamsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonReadParamsActionPerformed
        try {
            // TODO add your handling code here:
            jSpinnerNetID.commitEdit();
            jSpinnerAddrH.commitEdit();
            jSpinnerAddrL.commitEdit();

            this.jSpinnerBeacon.setValue(
                    controller.getNodeBeaconPeriod(
                            (byte)this.jSpinnerNetID.getValue(),
                            new NodeAddress(
                                    (Integer) this.jSpinnerAddrH.getValue(),
                                    (Integer) this.jSpinnerAddrL.getValue())));

            this.jSpinnerReport.setValue(
                    controller.getNodeReportPeriod(
                            (byte) this.jSpinnerNetID.getValue(),
                            new NodeAddress(
                                    (Integer) this.jSpinnerAddrH.getValue(),
                                    (Integer) this.jSpinnerAddrL.getValue())));

            this.jSpinnerRSSI.setValue(
                    controller.getNodeRssiMin(
                            (byte) this.jSpinnerNetID.getValue(),
                            new NodeAddress(
                                    (Integer) this.jSpinnerAddrH.getValue(),
                                    (Integer) this.jSpinnerAddrL.getValue())));

            this.jSpinnerTTL.setValue(
                    controller.getNodeTtlMax(
                            (byte) this.jSpinnerNetID.getValue(),
                            new NodeAddress(
                                    (Integer) this.jSpinnerAddrH.getValue(),
                                    (Integer) this.jSpinnerAddrL.getValue())));

        } catch (ParseException ex) {
            Logger.getLogger(ControllerGui.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jButtonReadParamsActionPerformed

    private void jButtonWriteParamsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonWriteParamsActionPerformed
        try {
            // TODO add your handling code here:
            jSpinnerNetID.commitEdit();
            jSpinnerAddrH.commitEdit();
            jSpinnerAddrL.commitEdit();
            jSpinnerRSSI.commitEdit();
            jSpinnerTTL.commitEdit();
            jSpinnerBeacon.commitEdit();
            jSpinnerReport.commitEdit();

            controller.setNodeBeaconPeriod(
                    (byte) this.jSpinnerNetID.getValue(),
                    new NodeAddress(
                            (Integer) this.jSpinnerAddrH.getValue(),
                            (Integer) this.jSpinnerAddrL.getValue()),
                    ((Number) this.jSpinnerBeacon.getValue()).shortValue());

            controller.setNodeReportPeriod(
                    (byte) this.jSpinnerNetID.getValue(),
                    new NodeAddress(
                            (Integer) this.jSpinnerAddrH.getValue(),
                            (Integer) this.jSpinnerAddrL.getValue()),
                    ((Number) this.jSpinnerReport.getValue()).shortValue());

            controller.setNodeRssiMin(
                    (byte) this.jSpinnerNetID.getValue(),
                    new NodeAddress(
                            (Integer) this.jSpinnerAddrH.getValue(),
                            (Integer) this.jSpinnerAddrL.getValue()),
                    ((Number) this.jSpinnerRSSI.getValue()).byteValue());

            controller.setNodeTtlMax(
                    (byte) this.jSpinnerNetID.getValue(),
                    new NodeAddress(
                            (Integer) this.jSpinnerAddrH.getValue(),
                            (Integer) this.jSpinnerAddrL.getValue()),
                    ((Number) this.jSpinnerTTL.getValue()).byteValue());

        } catch (ParseException ex) {
            Logger.getLogger(ControllerGui.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jButtonWriteParamsActionPerformed

    private void jButtonReadAcceptedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonReadAcceptedActionPerformed
        try {
            // TODO add your handling code here:
            jSpinnerNetID.commitEdit();
            jSpinnerAddrH.commitEdit();
            jSpinnerAddrL.commitEdit();
            List list = controller.getAcceptedAddressesList((byte) this.jSpinnerNetID.getValue(),
                    new NodeAddress(
                            (Integer) this.jSpinnerAddrH.getValue(),
                            (Integer) this.jSpinnerAddrL.getValue()));

            DefaultTableModel model = (DefaultTableModel) jTableAccepted.getModel();
            model.setRowCount(0);
            if (list != null) {
                for (NodeAddress addr : list) {
                    model.addRow(addr.getArray());
                }
            }
        } catch (ParseException ex) {
            Logger.getLogger(ControllerGui.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jButtonReadAcceptedActionPerformed

    private void jButtonRemoveAcceptedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRemoveAcceptedActionPerformed
        // TODO add your handling code here:
        int index = this.jTableAccepted.getSelectedRow();
        if (index >= 0) {
            try {

                jSpinnerNetID.commitEdit();
                jSpinnerAddrH.commitEdit();
                jSpinnerAddrL.commitEdit();

                controller.removeAcceptedAddress(
                        (byte) this.jSpinnerNetID.getValue(),
                        new NodeAddress(
                                (Integer) this.jSpinnerAddrH.getValue(),
                                (Integer) this.jSpinnerAddrL.getValue()),
                        new NodeAddress(
                        ((Number) jTableAccepted.getValueAt(index, 0)).byteValue(),
                        ((Number) jTableAccepted.getValueAt(index, 1)).byteValue()));

                ((DefaultTableModel) this.jTableAccepted.getModel()).removeRow(index);

            } catch (ParseException ex) {
                Logger.getLogger(ControllerGui.class.getName()).log(Level.SEVERE, null, ex);
            }

        } else {
            System.out.println("Please select a row");
        }
    }//GEN-LAST:event_jButtonRemoveAcceptedActionPerformed

    private void jButtonAddAcceptedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAddAcceptedActionPerformed
        // TODO add your handling code here:
        DefaultTableModel model = (DefaultTableModel) jTableAccepted.getModel();
        try {
            NodeAddress addr;
            String addrStr = JOptionPane.showInputDialog("Enter new address :");
            if (addrStr.contains(".")) {
                addr = new NodeAddress(addrStr);
                model.addRow(new Integer[]{(int) addr.getHigh() & 0xFF, (int) addr.getLow() & 0xFF});
            } else {
                addr = new NodeAddress(Integer.parseInt(addrStr));
                model.addRow(new Integer[]{(int) addr.getHigh() & 0xFF, (int) addr.getLow() & 0xFF});
            }

            jSpinnerNetID.commitEdit();
            jSpinnerAddrH.commitEdit();
            jSpinnerAddrL.commitEdit();

            controller.addAcceptedAddress(
                    (byte) this.jSpinnerNetID.getValue(),
                    new NodeAddress(
                            (Integer) this.jSpinnerAddrH.getValue(),
                            (Integer) this.jSpinnerAddrL.getValue()),
                    addr);

        } catch (HeadlessException | NumberFormatException e) {
            JOptionPane.showMessageDialog(this,
                    "Please insert a valid address."
                    + "\nExample: 0.125",
                    "Address Error",
                    JOptionPane.ERROR_MESSAGE);
        } catch (ParseException ex) {
            Logger.getLogger(ControllerGui.class.getName()).log(Level.SEVERE, null, ex);
        }

    }//GEN-LAST:event_jButtonAddAcceptedActionPerformed

    private void jButtonReadFlowsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonReadFlowsActionPerformed
        try {
            // TODO add your handling code here:
            jSpinnerNetID.commitEdit();
            jSpinnerAddrH.commitEdit();
            jSpinnerAddrL.commitEdit();

            DefaultTableModel model = (DefaultTableModel) jTableFlow.getModel();
            model.setRowCount(0);

            List entryList = controller.getRules(
                    (byte) this.jSpinnerNetID.getValue(),
                    new NodeAddress(
                            (Integer) this.jSpinnerAddrH.getValue(),
                            (Integer) this.jSpinnerAddrL.getValue()));

            int j = 0;
            for (FlowTableEntry entry : entryList) {

                if (entry.getWindow()[0].getSize() != 0) {
                    model.setRowCount(model.getRowCount() + 1);

                    int i = 0;
                    for (FlowTableWindow fw : entry.getWindow()) {
                        if (fw.getSize() != 0) {
                            this.jTableFlow.setValueAt(comboOp.getItemAt((fw.getOperator() / 8)), j, i);
                            i++;
                            this.jTableFlow.setValueAt(comboSize.getItemAt(fw.getSize() / 2), j, i);
                            i++;
                            this.jTableFlow.setValueAt(comboLoc.getItemAt((fw.getLocation())), j, i);
                            i++;
                            this.jTableFlow.setValueAt(comboOff.getItemAt((fw.getPos()) + 1), j, i);
                            i++;
                            this.jTableFlow.setValueAt(fw.getValueHigh(), j, i);
                            i++;
                            this.jTableFlow.setValueAt(fw.getValueLow(), j, i);
                            i++;
                        } else {
                            i += 6;
                        }
                    }

                    this.jTableFlow.setValueAt(comboActType.getItemAt((entry.getAction().getType() / 4)), j, i);
                    i++;
                    this.jTableFlow.setValueAt(entry.getAction().getMultimatch(), j, i);
                    i++;
                    this.jTableFlow.setValueAt(comboLoc.getItemAt((entry.getAction().getLocation())), j, i);
                    i++;
                    this.jTableFlow.setValueAt(comboOff.getItemAt((entry.getAction().getPos()) + 1), j, i);
                    i++;
                    this.jTableFlow.setValueAt(entry.getAction().getValueHigh(), j, i);
                    i++;
                    this.jTableFlow.setValueAt(entry.getAction().getValueLow(), j, i);
                    i++;
                    this.jTableFlow.setValueAt(entry.getStats().getTtl(), j, i);
                    i++;
                    this.jTableFlow.setValueAt(entry.getStats().getCounter(), j, i);
                    i++;
                }
                j++;
            }

        } catch (ParseException ex) {
            Logger.getLogger(ControllerGui.class.getName()).log(Level.SEVERE, null, ex);
        }

    }//GEN-LAST:event_jButtonReadFlowsActionPerformed

    private void jButtonRemoveFlowActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRemoveFlowActionPerformed
        try {
            if (this.jTableFlow.getSelectedRow() != -1) {
                // TODO add your handling code here:
                jSpinnerNetID.commitEdit();
                jSpinnerAddrH.commitEdit();
                jSpinnerAddrL.commitEdit();

                controller.removeRule((byte) this.jSpinnerNetID.getValue(),
                        new NodeAddress(
                                (Integer) this.jSpinnerAddrH.getValue(),
                                (Integer) this.jSpinnerAddrL.getValue()),
                        this.jTableFlow.getSelectedRow());

                DefaultTableModel model = (DefaultTableModel) jTableFlow.getModel();
                model.removeRow(this.jTableFlow.getSelectedRow());
            }
        } catch (ParseException ex) {
            Logger.getLogger(ControllerGui.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jButtonRemoveFlowActionPerformed

    private void jButtonAddFlowActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAddFlowActionPerformed
        // TODO add your handling code here: 
        this.jFrameAdd.setSize(563, 520);
        this.jFrameAdd.setVisible(true);
    }//GEN-LAST:event_jButtonAddFlowActionPerformed

    private void jButtonConvertActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonConvertActionPerformed
    /*    
        
        try {
            byte[] rule = new byte[16];

            if (jComboBoxSize1.getSelectedIndex() != 0) {
                rule[0] = (byte) ((jComboBoxOp1.getSelectedIndex() + 1) * 8 + (jComboBoxSize1.getSelectedIndex()) * 2 + jComboBoxS1.getSelectedIndex());
                rule[1] = ((Number) jComboBoxOff1.getSelectedIndex()).byteValue();
                rule[2] = ((((Number) jSpinnerValueH1.getValue()).byteValue()));
                rule[3] = ((((Number) jSpinnerValueL1.getValue()).byteValue()));
            }

            if (jComboBoxSize2.getSelectedIndex() != 0) {
                rule[4] = (byte) ((jComboBoxOp2.getSelectedIndex() + 1) * 8 + (jComboBoxSize2.getSelectedIndex()) * 2 + jComboBoxS2.getSelectedIndex());
                rule[5] = ((Number) jComboBoxOff2.getSelectedIndex()).byteValue();
                rule[6] = ((((Number) jSpinnerValueH2.getValue()).byteValue()));
                rule[7] = ((((Number) jSpinnerValueL2.getValue()).byteValue()));
            }

            if (jComboBoxSize3.getSelectedIndex() != 0) {
                rule[8] = (byte) ((jComboBoxOp3.getSelectedIndex() + 1) * 8 + (jComboBoxSize3.getSelectedIndex()) * 2 + jComboBoxS3.getSelectedIndex());
                rule[9] = ((Number) jComboBoxOff3.getSelectedIndex()).byteValue();
                rule[10] = ((((Number) jSpinnerValueH3.getValue()).byteValue()));
                rule[11] = ((((Number) jSpinnerValueL3.getValue()).byteValue()));
            }

            rule[12] = (byte) (((jComboBoxOpA.getSelectedIndex() + 1) << 2) + (jComboBoxMA.getSelectedIndex() * 2) + (jComboBoxSA.getSelectedIndex()));
            rule[13] = ((Number) jComboBoxA.getSelectedIndex()).byteValue();
            rule[14] = ((((Number) jSpinnerValueHA.getValue()).byteValue()));
            rule[15] = ((((Number) jSpinnerValueLA.getValue()).byteValue()));

            jSpinnerNetID.commitEdit();
            jSpinnerAddrH.commitEdit();
            jSpinnerAddrL.commitEdit();

            controller.addRule((byte)1, new NodeAddress("0.101"), rule);
        } catch (ParseException ex) {
            Logger.getLogger(ControllerGui.class.getName()).log(Level.SEVERE, null, ex);
        }
            */
    }//GEN-LAST:event_jButtonConvertActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonAddAccepted;
    private javax.swing.JButton jButtonAddFlow;
    private javax.swing.JButton jButtonConvert;
    private javax.swing.JButton jButtonReadAccepted;
    private javax.swing.JButton jButtonReadFlows;
    private javax.swing.JButton jButtonReadParams;
    private javax.swing.JButton jButtonRemoveAccepted;
    private javax.swing.JButton jButtonRemoveFlow;
    private javax.swing.JButton jButtonWriteParams;
    private javax.swing.JComboBox jComboBoxA;
    private javax.swing.JComboBox jComboBoxMA;
    private javax.swing.JComboBox jComboBoxOff1;
    private javax.swing.JComboBox jComboBoxOff2;
    private javax.swing.JComboBox jComboBoxOff3;
    private javax.swing.JComboBox jComboBoxOp1;
    private javax.swing.JComboBox jComboBoxOp2;
    private javax.swing.JComboBox jComboBoxOp3;
    private javax.swing.JComboBox jComboBoxOpA;
    private javax.swing.JComboBox jComboBoxS1;
    private javax.swing.JComboBox jComboBoxS2;
    private javax.swing.JComboBox jComboBoxS3;
    private javax.swing.JComboBox jComboBoxSA;
    private javax.swing.JComboBox jComboBoxSize1;
    private javax.swing.JComboBox jComboBoxSize2;
    private javax.swing.JComboBox jComboBoxSize3;
    private javax.swing.JFrame jFrameAdd;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JSpinner jSpinnerAddrH;
    private javax.swing.JSpinner jSpinnerAddrL;
    private javax.swing.JSpinner jSpinnerBeacon;
    private javax.swing.JSpinner jSpinnerNetID;
    private javax.swing.JSpinner jSpinnerRSSI;
    private javax.swing.JSpinner jSpinnerReport;
    private javax.swing.JSpinner jSpinnerTTL;
    private javax.swing.JSpinner jSpinnerValueH1;
    private javax.swing.JSpinner jSpinnerValueH2;
    private javax.swing.JSpinner jSpinnerValueH3;
    private javax.swing.JSpinner jSpinnerValueHA;
    private javax.swing.JSpinner jSpinnerValueL1;
    private javax.swing.JSpinner jSpinnerValueL2;
    private javax.swing.JSpinner jSpinnerValueL3;
    private javax.swing.JSpinner jSpinnerValueLA;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTable jTableAccepted;
    private javax.swing.JTable jTableFlow;
    // End of variables declaration//GEN-END:variables
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy