List of usage examples for javax.swing GroupLayout DEFAULT_SIZE
int DEFAULT_SIZE
To view the source code for javax.swing GroupLayout DEFAULT_SIZE.
Click Source Link
From source file:com.juanhg.car.CarApplet.java
private void autogeneratedCode() { JPanel panel_control = new JPanel(); panel_control.setBorder(new CompoundBorder(new EtchedBorder(EtchedBorder.RAISED, null, null), new BevelBorder(BevelBorder.RAISED, null, null, null, null))); JPanel panelInputs = new JPanel(); panelInputs.setToolTipText(""); panelInputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0))); JPanel panelOutputs = new JPanel(); panelOutputs.setToolTipText(""); panelOutputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0))); JPanel panelTitleOutputs = new JPanel(); panelTitleOutputs.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null)); JLabel labelOutputData = new JLabel("Datos de la Simulaci\u00F3n"); labelOutputData.setFont(new Font("Tahoma", Font.PLAIN, 14)); panelTitleOutputs.add(labelOutputData); lblWc = new JLabel("Wc:"); lblWc.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblWcValue = new JLabel(); lblWcValue.setText("0"); lblWcValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel lblNc = new JLabel("Ciclos:"); lblNc.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblNcValue = new JLabel(); lblNcValue.setText("0"); lblNcValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblO3 = new JLabel("Tmax:"); lblO3.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblTmaxValue = new JLabel(); lblTmaxValue.setText("0"); lblTmaxValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel lblV = new JLabel("V:"); lblV.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel lblP = new JLabel("P:"); lblP.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel lblH = new JLabel("Eta:"); lblH.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblEtaValue = new JLabel(); lblEtaValue.setText("0"); lblEtaValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblPValue = new JLabel(); lblPValue.setText("0"); lblPValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblVValue = new JLabel(); lblVValue.setText("0"); lblVValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel lblF = new JLabel("F:"); lblF.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblFValue = new JLabel(); lblFValue.setText("0"); lblFValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel lblDist = new JLabel("Dist:"); lblDist.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblXValue = new JLabel(); lblXValue.setText("0"); lblXValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); GroupLayout gl_panelOutputs = new GroupLayout(panelOutputs); gl_panelOutputs.setHorizontalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelOutputs.createSequentialGroup().addGroup(gl_panelOutputs .createParallelGroup(Alignment.LEADING) .addGroup(gl_panelOutputs.createSequentialGroup().addContainerGap().addGroup(gl_panelOutputs .createParallelGroup(Alignment.LEADING) .addComponent(lblNc, GroupLayout.PREFERRED_SIZE, 49, GroupLayout.PREFERRED_SIZE) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.TRAILING, false) .addComponent(lblWc, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(lblP, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(lblV, GroupLayout.DEFAULT_SIZE, 59, Short.MAX_VALUE))) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING, false) .addComponent(lblWcValue, GroupLayout.DEFAULT_SIZE, 92, Short.MAX_VALUE) .addComponent(lblNcValue, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(lblVValue, GroupLayout.DEFAULT_SIZE, 88, Short.MAX_VALUE) .addComponent(lblPValue, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(lblDist, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED).addComponent(lblXValue, GroupLayout.DEFAULT_SIZE, 76, Short.MAX_VALUE)) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(lblF, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED).addComponent(lblFValue, GroupLayout.DEFAULT_SIZE, 86, Short.MAX_VALUE)) .addGroup(gl_panelOutputs.createSequentialGroup().addComponent(lblH) .addGap(18).addComponent(lblEtaValue, GroupLayout.DEFAULT_SIZE, 79, Short.MAX_VALUE)) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(lblO3, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(lblTmaxValue, GroupLayout.DEFAULT_SIZE, 76, Short.MAX_VALUE)))) .addComponent(panelTitleOutputs, GroupLayout.PREFERRED_SIZE, 299, GroupLayout.PREFERRED_SIZE)) .addContainerGap())); gl_panelOutputs.setVerticalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(panelTitleOutputs, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGap(20)/* w ww . j a v a 2 s. c o m*/ .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelOutputs.createSequentialGroup().addComponent(lblWc) .addPreferredGap(ComponentPlacement.UNRELATED).addComponent(lblNc, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_panelOutputs.createSequentialGroup().addComponent(lblWcValue) .addPreferredGap(ComponentPlacement.UNRELATED).addComponent(lblNcValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_panelOutputs.createSequentialGroup() .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE) .addComponent(lblH, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblEtaValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE) .addComponent(lblO3, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblTmaxValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)))) .addGap(11) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addComponent(lblV, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblVValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblF, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblFValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addGap(11) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addComponent(lblDist, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE) .addComponent(lblP, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblPValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addComponent(lblXValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addContainerGap(30, Short.MAX_VALUE))); panelOutputs.setLayout(gl_panelOutputs); JPanel panelLicense = new JPanel(); panelLicense.setBorder(new LineBorder(new Color(0, 0, 0))); JPanel panel_6 = new JPanel(); panel_6.setBorder(new LineBorder(new Color(0, 0, 0))); GroupLayout gl_panel_control = new GroupLayout(panel_control); gl_panel_control.setHorizontalGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING) .addGroup(gl_panel_control.createSequentialGroup().addContainerGap().addGroup(gl_panel_control .createParallelGroup(Alignment.TRAILING) .addComponent(panelOutputs, GroupLayout.PREFERRED_SIZE, 300, GroupLayout.PREFERRED_SIZE) .addComponent(panelInputs, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 300, Short.MAX_VALUE) .addComponent(panel_6, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE) .addComponent(panelLicense, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)) .addContainerGap())); gl_panel_control.setVerticalGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING) .addGroup(gl_panel_control.createSequentialGroup().addContainerGap() .addComponent(panelInputs, GroupLayout.PREFERRED_SIZE, 211, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panelOutputs, GroupLayout.DEFAULT_SIZE, 184, Short.MAX_VALUE).addGap(18) .addComponent(panel_6, GroupLayout.PREFERRED_SIZE, 74, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED).addComponent(panelLicense, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGap(24))); btnLaunchSimulation = new JButton("Iniciar"); btnLaunchSimulation.setFont(new Font("Tahoma", Font.PLAIN, 16)); btnLaunchSimulation.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { btnLaunchSimulationEvent(event); } }); GroupLayout gl_panel_6 = new GroupLayout(panel_6); gl_panel_6.setHorizontalGroup(gl_panel_6.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_6.createSequentialGroup().addContainerGap() .addComponent(btnLaunchSimulation, GroupLayout.DEFAULT_SIZE, 278, Short.MAX_VALUE) .addContainerGap())); gl_panel_6.setVerticalGroup(gl_panel_6.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_6 .createSequentialGroup().addContainerGap().addComponent(btnLaunchSimulation, GroupLayout.PREFERRED_SIZE, 55, GroupLayout.PREFERRED_SIZE) .addContainerGap(69, Short.MAX_VALUE))); panel_6.setLayout(gl_panel_6); JLabel lblNewLabel = new JLabel("GNU GENERAL PUBLIC LICENSE"); panelLicense.add(lblNewLabel); JLabel lblVa = new JLabel("Va"); lblVa.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel lblR = new JLabel("R"); lblR.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel lblMg = new JLabel("mg"); lblMg.setFont(new Font("Tahoma", Font.PLAIN, 14)); JPanel panelTitle = new JPanel(); panelTitle.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null)); lblRValue = new JLabel("8"); lblRValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblMgValue = new JLabel("10"); lblMgValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblVaValue = new JLabel("6"); lblVaValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); sliderVa = new JSlider(); sliderVa.setMinimum(5); sliderVa.setMaximum(8); sliderVa.setMinorTickSpacing(1); sliderVa.setValue(6); sliderVa.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent event) { sliderI1Event(); } }); sliderR = new JSlider(); sliderR.setMinimum(7); sliderR.setMaximum(13); sliderR.setMinorTickSpacing(1); sliderR.setValue(8); sliderR.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { sliderI2Event(); } }); sliderMg = new JSlider(); sliderMg.setMinimum(1); sliderMg.setMaximum(20); sliderMg.setValue(10); sliderMg.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { sliderI3Event(); } }); JLabel lblIVcar = new JLabel("Velocidad"); lblIVcar.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblVcarValue = new JLabel("120"); lblVcarValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); sliderVcar = new JSlider(); sliderVcar.setMinimum(1); sliderVcar.setMaximum(160); sliderVcar.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent arg0) { sliderI4Event(); } }); sliderVcar.setValue(120); sliderVcar.setMinorTickSpacing(1); sliderQc = new JSlider(); sliderQc.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent arg0) { sliderI5Event(); } }); sliderQc.setMaximum(1500); sliderQc.setMinimum(500); sliderQc.setValue(600); sliderQc.setMinorTickSpacing(100); lblQcValue = new JLabel("600"); lblQcValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel lblQc = new JLabel("Qc"); lblQc.setFont(new Font("Tahoma", Font.PLAIN, 14)); GroupLayout gl_panelInputs = new GroupLayout(panelInputs); gl_panelInputs.setHorizontalGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING) .addGroup(gl_panelInputs.createSequentialGroup().addGap(20).addGroup(gl_panelInputs .createParallelGroup(Alignment.TRAILING) .addGroup(gl_panelInputs.createSequentialGroup() .addComponent(lblQc, GroupLayout.PREFERRED_SIZE, 61, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED, 24, Short.MAX_VALUE) .addComponent(lblQcValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE) .addGap(18) .addComponent(sliderQc, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED)) .addGroup(gl_panelInputs.createSequentialGroup().addGroup(gl_panelInputs .createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createSequentialGroup().addGroup(gl_panelInputs .createParallelGroup(Alignment.TRAILING) .addComponent(lblMg, GroupLayout.DEFAULT_SIZE, 67, Short.MAX_VALUE) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(lblVa, GroupLayout.PREFERRED_SIZE, 62, GroupLayout.PREFERRED_SIZE) .addComponent(lblIVcar, Alignment.TRAILING, GroupLayout.PREFERRED_SIZE, 67, GroupLayout.PREFERRED_SIZE))) .addGap(18)) .addGroup(gl_panelInputs.createSequentialGroup() .addComponent(lblR, GroupLayout.DEFAULT_SIZE, 79, Short.MAX_VALUE) .addPreferredGap(ComponentPlacement.RELATED))) .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING) .addGroup(gl_panelInputs.createSequentialGroup() .addComponent(lblVcarValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE) .addGap(18) .addComponent(sliderVcar, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED)) .addGroup(gl_panelInputs.createSequentialGroup() .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(lblVaValue, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE) .addComponent(lblRValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE) .addComponent(lblMgValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE)) .addGap(18).addGroup( gl_panelInputs.createParallelGroup(Alignment.LEADING, false) .addComponent(sliderVa, 0, 0, Short.MAX_VALUE) .addComponent(sliderR, 0, 0, Short.MAX_VALUE) .addComponent(sliderMg, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE)))))) .addGap(48)) .addComponent(panelTitle, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 315, Short.MAX_VALUE)); gl_panelInputs.setVerticalGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createSequentialGroup() .addComponent(panelTitle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGap(18) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createSequentialGroup() .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(lblVaValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent( sliderVa, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE) .addComponent(lblRValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblR)) .addComponent(sliderR, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGap(11) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE) .addComponent(lblMgValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblMg)) .addComponent(sliderMg, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))) .addComponent(lblVa)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING) .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE) .addComponent(lblVcarValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblIVcar, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addComponent(sliderVcar, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING) .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE) .addComponent(lblQc, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblQcValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addComponent(sliderQc, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGap(3))); JLabel lblDatosDeEntrada = new JLabel("Datos de Entrada"); lblDatosDeEntrada.setFont(new Font("Tahoma", Font.PLAIN, 14)); panelTitle.add(lblDatosDeEntrada); panelInputs.setLayout(gl_panelInputs); panel_control.setLayout(gl_panel_control); JPanel panel_visualizar = new JPanel(); panel_visualizar.setBackground(Color.WHITE); GroupLayout groupLayout = new GroupLayout(getContentPane()); groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup().addContainerGap() .addComponent(panel_control, GroupLayout.PREFERRED_SIZE, 325, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel_visualizar, GroupLayout.PREFERRED_SIZE, 688, GroupLayout.PREFERRED_SIZE) .addContainerGap(94, Short.MAX_VALUE))); groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.TRAILING) .addGroup(groupLayout.createSequentialGroup().addContainerGap() .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING) .addComponent(panel_visualizar, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 568, Short.MAX_VALUE) .addComponent(panel_control, GroupLayout.PREFERRED_SIZE, 568, GroupLayout.PREFERRED_SIZE)) .addContainerGap())); JPanel panel = new JPanel(); panel.setBackground(Color.WHITE); JPanel panel_1 = new JPanel(); panelPlot = new JPanelGrafica(); GroupLayout gl_panel_1 = new GroupLayout(panel_1); gl_panel_1.setHorizontalGroup( gl_panel_1.createParallelGroup(Alignment.LEADING).addGap(0, 263, Short.MAX_VALUE) .addComponent(panelPlot, GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE)); gl_panel_1 .setVerticalGroup(gl_panel_1.createParallelGroup(Alignment.LEADING).addGap(0, 241, Short.MAX_VALUE) .addComponent(panelPlot, GroupLayout.DEFAULT_SIZE, 241, Short.MAX_VALUE)); panel_1.setLayout(gl_panel_1); JPanel panel_2 = new JPanel(); panelMotor = new JPanelGrafica(); GroupLayout gl_panel_2 = new GroupLayout(panel_2); gl_panel_2.setHorizontalGroup(gl_panel_2.createParallelGroup(Alignment.LEADING).addComponent(panelMotor, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)); gl_panel_2.setVerticalGroup(gl_panel_2.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_2.createSequentialGroup() .addComponent(panelMotor, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); panel_2.setLayout(gl_panel_2); GroupLayout gl_panel = new GroupLayout(panel); gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(Alignment.TRAILING) .addGroup(gl_panel.createSequentialGroup().addContainerGap() .addComponent(panel_1, GroupLayout.DEFAULT_SIZE, 384, Short.MAX_VALUE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel_2, GroupLayout.PREFERRED_SIZE, 258, GroupLayout.PREFERRED_SIZE) .addContainerGap())); gl_panel.setVerticalGroup(gl_panel.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel.createSequentialGroup().addContainerGap() .addGroup(gl_panel.createParallelGroup(Alignment.LEADING) .addComponent(panel_1, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE) .addComponent(panel_2, 0, 0, Short.MAX_VALUE)) .addContainerGap())); panel.setLayout(gl_panel); JPanel panel_3 = new JPanel(); panel_3.setBackground(Color.WHITE); JPanel panel_4 = new JPanel(); panelCar = new JPanelGrafica(); GroupLayout gl_panel_4 = new GroupLayout(panel_4); gl_panel_4.setHorizontalGroup(gl_panel_4.createParallelGroup(Alignment.LEADING).addComponent(panelCar, GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE)); gl_panel_4.setVerticalGroup(gl_panel_4.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_4.createSequentialGroup() .addComponent(panelCar, GroupLayout.PREFERRED_SIZE, 252, GroupLayout.PREFERRED_SIZE) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); panel_4.setLayout(gl_panel_4); GroupLayout gl_panel_3 = new GroupLayout(panel_3); gl_panel_3.setHorizontalGroup(gl_panel_3.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_3.createSequentialGroup().addContainerGap() .addComponent(panel_4, GroupLayout.DEFAULT_SIZE, 648, Short.MAX_VALUE).addContainerGap())); gl_panel_3.setVerticalGroup(gl_panel_3.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_3.createSequentialGroup().addContainerGap() .addComponent(panel_4, GroupLayout.PREFERRED_SIZE, 252, Short.MAX_VALUE) .addContainerGap())); panel_3.setLayout(gl_panel_3); GroupLayout gl_panel_visualizar = new GroupLayout(panel_visualizar); gl_panel_visualizar.setHorizontalGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING) .addGroup(Alignment.TRAILING, gl_panel_visualizar.createSequentialGroup().addContainerGap() .addGroup(gl_panel_visualizar.createParallelGroup(Alignment.TRAILING) .addComponent(panel_3, GroupLayout.PREFERRED_SIZE, 668, GroupLayout.PREFERRED_SIZE) .addComponent(panel, GroupLayout.DEFAULT_SIZE, 668, Short.MAX_VALUE)) .addContainerGap())); gl_panel_visualizar.setVerticalGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_visualizar.createSequentialGroup().addContainerGap() .addComponent(panel, GroupLayout.PREFERRED_SIZE, 261, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(panel_3, GroupLayout.DEFAULT_SIZE, 274, Short.MAX_VALUE).addContainerGap())); panel_visualizar.setLayout(gl_panel_visualizar); getContentPane().setLayout(groupLayout); }
From source file:de.tor.tribes.ui.views.DSWorkbenchTroopsFrame.java
/** * 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.//w w w . j av a 2 s . c om */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; jXTroopsPanel = new org.jdesktop.swingx.JXPanel(); jTroopsTabPane = new javax.swing.JTabbedPane(); jxSearchPane = new org.jdesktop.swingx.JXPanel(); jXPanel2 = new org.jdesktop.swingx.JXPanel(); jButton12 = new javax.swing.JButton(); jFilterRows = new javax.swing.JCheckBox(); jScrollPane4 = new javax.swing.JScrollPane(); jXGroupsList = new org.jdesktop.swingx.JXList(); jLabel22 = new javax.swing.JLabel(); jRelationType1 = new javax.swing.JCheckBox(); jTroopsAddDialog = new javax.swing.JDialog(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jTroopAddTribe = new javax.swing.JComboBox(); jTroopAddVillage = new javax.swing.JComboBox(); jApplyTroopAddButton = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jTroopsInformationAlwaysOnTop = new javax.swing.JCheckBox(); jTroopsPanel = new javax.swing.JPanel(); capabilityInfoPanel1 = new de.tor.tribes.ui.components.CapabilityInfoPanel(); jXTroopsPanel.setMinimumSize(new java.awt.Dimension(700, 500)); jXTroopsPanel.setPreferredSize(new java.awt.Dimension(700, 500)); jXTroopsPanel.setLayout(new java.awt.BorderLayout()); jXTroopsPanel.add(jTroopsTabPane, java.awt.BorderLayout.CENTER); jxSearchPane.setOpaque(false); jxSearchPane.setLayout(new java.awt.GridBagLayout()); jXPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jXPanel2.setInheritAlpha(false); jButton12.setText("Anwenden"); jButton12.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(java.awt.event.MouseEvent evt) { fireHideGlassPaneEvent(evt); } }); jFilterRows.setText("Nur gefilterte Zeilen anzeigen"); jFilterRows.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { jFilterRowsfireUpdateFilterEvent(evt); } }); jXGroupsList.setModel(new javax.swing.AbstractListModel() { String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" }; public int getSize() { return strings.length; } public Object getElementAt(int i) { return strings[i]; } }); jScrollPane4.setViewportView(jXGroupsList); jLabel22.setText("Gruppen"); jRelationType1.setSelected(true); jRelationType1.setText("Verknpfung"); jRelationType1.setToolTipText( "Verknpfung der gewhlten Dorfgruppen (UND = Dorf muss in allen Gruppen sein, ODER = Dorf muss in mindestens einer Gruppe sein)"); jRelationType1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); jRelationType1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/ui/logic_or.png"))); // NOI18N jRelationType1.setRolloverEnabled(false); jRelationType1.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/res/ui/logic_and.png"))); // NOI18N jRelationType1.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { fireRelationChangedEvent(evt); } }); javax.swing.GroupLayout jXPanel2Layout = new javax.swing.GroupLayout(jXPanel2); jXPanel2.setLayout(jXPanel2Layout); jXPanel2Layout.setHorizontalGroup(jXPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jXPanel2Layout.createSequentialGroup().addContainerGap().addComponent(jLabel22) .addGap(18, 18, 18) .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jRelationType1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 215, Short.MAX_VALUE) .addComponent(jFilterRows, javax.swing.GroupLayout.PREFERRED_SIZE, 215, Short.MAX_VALUE) .addComponent(jButton12)) .addContainerGap())); jXPanel2Layout .setVerticalGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jXPanel2Layout.createSequentialGroup().addContainerGap().addGroup(jXPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jXPanel2Layout.createSequentialGroup() .addGroup(jXPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel22).addComponent(jRelationType1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jFilterRows) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton12)) .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap())); jxSearchPane.add(jXPanel2, new java.awt.GridBagConstraints()); jTroopsAddDialog.setTitle("Truppen hinzufgen"); jTroopsAddDialog.setModal(true); jTroopsAddDialog.getContentPane().setLayout(new java.awt.GridBagLayout()); jLabel1.setText("Spieler"); jLabel1.setMaximumSize(new java.awt.Dimension(60, 14)); jLabel1.setMinimumSize(new java.awt.Dimension(60, 14)); jLabel1.setPreferredSize(new java.awt.Dimension(60, 14)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jTroopsAddDialog.getContentPane().add(jLabel1, gridBagConstraints); jLabel2.setText("Dorf"); jLabel2.setMaximumSize(new java.awt.Dimension(60, 14)); jLabel2.setMinimumSize(new java.awt.Dimension(60, 14)); jLabel2.setPreferredSize(new java.awt.Dimension(60, 14)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jTroopsAddDialog.getContentPane().add(jLabel2, gridBagConstraints); jTroopAddTribe.setModel( new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); jTroopAddTribe.setMinimumSize(new java.awt.Dimension(200, 25)); jTroopAddTribe.setPreferredSize(new java.awt.Dimension(200, 25)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jTroopsAddDialog.getContentPane().add(jTroopAddTribe, gridBagConstraints); jTroopAddVillage.setModel( new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); jTroopAddVillage.setMinimumSize(new java.awt.Dimension(200, 20)); jTroopAddVillage.setPreferredSize(new java.awt.Dimension(200, 25)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jTroopsAddDialog.getContentPane().add(jTroopAddVillage, gridBagConstraints); jApplyTroopAddButton.setText("Hinzufgen"); jApplyTroopAddButton.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(java.awt.event.MouseEvent evt) { fireApplyTroopAddEvent(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jTroopsAddDialog.getContentPane().add(jApplyTroopAddButton, gridBagConstraints); jButton2.setText("Abbrechen"); jButton2.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(java.awt.event.MouseEvent evt) { fireApplyTroopAddEvent(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jTroopsAddDialog.getContentPane().add(jButton2, gridBagConstraints); setTitle("Truppen"); getContentPane().setLayout(new java.awt.GridBagLayout()); jTroopsInformationAlwaysOnTop.setText("Immer im Vordergrund"); jTroopsInformationAlwaysOnTop.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { fireTroopsFrameOnTopEvent(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); getContentPane().add(jTroopsInformationAlwaysOnTop, gridBagConstraints); jTroopsPanel.setBackground(new java.awt.Color(239, 235, 223)); jTroopsPanel.setMinimumSize(new java.awt.Dimension(700, 500)); jTroopsPanel.setPreferredSize(new java.awt.Dimension(700, 500)); jTroopsPanel.setLayout(new java.awt.BorderLayout()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; getContentPane().add(jTroopsPanel, gridBagConstraints); capabilityInfoPanel1.setCopyable(false); capabilityInfoPanel1.setPastable(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); getContentPane().add(capabilityInfoPanel1, gridBagConstraints); pack(); }
From source file:com.ga.forms.DailyLogAddUI.java
/** * 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./* w w w. jav a 2s. c o m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { group = new javax.swing.ButtonGroup(); jPanel1 = new javax.swing.JPanel(); mainTitleLbl = new javax.swing.JLabel(); jSeparator1 = new javax.swing.JSeparator(); exitButton = new javax.swing.JButton(); viewButton = new javax.swing.JButton(); dailyLogPanel = new javax.swing.JPanel(); dateLbl = new javax.swing.JLabel(); dateDisplayLbl = new javax.swing.JLabel(); dayLbl = new javax.swing.JLabel(); dayDisplayLbl = new javax.swing.JLabel(); checkInLbl = new javax.swing.JLabel(); checkoutLbl = new javax.swing.JLabel(); breakLbl = new javax.swing.JLabel(); checkInTimeCombo = new javax.swing.JComboBox(); checkOutTimeCombo = new javax.swing.JComboBox(); checkInOutButton = new javax.swing.JToggleButton(); breakOptionPanel = new javax.swing.JPanel(); yesRdButton = new javax.swing.JRadioButton(); noRdButton = new javax.swing.JRadioButton(); customRdButton = new javax.swing.JRadioButton(); customBreakTimeTextField = new javax.swing.JTextField(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Daily Log Manager"); setBounds(new java.awt.Rectangle(0, 0, 395, 389)); setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); setMinimumSize(new java.awt.Dimension(395, 389)); jPanel1.setMaximumSize(new java.awt.Dimension(395, 389)); jPanel1.setMinimumSize(new java.awt.Dimension(395, 389)); jPanel1.setPreferredSize(new java.awt.Dimension(464, 474)); mainTitleLbl.setFont(new java.awt.Font("Arial", 0, 36)); // NOI18N mainTitleLbl.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); mainTitleLbl.setText("Daily Log Manager"); mainTitleLbl.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); exitButton.setText("Exit"); exitButton.setMaximumSize(new java.awt.Dimension(72, 29)); exitButton.setMinimumSize(new java.awt.Dimension(72, 29)); exitButton.setPreferredSize(new java.awt.Dimension(72, 29)); exitButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exitButtonActionPerformed(evt); } }); viewButton.setText("View"); viewButton.setMaximumSize(new java.awt.Dimension(72, 29)); viewButton.setMinimumSize(new java.awt.Dimension(72, 29)); viewButton.setPreferredSize(new java.awt.Dimension(72, 29)); viewButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { viewButtonActionPerformed(evt); } }); dailyLogPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Add Daily Log")); dailyLogPanel.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N dailyLogPanel.setName("Daily Log Entry"); // NOI18N dailyLogPanel.setPreferredSize(new java.awt.Dimension(240, 190)); dateLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N dateLbl.setText("Date"); dateLbl.setPreferredSize(new java.awt.Dimension(56, 17)); dateDisplayLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N dateDisplayLbl.setEnabled(false); dateDisplayLbl.setMaximumSize(new java.awt.Dimension(144, 17)); dateDisplayLbl.setMinimumSize(new java.awt.Dimension(144, 17)); dateDisplayLbl.setPreferredSize(new java.awt.Dimension(144, 17)); dateDisplayLbl.setRequestFocusEnabled(false); dayLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N dayLbl.setText("Day"); dayLbl.setPreferredSize(new java.awt.Dimension(56, 17)); dayDisplayLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N dayDisplayLbl.setEnabled(false); dayDisplayLbl.setMaximumSize(new java.awt.Dimension(144, 17)); dayDisplayLbl.setMinimumSize(new java.awt.Dimension(144, 17)); dayDisplayLbl.setPreferredSize(new java.awt.Dimension(144, 17)); dayDisplayLbl.setRequestFocusEnabled(false); checkInLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N checkInLbl.setText("In"); checkInLbl.setPreferredSize(new java.awt.Dimension(56, 17)); checkoutLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N checkoutLbl.setText("Out"); checkoutLbl.setPreferredSize(new java.awt.Dimension(56, 17)); breakLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N breakLbl.setText("Break"); breakLbl.setVerticalAlignment(javax.swing.SwingConstants.TOP); breakLbl.setPreferredSize(new java.awt.Dimension(56, 17)); checkInTimeCombo.setModel( new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); checkInTimeCombo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { checkInTimeComboActionPerformed(evt); } }); checkOutTimeCombo.setModel( new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); checkOutTimeCombo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { checkOutTimeComboActionPerformed(evt); } }); checkInOutButton.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N checkInOutButton.setText("Check In"); checkInOutButton.setMaximumSize(new java.awt.Dimension(102, 29)); checkInOutButton.setMinimumSize(new java.awt.Dimension(102, 29)); checkInOutButton.setPreferredSize(new java.awt.Dimension(102, 29)); checkInOutButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { checkInOutButtonActionPerformed(evt); } }); breakOptionPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Options")); breakOptionPanel.setPreferredSize(new java.awt.Dimension(255, 98)); yesRdButton.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N yesRdButton.setText("Yes"); yesRdButton.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { yesRdButtonMouseClicked(evt); } }); noRdButton.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N noRdButton.setSelected(true); noRdButton.setText("No"); noRdButton.setPreferredSize(new java.awt.Dimension(51, 24)); noRdButton.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { noRdButtonMouseClicked(evt); } }); customRdButton.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N customRdButton.setText("Custom"); customRdButton.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { customRdButtonItemStateChanged(evt); } }); customRdButton.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { customRdButtonStateChanged(evt); } }); customRdButton.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { customRdButtonMouseClicked(evt); } }); customBreakTimeTextField.setText("00:30"); customBreakTimeTextField.setEnabled(false); javax.swing.GroupLayout breakOptionPanelLayout = new javax.swing.GroupLayout(breakOptionPanel); breakOptionPanel.setLayout(breakOptionPanelLayout); breakOptionPanelLayout.setHorizontalGroup(breakOptionPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(breakOptionPanelLayout.createSequentialGroup().addGap(5, 5, 5) .addGroup(breakOptionPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(customBreakTimeTextField, javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(breakOptionPanelLayout.createSequentialGroup().addComponent(yesRdButton) .addGap(5, 5, 5) .addComponent(noRdButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(5, 5, 5).addComponent(customRdButton) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap())); breakOptionPanelLayout.setVerticalGroup(breakOptionPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(breakOptionPanelLayout.createSequentialGroup().addGap(5, 5, 5) .addGroup(breakOptionPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(yesRdButton) .addComponent(noRdButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(customRdButton)) .addGap(5, 5, 5).addComponent(customBreakTimeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))); yesRdButton.getAccessibleContext().setAccessibleName("breakRdButton"); noRdButton.getAccessibleContext().setAccessibleName("breakRdButton"); customRdButton.getAccessibleContext().setAccessibleName("breakRdButton"); customBreakTimeTextField.getAccessibleContext().setAccessibleName("customBreakTimeTextField"); javax.swing.GroupLayout dailyLogPanelLayout = new javax.swing.GroupLayout(dailyLogPanel); dailyLogPanel.setLayout(dailyLogPanelLayout); dailyLogPanelLayout.setHorizontalGroup(dailyLogPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(dailyLogPanelLayout.createSequentialGroup().addContainerGap().addGroup(dailyLogPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, dailyLogPanelLayout.createSequentialGroup().addGroup(dailyLogPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, dailyLogPanelLayout .createSequentialGroup() .addComponent(dayLbl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(dayDisplayLbl, javax.swing.GroupLayout.DEFAULT_SIZE, 304, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, dailyLogPanelLayout .createSequentialGroup() .addComponent(dateLbl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent( dateDisplayLbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addGap(44, 44, 44)) .addGroup(dailyLogPanelLayout.createSequentialGroup().addGroup(dailyLogPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(dailyLogPanelLayout.createSequentialGroup() .addComponent(checkInLbl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(checkInTimeCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(dailyLogPanelLayout.createSequentialGroup().addGroup(dailyLogPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(checkoutLbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(breakLbl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(dailyLogPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(checkOutTimeCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(breakOptionPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addContainerGap(152, Short.MAX_VALUE)))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, dailyLogPanelLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(checkInOutButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(21, 21, 21))); dailyLogPanelLayout.setVerticalGroup(dailyLogPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(dailyLogPanelLayout.createSequentialGroup().addContainerGap() .addGroup(dailyLogPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(dateLbl, javax.swing.GroupLayout.DEFAULT_SIZE, 18, Short.MAX_VALUE) .addComponent(dateDisplayLbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(dailyLogPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(dayLbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(dayDisplayLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(dailyLogPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(checkInTimeCombo).addComponent(checkInLbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(dailyLogPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(checkOutTimeCombo).addComponent(checkoutLbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(dailyLogPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(dailyLogPanelLayout.createSequentialGroup() .addComponent(breakLbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(47, 47, 47)) .addGroup(dailyLogPanelLayout.createSequentialGroup() .addComponent(breakOptionPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, 40, Short.MAX_VALUE) .addComponent(checkInOutButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())))); dayLbl.getAccessibleContext().setAccessibleName("dayLbl"); dayDisplayLbl.getAccessibleContext().setAccessibleName("dayDisplayLbl"); checkInTimeCombo.getAccessibleContext().setAccessibleName("checkInTimeCombo"); checkOutTimeCombo.getAccessibleContext().setAccessibleName("checkOutTimeCombo"); checkInOutButton.getAccessibleContext().setAccessibleName("checkInOutButton"); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(dailyLogPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 452, Short.MAX_VALUE) .addGroup(jPanel1Layout.createSequentialGroup().addGap(0, 287, Short.MAX_VALUE) .addComponent(viewButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(mainTitleLbl, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING)); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap() .addComponent(mainTitleLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(dailyLogPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 327, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 6, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(viewButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap())); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))); pack(); }
From source file:uk.ac.ox.cbrg.cpfp.uploadapp.UploadApplet.java
/** This method is called from within the init() method to * initialize the form./*w w w .j a v a 2s .co m*/ * 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(); jScrollPane1 = new javax.swing.JScrollPane(); fileTable = new javax.swing.JTable(); btnAdd = new javax.swing.JButton(); btnDel = new javax.swing.JButton(); btnUpload = new javax.swing.JButton(); prgUploadProgress = new javax.swing.JProgressBar(); lblProgress = new javax.swing.JLabel(); lblMessages = new javax.swing.JLabel(); jScrollPane2 = new javax.swing.JScrollPane(); txtMessages = new javax.swing.JTextArea(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); fileTable.setModel(new javax.swing.table.DefaultTableModel(new Object[][] { }, new String[] { "Filename", "Size" }) { Class[] types = new Class[] { java.lang.String.class, java.lang.String.class }; boolean[] canEdit = new boolean[] { false, false }; public Class getColumnClass(int columnIndex) { return types[columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit[columnIndex]; } }); fileTable.setColumnSelectionAllowed(true); fileTable.getTableHeader().setReorderingAllowed(false); jScrollPane1.setViewportView(fileTable); fileTable.getColumnModel().getSelectionModel() .setSelectionMode(javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); btnAdd.setIcon( new javax.swing.ImageIcon(getClass().getResource("/uk/ac/ox/cbrg/cpfp/uploadapp/12-em-plus.png"))); // NOI18N btnAdd.setText("Add File(s)"); btnAdd.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnAddActionPerformed(evt); } }); btnDel.setIcon( new javax.swing.ImageIcon(getClass().getResource("/uk/ac/ox/cbrg/cpfp/uploadapp/12-em-cross.png"))); // NOI18N btnDel.setText("Remove File(s)"); btnDel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnDelActionPerformed(evt); } }); btnUpload.setIcon( new javax.swing.ImageIcon(getClass().getResource("/uk/ac/ox/cbrg/cpfp/uploadapp/12-em-up.png"))); // NOI18N btnUpload.setText("Upload Files"); btnUpload.setEnabled(false); btnUpload.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnUploadActionPerformed(evt); } }); prgUploadProgress.setStringPainted(true); lblProgress.setText("Progress:"); lblMessages.setText("Messages:"); txtMessages.setColumns(20); txtMessages.setRows(5); jScrollPane2.setViewportView(txtMessages); jLabel1.setFont(jLabel1.getFont().deriveFont(jLabel1.getFont().getStyle() | java.awt.Font.BOLD, jLabel1.getFont().getSize() + 3)); jLabel1.setForeground(javax.swing.UIManager.getDefaults().getColor("textText")); jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel1.setText("CPFP File Uploader"); jLabel2.setText("2011.10.04"); 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) .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 609, Short.MAX_VALUE) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 609, Short.MAX_VALUE) .addComponent(prgUploadProgress, javax.swing.GroupLayout.DEFAULT_SIZE, 609, Short.MAX_VALUE) .addComponent(lblProgress) .addGroup(jPanel1Layout.createSequentialGroup().addGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addComponent(btnAdd) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnDel)) .addComponent(lblMessages)) .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 257, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createSequentialGroup().addGap(103, 103, 103) .addComponent(jLabel2))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnUpload))) .addContainerGap())); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 244, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnAdd).addComponent(btnDel).addComponent(btnUpload) .addComponent(jLabel1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(lblMessages) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(lblProgress) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(prgUploadProgress, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(35, 35, 35)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout .createSequentialGroup().addComponent(jLabel2).addGap(195, 195, 195))))); 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().addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap().addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); }
From source file:eu.ggnet.dwoss.redtape.position.PositionUpdateCask.java
/** This method is called from within the constructor to * initialize the form.//from w w w .j a v a2 s . co m * 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() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); preDecimalSpinner = new javax.swing.JSpinner(); jLabel4 = new javax.swing.JLabel(); bookingAccountBox = new javax.swing.JComboBox(); jLabel5 = new javax.swing.JLabel(); priceField = new javax.swing.JTextField(); jLabel7 = new javax.swing.JLabel(); afterTaxPriceField = new javax.swing.JTextField(); jLabel8 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); descriptionArea = new javax.swing.JTextArea(); jLabel9 = new javax.swing.JLabel(); jScrollPane2 = new javax.swing.JScrollPane(); nameArea = new javax.swing.JTextArea(); priceSumField = new javax.swing.JTextField(); afterTaxSumField = new javax.swing.JTextField(); jSeparator1 = new javax.swing.JSeparator(); jLabel6 = new javax.swing.JLabel(); jLabel10 = new javax.swing.JLabel(); postDecimalSpinner = new javax.swing.JSpinner(); setMinimumSize(new java.awt.Dimension(328, 572)); jLabel1.setText("Positionsname/berschrift:"); jLabel2.setText("Positionstyp:"); jLabel3.setText("Menge / Zeit:"); jLabel3.setToolTipText("<html>Zeit in decimalformat <br /> z.B. 1.35 = 1 stunde 35 minuten</html>"); preDecimalSpinner.setModel(new javax.swing.SpinnerNumberModel(1, 0, null, 1)); org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${preDecimal}"), preDecimalSpinner, org.jdesktop.beansbinding.BeanProperty.create("value"), "amountBinding"); bindingGroup.addBinding(binding); jLabel4.setText("Buchungskonto:"); bookingAccountBox.setEnabled(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${bookingAccount}"), bookingAccountBox, org.jdesktop.beansbinding.BeanProperty.create("selectedItem"), "bookingAccountBinding"); binding.setSourceNullValue(null); bindingGroup.addBinding(binding); bookingAccountBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { bookingAccountBoxActionPerformed(evt); } }); jLabel5.setText("Nettopreis:"); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${price}"), priceField, org.jdesktop.beansbinding.BeanProperty.create("text"), "priceBinding"); binding.setConverter(getStringConverter()); bindingGroup.addBinding(binding); jLabel7.setText("Bruttopreis:"); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${price}"), afterTaxPriceField, org.jdesktop.beansbinding.BeanProperty.create("text"), "afterTaxPriceBinding"); binding.setConverter(getTaxedConverter()); bindingGroup.addBinding(binding); jLabel8.setText("Beschreibung:"); descriptionArea.setColumns(20); descriptionArea.setLineWrap(true); descriptionArea.setRows(5); descriptionArea.setWrapStyleWord(true); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${description}"), descriptionArea, org.jdesktop.beansbinding.BeanProperty.create("text"), "positionDescriptionBinding"); bindingGroup.addBinding(binding); jScrollPane1.setViewportView(descriptionArea); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${position.type.name}"), jLabel9, org.jdesktop.beansbinding.BeanProperty.create("text"), "positionTypeBinding"); bindingGroup.addBinding(binding); jScrollPane2.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); nameArea.setEditable(false); nameArea.setColumns(20); nameArea.setLineWrap(true); nameArea.setRows(5); nameArea.setWrapStyleWord(true); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${positionName}"), nameArea, org.jdesktop.beansbinding.BeanProperty.create("text"), "nameBinding"); bindingGroup.addBinding(binding); jScrollPane2.setViewportView(nameArea); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${amount * price }"), priceSumField, org.jdesktop.beansbinding.BeanProperty.create("text"), "priceSumBinding"); binding.setConverter(getStringConverter()); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${amount *price }"), afterTaxSumField, org.jdesktop.beansbinding.BeanProperty.create("text"), "afterTaxSumBinding"); binding.setConverter(getTaxedConverter()); bindingGroup.addBinding(binding); jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL); jSeparator1.setToolTipText(""); jLabel6.setText("Summe"); jLabel10.setText(","); postDecimalSpinner.setModel(new javax.swing.SpinnerNumberModel(0, 0, 75, 25)); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${postDecimal}"), postDecimalSpinner, org.jdesktop.beansbinding.BeanProperty.create("value"), "decimalBounding"); bindingGroup.addBinding(binding); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addComponent(jScrollPane1) .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING) .addComponent( bookingAccountBox, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout .createSequentialGroup() .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(109, 109, 109)) .addGroup(layout.createSequentialGroup() .addComponent(preDecimalSpinner, javax.swing.GroupLayout.DEFAULT_SIZE, 72, Short.MAX_VALUE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel10).addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(postDecimalSpinner, javax.swing.GroupLayout.DEFAULT_SIZE, 53, Short.MAX_VALUE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel6).addGap(68, 68, 68)) .addGroup(layout.createSequentialGroup() .addGroup(layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(priceField) .addComponent(afterTaxPriceField)) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 6, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(priceSumField, javax.swing.GroupLayout.DEFAULT_SIZE, 102, Short.MAX_VALUE) .addComponent(afterTaxSumField))))) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.LEADING)) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jLabel1).addGap(4, 4, 4) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2).addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(5, 5, 5) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4).addComponent(bookingAccountBox, 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.BASELINE) .addComponent(jLabel3) .addComponent(preDecimalSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel10) .addComponent(postDecimalSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel6)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5).addComponent(priceField, 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.BASELINE) .addComponent(jLabel7).addComponent(afterTaxPriceField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(layout.createSequentialGroup().addGap(6, 6, 6).addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(layout.createSequentialGroup() .addComponent(priceSumField, 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(afterTaxSumField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel8) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 316, Short.MAX_VALUE) .addContainerGap())); bindingGroup.bind(); }
From source file:me.mayo.telnetkek.MainPanel.java
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { splitPane = new javax.swing.JSplitPane(); jPanel3 = new javax.swing.JPanel(); mainOutputScoll = new javax.swing.JScrollPane(); mainOutput = new javax.swing.JTextPane(); btnDisconnect = new javax.swing.JButton(); btnSend = new javax.swing.JButton(); txtServer = new javax.swing.JComboBox<>(); chkAutoScroll = new javax.swing.JCheckBox(); txtCommand = new javax.swing.JTextField(); btnConnect = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jTabbedPane1 = new javax.swing.JTabbedPane(); jPanel2 = new javax.swing.JPanel(); tblPlayersScroll = new javax.swing.JScrollPane(); tblPlayers = new javax.swing.JTable(); jLabel3 = new javax.swing.JLabel(); txtNumPlayers = new javax.swing.JTextField(); jPanel1 = new javax.swing.JPanel(); chkIgnorePlayerCommands = new javax.swing.JCheckBox(); chkIgnoreServerCommands = new javax.swing.JCheckBox(); chkShowChatOnly = new javax.swing.JCheckBox(); chkIgnoreErrors = new javax.swing.JCheckBox(); jPanel4 = new javax.swing.JPanel(); favoriteButtonsPanelHolder = new javax.swing.JPanel(); favoriteButtonsPanelScroll = new javax.swing.JScrollPane(); favoriteButtonsPanel = new me.mayo.telnetkek.button.FavoriteButtonsPanel(favButtonList); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("BukkitTelnetClient"); splitPane.setBackground(new java.awt.Color(68, 68, 68)); splitPane.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(68, 68, 68), 5)); splitPane.setResizeWeight(1.0);//from w ww.j av a 2s. com jPanel3.setBackground(new java.awt.Color(68, 68, 68)); mainOutput.setEditable(false); mainOutput.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N mainOutput.setForeground(new java.awt.Color(255, 255, 255)); mainOutputScoll.setViewportView(mainOutput); btnDisconnect.setBackground(new java.awt.Color(68, 68, 68)); btnDisconnect.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N btnDisconnect.setText("Leave"); btnDisconnect.setEnabled(false); btnDisconnect.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnDisconnectActionPerformed(evt); } }); btnSend.setBackground(new java.awt.Color(68, 68, 68)); btnSend.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N btnSend.setText("Send"); btnSend.setEnabled(false); btnSend.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnSendActionPerformed(evt); } }); txtServer.setBackground(new java.awt.Color(91, 91, 91)); txtServer.setEditable(true); txtServer.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N txtServer.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtServerActionPerformed(evt); } }); chkAutoScroll.setBackground(new java.awt.Color(68, 68, 68)); chkAutoScroll.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N chkAutoScroll.setForeground(new java.awt.Color(255, 255, 255)); chkAutoScroll.setSelected(true); chkAutoScroll.setText("Auto Scroll"); txtCommand.setEnabled(false); txtCommand.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { txtCommandKeyPressed(evt); } }); btnConnect.setBackground(new java.awt.Color(68, 68, 68)); btnConnect.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N btnConnect.setText("Join"); btnConnect.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnConnectActionPerformed(evt); } }); jLabel1.setBackground(new java.awt.Color(68, 68, 68)); jLabel1.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N jLabel1.setForeground(new java.awt.Color(255, 255, 255)); jLabel1.setText("Command:"); jLabel2.setBackground(new java.awt.Color(68, 68, 68)); jLabel2.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N jLabel2.setForeground(new java.awt.Color(255, 255, 255)); jLabel2.setText("Server:"); 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) .addComponent(mainOutputScoll) .addGroup(jPanel3Layout.createSequentialGroup().addGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel1)).addGap(18, 18, 18) .addGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(txtCommand) .addComponent(txtServer, 0, 411, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(btnConnect, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btnSend, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(btnDisconnect).addComponent(chkAutoScroll)))) .addContainerGap())); jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] { btnConnect, btnDisconnect, btnSend, chkAutoScroll }); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap() .addComponent(mainOutputScoll, javax.swing.GroupLayout.DEFAULT_SIZE, 345, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(txtCommand, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1).addComponent(btnSend).addComponent(chkAutoScroll)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2).addComponent(btnConnect).addComponent(btnDisconnect) .addComponent(txtServer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap())); splitPane.setLeftComponent(jPanel3); jTabbedPane1.setBackground(new java.awt.Color(68, 68, 68)); jTabbedPane1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); jTabbedPane1.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N jPanel2.setBackground(new java.awt.Color(68, 68, 68)); tblPlayers.setAutoCreateRowSorter(true); tblPlayers.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N tblPlayers.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); tblPlayersScroll.setViewportView(tblPlayers); tblPlayers.getColumnModel().getSelectionModel() .setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); jLabel3.setBackground(new java.awt.Color(68, 68, 68)); jLabel3.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N jLabel3.setForeground(new java.awt.Color(255, 255, 255)); jLabel3.setText("Number of Players:"); txtNumPlayers.setEditable(false); txtNumPlayers.setBackground(new java.awt.Color(255, 255, 255)); txtNumPlayers.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N 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) .addComponent(tblPlayersScroll, javax.swing.GroupLayout.DEFAULT_SIZE, 329, Short.MAX_VALUE) .addGroup(jPanel2Layout.createSequentialGroup().addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(txtNumPlayers, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0))) .addContainerGap())); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap() .addComponent(tblPlayersScroll, javax.swing.GroupLayout.DEFAULT_SIZE, 349, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3).addComponent(txtNumPlayers, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap())); jTabbedPane1.addTab("Player List", jPanel2); jPanel1.setBackground(new java.awt.Color(68, 68, 68)); jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(68, 68, 68))); chkIgnorePlayerCommands.setBackground(new java.awt.Color(68, 68, 68)); chkIgnorePlayerCommands.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N chkIgnorePlayerCommands.setForeground(new java.awt.Color(255, 255, 255)); chkIgnorePlayerCommands.setSelected(true); chkIgnorePlayerCommands.setText("Ignore \"[PLAYER_COMMAND]\" messages"); chkIgnoreServerCommands.setBackground(new java.awt.Color(68, 68, 68)); chkIgnoreServerCommands.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N chkIgnoreServerCommands.setForeground(new java.awt.Color(255, 255, 255)); chkIgnoreServerCommands.setSelected(true); chkIgnoreServerCommands.setText("Ignore \"issued server command\" messages"); chkIgnoreServerCommands.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { chkIgnoreServerCommandsActionPerformed(evt); } }); chkShowChatOnly.setBackground(new java.awt.Color(68, 68, 68)); chkShowChatOnly.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N chkShowChatOnly.setForeground(new java.awt.Color(255, 255, 255)); chkShowChatOnly.setText("Show chat only"); chkShowChatOnly.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { chkShowChatOnlyActionPerformed(evt); } }); chkIgnoreErrors.setBackground(new java.awt.Color(68, 68, 68)); chkIgnoreErrors.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N chkIgnoreErrors.setForeground(new java.awt.Color(255, 255, 255)); chkIgnoreErrors.setText("Ignore warnings and errors"); chkIgnoreErrors.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { chkIgnoreErrorsActionPerformed(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) .addComponent(chkIgnorePlayerCommands).addComponent(chkIgnoreServerCommands) .addComponent(chkShowChatOnly).addComponent(chkIgnoreErrors)) .addContainerGap(68, Short.MAX_VALUE))); jPanel1Layout .setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap() .addComponent(chkIgnorePlayerCommands, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(chkIgnoreServerCommands, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(chkShowChatOnly, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(chkIgnoreErrors, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(307, Short.MAX_VALUE))); jTabbedPane1.addTab("Filters", jPanel1); jPanel4.setBackground(new java.awt.Color(68, 68, 68)); jPanel4.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N favoriteButtonsPanelHolder.setLayout(new java.awt.BorderLayout()); favoriteButtonsPanelScroll.setBorder(null); favoriteButtonsPanel.setBackground(new java.awt.Color(68, 68, 68)); favoriteButtonsPanel.setLayout(null); favoriteButtonsPanelScroll.setViewportView(favoriteButtonsPanel); favoriteButtonsPanelHolder.add(favoriteButtonsPanelScroll, java.awt.BorderLayout.CENTER); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout .setHorizontalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout .createSequentialGroup().addGap(0, 0, 0).addComponent(favoriteButtonsPanelHolder, javax.swing.GroupLayout.DEFAULT_SIZE, 349, Short.MAX_VALUE) .addGap(0, 0, 0))); jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap() .addComponent(favoriteButtonsPanelHolder, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); jTabbedPane1.addTab("Commands", jPanel4); splitPane.setRightComponent(jTabbedPane1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGap(0, 0, 0).addComponent(splitPane).addGap(0, 0, 0))); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(splitPane, javax.swing.GroupLayout.Alignment.TRAILING)); pack(); }
From source file:multiplayer.pong.client.LobbyFrame.java
/** * 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./*w w w . j av a 2 s . com*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jScrollPane2 = new javax.swing.JScrollPane(); jScrollPane2.setBackground(Color.WHITE); usernamesT = new javax.swing.JTable(); usernamesT.setBackground(Color.WHITE); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setBackground(new java.awt.Color(0, 0, 0)); usernamesT.setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { null }, { null }, { null }, { null } }, new String[] { "Username" }) { boolean[] canEdit = new boolean[] { false }; public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit[columnIndex]; } }); usernamesT.setGridColor(new java.awt.Color(0, 0, 0)); usernamesT.setInheritsPopupMenu(true); jScrollPane2.setViewportView(usernamesT); if (usernamesT.getColumnModel().getColumnCount() > 0) { usernamesT.getColumnModel().getColumn(0).setResizable(false); } JLabel lblUtilisateursEnligne = new JLabel("Utilisateurs en-ligne"); lblUtilisateursEnligne.setForeground(new Color(255, 255, 255)); lblUtilisateursEnligne.setFont(new Font("Trebuchet MS", Font.PLAIN, 14)); commandBtn = new JButton("Envoyer"); commandBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { commandBtnActionPerformed(e); } }); JLabel lblLobbyPrincipal = new JLabel("Lobby Principal"); lblLobbyPrincipal.setFont(new Font("Georgia", Font.PLAIN, 70)); lblLobbyPrincipal.setForeground(new Color(255, 255, 255)); lblLobbyPrincipal.setBackground(new Color(0, 0, 0)); scrollPane = new JScrollPane(); scrollPane.setBackground(Color.WHITE); cmdPrompt = new JTextField(); cmdPrompt.setColumns(10); cmdPrompt.grabFocus(); scrollPane_1 = new JScrollPane(); lblWelcome = new JLabel("Bienvenue, " + SocketHandler.username); lblWelcome.setHorizontalAlignment(SwingConstants.RIGHT); lblWelcome.setFont(new Font("Georgia", Font.PLAIN, 18)); lblWelcome.setForeground(Color.WHITE); JLabel label = new JLabel("Amis connect\u00E9s"); label.setForeground(Color.WHITE); label.setFont(new Font("Trebuchet MS", Font.PLAIN, 14)); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); layout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout .createSequentialGroup().addContainerGap() .addGroup(layout.createParallelGroup(Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(Alignment.LEADING) .addComponent(scrollPane_1, GroupLayout.PREFERRED_SIZE, 605, GroupLayout.PREFERRED_SIZE) .addComponent(cmdPrompt, 605, 605, 605)) .addPreferredGap(ComponentPlacement.RELATED)) .addGroup(layout.createSequentialGroup() .addComponent(lblLobbyPrincipal, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(120))) .addGroup(layout.createParallelGroup(Alignment.TRAILING) .addComponent(lblUtilisateursEnligne, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE) .addGroup(Alignment.LEADING, layout.createSequentialGroup().addPreferredGap(ComponentPlacement.RELATED) .addComponent(lblWelcome, GroupLayout.PREFERRED_SIZE, 160, GroupLayout.PREFERRED_SIZE)) .addComponent(commandBtn, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup().addPreferredGap(ComponentPlacement.RELATED) .addComponent(label, GroupLayout.PREFERRED_SIZE, 169, GroupLayout.PREFERRED_SIZE)) .addGroup(Alignment.LEADING, layout.createSequentialGroup().addPreferredGap(ComponentPlacement.RELATED) .addComponent(jScrollPane2, GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE)) .addGroup(Alignment.LEADING, layout.createSequentialGroup().addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE))) .addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout .createSequentialGroup().addContainerGap() .addGroup(layout.createParallelGroup(Alignment.TRAILING).addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(Alignment.LEADING) .addComponent(lblLobbyPrincipal, GroupLayout.PREFERRED_SIZE, 85, GroupLayout.PREFERRED_SIZE) .addComponent(lblWelcome, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE)) .addGap(18) .addGroup(layout.createParallelGroup(Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(scrollPane, GroupLayout.PREFERRED_SIZE, 164, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(lblUtilisateursEnligne, GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(jScrollPane2, GroupLayout.DEFAULT_SIZE, 232, Short.MAX_VALUE)) .addComponent(scrollPane_1, GroupLayout.DEFAULT_SIZE, 432, Short.MAX_VALUE)) .addGap(9) .addGroup( layout.createParallelGroup(Alignment.BASELINE) .addComponent(cmdPrompt, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE) .addComponent(commandBtn)) .addGap(22)) .addGroup(layout.createSequentialGroup() .addComponent(label, GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE) .addGap(492))))); ta = new JTextPane(); ta.setEditable(false); ta.setFont(new Font("SansSerif", Font.PLAIN, 14)); scrollPane_1.setViewportView(ta); friendsT = new JTable(); friendsT.setModel(new DefaultTableModel(new Object[][] {}, new String[] { "Username" })); scrollPane.setViewportView(friendsT); getContentPane().setLayout(layout); pack(); }
From source file:homenetapp.HomeNetAppGui.java
/** This method is called from within the constructor to * initialize the form./*from w ww . ja va2 s.co m*/ * 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() { SendPacketFrame = new javax.swing.JFrame(); sendPacketButton = new javax.swing.JButton(); jPanel1 = new javax.swing.JPanel(); toNodeLabel = new javax.swing.JLabel(); toNodeSpinner = new javax.swing.JSpinner(); toDeviceLabel = new javax.swing.JLabel(); toDeviceSpinner = new javax.swing.JSpinner(); fromNodeLabel = new javax.swing.JLabel(); fromNodeSpinner = new javax.swing.JSpinner(); fromDeviceLabel = new javax.swing.JLabel(); commandLabel = new javax.swing.JLabel(); commandComboBox = new javax.swing.JComboBox(); payloadLabel = new javax.swing.JLabel(); payloadTextField = new javax.swing.JTextField(); fromDeviceSpinner = new javax.swing.JSpinner(); jSplitPane1 = new javax.swing.JSplitPane(); SettingsDialog = new javax.swing.JDialog(); jTabbedPane1 = new javax.swing.JTabbedPane(); jPanel4 = new javax.swing.JPanel(); serverLabel = new javax.swing.JLabel(); apiKeyLabel = new javax.swing.JLabel(); serverTextField = new javax.swing.JTextField(); apiKeyTextField = new javax.swing.JTextField(); testButton = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); certPropertiesLabel = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jPanel5 = new javax.swing.JPanel(); serverPortLabel = new javax.swing.JLabel(); serverPortTextField = new javax.swing.JTextField(); enableUPnPCheckBox = new javax.swing.JCheckBox(); enableServerCheckBox = new javax.swing.JCheckBox(); jSeparator1 = new javax.swing.JSeparator(); jPanel6 = new javax.swing.JPanel(); checkForUpdatesCheckBox = new javax.swing.JCheckBox(); settingsSaveButton = new javax.swing.JButton(); filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767)); cardPanel = new javax.swing.JPanel(); mainPanel = new javax.swing.JPanel(); jPanel3 = new javax.swing.JPanel(); jSplitPane2 = new javax.swing.JSplitPane(); jPanel2 = new javax.swing.JPanel(); jLabel9 = new javax.swing.JLabel(); jScrollPane2 = new javax.swing.JScrollPane(); packetTextArea = new javax.swing.JTextArea(); jScrollPane3 = new javax.swing.JScrollPane(); packetListModel = new DefaultListModel(); jList1 = new javax.swing.JList(); autoUpdateToggleButton = new javax.swing.JToggleButton(); jScrollPane1 = new javax.swing.JScrollPane(); consoleTextPane = new javax.swing.JTextPane(); statusPanel = new javax.swing.JPanel(); jLabel7 = new javax.swing.JLabel(); localStatusLabel = new javax.swing.JLabel(); jLabel11 = new javax.swing.JLabel(); remoteStatusLabel = new javax.swing.JLabel(); localSendingLabel = new javax.swing.JLabel(); localReceivingLabel = new javax.swing.JLabel(); remoteSendingLabel = new javax.swing.JLabel(); remoteReceivingLabel = new javax.swing.JLabel(); topMenuBar = new javax.swing.JMenuBar(); menuFile = new javax.swing.JMenu(); jMenuItem3 = new javax.swing.JMenuItem(); menuTools = new javax.swing.JMenu(); menuToolsSendPacket = new javax.swing.JMenuItem(); menuToolsSettings = new javax.swing.JMenuItem(); menuSerialPorts = new javax.swing.JMenu(); menuHelp = new javax.swing.JMenu(); menuHelpOnline = new javax.swing.JMenuItem(); menuHelpAbout = new javax.swing.JMenuItem(); SendPacketFrame.setTitle("Send Packet"); SendPacketFrame.setMinimumSize(new java.awt.Dimension(380, 240)); SendPacketFrame.setResizable(false); SendPacketFrame.addWindowListener(new java.awt.event.WindowAdapter() { public void windowOpened(java.awt.event.WindowEvent evt) { SendPacketFrameWindowOpened(evt); } }); sendPacketButton.setText("Send"); sendPacketButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { sendPacketButtonActionPerformed(evt); } }); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Packet")); toNodeLabel.setText("To Node: "); toNodeSpinner.setModel(new javax.swing.SpinnerNumberModel(0, 0, 4095, 1)); toDeviceLabel.setText("To Device:"); toDeviceSpinner.setModel(new javax.swing.SpinnerNumberModel(0, 0, 15, 1)); fromNodeLabel.setText("From Node:"); fromNodeSpinner.setModel(new javax.swing.SpinnerNumberModel(0, 0, 4095, 1)); fromDeviceLabel.setText("From Device:"); commandLabel.setText("Command:"); commandComboBox.setModel(new javax.swing.DefaultComboBoxModel(homenetapp.getCommandKeys())); commandComboBox.setRenderer(new CommandRenderer()); payloadLabel.setText("Payload:"); fromDeviceSpinner.setModel(new javax.swing.SpinnerNumberModel(0, 0, 15, 1)); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addGap(10, 10, 10).addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addComponent(payloadLabel) .addComponent(commandLabel).addComponent(fromNodeLabel).addComponent(toNodeLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(commandComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(toNodeSpinner).addComponent(fromNodeSpinner)) .addGap(18, 18, 18) .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(fromDeviceLabel).addComponent(toDeviceLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(toDeviceSpinner, 0, 0, Short.MAX_VALUE).addComponent( fromDeviceSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 37, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 2, Short.MAX_VALUE)) .addComponent(payloadTextField)) .addContainerGap(17, Short.MAX_VALUE))); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(toNodeLabel) .addComponent(toNodeSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(toDeviceLabel).addComponent(toDeviceSpinner, 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(fromNodeLabel) .addComponent(fromNodeSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(fromDeviceLabel).addComponent(fromDeviceSpinner, 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(commandComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(commandLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(payloadTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(payloadLabel)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); javax.swing.GroupLayout SendPacketFrameLayout = new javax.swing.GroupLayout( SendPacketFrame.getContentPane()); SendPacketFrame.getContentPane().setLayout(SendPacketFrameLayout); SendPacketFrameLayout.setHorizontalGroup( SendPacketFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(SendPacketFrameLayout.createSequentialGroup().addContainerGap() .addGroup(SendPacketFrameLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(sendPacketButton).addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); SendPacketFrameLayout.setVerticalGroup(SendPacketFrameLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(SendPacketFrameLayout.createSequentialGroup().addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(sendPacketButton) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); SettingsDialog.setTitle("HomeNet Settings"); SettingsDialog.setMinimumSize(new java.awt.Dimension(400, 300)); SettingsDialog.setResizable(false); SettingsDialog.addWindowListener(new java.awt.event.WindowAdapter() { public void windowOpened(java.awt.event.WindowEvent evt) { SettingsDialogWindowOpened(evt); } }); serverLabel.setText("Server:"); apiKeyLabel.setText("API Key:"); serverTextField.setEditable(false); serverTextField.setText("homenet.me"); apiKeyTextField.setText("reallylongstringofchars"); testButton.setText("Test"); testButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { testButtonActionPerformed(evt); } }); jLabel1.setText("SSL Cert:"); certPropertiesLabel.setText("Loading..."); jButton1.setText("Paste"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap().addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(apiKeyLabel).addComponent(serverLabel)) .addComponent(jLabel1)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() .addComponent(certPropertiesLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 182, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(testButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1)) .addComponent(apiKeyTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 304, Short.MAX_VALUE) .addComponent(serverTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 304, Short.MAX_VALUE)) .addContainerGap())); jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(serverTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(serverLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(apiKeyTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(apiKeyLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1).addComponent(certPropertiesLabel).addComponent(testButton) .addComponent(jButton1)) .addContainerGap(81, Short.MAX_VALUE))); jTabbedPane1.addTab("Client", jPanel4); serverPortLabel.setText("Port:"); serverPortTextField.setEditable(false); serverPortTextField.setText("2443"); enableUPnPCheckBox.setText("Enable UPnP Portforwarding"); enableServerCheckBox.setSelected(true); enableServerCheckBox.setText("Enable Local Server"); enableServerCheckBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { enableServerCheckBoxActionPerformed(evt); } }); 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().addComponent(serverPortLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(serverPortTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(294, Short.MAX_VALUE)) .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap().addComponent(enableServerCheckBox) .addContainerGap(250, Short.MAX_VALUE)) .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 375, Short.MAX_VALUE) .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap().addComponent(enableUPnPCheckBox) .addContainerGap(208, Short.MAX_VALUE))); jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap().addComponent(enableServerCheckBox) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(serverPortTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(serverPortLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(enableUPnPCheckBox).addContainerGap(77, Short.MAX_VALUE))); jTabbedPane1.addTab("Server", jPanel5); checkForUpdatesCheckBox.setText("Check For Updates"); 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() .addComponent(checkForUpdatesCheckBox).addContainerGap(252, Short.MAX_VALUE))); jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap() .addComponent(checkForUpdatesCheckBox).addContainerGap(137, Short.MAX_VALUE))); jTabbedPane1.addTab("Preferences", jPanel6); settingsSaveButton.setText("Save"); settingsSaveButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { settingsSaveButtonActionPerformed(evt); } }); javax.swing.GroupLayout SettingsDialogLayout = new javax.swing.GroupLayout(SettingsDialog.getContentPane()); SettingsDialog.getContentPane().setLayout(SettingsDialogLayout); SettingsDialogLayout.setHorizontalGroup(SettingsDialogLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(SettingsDialogLayout.createSequentialGroup().addContainerGap().addGroup( SettingsDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(settingsSaveButton, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)) .addContainerGap())); SettingsDialogLayout.setVerticalGroup(SettingsDialogLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, SettingsDialogLayout.createSequentialGroup() .addContainerGap() .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 195, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(settingsSaveButton).addContainerGap())); jTabbedPane1.getAccessibleContext().setAccessibleName("Server"); SettingsDialog.getAccessibleContext().setAccessibleName("HomeNet App Settings"); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("HomeNet.me Desktop App"); cardPanel.setLayout(new java.awt.CardLayout()); mainPanel.setLayout(new javax.swing.BoxLayout(mainPanel, javax.swing.BoxLayout.Y_AXIS)); jSplitPane2.setDividerLocation(200); jSplitPane2.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); jLabel9.setText("Packets Received:"); packetTextArea.setColumns(20); packetTextArea.setFont(new java.awt.Font("Courier New", 0, 12)); packetTextArea.setRows(5); jScrollPane2.setViewportView(packetTextArea); jList1.setModel(packetListModel); jList1.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); jList1.setCellRenderer(new PacketListRenderer()); jList1.addListSelectionListener(new javax.swing.event.ListSelectionListener() { public void valueChanged(javax.swing.event.ListSelectionEvent evt) { jList1ValueChanged(evt); } }); jScrollPane3.setViewportView(jList1); autoUpdateToggleButton.setSelected(true); autoUpdateToggleButton.setText("Auto Update"); autoUpdateToggleButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { autoUpdateToggleButtonActionPerformed(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) .addComponent(jLabel9).addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(autoUpdateToggleButton).addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 350, Short.MAX_VALUE)) .addContainerGap())); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel9).addComponent(autoUpdateToggleButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 148, Short.MAX_VALUE) .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 148, Short.MAX_VALUE)) .addContainerGap())); jSplitPane2.setTopComponent(jPanel2); consoleTextPane.setBackground(new java.awt.Color(0, 0, 0)); consoleTextPane.setEditable(false); consoleTextPane.setFont(new java.awt.Font("Consolas", 0, 10)); consoleTextPane.setForeground(new java.awt.Color(255, 255, 255)); jScrollPane1.setViewportView(consoleTextPane); jSplitPane2.setRightComponent(jScrollPane1); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 530, Short.MAX_VALUE) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jSplitPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 530, Short.MAX_VALUE))); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 320, Short.MAX_VALUE) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jSplitPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 320, Short.MAX_VALUE))); mainPanel.add(jPanel3); statusPanel.setBackground(new java.awt.Color(204, 204, 204)); statusPanel.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); jLabel7.setText("Local:"); localStatusLabel.setText("Not Connected"); jLabel11.setText("Remote:"); remoteStatusLabel.setText("Not Connected"); localSendingLabel.setFont(new java.awt.Font("Courier New", 0, 11)); localSendingLabel.setText("( )"); localReceivingLabel.setFont(new java.awt.Font("Courier New", 0, 11)); localReceivingLabel.setText("( )"); remoteSendingLabel.setFont(new java.awt.Font("Courier New", 0, 11)); remoteSendingLabel.setText("( )"); remoteReceivingLabel.setFont(new java.awt.Font("Courier New", 0, 11)); remoteReceivingLabel.setText("( )"); javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel); statusPanel.setLayout(statusPanelLayout); statusPanelLayout.setHorizontalGroup(statusPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(statusPanelLayout.createSequentialGroup().addContainerGap().addComponent(jLabel7) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(localStatusLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(localSendingLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(localReceivingLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 177, Short.MAX_VALUE) .addComponent(jLabel11).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(remoteStatusLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(remoteSendingLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(remoteReceivingLabel).addContainerGap())); statusPanelLayout .setVerticalGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(localStatusLabel).addComponent(localSendingLabel) .addComponent(localReceivingLabel).addComponent(remoteSendingLabel) .addComponent(remoteReceivingLabel).addComponent(remoteStatusLabel) .addComponent(jLabel11))); mainPanel.add(statusPanel); cardPanel.add(mainPanel, "card2"); topMenuBar.setVisible(false); menuFile.setMnemonic('f'); menuFile.setText("File"); jMenuItem3.setMnemonic('e'); jMenuItem3.setText("Exit"); jMenuItem3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem3ActionPerformed(evt); } }); menuFile.add(jMenuItem3); topMenuBar.add(menuFile); menuTools.setMnemonic('t'); menuTools.setText("Tools"); menuToolsSendPacket.setMnemonic('p'); menuToolsSendPacket.setText("Send Packet"); menuToolsSendPacket.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuToolsSendPacketActionPerformed(evt); } }); menuTools.add(menuToolsSendPacket); menuToolsSettings.setMnemonic('s'); menuToolsSettings.setText("Settings"); menuToolsSettings.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuToolsSettingsActionPerformed(evt); } }); menuTools.add(menuToolsSettings); menuSerialPorts.setMnemonic('e'); menuSerialPorts.setText("Select Ports"); menuSerialPorts.addMenuListener(new javax.swing.event.MenuListener() { public void menuCanceled(javax.swing.event.MenuEvent evt) { } public void menuDeselected(javax.swing.event.MenuEvent evt) { } public void menuSelected(javax.swing.event.MenuEvent evt) { menuSerialPortsMenuSelected(evt); } }); menuSerialPorts.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuSerialPortsActionPerformed(evt); } }); menuTools.add(menuSerialPorts); topMenuBar.add(menuTools); menuHelp.setMnemonic('h'); menuHelp.setText("Help"); menuHelpOnline.setText("Online Help"); menuHelpOnline.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuHelpOnlineActionPerformed(evt); } }); menuHelp.add(menuHelpOnline); menuHelpAbout.setText("About"); menuHelpAbout.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuHelpAboutActionPerformed(evt); } }); menuHelp.add(menuHelpAbout); topMenuBar.add(menuHelp); setJMenuBar(topMenuBar); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(cardPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 530, Short.MAX_VALUE)); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(cardPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 340, Short.MAX_VALUE)); pack(); }
From source file:com.juanhg.cicloc.cicloCApplet.java
private void autogeneratedCode() { JPanel panel_control = new JPanel(); panel_control.setBorder(new CompoundBorder(new EtchedBorder(EtchedBorder.RAISED, null, null), new BevelBorder(BevelBorder.RAISED, null, null, null, null))); JPanel panelInputs = new JPanel(); panelInputs.setToolTipText(""); panelInputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0))); JPanel panelOutputs = new JPanel(); panelOutputs.setToolTipText(""); panelOutputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0))); JPanel panelTitleOutputs = new JPanel(); panelTitleOutputs.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null)); JLabel labelOutputData = new JLabel("Datos de la Simulaci\u00F3n"); labelOutputData.setFont(new Font("Tahoma", Font.PLAIN, 14)); panelTitleOutputs.add(labelOutputData); lblPhase = new JLabel("Trabajo Ciclo:"); lblPhase.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblTrabajoCValue = new JLabel(); lblTrabajoCValue.setText("0"); lblTrabajoCValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel lblPosicion = new JLabel("Trabajo:"); lblPosicion.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblTrabajoValue = new JLabel(); lblTrabajoValue.setText("0"); lblTrabajoValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); hotImage = loadImage(hot);/*from w w w. j ava 2s . c o m*/ coldImage = loadImage(cold); lblE = new JLabel("Rendimiento:"); lblE.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblEValue = new JLabel(); lblEValue.setText("0"); lblEValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); GroupLayout gl_panelOutputs = new GroupLayout(panelOutputs); gl_panelOutputs.setHorizontalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelOutputs.createSequentialGroup().addGap(22).addGroup(gl_panelOutputs .createParallelGroup(Alignment.LEADING) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(lblE, GroupLayout.PREFERRED_SIZE, 84, GroupLayout.PREFERRED_SIZE) .addGap(26).addComponent(lblEValue, GroupLayout.DEFAULT_SIZE, 103, Short.MAX_VALUE)) .addGroup(gl_panelOutputs.createSequentialGroup() .addGroup(gl_panelOutputs.createParallelGroup(Alignment.TRAILING) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(lblPhase, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(26)) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(lblPosicion, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE) .addGap(29))) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING, false) .addComponent(lblTrabajoValue, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(lblTrabajoCValue, GroupLayout.PREFERRED_SIZE, 103, GroupLayout.PREFERRED_SIZE)))) .addGap(109)) .addGroup(gl_panelOutputs.createSequentialGroup().addComponent(panelTitleOutputs, GroupLayout.PREFERRED_SIZE, 262, GroupLayout.PREFERRED_SIZE) .addContainerGap(82, Short.MAX_VALUE))); gl_panelOutputs .setVerticalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(panelTitleOutputs, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE) .addComponent(lblTrabajoCValue).addComponent(lblPhase)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE) .addComponent(lblPosicion, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblTrabajoValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addComponent(lblE, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblEValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addGap(79))); panelOutputs.setLayout(gl_panelOutputs); panel_1 = new JPanel(); panel_1.setBorder(new LineBorder(new Color(0, 0, 0))); JPanel panel_6 = new JPanel(); panel_6.setBorder(new LineBorder(new Color(0, 0, 0))); GroupLayout gl_panel_control = new GroupLayout(panel_control); gl_panel_control.setHorizontalGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING) .addGroup(gl_panel_control.createSequentialGroup().addContainerGap() .addGroup(gl_panel_control.createParallelGroup(Alignment.LEADING, false) .addComponent(panelOutputs, 0, 0, Short.MAX_VALUE) .addComponent(panelInputs, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panel_6, 0, 0, Short.MAX_VALUE).addComponent(panel_1, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(92, Short.MAX_VALUE))); gl_panel_control.setVerticalGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING) .addGroup(gl_panel_control.createSequentialGroup().addContainerGap() .addComponent(panelInputs, GroupLayout.PREFERRED_SIZE, 213, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panelOutputs, GroupLayout.PREFERRED_SIZE, 129, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel_6, GroupLayout.PREFERRED_SIZE, 146, Short.MAX_VALUE) .addPreferredGap(ComponentPlacement.RELATED).addComponent(panel_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGap(17))); btnLaunchSimulation = new JButton("Iniciar"); btnLaunchSimulation.setFont(new Font("Tahoma", Font.PLAIN, 16)); btnLaunchSimulation.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { btnLaunchSimulationEvent(event); } }); btnCold = new JButton(""); btnCold.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { btnHot.setEnabled(true); btnCold.setEnabled(false); isHot = false; lblE.setText("Eficiencia"); lblModeValue.setText("Modo Frig"); panelMode.setBackground(Color.BLUE); } }); btnCold.setIcon(new ImageIcon(coldImage)); btnCold.setEnabled(true); panelMode = new JPanel(); panelMode.setBorder(new LineBorder(new Color(0, 0, 0))); panelMode.setBackground(Color.ORANGE); btnHot = new JButton(""); btnHot.setIcon(new ImageIcon(hotImage)); btnHot.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { btnHot.setEnabled(false); btnCold.setEnabled(true); isHot = true; lblE.setText("Rendimiento"); lblModeValue.setText("Modo Motor"); panelMode.setBackground(Color.ORANGE); } }); btnHot.setEnabled(false); GroupLayout gl_panel_6 = new GroupLayout(panel_6); gl_panel_6.setHorizontalGroup(gl_panel_6.createParallelGroup(Alignment.LEADING).addGroup(gl_panel_6 .createSequentialGroup().addContainerGap() .addGroup(gl_panel_6.createParallelGroup(Alignment.LEADING, false) .addComponent(panelMode, Alignment.TRAILING, 0, 0, Short.MAX_VALUE) .addComponent(btnHot, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE)) .addGap(10) .addGroup(gl_panel_6.createParallelGroup(Alignment.TRAILING, false) .addComponent(btnCold, GroupLayout.PREFERRED_SIZE, 112, GroupLayout.PREFERRED_SIZE) .addComponent(btnLaunchSimulation, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); gl_panel_6.setVerticalGroup(gl_panel_6.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_6.createSequentialGroup().addGap(10) .addGroup(gl_panel_6.createParallelGroup(Alignment.LEADING) .addComponent(panelMode, 0, 0, Short.MAX_VALUE).addComponent(btnLaunchSimulation, GroupLayout.PREFERRED_SIZE, 45, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panel_6.createParallelGroup(Alignment.TRAILING) .addComponent(btnCold, GroupLayout.DEFAULT_SIZE, 68, Short.MAX_VALUE) .addComponent(btnHot, GroupLayout.DEFAULT_SIZE, 68, Short.MAX_VALUE)) .addContainerGap())); lblModeValue = new JLabel("Modo Motor"); lblModeValue.setFont(new Font("Tahoma", Font.PLAIN, 17)); GroupLayout gl_panelMode = new GroupLayout(panelMode); gl_panelMode.setHorizontalGroup(gl_panelMode.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelMode.createSequentialGroup().addContainerGap() .addComponent(lblModeValue, GroupLayout.PREFERRED_SIZE, 113, GroupLayout.PREFERRED_SIZE) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); gl_panelMode .setVerticalGroup(gl_panelMode.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelMode .createSequentialGroup().addContainerGap().addComponent(lblModeValue, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(52))); panelMode.setLayout(gl_panelMode); panel_6.setLayout(gl_panel_6); JLabel lblNewLabel = new JLabel("GNU GENERAL PUBLIC LICENSE"); panel_1.add(lblNewLabel); JLabel LabelT1 = new JLabel("T1"); LabelT1.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel labelT2 = new JLabel("T2"); labelT2.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel labelVmin = new JLabel("Vm\u00EDn"); labelVmin.setFont(new Font("Tahoma", Font.PLAIN, 14)); JPanel panelTitle = new JPanel(); panelTitle.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null)); lblT2Value = new JLabel("300"); lblT2Value.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblVminValue = new JLabel("2"); lblVminValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblT1Value = new JLabel("400"); lblT1Value.setFont(new Font("Tahoma", Font.PLAIN, 14)); sliderT1 = new JSlider(); sliderT1.setMinimum(350); sliderT1.setMaximum(450); sliderT1.setMinorTickSpacing(1); sliderT1.setValue(400); sliderT1.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent event) { sliderT1Event(); } }); sliderT2 = new JSlider(); sliderT2.setMinimum(270); sliderT2.setMaximum(330); sliderT2.setMinorTickSpacing(1); sliderT2.setValue(300); sliderT2.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { sliderT2Event(); } }); sliderVMin = new JSlider(); sliderVMin.setMaximum(4); sliderVMin.setMinimum(1); sliderVMin.setValue(2); sliderVMin.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { sliderVminEvent(); } }); JLabel lblVmax = new JLabel("Vm\u00E1x"); lblVmax.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblVmaxValue = new JLabel("7"); lblVmaxValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); sliderVMax = new JSlider(); sliderVMax.setMaximum(10); sliderVMax.setMinimum(6); sliderVMax.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent arg0) { sliderVmaxEvent(); } }); sliderVMax.setValue(7); sliderVMax.setMinorTickSpacing(1); JLabel labelN = new JLabel("N"); labelN.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblNValue = new JLabel("10"); lblNValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); sliderN = new JSlider(); sliderN.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { sliderNEvent(); } }); sliderN.setValue(10); sliderN.setMinorTickSpacing(1); GroupLayout gl_panelInputs = new GroupLayout(panelInputs); gl_panelInputs.setHorizontalGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createSequentialGroup().addGap(19).addGroup(gl_panelInputs .createParallelGroup(Alignment.LEADING, false) .addComponent(labelN, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(lblVmax, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(labelVmin, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(labelT2, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(LabelT1, GroupLayout.PREFERRED_SIZE, 65, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING, false) .addGroup(gl_panelInputs.createSequentialGroup() .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(lblT1Value, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE) .addComponent(lblT2Value, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE) .addComponent(lblVminValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE)) .addGap(18) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING, false) .addComponent(sliderT1, 0, 0, Short.MAX_VALUE) .addComponent(sliderT2, 0, 0, Short.MAX_VALUE) .addComponent(sliderVMin, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE))) .addGroup(gl_panelInputs.createSequentialGroup() .addComponent(lblVmaxValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE) .addGap(18).addComponent(sliderVMax, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_panelInputs.createSequentialGroup() .addComponent(lblNValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE) .addGap(18) .addComponent(sliderN, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED))) .addContainerGap()) .addComponent(panelTitle, GroupLayout.DEFAULT_SIZE, 259, Short.MAX_VALUE)); gl_panelInputs.setVerticalGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createSequentialGroup() .addComponent(panelTitle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGap(18) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createSequentialGroup().addComponent(LabelT1).addGap(12) .addComponent(labelT2).addGap(17).addComponent(labelVmin).addGap(17) .addComponent(lblVmax, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addGap(17).addComponent(labelN, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_panelInputs.createSequentialGroup() .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(lblT1Value, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(sliderT1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(lblT2Value, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(sliderT2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGap(11) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(lblVminValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(sliderVMin, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(lblVmaxValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(sliderVMax, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING) .addComponent(lblNValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(sliderN, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))) .addGap(8))); JLabel lblDatosDeEntrada = new JLabel("Datos de Entrada"); lblDatosDeEntrada.setFont(new Font("Tahoma", Font.PLAIN, 14)); panelTitle.add(lblDatosDeEntrada); panelInputs.setLayout(gl_panelInputs); panel_control.setLayout(gl_panel_control); JPanel panel_visualizar = new JPanel(); panel_visualizar.setBackground(Color.WHITE); GroupLayout groupLayout = new GroupLayout(getContentPane()); groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.TRAILING) .addGroup(Alignment.LEADING, groupLayout.createSequentialGroup().addContainerGap() .addComponent(panel_control, GroupLayout.PREFERRED_SIZE, 286, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED).addComponent(panel_visualizar, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addContainerGap(93, Short.MAX_VALUE))); groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.TRAILING).addGroup(groupLayout .createSequentialGroup().addContainerGap() .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING) .addComponent(panel_visualizar, GroupLayout.DEFAULT_SIZE, 567, Short.MAX_VALUE) .addComponent(panel_control, GroupLayout.PREFERRED_SIZE, 568, GroupLayout.PREFERRED_SIZE)) .addContainerGap())); JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP); panelPiston = new JPanelGrafica(); panelPiston.setBackground(Color.WHITE); JPanel panel_5 = new JPanel(); panel_5.setBackground(Color.WHITE); JPanel panel = new JPanel(); panel.setBackground(Color.WHITE); GroupLayout gl_panel_visualizar = new GroupLayout(panel_visualizar); gl_panel_visualizar.setHorizontalGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING) .addComponent(tabbedPane, GroupLayout.DEFAULT_SIZE, 845, Short.MAX_VALUE) .addGroup(gl_panel_visualizar.createSequentialGroup().addContainerGap() .addComponent(panelPiston, GroupLayout.PREFERRED_SIZE, 355, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel, GroupLayout.PREFERRED_SIZE, 183, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel_5, GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE).addContainerGap())); gl_panel_visualizar.setVerticalGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_visualizar.createSequentialGroup() .addComponent(tabbedPane, GroupLayout.PREFERRED_SIZE, 289, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING) .addComponent(panel, GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE) .addComponent(panelPiston, GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE) .addComponent(panel_5, GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE)) .addContainerGap())); panelTermo = new JPanelGrafica(); panelTermo.setBackground(Color.WHITE); GroupLayout gl_panel = new GroupLayout(panel); gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(Alignment.LEADING).addComponent(panelTermo, GroupLayout.DEFAULT_SIZE, 131, Short.MAX_VALUE)); gl_panel.setVerticalGroup(gl_panel.createParallelGroup(Alignment.LEADING).addComponent(panelTermo, GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE)); panel.setLayout(gl_panel); panelPistonInterno = new JPanelGrafica(); panelPistonInterno.setBackground(Color.WHITE); GroupLayout gl_panelPiston = new GroupLayout(panelPiston); gl_panelPiston.setHorizontalGroup(gl_panelPiston.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelPiston.createSequentialGroup() .addComponent(panelPistonInterno, GroupLayout.PREFERRED_SIZE, 354, GroupLayout.PREFERRED_SIZE) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); gl_panelPiston.setVerticalGroup(gl_panelPiston.createParallelGroup(Alignment.LEADING) .addComponent(panelPistonInterno, GroupLayout.DEFAULT_SIZE, 261, Short.MAX_VALUE)); panelPiston.setLayout(gl_panelPiston); JPanel panelBulb = new JPanel(); panelBulb.setBackground(Color.WHITE); JPanel panelLED = new JPanel(); panelLED.setBackground(Color.WHITE); lblBulbValue = new JLabel("- Horas"); lblLEDValue = new JLabel("- Horas"); GroupLayout gl_panel_5 = new GroupLayout(panel_5); gl_panel_5.setHorizontalGroup(gl_panel_5.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_5.createSequentialGroup() .addGroup(gl_panel_5.createParallelGroup(Alignment.LEADING, false) .addComponent(panelLED, 0, 0, Short.MAX_VALUE) .addComponent(panelBulb, GroupLayout.PREFERRED_SIZE, 132, Short.MAX_VALUE)) .addGap(18).addGroup(gl_panel_5.createParallelGroup(Alignment.LEADING) .addComponent(lblBulbValue).addComponent(lblLEDValue)) .addContainerGap(87, Short.MAX_VALUE))); gl_panel_5.setVerticalGroup(gl_panel_5.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_5.createSequentialGroup() .addComponent(panelBulb, GroupLayout.PREFERRED_SIZE, 143, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(panelLED, GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)) .addGroup(gl_panel_5.createSequentialGroup().addGap(64).addComponent(lblBulbValue) .addPreferredGap(ComponentPlacement.RELATED, 135, Short.MAX_VALUE).addComponent(lblLEDValue) .addGap(64))); LEDOnImage = loadImage(LEDOn); LEDOffImage = loadImage(LEDOff); lblLED = new JLabel(new ImageIcon(LEDOffImage)); lblLED.setBackground(Color.WHITE); GroupLayout gl_panelLED = new GroupLayout(panelLED); gl_panelLED.setHorizontalGroup(gl_panelLED.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelLED.createSequentialGroup() .addComponent(lblLED, GroupLayout.PREFERRED_SIZE, 131, GroupLayout.PREFERRED_SIZE) .addContainerGap(33, Short.MAX_VALUE))); gl_panelLED.setVerticalGroup(gl_panelLED.createParallelGroup(Alignment.TRAILING).addGroup(Alignment.LEADING, gl_panelLED.createSequentialGroup().addContainerGap().addComponent(lblLED, GroupLayout.DEFAULT_SIZE, 126, Short.MAX_VALUE))); panelLED.setLayout(gl_panelLED); bulbOnImage = loadImage(bulbOn); bulbOffImage = loadImage(bulbOff); lblBulb = new JLabel(new ImageIcon(bulbOffImage)); lblBulb.setBackground(Color.WHITE); GroupLayout gl_panelBulb = new GroupLayout(panelBulb); gl_panelBulb.setHorizontalGroup(gl_panelBulb.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelBulb.createSequentialGroup() .addComponent(lblBulb, GroupLayout.PREFERRED_SIZE, 134, GroupLayout.PREFERRED_SIZE) .addContainerGap(30, Short.MAX_VALUE))); gl_panelBulb.setVerticalGroup(gl_panelBulb.createParallelGroup(Alignment.LEADING).addComponent(lblBulb, GroupLayout.DEFAULT_SIZE, 143, Short.MAX_VALUE)); panelBulb.setLayout(gl_panelBulb); panel_5.setLayout(gl_panel_5); JPanel panelXV = new JPanel(); panelXV.setBackground(Color.WHITE); tabbedPane.addTab("Grficas V", null, panelXV, null); JPanel panel_2 = new JPanel(); JPanel panel_3 = new JPanel(); JPanel panel_4 = new JPanel(); panelTV = new JPanelGrafica(); GroupLayout gl_panel_4 = new GroupLayout(panel_4); gl_panel_4.setHorizontalGroup( gl_panel_4.createParallelGroup(Alignment.LEADING).addGap(0, 272, Short.MAX_VALUE) .addComponent(panelTV, GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE)); gl_panel_4 .setVerticalGroup(gl_panel_4.createParallelGroup(Alignment.LEADING).addGap(0, 241, Short.MAX_VALUE) .addGroup(gl_panel_4.createSequentialGroup() .addComponent(panelTV, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE) .addContainerGap(306, Short.MAX_VALUE))); panel_4.setLayout(gl_panel_4); GroupLayout gl_panelXV = new GroupLayout(panelXV); gl_panelXV.setHorizontalGroup(gl_panelXV.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelXV.createSequentialGroup().addContainerGap() .addComponent(panel_2, GroupLayout.PREFERRED_SIZE, 263, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel_3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel_4, GroupLayout.PREFERRED_SIZE, 272, GroupLayout.PREFERRED_SIZE) .addContainerGap(11, Short.MAX_VALUE))); gl_panelXV.setVerticalGroup(gl_panelXV.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelXV.createSequentialGroup().addContainerGap() .addGroup(gl_panelXV.createParallelGroup(Alignment.LEADING) .addComponent(panel_4, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE) .addGroup(gl_panelXV.createParallelGroup(Alignment.TRAILING, false) .addComponent(panel_3, Alignment.LEADING, 0, 0, Short.MAX_VALUE) .addComponent(panel_2, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 241, Short.MAX_VALUE))) .addContainerGap(317, Short.MAX_VALUE))); panelUV = new JPanelGrafica(); GroupLayout gl_panel_3 = new GroupLayout(panel_3); gl_panel_3.setHorizontalGroup(gl_panel_3.createParallelGroup(Alignment.LEADING).addComponent(panelUV, GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE)); gl_panel_3.setVerticalGroup(gl_panel_3.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_3.createSequentialGroup() .addComponent(panelUV, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE) .addContainerGap(306, Short.MAX_VALUE))); panel_3.setLayout(gl_panel_3); panelPV = new JPanelGrafica(); GroupLayout gl_panel_2 = new GroupLayout(panel_2); gl_panel_2.setHorizontalGroup(gl_panel_2.createParallelGroup(Alignment.LEADING).addComponent(panelPV, GroupLayout.DEFAULT_SIZE, 249, Short.MAX_VALUE)); gl_panel_2.setVerticalGroup(gl_panel_2.createParallelGroup(Alignment.LEADING).addComponent(panelPV, GroupLayout.DEFAULT_SIZE, 225, Short.MAX_VALUE)); panel_2.setLayout(gl_panel_2); panelXV.setLayout(gl_panelXV); JPanel panelXT = new JPanel(); panelXT.setBackground(Color.WHITE); tabbedPane.addTab("Grficas T", null, panelXT, null); JPanel panel_9 = new JPanel(); panelPT = new JPanelGrafica(); GroupLayout gl_panel_9 = new GroupLayout(panel_9); gl_panel_9.setHorizontalGroup( gl_panel_9.createParallelGroup(Alignment.LEADING).addGap(0, 263, Short.MAX_VALUE) .addComponent(panelPT, GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE)); gl_panel_9 .setVerticalGroup(gl_panel_9.createParallelGroup(Alignment.LEADING).addGap(0, 241, Short.MAX_VALUE) .addComponent(panelPT, GroupLayout.DEFAULT_SIZE, 241, Short.MAX_VALUE)); panel_9.setLayout(gl_panel_9); JPanel panel_10 = new JPanel(); panelST = new JPanelGrafica(); GroupLayout gl_panel_10 = new GroupLayout(panel_10); gl_panel_10.setHorizontalGroup( gl_panel_10.createParallelGroup(Alignment.LEADING).addGap(0, 272, Short.MAX_VALUE) .addComponent(panelST, GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE)); gl_panel_10 .setVerticalGroup(gl_panel_10.createParallelGroup(Alignment.LEADING).addGap(0, 241, Short.MAX_VALUE) .addGroup(gl_panel_10.createSequentialGroup() .addComponent(panelST, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); panel_10.setLayout(gl_panel_10); JPanel panel_11 = new JPanel(); panelUT = new JPanelGrafica(); GroupLayout gl_panel_11 = new GroupLayout(panel_11); gl_panel_11.setHorizontalGroup( gl_panel_11.createParallelGroup(Alignment.LEADING).addGap(0, 272, Short.MAX_VALUE) .addComponent(panelUT, GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE)); gl_panel_11 .setVerticalGroup(gl_panel_11.createParallelGroup(Alignment.LEADING).addGap(0, 241, Short.MAX_VALUE) .addGroup(gl_panel_11.createSequentialGroup() .addComponent(panelUT, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); panel_11.setLayout(gl_panel_11); GroupLayout gl_panelXT = new GroupLayout(panelXT); gl_panelXT.setHorizontalGroup(gl_panelXT.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelXT.createSequentialGroup().addContainerGap() .addComponent(panel_9, GroupLayout.PREFERRED_SIZE, 263, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel_10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel_11, GroupLayout.PREFERRED_SIZE, 272, GroupLayout.PREFERRED_SIZE) .addContainerGap(11, Short.MAX_VALUE))); gl_panelXT.setVerticalGroup(gl_panelXT.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelXT.createSequentialGroup().addContainerGap() .addGroup(gl_panelXT.createParallelGroup(Alignment.LEADING) .addComponent(panel_11, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE) .addGroup(gl_panelXT.createParallelGroup(Alignment.TRAILING, false) .addComponent(panel_10, Alignment.LEADING, 0, 0, Short.MAX_VALUE) .addComponent(panel_9, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 241, Short.MAX_VALUE))) .addContainerGap(317, Short.MAX_VALUE))); panelXT.setLayout(gl_panelXT); panel_visualizar.setLayout(gl_panel_visualizar); getContentPane().setLayout(groupLayout); }
From source file:com.juanhg.icecubes.IceCubesApplet.java
private void autogeneratedCode() { JPanel panel_control = new JPanel(); panel_control.setBorder(new CompoundBorder(new EtchedBorder(EtchedBorder.RAISED, null, null), new BevelBorder(BevelBorder.RAISED, null, null, null, null))); JPanel panelInputs = new JPanel(); panelInputs.setToolTipText(""); panelInputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0))); JPanel panelOutputs = new JPanel(); panelOutputs.setToolTipText(""); panelOutputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0))); JPanel panelTitleOutputs = new JPanel(); panelTitleOutputs.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null)); JLabel labelOutputData = new JLabel("Datos de la Simulaci\u00F3n"); labelOutputData.setFont(new Font("Tahoma", Font.PLAIN, 14)); panelTitleOutputs.add(labelOutputData); lblO1 = new JLabel("T:"); lblO1.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblO1Value = new JLabel(); lblO1Value.setText("0"); lblO1Value.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel lblO2 = new JLabel("t:"); lblO2.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblO2Value = new JLabel(); lblO2Value.setText("0"); lblO2Value.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel lblV = new JLabel("V:"); lblV.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblVValue = new JLabel(); lblVValue.setText("0"); lblVValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); GroupLayout gl_panelOutputs = new GroupLayout(panelOutputs); gl_panelOutputs.setHorizontalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addComponent(panelTitleOutputs, GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE) .addGroup(gl_panelOutputs.createSequentialGroup() .addGroup(gl_panelOutputs.createParallelGroup(Alignment.TRAILING) .addGroup(gl_panelOutputs.createSequentialGroup().addGap(22) .addComponent(lblO1, GroupLayout.DEFAULT_SIZE, 88, Short.MAX_VALUE) .addPreferredGap(ComponentPlacement.RELATED)) .addGroup(gl_panelOutputs.createSequentialGroup().addContainerGap() .addComponent(lblO2, GroupLayout.PREFERRED_SIZE, 57, GroupLayout.PREFERRED_SIZE) .addGap(37))) .addGroup(//from ww w . j a v a 2s .com gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(lblO1Value, GroupLayout.DEFAULT_SIZE, 52, Short.MAX_VALUE) .addGap(3)) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(lblO2Value, GroupLayout.PREFERRED_SIZE, 55, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED))) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(lblV, GroupLayout.PREFERRED_SIZE, 44, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(lblVValue, GroupLayout.PREFERRED_SIZE, 110, GroupLayout.PREFERRED_SIZE) .addContainerGap())); gl_panelOutputs .setVerticalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(panelTitleOutputs, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE) .addComponent(lblO1).addComponent(lblO1Value) .addComponent(lblV, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblVValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE) .addComponent(lblO2, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblO2Value, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addGap(40))); panelOutputs.setLayout(gl_panelOutputs); JPanel panelLicense = new JPanel(); panelLicense.setBorder(new LineBorder(new Color(0, 0, 0))); JPanel panel_6 = new JPanel(); panel_6.setBorder(new LineBorder(new Color(0, 0, 0))); GroupLayout gl_panel_control = new GroupLayout(panel_control); gl_panel_control .setHorizontalGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING) .addGroup(Alignment.LEADING, gl_panel_control.createSequentialGroup().addContainerGap() .addGroup(gl_panel_control.createParallelGroup(Alignment.LEADING) .addComponent(panelOutputs, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panelInputs, GroupLayout.PREFERRED_SIZE, 346, Short.MAX_VALUE) .addComponent(panel_6, Alignment.TRAILING, GroupLayout.PREFERRED_SIZE, 346, Short.MAX_VALUE) .addComponent(panelLicense, GroupLayout.DEFAULT_SIZE, 346, Short.MAX_VALUE)) .addContainerGap())); gl_panel_control.setVerticalGroup(gl_panel_control.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_control.createSequentialGroup().addContainerGap() .addComponent(panelInputs, GroupLayout.PREFERRED_SIZE, 225, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panelOutputs, GroupLayout.PREFERRED_SIZE, 112, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(panel_6, GroupLayout.PREFERRED_SIZE, 80, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panelLicense, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); btnLaunchSimulation = new JButton("Iniciar"); btnLaunchSimulation.setFont(new Font("Tahoma", Font.PLAIN, 16)); btnLaunchSimulation.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { btnLaunchSimulationEvent(event); } }); GroupLayout gl_panel_6 = new GroupLayout(panel_6); gl_panel_6.setHorizontalGroup(gl_panel_6.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_6.createSequentialGroup().addContainerGap() .addComponent(btnLaunchSimulation, GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE) .addContainerGap())); gl_panel_6.setVerticalGroup(gl_panel_6.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_6 .createSequentialGroup().addContainerGap().addComponent(btnLaunchSimulation, GroupLayout.PREFERRED_SIZE, 55, GroupLayout.PREFERRED_SIZE) .addContainerGap(78, Short.MAX_VALUE))); panel_6.setLayout(gl_panel_6); JLabel lblNewLabel = new JLabel("GNU GENERAL PUBLIC LICENSE"); panelLicense.add(lblNewLabel); JLabel LabelI1 = new JLabel("Volumen"); LabelI1.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel labelI2 = new JLabel("T"); labelI2.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel labelI3 = new JLabel("t"); labelI3.setFont(new Font("Tahoma", Font.PLAIN, 14)); JPanel panelTitle = new JPanel(); panelTitle.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null)); lblTValue = new JLabel("15"); lblTValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); lbltValue = new JLabel("-15"); lbltValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblVolValue = new JLabel("20"); lblVolValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); sliderVol = new JSlider(); sliderVol.setMinimum(1); sliderVol.setMaximum(30); sliderVol.setMinorTickSpacing(1); sliderVol.setValue(20); sliderVol.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent event) { sliderI1Event(); } }); sliderT = new JSlider(); sliderT.setMinimum(5); sliderT.setMaximum(30); sliderT.setMinorTickSpacing(1); sliderT.setValue(15); sliderT.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { sliderI2Event(); } }); slidert = new JSlider(); slidert.setMinimum(5); slidert.setMaximum(30); slidert.setValue(15); slidert.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { sliderI3Event(); } }); JLabel lblI4 = new JLabel("N\u00BA de Cubitos"); lblI4.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblNValue = new JLabel("1"); lblNValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); sliderN = new JSlider(); sliderN.setMinimum(1); sliderN.setMaximum(4); sliderN.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent arg0) { sliderI4Event(); } }); sliderN.setValue(1); sliderN.setMinorTickSpacing(1); waterImage = loadImage(water); btnWater = new JButton(new ImageIcon(waterImage)); btnWater.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { btnWater.setEnabled(false); btnMilk.setEnabled(true); btnOrange.setEnabled(true); btnlemonade.setEnabled(true); type = WATER; fluidColor = new Color(100, 180, 255, 70); updateGlass(IceCubesModel.getV(sliderVol.getValue(), sliderN.getValue())); repaint(); } }); milkImage = loadImage(milk); btnMilk = new JButton(new ImageIcon(milkImage)); btnMilk.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { btnWater.setEnabled(true); btnMilk.setEnabled(false); btnOrange.setEnabled(true); btnlemonade.setEnabled(true); type = MILK; fluidColor = new Color(255, 255, 255, 255); updateGlass(IceCubesModel.getV(sliderVol.getValue(), sliderN.getValue())); repaint(); } }); orangeImage = loadImage(orange); btnOrange = new JButton(new ImageIcon(orangeImage)); btnOrange.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { btnWater.setEnabled(true); btnMilk.setEnabled(true); btnOrange.setEnabled(false); btnlemonade.setEnabled(true); type = ORANGE; fluidColor = new Color(225, 150, 0, 220); updateGlass(IceCubesModel.getV(sliderVol.getValue(), sliderN.getValue())); repaint(); } }); lemonadeImage = loadImage(lemonade); btnlemonade = new JButton(new ImageIcon(lemonadeImage)); btnlemonade.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { btnWater.setEnabled(true); btnMilk.setEnabled(true); btnOrange.setEnabled(true); btnlemonade.setEnabled(false); type = LEMONADE; fluidColor = new Color(225, 225, 0, 150); updateGlass(IceCubesModel.getV(sliderVol.getValue(), sliderN.getValue())); repaint(); } }); GroupLayout gl_panelInputs = new GroupLayout(panelInputs); gl_panelInputs.setHorizontalGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING) .addComponent(panelTitle, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE) .addGroup(gl_panelInputs.createSequentialGroup().addContainerGap(23, Short.MAX_VALUE) .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING).addGroup(gl_panelInputs .createSequentialGroup() .addComponent(btnWater, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(btnMilk, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(btnOrange, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(btnlemonade, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE) .addGap(8)) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createSequentialGroup().addGroup(gl_panelInputs .createParallelGroup(Alignment.TRAILING, false) .addComponent(labelI3, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(LabelI1, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(labelI2, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 120, GroupLayout.PREFERRED_SIZE)) .addGap(18) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(lblVolValue, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE) .addComponent(lblTValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE) .addComponent(lbltValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE)) .addGap(18).addGroup( gl_panelInputs.createParallelGroup(Alignment.LEADING, false) .addComponent(sliderVol, 0, 0, Short.MAX_VALUE) .addComponent(sliderT, 0, 0, Short.MAX_VALUE) .addComponent(slidert, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE))) .addGroup(gl_panelInputs.createSequentialGroup() .addComponent(lblI4, GroupLayout.PREFERRED_SIZE, 120, GroupLayout.PREFERRED_SIZE) .addGap(18) .addComponent(lblNValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE) .addGap(18).addComponent(sliderN, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE)))) .addGap(15))); gl_panelInputs.setVerticalGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createSequentialGroup() .addComponent(panelTitle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGap(18) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE) .addComponent(LabelI1).addComponent(lblVolValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addComponent(sliderVol, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE) .addComponent(labelI2).addComponent(lblTValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addComponent(sliderT, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGap(11) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING).addComponent(labelI3) .addComponent(lbltValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(slidert, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(lblI4, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblNValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(sliderN, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGap(7) .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING, false) .addComponent(btnWater, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btnMilk, GroupLayout.DEFAULT_SIZE, 57, Short.MAX_VALUE) .addComponent(btnOrange, GroupLayout.DEFAULT_SIZE, 57, Short.MAX_VALUE) .addComponent(btnlemonade, GroupLayout.DEFAULT_SIZE, 57, Short.MAX_VALUE)) .addGap(11))); JLabel lblDatosDeEntrada = new JLabel("Datos de Entrada"); lblDatosDeEntrada.setFont(new Font("Tahoma", Font.PLAIN, 14)); panelTitle.add(lblDatosDeEntrada); panelInputs.setLayout(gl_panelInputs); panel_control.setLayout(gl_panel_control); JPanel panel_visualizar = new JPanel(); panel_visualizar.setBackground(Color.WHITE); GroupLayout groupLayout = new GroupLayout(getContentPane()); groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup( Alignment.TRAILING, groupLayout.createSequentialGroup().addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panel_control, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel_visualizar, GroupLayout.PREFERRED_SIZE, 694, GroupLayout.PREFERRED_SIZE) .addGap(156))); groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.TRAILING).addGroup(Alignment.LEADING, groupLayout.createSequentialGroup().addGap(12) .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING, false) .addComponent(panel_visualizar, Alignment.LEADING, 0, 0, Short.MAX_VALUE) .addComponent(panel_control, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 494, Short.MAX_VALUE)) .addContainerGap(84, Short.MAX_VALUE))); JPanel panel = new JPanel(); panel.setBorder(new LineBorder(new Color(0, 0, 0))); panel.setBounds(0, 0, 368, 494); panel.setBackground(Color.WHITE); JPanel panel_1 = new JPanel(); panel_1.setBounds(1, 1, 366, 31); panel_1.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null)); JLabel lblSimulacin = new JLabel("Simulaci\u00F3n"); lblSimulacin.setFont(new Font("Tahoma", Font.PLAIN, 14)); panel_1.add(lblSimulacin); JPanel panel_3 = new JPanel(); panel_3.setBorder(new LineBorder(new Color(0, 0, 0))); panel_3.setBackground(Color.WHITE); panel_3.setBounds(368, 0, 326, 494); panel_visualizar.setLayout(null); panel_visualizar.add(panel); panel.setLayout(null); panel.add(panel_1); panel_7 = new JPanelGrafica(); panel_7.setBackground(Color.WHITE); panel_7.setBounds(1, 31, 366, 463); panel.add(panel_7); panelGlass = new JPanelGrafica(); panelGlass.setBackground(Color.WHITE); GroupLayout gl_panel_7 = new GroupLayout(panel_7); gl_panel_7.setHorizontalGroup(gl_panel_7.createParallelGroup(Alignment.LEADING).addComponent(panelGlass, GroupLayout.DEFAULT_SIZE, 366, Short.MAX_VALUE)); gl_panel_7.setVerticalGroup(gl_panel_7.createParallelGroup(Alignment.LEADING).addComponent(panelGlass, GroupLayout.DEFAULT_SIZE, 463, Short.MAX_VALUE)); panel_7.setLayout(gl_panel_7); panel_visualizar.add(panel_3); panel_3.setLayout(null); JPanel panel_4 = new JPanel(); panel_4.setBounds(1, 1, 324, 31); panel_4.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null)); JLabel lblGrficaDeEvolucin = new JLabel("Gr\u00E1fica de Evoluci\u00F3n (T frente a Q)"); lblGrficaDeEvolucin.setFont(new Font("Tahoma", Font.PLAIN, 14)); panel_4.add(lblGrficaDeEvolucin); panel_3.add(panel_4); JPanel panel7 = new JPanel(); panel7.setBorder(new LineBorder(new Color(0, 0, 0))); panel7.setBackground(Color.WHITE); panel7.setBounds(1, 31, 324, 463); panel_3.add(panel7); panel7.setLayout(null); panelChart = new JPanelGrafica(); panelChart.setBorder(new LineBorder(new Color(0, 0, 0))); panelChart.setBackground(Color.WHITE); panelChart.setBounds(0, 0, 324, 462); panel7.add(panelChart); getContentPane().setLayout(groupLayout); }