Java tutorial
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Graphics; import SimulationStructure.SimulationStarter; import java.awt.BorderLayout; import java.util.ArrayList; import javax.swing.JTextField; import javax.swing.event.ChangeEvent; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.chart.axis.NumberAxis; import org.jfree.chart.axis.NumberTickUnit; import org.jfree.chart.plot.XYPlot; import org.jfree.data.xy.XYDataset; import org.jfree.data.xy.XYSeries; import org.jfree.data.xy.XYSeriesCollection; /** * * @author korenciak.marek */ public class SimulationGUI extends javax.swing.JFrame implements ISimGraphics { private SimulationStarter starter = null; private boolean simulationPaused = false; private boolean observerModeOff = true; private Thread simulationThread = null; private int vehicleCount = 0; private int iterator = 0; /** * Creates new form NewJFrame */ public SimulationGUI() { initComponents(); setLocationRelativeTo(null); starter = new SimulationStarter(); starter.addGUI(this); jLabel50.setText(""); jLabel51.setText(""); reset(); resetV1(); resetV2(); resetV3(); resetV4(); resetS1(); resetS2(); rowNameLabel.setText("Row A"); rowNameLabel1.setText("Row B"); vehicleNameLabel.setText(""); vehicleNameLabel1.setText(""); vehicleNameLabel2.setText(""); vehicleNameLabel3.setText(""); move.setText(""); delayTimeSlider.setMinimum(200); delayTimeSlider.setMaximum(3000); delayTimeSlider.setValue(1000); repeteTimeSlider.setMinimum(1); repeteTimeSlider.setMaximum(50); repeteTimeSlider.setValue(15); jLabel50.setText(delayTimeSlider.getValue() + ""); jLabel51.setText(repeteTimeSlider.getValue() + ""); delayTimeSlider.addChangeListener(new javax.swing.event.ChangeListener() { @Override public void stateChanged(ChangeEvent e) { jLabel50.setText(delayTimeSlider.getValue() + ""); if (starter.simulationRunning()) { starter.setDelayTime(delayTimeSlider.getValue()); } } }); repeteTimeSlider.addChangeListener(new javax.swing.event.ChangeListener() { @Override public void stateChanged(ChangeEvent e) { jLabel51.setText(repeteTimeSlider.getValue() + ""); if (starter.simulationRunning()) { starter.setRepeteTime(repeteTimeSlider.getValue()); } } }); } /** * 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") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); configVariantComboBox = new javax.swing.JComboBox(); jLabel1 = new javax.swing.JLabel(); replicationNumbreTextField = new javax.swing.JTextField(); simulateButton = new javax.swing.JButton(); pauseButton = new javax.swing.JButton(); stopButton = new javax.swing.JButton(); jPanel2 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); observerButton = new javax.swing.JButton(); jLabel4 = new javax.swing.JLabel(); delayTimeSlider = new javax.swing.JSlider(); repeteTimeSlider = new javax.swing.JSlider(); jLabel13 = new javax.swing.JLabel(); actualSimulationTime = new javax.swing.JLabel(); jLabel50 = new javax.swing.JLabel(); jLabel51 = new javax.swing.JLabel(); jPanel5 = new javax.swing.JPanel(); vehicleInfoPanel1 = new javax.swing.JPanel(); jPanel7 = new javax.swing.JPanel(); jLabel14 = new javax.swing.JLabel(); jLabel15 = new javax.swing.JLabel(); jLabel16 = new javax.swing.JLabel(); jLabel17 = new javax.swing.JLabel(); jLabel18 = new javax.swing.JLabel(); jLabel19 = new javax.swing.JLabel(); jLabel20 = new javax.swing.JLabel(); vehicleWaitingALabel = new javax.swing.JLabel(); vehicleNameLabel = new javax.swing.JLabel(); vehicleAvgWaitingALabel = new javax.swing.JLabel(); vehicleAvgWaitingBLabel = new javax.swing.JLabel(); vehicleWaitingBLabel = new javax.swing.JLabel(); vehicleStatus = new javax.swing.JLabel(); vehicleActionTime = new javax.swing.JLabel(); vehicleInfoPanel2 = new javax.swing.JPanel(); jPanel8 = new javax.swing.JPanel(); jLabel21 = new javax.swing.JLabel(); jLabel22 = new javax.swing.JLabel(); jLabel23 = new javax.swing.JLabel(); jLabel24 = new javax.swing.JLabel(); jLabel25 = new javax.swing.JLabel(); jLabel26 = new javax.swing.JLabel(); jLabel27 = new javax.swing.JLabel(); vehicleWaitingALabel1 = new javax.swing.JLabel(); vehicleNameLabel1 = new javax.swing.JLabel(); vehicleAvgWaitingALabel1 = new javax.swing.JLabel(); vehicleAvgWaitingBLabel1 = new javax.swing.JLabel(); vehicleWaitingBLabel1 = new javax.swing.JLabel(); vehicleStatus1 = new javax.swing.JLabel(); vehicleActionTime1 = new javax.swing.JLabel(); jPanel9 = new javax.swing.JPanel(); jLabel28 = new javax.swing.JLabel(); 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(); jLabel34 = new javax.swing.JLabel(); vehicleWaitingALabel2 = new javax.swing.JLabel(); vehicleNameLabel2 = new javax.swing.JLabel(); vehicleAvgWaitingALabel2 = new javax.swing.JLabel(); vehicleAvgWaitingBLabel2 = new javax.swing.JLabel(); vehicleWaitingBLabel2 = new javax.swing.JLabel(); vehicleStatus2 = new javax.swing.JLabel(); vehicleActionTime2 = new javax.swing.JLabel(); jPanel10 = new javax.swing.JPanel(); jLabel35 = new javax.swing.JLabel(); jLabel36 = new javax.swing.JLabel(); jLabel37 = new javax.swing.JLabel(); jLabel38 = new javax.swing.JLabel(); jLabel39 = new javax.swing.JLabel(); jLabel40 = new javax.swing.JLabel(); jLabel41 = new javax.swing.JLabel(); vehicleWaitingALabel3 = new javax.swing.JLabel(); vehicleNameLabel3 = new javax.swing.JLabel(); vehicleAvgWaitingALabel3 = new javax.swing.JLabel(); vehicleAvgWaitingBLabel3 = new javax.swing.JLabel(); vehicleWaitingBLabel3 = new javax.swing.JLabel(); vehicleStatus3 = new javax.swing.JLabel(); vehicleActionTime3 = new javax.swing.JLabel(); jPanel3 = new javax.swing.JPanel(); serviceAInfoPanel = new javax.swing.JPanel(); jPanel11 = new javax.swing.JPanel(); jLabel42 = new javax.swing.JLabel(); jLabel43 = new javax.swing.JLabel(); jLabel44 = new javax.swing.JLabel(); jLabel45 = new javax.swing.JLabel(); rowProgress = new javax.swing.JProgressBar(); rowVehicleActualLabel = new javax.swing.JLabel(); rowWorkingLabel = new javax.swing.JLabel(); rowNameLabel = new javax.swing.JLabel(); rowActionEndLabel = new javax.swing.JLabel(); rowWorkLevelLabel = new javax.swing.JLabel(); serviceBInfoPanel = new javax.swing.JPanel(); jPanel12 = new javax.swing.JPanel(); jLabel46 = new javax.swing.JLabel(); jLabel47 = new javax.swing.JLabel(); jLabel48 = new javax.swing.JLabel(); jLabel49 = new javax.swing.JLabel(); rowProgress1 = new javax.swing.JProgressBar(); rowVehicleActualLabel1 = new javax.swing.JLabel(); rowWorkingLabel1 = new javax.swing.JLabel(); rowNameLabel1 = new javax.swing.JLabel(); rowActionEndLabel1 = new javax.swing.JLabel(); rowWorkLevelLabel1 = new javax.swing.JLabel(); jPanel6 = new javax.swing.JPanel(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); 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(); jLabel12 = new javax.swing.JLabel(); simulationSumTimeALabel = new javax.swing.JLabel(); simulationSumTimeBLabel = new javax.swing.JLabel(); simulationAvgTimeALabel = new javax.swing.JLabel(); simulationAvgTimeBLabel = new javax.swing.JLabel(); simulationCLTimeLabel = new javax.swing.JLabel(); simulationAvgTimeLabel = new javax.swing.JLabel(); simulationRowSizeBLabel = new javax.swing.JLabel(); simulationRowSizeALabel = new javax.swing.JLabel(); jLabel52 = new javax.swing.JLabel(); replicationNumber = new javax.swing.JLabel(); jLabel53 = new javax.swing.JLabel(); move = new javax.swing.JLabel(); jPanel13 = new javax.swing.JPanel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jPanel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)); jLabel2.setText("Configuration"); configVariantComboBox.setModel(new javax.swing.DefaultComboBoxModel( new String[] { "Configuration 1", "Configuration 2", "Configuration 3" })); jLabel1.setText("Replications"); simulateButton.setText("Simulate"); simulateButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { simulateButtonActionPerformed(evt); } }); pauseButton.setText("Pause"); pauseButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { pauseButtonActionPerformed(evt); } }); stopButton.setText("Stop"); stopButton.setMaximumSize(new java.awt.Dimension(73, 23)); stopButton.setMinimumSize(new java.awt.Dimension(73, 23)); stopButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { stopButtonActionPerformed(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().addComponent(jLabel2) .addGap(18, 18, 18) .addComponent(configVariantComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(61, 61, 61).addComponent(jLabel1).addGap(18, 18, 18) .addComponent(replicationNumbreTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(simulateButton).addGap(31, 31, 31) .addComponent(pauseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(31, 31, 31).addComponent(stopButton, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(27, 27, 27))); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel2) .addComponent(configVariantComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1) .addComponent(replicationNumbreTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(simulateButton).addComponent(pauseButton).addComponent(stopButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)); jLabel3.setText("Delay time"); observerButton.setText("Observer mode"); observerButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { observerButtonActionPerformed(evt); } }); jLabel4.setText("Repete time"); jLabel13.setText("Simulation time"); actualSimulationTime.setText("jLabel14"); jLabel50.setText("jLabel50"); jLabel51.setText("jLabel51"); 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(jPanel2Layout.createSequentialGroup().addComponent(jLabel13) .addGap(18, 18, 18).addComponent(actualSimulationTime).addGap(54, 54, 54) .addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel3).addComponent(jLabel4)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel50).addComponent(jLabel51)) .addGap(9, 9, 9)) .addGroup(jPanel2Layout.createSequentialGroup().addComponent(observerButton) .addGap(0, 0, Short.MAX_VALUE))) .addGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(repeteTimeSlider, javax.swing.GroupLayout.DEFAULT_SIZE, 629, Short.MAX_VALUE) .addComponent(delayTimeSlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(observerButton).addComponent(jLabel3).addComponent(jLabel50)) .addGap(18, 18, 18) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel13).addComponent(actualSimulationTime).addComponent(jLabel4) .addComponent(jLabel51)) .addContainerGap(28, Short.MAX_VALUE)) .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap() .addComponent(delayTimeSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(repeteTimeSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(20, Short.MAX_VALUE))); vehicleInfoPanel1.setPreferredSize(new java.awt.Dimension(238, 198)); jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder("Vehicle Info")); jLabel14.setText("Name"); jLabel15.setText("Waiting time A total"); jLabel16.setText("Waiting time B total"); jLabel17.setText("Avg waiting time A"); jLabel18.setText("Avg waiting time B"); jLabel19.setText("Vehicle status"); jLabel20.setText("Time of end action"); vehicleWaitingALabel.setText("jLabel8"); vehicleNameLabel.setText("jLabel9"); vehicleAvgWaitingALabel.setText("jLabel10"); vehicleAvgWaitingBLabel.setText("jLabel11"); vehicleWaitingBLabel.setText("jLabel12"); vehicleStatus.setText("jLabel13"); vehicleActionTime.setText("jLabel14"); 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).addComponent(jLabel14) .addComponent(jLabel15).addComponent(jLabel16).addComponent(jLabel17).addComponent(jLabel18) .addComponent(jLabel19).addComponent(jLabel20)).addGap(28, 28, 28) .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(vehicleStatus, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(vehicleAvgWaitingBLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(vehicleAvgWaitingALabel, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(vehicleNameLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel7Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(vehicleWaitingBLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 59, Short.MAX_VALUE) .addComponent(vehicleWaitingALabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(vehicleActionTime, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(0, 19, Short.MAX_VALUE))); jPanel7Layout.setVerticalGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout.createSequentialGroup() .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel14).addComponent(vehicleNameLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel15).addComponent(vehicleWaitingALabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(vehicleWaitingBLabel).addComponent(jLabel16)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel17).addComponent(vehicleAvgWaitingALabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel18).addComponent(vehicleAvgWaitingBLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel19).addComponent(vehicleStatus)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel20).addComponent(vehicleActionTime)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); javax.swing.GroupLayout vehicleInfoPanel1Layout = new javax.swing.GroupLayout(vehicleInfoPanel1); vehicleInfoPanel1.setLayout(vehicleInfoPanel1Layout); vehicleInfoPanel1Layout.setHorizontalGroup(vehicleInfoPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE) .addGroup(vehicleInfoPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, vehicleInfoPanel1Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))); vehicleInfoPanel1Layout.setVerticalGroup(vehicleInfoPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 168, Short.MAX_VALUE) .addGroup(vehicleInfoPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(vehicleInfoPanel1Layout.createSequentialGroup() .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)))); vehicleInfoPanel2.setPreferredSize(new java.awt.Dimension(238, 198)); jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder("Vehicle Info")); jLabel21.setText("Name"); jLabel22.setText("Waiting time A total"); jLabel23.setText("Waiting time B total"); jLabel24.setText("Avg waiting time A"); jLabel25.setText("Avg waiting time B"); jLabel26.setText("Vehicle status"); jLabel27.setText("Time of end action"); vehicleWaitingALabel1.setText("jLabel8"); vehicleNameLabel1.setText("jLabel9"); vehicleAvgWaitingALabel1.setText("jLabel10"); vehicleAvgWaitingBLabel1.setText("jLabel11"); vehicleWaitingBLabel1.setText("jLabel12"); vehicleStatus1.setText("jLabel13"); vehicleActionTime1.setText("jLabel14"); 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.createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup( jPanel8Layout.createSequentialGroup().addComponent(jLabel21) .addGap(85, 85, 85).addComponent(vehicleNameLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel8Layout.createSequentialGroup().addComponent(jLabel22) .addGap(18, 18, 18).addComponent(vehicleWaitingALabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel8Layout.createSequentialGroup().addGroup(jPanel8Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel23).addComponent(jLabel24) .addComponent(jLabel25).addComponent(jLabel26)).addGap(18, 18, 18) .addGroup(jPanel8Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(vehicleStatus1, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel8Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(vehicleAvgWaitingBLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel8Layout.createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(vehicleAvgWaitingALabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(vehicleWaitingBLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))))) .addGroup(jPanel8Layout.createSequentialGroup().addComponent(jLabel27) .addGap(23, 23, 23).addComponent(vehicleActionTime1, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(37, Short.MAX_VALUE))); jPanel8Layout.setVerticalGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel8Layout.createSequentialGroup() .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel21).addComponent(vehicleNameLabel1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel22).addComponent(vehicleWaitingALabel1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel23).addComponent(vehicleWaitingBLabel1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel24).addComponent(vehicleAvgWaitingALabel1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel25).addComponent(vehicleAvgWaitingBLabel1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel26).addComponent(vehicleStatus1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(vehicleActionTime1).addComponent(jLabel27)) .addGap(45, 45, 45))); javax.swing.GroupLayout vehicleInfoPanel2Layout = new javax.swing.GroupLayout(vehicleInfoPanel2); vehicleInfoPanel2.setLayout(vehicleInfoPanel2Layout); vehicleInfoPanel2Layout.setHorizontalGroup(vehicleInfoPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE) .addGroup(vehicleInfoPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(vehicleInfoPanel2Layout.createSequentialGroup() .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)))); vehicleInfoPanel2Layout.setVerticalGroup( vehicleInfoPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 167, Short.MAX_VALUE) .addGroup(vehicleInfoPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(vehicleInfoPanel2Layout.createSequentialGroup() .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, 167, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)))); jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder("Vehicle Info")); jLabel28.setText("Name"); jLabel29.setText("Waiting time A total"); jLabel30.setText("Waiting time B total"); jLabel31.setText("Avg waiting time A"); jLabel32.setText("Avg waiting time B"); jLabel33.setText("Vehicle status"); jLabel34.setText("Time of end action"); vehicleWaitingALabel2.setText("jLabel8"); vehicleNameLabel2.setText("jLabel9"); vehicleAvgWaitingALabel2.setText("jLabel10"); vehicleAvgWaitingBLabel2.setText("jLabel11"); vehicleWaitingBLabel2.setText("jLabel12"); vehicleStatus2.setText("jLabel13"); vehicleActionTime2.setText("jLabel14"); javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9); jPanel9.setLayout(jPanel9Layout); jPanel9Layout.setHorizontalGroup(jPanel9Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel9Layout.createSequentialGroup().addContainerGap().addGroup(jPanel9Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel9Layout.createSequentialGroup().addGroup(jPanel9Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel9Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel9Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jPanel9Layout.createSequentialGroup() .addComponent(jLabel29).addGap(18, 18, 18) .addComponent(vehicleWaitingALabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup( jPanel9Layout.createSequentialGroup().addComponent(jLabel28) .addGap(85, 85, 85).addComponent(vehicleNameLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel9Layout.createSequentialGroup() .addComponent(jLabel30).addGap(18, 18, 18) .addComponent(vehicleWaitingBLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addGroup(jPanel9Layout.createSequentialGroup().addGap(111, 111, 111) .addComponent(vehicleAvgWaitingALabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel9Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(vehicleAvgWaitingBLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(vehicleStatus2, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(vehicleActionTime2, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(26, Short.MAX_VALUE)) .addGroup( jPanel9Layout.createSequentialGroup() .addGroup(jPanel9Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel31).addComponent(jLabel32) .addComponent(jLabel33).addComponent(jLabel34)) .addGap(0, 0, Short.MAX_VALUE))))); jPanel9Layout.setVerticalGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel9Layout.createSequentialGroup() .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel28).addComponent(vehicleNameLabel2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel29).addComponent(vehicleWaitingALabel2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel30).addComponent(vehicleWaitingBLabel2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel31).addComponent(vehicleAvgWaitingALabel2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel32).addComponent(vehicleAvgWaitingBLabel2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel33).addComponent(vehicleStatus2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel34).addComponent(vehicleActionTime2)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder("Vehicle Info")); jLabel35.setText("Name"); jLabel36.setText("Waiting time A total"); jLabel37.setText("Waiting time B total"); jLabel38.setText("Avg waiting time A"); jLabel39.setText("Avg waiting time B"); jLabel40.setText("Vehicle status"); jLabel41.setText("Time of end action"); vehicleWaitingALabel3.setText("jLabel8"); vehicleNameLabel3.setText("jLabel9"); vehicleAvgWaitingALabel3.setText("jLabel10"); vehicleAvgWaitingBLabel3.setText("jLabel11"); vehicleWaitingBLabel3.setText("jLabel12"); vehicleStatus3.setText("jLabel13"); vehicleActionTime3.setText("jLabel14"); javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10); jPanel10.setLayout(jPanel10Layout); jPanel10Layout.setHorizontalGroup(jPanel10Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel10Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel10Layout.createSequentialGroup().addGroup(jPanel10Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel10Layout.createSequentialGroup().addComponent(jLabel35) .addGap(85, 85, 85).addComponent(vehicleNameLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel10Layout.createSequentialGroup().addComponent(jLabel36) .addGap(18, 18, 18).addComponent(vehicleWaitingALabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(30, Short.MAX_VALUE)) .addGroup(jPanel10Layout.createSequentialGroup().addGroup(jPanel10Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel37).addComponent(jLabel38).addComponent(jLabel39) .addComponent(jLabel40).addComponent(jLabel41)).addGap(18, 18, 18) .addGroup(jPanel10Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(vehicleAvgWaitingBLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(vehicleAvgWaitingALabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE) .addComponent(vehicleWaitingBLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( vehicleStatus3, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(vehicleActionTime3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(0, 0, Short.MAX_VALUE))))); jPanel10Layout.setVerticalGroup(jPanel10Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel10Layout.createSequentialGroup() .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel35).addComponent(vehicleNameLabel3)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel36).addComponent(vehicleWaitingALabel3)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel37).addComponent(vehicleWaitingBLabel3)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel38).addComponent(vehicleAvgWaitingALabel3)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel39).addComponent(vehicleAvgWaitingBLabel3)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel40).addComponent(vehicleStatus3)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel41).addComponent(vehicleActionTime3)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup(jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup() .addComponent(vehicleInfoPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(vehicleInfoPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))); jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup() .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jPanel10, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addComponent(jPanel9, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(vehicleInfoPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 167, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(vehicleInfoPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(45, Short.MAX_VALUE))); jPanel11.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)); jLabel42.setText("Row name"); jLabel43.setText("Working"); jLabel44.setText("Vehicle name"); jLabel45.setText("End action"); rowVehicleActualLabel.setText("jLabel5"); rowWorkingLabel.setText("jLabel6"); rowNameLabel.setText("jLabel7"); rowActionEndLabel.setText("jLabel8"); rowWorkLevelLabel.setText("jLabel5"); javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11); jPanel11.setLayout(jPanel11Layout); jPanel11Layout.setHorizontalGroup(jPanel11Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel11Layout.createSequentialGroup().addGroup(jPanel11Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel11Layout.createSequentialGroup().addContainerGap().addGroup(jPanel11Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel45) .addGroup(jPanel11Layout.createSequentialGroup().addGroup(jPanel11Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel44).addComponent(jLabel43).addComponent(jLabel42)) .addGap(18, 18, 18) .addGroup(jPanel11Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(rowWorkLevelLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel11Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(rowVehicleActualLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 114, Short.MAX_VALUE) .addComponent(rowWorkingLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(rowNameLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(rowActionEndLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))))) .addGroup(jPanel11Layout.createSequentialGroup().addGap(28, 28, 28).addComponent( rowProgress, javax.swing.GroupLayout.PREFERRED_SIZE, 176, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(28, Short.MAX_VALUE))); jPanel11Layout.setVerticalGroup(jPanel11Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel11Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel42).addComponent(rowNameLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel43).addComponent(rowWorkingLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel44).addComponent(rowVehicleActualLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel45).addComponent(rowActionEndLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE) .addComponent(rowWorkLevelLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(rowProgress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(23, 23, 23))); javax.swing.GroupLayout serviceAInfoPanelLayout = new javax.swing.GroupLayout(serviceAInfoPanel); serviceAInfoPanel.setLayout(serviceAInfoPanelLayout); serviceAInfoPanelLayout.setHorizontalGroup(serviceAInfoPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE) .addGroup(serviceAInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(serviceAInfoPanelLayout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)))); serviceAInfoPanelLayout.setVerticalGroup(serviceAInfoPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 200, Short.MAX_VALUE) .addGroup(serviceAInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(serviceAInfoPanelLayout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)))); serviceBInfoPanel.setPreferredSize(new java.awt.Dimension(0, 194)); jPanel12.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)); jLabel46.setText("Row name"); jLabel47.setText("Working"); jLabel48.setText("Vehicle name"); jLabel49.setText("End action"); rowVehicleActualLabel1.setText("jLabel5"); rowWorkingLabel1.setText("jLabel6"); rowNameLabel1.setText("jLabel7"); rowActionEndLabel1.setText("jLabel8"); rowWorkLevelLabel1.setText("jLabel5"); javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12); jPanel12.setLayout(jPanel12Layout); jPanel12Layout.setHorizontalGroup(jPanel12Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel12Layout.createSequentialGroup().addGroup(jPanel12Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel12Layout .createSequentialGroup().addContainerGap().addGroup(jPanel12Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel48).addComponent(jLabel47).addComponent(jLabel46) .addComponent(jLabel49)) .addGap(18, 18, 18) .addGroup(jPanel12Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(rowVehicleActualLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 114, Short.MAX_VALUE) .addComponent(rowWorkingLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(rowNameLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(rowActionEndLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(rowWorkLevelLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel12Layout.createSequentialGroup().addGap(28, 28, 28).addComponent( rowProgress1, javax.swing.GroupLayout.PREFERRED_SIZE, 176, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(28, Short.MAX_VALUE))); jPanel12Layout.setVerticalGroup(jPanel12Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel12Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel46).addComponent(rowNameLabel1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel47).addComponent(rowWorkingLabel1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel48).addComponent(rowVehicleActualLabel1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel49).addComponent(rowActionEndLabel1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE) .addComponent(rowWorkLevelLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(rowProgress1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(23, 23, 23))); javax.swing.GroupLayout serviceBInfoPanelLayout = new javax.swing.GroupLayout(serviceBInfoPanel); serviceBInfoPanel.setLayout(serviceBInfoPanelLayout); serviceBInfoPanelLayout.setHorizontalGroup(serviceBInfoPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 236, Short.MAX_VALUE) .addGroup(serviceBInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(serviceBInfoPanelLayout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)))); serviceBInfoPanelLayout.setVerticalGroup(serviceBInfoPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 195, Short.MAX_VALUE) .addGroup(serviceBInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(serviceBInfoPanelLayout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)))); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(serviceAInfoPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(serviceBInfoPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 236, Short.MAX_VALUE)); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addComponent(serviceAInfoPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(serviceBInfoPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE))); jPanel6.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)); jLabel5.setText("Simulation time 90% CL"); jLabel6.setText("Sum waiting time row A"); jLabel7.setText("Sum waiting time row B"); jLabel8.setText("Avg waiting time row A"); jLabel9.setText("Avg waiting time row B"); jLabel10.setText("Row size A"); jLabel11.setText("Row size B"); jLabel12.setText("Avg simulation time"); simulationSumTimeALabel.setText("jLabel13"); simulationSumTimeBLabel.setText("jLabel14"); simulationAvgTimeALabel.setText("jLabel15"); simulationAvgTimeBLabel.setText("jLabel16"); simulationCLTimeLabel.setText("jLabel17"); simulationAvgTimeLabel.setText("jLabel18"); simulationRowSizeBLabel.setText("jLabel19"); simulationRowSizeALabel.setText("jLabel20"); jLabel52.setText("Replication #"); replicationNumber.setText("jLabel53"); jLabel53.setText("Move"); move.setText("jLabel54"); 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) .addComponent(jLabel6).addComponent(jLabel7).addComponent(jLabel8) .addComponent(jLabel9)) .addGap(35, 35, 35) .addGroup(jPanel6Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(simulationAvgTimeBLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE) .addComponent(simulationSumTimeALabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(simulationSumTimeBLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(simulationAvgTimeALabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup().addGap(18, 18, 18) .addGroup(jPanel6Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel10).addComponent(jLabel12) .addComponent(jLabel11))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout .createSequentialGroup().addGap(18, 18, 18).addComponent(jLabel5))) .addGap(18, 18, 18) .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(simulationCLTimeLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(simulationAvgTimeLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout .createSequentialGroup() .addGroup(jPanel6Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(simulationRowSizeBLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(simulationRowSizeALabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(18, 18, 18) .addGroup(jPanel6Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel52).addComponent(jLabel53)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel6Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(move).addComponent(replicationNumber, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(16, 16, 16))) .addContainerGap())); jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel6).addComponent(jLabel10).addComponent(simulationSumTimeALabel) .addComponent(simulationRowSizeALabel).addComponent(jLabel52) .addComponent(replicationNumber)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel7).addComponent(jLabel11).addComponent(simulationSumTimeBLabel) .addComponent(simulationRowSizeBLabel).addComponent(jLabel53).addComponent(move)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel8).addComponent(jLabel12).addComponent(simulationAvgTimeALabel) .addComponent(simulationAvgTimeLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel9).addComponent(jLabel5).addComponent(simulationAvgTimeBLabel) .addComponent(simulationCLTimeLabel)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13); jPanel13.setLayout(jPanel13Layout); jPanel13Layout.setHorizontalGroup(jPanel13Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); jPanel13Layout.setVerticalGroup(jPanel13Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGap(0, 0, 0) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGap(41, 41, 41).addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))); pack(); }// </editor-fold>//GEN-END:initComponents private void simulateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_simulateButtonActionPerformed if (valideInput(replicationNumbreTextField)) { vehicleCount = 0; starter.setConfigurationNumber(convertConfig()); starter.setMaxSimTime(Double.MAX_VALUE); starter.setReplicationCount(convert(replicationNumbreTextField)); simulationThread = new Thread(starter); simulationThread.start(); starter.setRepeteTime(repeteTimeSlider.getValue()); starter.setDelayTime(delayTimeSlider.getValue()); } }//GEN-LAST:event_simulateButtonActionPerformed private void pauseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pauseButtonActionPerformed if (!simulationPaused) { starter.simulationPause(); simulationPaused = true; pauseButton.setText("Unpause"); } else { starter.simulationUnpause(); simulationPaused = false; pauseButton.setText("Pause"); } }//GEN-LAST:event_pauseButtonActionPerformed private void stopButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_stopButtonActionPerformed starter.simulationStop(); }//GEN-LAST:event_stopButtonActionPerformed private void observerButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_observerButtonActionPerformed if (observerModeOff) { starter.simulationTurnOnObserverMode(); observerModeOff = false; observerButton.setText("Observer mode off"); } else { starter.simulationTurnOffObserverMode(); observerModeOff = true; observerButton.setText("Observer mode on"); } }//GEN-LAST:event_observerButtonActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new SimulationGUI().setVisible(true); } }); } private void reset() { simulationAvgTimeALabel.setText(""); simulationAvgTimeBLabel.setText(""); simulationAvgTimeLabel.setText(""); simulationCLTimeLabel.setText(""); simulationRowSizeALabel.setText(""); simulationRowSizeBLabel.setText(""); simulationSumTimeALabel.setText(""); simulationSumTimeBLabel.setText(""); actualSimulationTime.setText(""); replicationNumber.setText(""); } private boolean valideInput(JTextField textField) { try { Integer.parseInt(textField.getText()); } catch (NumberFormatException e) { return false; } return true; } private int convert(JTextField textField) { return Integer.parseInt(textField.getText()); } private int convertConfig() { switch (configVariantComboBox.getSelectedItem().toString()) { case "Configuration 1": return 0; case "Configuration 2": return 1; case "Configuration 3": return 2; } return 0; } private XYDataset fillDataset(ArrayList<Double> data, int jump, double koef) { XYSeriesCollection dataset = new XYSeriesCollection(); XYSeries grafPriemer = new XYSeries("Avg value"); for (int i = (int) (data.size() * koef); i < data.size(); i += jump) { grafPriemer.add(i + 1, data.get(i) / 60); } dataset.addSeries(grafPriemer); return dataset; } private ChartPanel createGraph(XYDataset dataset, int odstupy, String menoGrafu, String xAxisMeno, String yAxisMeno) { JFreeChart graf = ChartFactory.createXYLineChart(menoGrafu, xAxisMeno, yAxisMeno, dataset); XYPlot plot = graf.getXYPlot(); NumberAxis yAxis = (NumberAxis) plot.getRangeAxis(); yAxis.setAutoRangeIncludesZero(false); NumberAxis xAxis = (NumberAxis) plot.getDomainAxis(); xAxis.setTickUnit(new NumberTickUnit(odstupy)); return new ChartPanel(graf); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel actualSimulationTime; private javax.swing.JComboBox configVariantComboBox; private javax.swing.JSlider delayTimeSlider; 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 jLabel17; private javax.swing.JLabel jLabel18; private javax.swing.JLabel jLabel19; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel20; private javax.swing.JLabel jLabel21; private javax.swing.JLabel jLabel22; private javax.swing.JLabel jLabel23; private javax.swing.JLabel jLabel24; private javax.swing.JLabel jLabel25; 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 jLabel34; private javax.swing.JLabel jLabel35; private javax.swing.JLabel jLabel36; private javax.swing.JLabel jLabel37; private javax.swing.JLabel jLabel38; private javax.swing.JLabel jLabel39; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel40; private javax.swing.JLabel jLabel41; private javax.swing.JLabel jLabel42; private javax.swing.JLabel jLabel43; private javax.swing.JLabel jLabel44; private javax.swing.JLabel jLabel45; private javax.swing.JLabel jLabel46; private javax.swing.JLabel jLabel47; private javax.swing.JLabel jLabel48; private javax.swing.JLabel jLabel49; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel50; private javax.swing.JLabel jLabel51; private javax.swing.JLabel jLabel52; private javax.swing.JLabel jLabel53; 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 jPanel10; private javax.swing.JPanel jPanel11; private javax.swing.JPanel jPanel12; private javax.swing.JPanel jPanel13; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; private javax.swing.JPanel jPanel5; private javax.swing.JPanel jPanel6; private javax.swing.JPanel jPanel7; private javax.swing.JPanel jPanel8; private javax.swing.JPanel jPanel9; private javax.swing.JLabel move; private javax.swing.JButton observerButton; private javax.swing.JButton pauseButton; private javax.swing.JSlider repeteTimeSlider; private javax.swing.JLabel replicationNumber; private javax.swing.JTextField replicationNumbreTextField; private javax.swing.JLabel rowActionEndLabel; private javax.swing.JLabel rowActionEndLabel1; private javax.swing.JLabel rowNameLabel; private javax.swing.JLabel rowNameLabel1; private javax.swing.JProgressBar rowProgress; private javax.swing.JProgressBar rowProgress1; private javax.swing.JLabel rowVehicleActualLabel; private javax.swing.JLabel rowVehicleActualLabel1; private javax.swing.JLabel rowWorkLevelLabel; private javax.swing.JLabel rowWorkLevelLabel1; private javax.swing.JLabel rowWorkingLabel; private javax.swing.JLabel rowWorkingLabel1; private javax.swing.JPanel serviceAInfoPanel; private javax.swing.JPanel serviceBInfoPanel; private javax.swing.JButton simulateButton; private javax.swing.JLabel simulationAvgTimeALabel; private javax.swing.JLabel simulationAvgTimeBLabel; private javax.swing.JLabel simulationAvgTimeLabel; private javax.swing.JLabel simulationCLTimeLabel; private javax.swing.JLabel simulationRowSizeALabel; private javax.swing.JLabel simulationRowSizeBLabel; private javax.swing.JLabel simulationSumTimeALabel; private javax.swing.JLabel simulationSumTimeBLabel; private javax.swing.JButton stopButton; private javax.swing.JLabel vehicleActionTime; private javax.swing.JLabel vehicleActionTime1; private javax.swing.JLabel vehicleActionTime2; private javax.swing.JLabel vehicleActionTime3; private javax.swing.JLabel vehicleAvgWaitingALabel; private javax.swing.JLabel vehicleAvgWaitingALabel1; private javax.swing.JLabel vehicleAvgWaitingALabel2; private javax.swing.JLabel vehicleAvgWaitingALabel3; private javax.swing.JLabel vehicleAvgWaitingBLabel; private javax.swing.JLabel vehicleAvgWaitingBLabel1; private javax.swing.JLabel vehicleAvgWaitingBLabel2; private javax.swing.JLabel vehicleAvgWaitingBLabel3; private javax.swing.JPanel vehicleInfoPanel1; private javax.swing.JPanel vehicleInfoPanel2; private javax.swing.JLabel vehicleNameLabel; private javax.swing.JLabel vehicleNameLabel1; private javax.swing.JLabel vehicleNameLabel2; private javax.swing.JLabel vehicleNameLabel3; private javax.swing.JLabel vehicleStatus; private javax.swing.JLabel vehicleStatus1; private javax.swing.JLabel vehicleStatus2; private javax.swing.JLabel vehicleStatus3; private javax.swing.JLabel vehicleWaitingALabel; private javax.swing.JLabel vehicleWaitingALabel1; private javax.swing.JLabel vehicleWaitingALabel2; private javax.swing.JLabel vehicleWaitingALabel3; private javax.swing.JLabel vehicleWaitingBLabel; private javax.swing.JLabel vehicleWaitingBLabel1; private javax.swing.JLabel vehicleWaitingBLabel2; private javax.swing.JLabel vehicleWaitingBLabel3; // End of variables declaration//GEN-END:variables @Override public void setSimTime(double simTime) { actualSimulationTime.setText(String.format("%.0f", simTime / 60) + " h " + (String.format("%.0f", ((simTime / 60) % 1) * 60)) + " m"); } @Override public void setProgressA(double actual, double max, String vehicleName, Double actionEnd) { rowWorkLevelLabel.setText(String.format("%.1f", actual) + " / " + String.format("%.1f", max)); if (actual == 0 && max == 0) { rowProgress.setValue(0); rowVehicleActualLabel.setText(""); rowActionEndLabel.setText(""); rowWorkingLabel.setText("false"); } else { rowProgress.setValue((int) Math.round(actual)); rowProgress.setMaximum((int) Math.round(max)); rowVehicleActualLabel.setText(vehicleName); rowActionEndLabel.setText(String.format("%.1f", actionEnd) + " minutes"); rowWorkingLabel.setText("true"); } } @Override public void setProgressB(double actual, double max, String vehicleName, Double actionEnd) { rowWorkLevelLabel1.setText(String.format("%.1f", actual) + " / " + String.format("%.1f", max)); if (actual == 0 && max == 0) { rowProgress1.setValue(0); rowVehicleActualLabel1.setText(""); rowActionEndLabel1.setText(""); rowWorkingLabel1.setText("false"); } else { rowProgress1.setValue((int) actual); rowProgress1.setMaximum((int) max); rowVehicleActualLabel1.setText(vehicleName); rowActionEndLabel1.setText(String.format("%.1f", actionEnd) + " minutes"); rowWorkingLabel1.setText("true"); } } @Override public void setCarInformation(String name, double waitingATotal, double waitingBTotal, double waitingAAvg, double waitingBAvg, String status, Double timeOfAction) { if (vehicleNameLabel.getText().compareTo(name) == 0) { updateVehicel1(timeOfAction, waitingAAvg, waitingBAvg, status, waitingATotal, waitingAAvg); } else { if (vehicleNameLabel1.getText().compareTo(name) == 0) { updateVehicel2(timeOfAction, waitingAAvg, waitingBAvg, status, waitingATotal, waitingAAvg); } else { if (vehicleNameLabel2.getText().compareTo(name) == 0) { updateVehicel3(timeOfAction, waitingAAvg, waitingBAvg, status, waitingATotal, waitingAAvg); } else { if (vehicleNameLabel3.getText().compareTo(name) == 0) { updateVehicel4(timeOfAction, waitingAAvg, waitingBAvg, status, waitingATotal, waitingAAvg); } else { switch (vehicleCount) { case 0: vehicleNameLabel.setText(name); break; case 1: vehicleNameLabel1.setText(name); break; case 2: vehicleNameLabel2.setText(name); break; case 3: vehicleNameLabel3.setText(name); break; } vehicleCount++; setCarInformation(name, waitingATotal, waitingBTotal, waitingAAvg, waitingBAvg, status, timeOfAction); } } } } } public void updateVehicel1(Double paActionTime, double paAvgWaitingTimeA, double paAvgWaitingTimeB, String paVehicleStatus, double paWaitingTimeA, double paWaitingTimeB) { vehicleActionTime.setText(String.format("%.2f", paActionTime) + " minutes"); vehicleAvgWaitingALabel.setText(String.format("%.2f", paAvgWaitingTimeA) + " minutes"); vehicleAvgWaitingBLabel.setText(String.format("%.2f", paAvgWaitingTimeB) + " minutes"); vehicleStatus.setText(paVehicleStatus); vehicleWaitingALabel.setText(String.format("%.2f", paWaitingTimeA) + " minutes"); vehicleWaitingBLabel.setText(String.format("%.2f", paWaitingTimeB) + " minutes"); } public void updateVehicel2(Double paActionTime, double paAvgWaitingTimeA, double paAvgWaitingTimeB, String paVehicleStatus, double paWaitingTimeA, double paWaitingTimeB) { vehicleActionTime1.setText(String.format("%.2f", paActionTime) + " minutes"); vehicleAvgWaitingALabel1.setText(String.format("%.2f", paAvgWaitingTimeA) + " minutes"); vehicleAvgWaitingBLabel1.setText(String.format("%.2f", paAvgWaitingTimeB) + " minutes"); vehicleStatus1.setText(paVehicleStatus); vehicleWaitingALabel1.setText(String.format("%.2f", paWaitingTimeA) + " minutes"); vehicleWaitingBLabel1.setText(String.format("%.2f", paWaitingTimeB) + " minutes"); } public void updateVehicel3(Double paActionTime, double paAvgWaitingTimeA, double paAvgWaitingTimeB, String paVehicleStatus, double paWaitingTimeA, double paWaitingTimeB) { vehicleActionTime2.setText(String.format("%.2f", paActionTime) + " minutes"); vehicleAvgWaitingALabel2.setText(String.format("%.2f", paAvgWaitingTimeA) + " minutes"); vehicleAvgWaitingBLabel2.setText(String.format("%.2f", paAvgWaitingTimeB) + " minutes"); vehicleStatus2.setText(paVehicleStatus); vehicleWaitingALabel2.setText(String.format("%.2f", paWaitingTimeA) + " minutes"); vehicleWaitingBLabel2.setText(String.format("%.2f", paWaitingTimeB) + " minutes"); } public void updateVehicel4(Double paActionTime, double paAvgWaitingTimeA, double paAvgWaitingTimeB, String paVehicleStatus, double paWaitingTimeA, double paWaitingTimeB) { vehicleActionTime3.setText(String.format("%.2f", paActionTime) + " minutes"); vehicleAvgWaitingALabel3.setText(String.format("%.2f", paAvgWaitingTimeA) + " minutes"); vehicleAvgWaitingBLabel3.setText(String.format("%.2f", paAvgWaitingTimeB) + " minutes"); vehicleStatus3.setText(paVehicleStatus); vehicleWaitingALabel3.setText(String.format("%.2f", paWaitingTimeA) + " minutes"); vehicleWaitingBLabel3.setText(String.format("%.2f", paWaitingTimeB) + " minutes"); } @Override public void setAvgSimulationTime(double simTime) { simulationAvgTimeLabel.setText(String.format("%.6f", simTime / 60) + " hours"); } @Override public void setConfidenceIntervalOfSimulationTime(double lowBoundOfInterval, double highBoundOfInterval) { simulationCLTimeLabel.setText("<" + String.format("%.6f", lowBoundOfInterval / 60) + " ; " + String.format("%.6f", highBoundOfInterval / 60) + "> hours"); } @Override public void setSumWaitingTimeInRowA(double time) { simulationSumTimeALabel.setText(String.format("%.6f", time / 60) + " hours"); } @Override public void setSumWaitingTimeInRowB(double time) { simulationSumTimeBLabel.setText(String.format("%.6f", time / 60) + " hours"); } @Override public void setAvgWaitingTimeRowA(double time) { simulationAvgTimeALabel.setText(String.format("%.6f", time) + " minutes"); } @Override public void setAvgWaitingTimeRowB(double time) { simulationAvgTimeBLabel.setText(String.format("%.6f", time) + " minutes"); } @Override public void setAvgRowASize(double rowSize) { simulationRowSizeALabel.setText(String.format("%.6f", rowSize) + ""); } @Override public void setAvgRowBSize(double rowSize) { simulationRowSizeBLabel.setText(String.format("%.6f", rowSize) + ""); } private void resetV1() { vehicleActionTime.setText(""); vehicleAvgWaitingALabel.setText(""); vehicleAvgWaitingBLabel.setText(""); vehicleStatus.setText(""); vehicleWaitingALabel.setText(""); vehicleWaitingBLabel.setText(""); } private void resetV2() { vehicleActionTime1.setText(""); vehicleAvgWaitingALabel1.setText(""); vehicleAvgWaitingBLabel1.setText(""); vehicleStatus1.setText(""); vehicleWaitingALabel1.setText(""); vehicleWaitingBLabel1.setText(""); } private void resetV3() { vehicleActionTime2.setText(""); vehicleAvgWaitingALabel2.setText(""); vehicleAvgWaitingBLabel2.setText(""); vehicleStatus2.setText(""); vehicleWaitingALabel2.setText(""); vehicleWaitingBLabel2.setText(""); } private void resetV4() { vehicleActionTime3.setText(""); vehicleAvgWaitingALabel3.setText(""); vehicleAvgWaitingBLabel3.setText(""); vehicleStatus3.setText(""); vehicleWaitingALabel3.setText(""); vehicleWaitingBLabel3.setText(""); } private void resetS1() { rowActionEndLabel.setText(""); rowProgress.setToolTipText(""); rowVehicleActualLabel.setText(""); rowWorkLevelLabel.setText(""); rowWorkingLabel.setText(""); } private void resetS2() { rowActionEndLabel1.setText(""); rowProgress1.setToolTipText(""); rowVehicleActualLabel1.setText(""); rowWorkLevelLabel1.setText(""); rowWorkingLabel1.setText(""); } @Override public void setGraphDataset(ArrayList<Double> dataSet) { if (iterator > 10) { if (iterator % 1000 == 0) { jPanel13.setLayout(new java.awt.BorderLayout()); jPanel13.removeAll(); jPanel13.add( createGraph(fillDataset(dataSet, 30, 0.4), convert(replicationNumbreTextField) / 10, "Graph avg simulation time to replication", "Replication", "Avg sim time value"), BorderLayout.CENTER); jPanel13.validate(); jPanel13.repaint(); } } iterator++; } @Override public void setReplicationNumber(int paReplicationNumber) { replicationNumber.setText(paReplicationNumber + ""); } @Override public void setMoveVehicles(double moveSize) { move.setText(String.format("%.2f", moveSize) + ""); } }