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:jpad.MainEditor.java
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); mainTextArea = new javax.swing.JTextArea(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); openMenuItem = new javax.swing.JMenuItem(); saveMenuItem = new javax.swing.JMenuItem(); saveAsMenuItem = new javax.swing.JMenuItem(); seperator_OpenAndExit = new javax.swing.JPopupMenu.Separator(); exitMenuItem = new javax.swing.JMenuItem(); jMenu2 = new javax.swing.JMenu(); textWrapMenuItem = new javax.swing.JCheckBoxMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); setTitle("JPad"); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { formWindowClosing(evt);// w w w . j av a 2s.c o m } }); mainTextArea.setColumns(20); mainTextArea.setLineWrap(true); mainTextArea.setRows(5); jScrollPane1.setViewportView(mainTextArea); textChanged(); jMenu1.setText("File"); openMenuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_O, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); openMenuItem.setText("Open..."); openMenuItem.setToolTipText("Open a file"); openMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { openMenuItemActionPerformed(evt); } }); jMenu1.add(openMenuItem); saveMenuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_S, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); saveMenuItem.setText("Save..."); saveMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveMenuItemActionPerformed(evt); } }); jMenu1.add(saveMenuItem); saveAsMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, (java.awt.event.InputEvent.SHIFT_MASK | (Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())))); saveAsMenuItem.setText("Save As..."); saveAsMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveAsMenuItemActionPerformed(evt); } }); jMenu1.add(saveAsMenuItem); jMenu1.add(seperator_OpenAndExit); exitMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.CTRL_MASK)); exitMenuItem.setText("Exit"); exitMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exitMenuItemActionPerformed(evt); } }); jMenu1.add(exitMenuItem); if (_isOSX) { exitMenuItem.getParent().remove(exitMenuItem); } jMenuBar1.add(jMenu1); jMenu2.setText("Edit"); textWrapMenuItem.setText("Text Wrap"); textWrapMenuItem.setToolTipText("Enables or disables text wrap"); textWrapMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { textWrapMenuItemActionPerformed(evt); } }); jMenu2.add(textWrapMenuItem); if (mainTextArea.getLineWrap() == true) { textWrapMenuItem.setSelected(true); } else { textWrapMenuItem.setSelected(false); } jMenuBar1.add(jMenu2); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 581, Short.MAX_VALUE)); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 543, Short.MAX_VALUE)); pack(); }
From source file:at.becast.youploader.gui.FrmMain.java
public void initMainTab() { cmbCategory = new JComboBox<Categories>(); cmbCategory.setModel(new DefaultComboBoxModel<Categories>(Categories.values())); SideBar sideBar = new SideBar(SideBar.SideBarMode.TOP_LEVEL, true, 300, true); ss1 = new SidebarSection(sideBar, LANG.getString("frmMain.Sidebar.Settings"), new EditPanel(this), new ImageIcon(getClass().getResource("/pencil.png"))); ss2 = new SidebarSection(sideBar, LANG.getString("frmMain.Sidebar.Playlists"), new PlaylistPanel(this), new ImageIcon(getClass().getResource("/layers.png"))); ss3 = new SidebarSection(sideBar, LANG.getString("frmMain.Sidebar.Monetisation"), new MonetPanel(), new ImageIcon(getClass().getResource("/money.png"))); sideBar.addSection(ss1, false);//from w w w .j a v a 2 s . c o m sideBar.addSection(ss2); sideBar.addSection(ss3); JPanel mainTab = new JPanel(); JPanel panel = new JPanel(); GroupLayout mainTabLayout = new GroupLayout(mainTab); mainTabLayout.setHorizontalGroup(mainTabLayout.createParallelGroup(Alignment.TRAILING) .addGroup(mainTabLayout.createSequentialGroup() .addComponent(panel, GroupLayout.DEFAULT_SIZE, 465, Short.MAX_VALUE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(sideBar, GroupLayout.DEFAULT_SIZE, 408, Short.MAX_VALUE))); mainTabLayout.setVerticalGroup(mainTabLayout.createParallelGroup(Alignment.LEADING) .addComponent(panel, GroupLayout.DEFAULT_SIZE, 492, Short.MAX_VALUE) .addGroup(mainTabLayout.createSequentialGroup() .addComponent(sideBar, GroupLayout.DEFAULT_SIZE, 469, Short.MAX_VALUE).addContainerGap())); panel.setLayout(new FormLayout( new ColumnSpec[] { ColumnSpec.decode("2px"), FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("20px:grow"), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("23px"), ColumnSpec.decode("33px"), FormSpecs.UNRELATED_GAP_COLSPEC, ColumnSpec.decode("61px"), FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("24px"), ColumnSpec.decode("28px"), ColumnSpec.decode("40px"), ColumnSpec.decode("36px"), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("28px"), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("58px"), }, new RowSpec[] { RowSpec.decode("2px"), FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("14px"), RowSpec.decode("25px"), FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("14px"), RowSpec.decode("25px"), FormSpecs.LINE_GAP_ROWSPEC, RowSpec.decode("14px"), RowSpec.decode("25px"), FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, RowSpec.decode("64dlu:grow"), FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, RowSpec.decode("max(64dlu;default)"), FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, RowSpec.decode("25px"), FormSpecs.PARAGRAPH_GAP_ROWSPEC, RowSpec.decode("24px"), RowSpec.decode("23px"), })); lbltitlelenght = new JLabel("(0/100)"); panel.add(lbltitlelenght, "14, 6, 3, 1, right, top"); txtTitle = new JTextField(); contextMenu.add(txtTitle); panel.add(txtTitle, "3, 7, 14, 1, fill, fill"); txtTitle.setColumns(10); txtTitle.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { calcNotifies(); } }); JLabel lblCategory = new JLabel(LANG.getString("frmMain.Category")); panel.add(lblCategory, "3, 9, 4, 1, left, bottom"); panel.add(cmbCategory, "3, 10, 14, 1, fill, fill"); JLabel lblDescription = new JLabel(LANG.getString("frmMain.Description")); panel.add(lblDescription, "3, 12, 4, 1, left, bottom"); lblDesclenght = new JLabel("(0/5000)"); panel.add(lblDesclenght, "14, 12, 3, 1, right, bottom"); JScrollPane DescriptionScrollPane = new JScrollPane(); panel.add(DescriptionScrollPane, "3, 13, 14, 1, fill, fill"); txtDescription = new JTextArea(); contextMenu.add(txtDescription); txtDescription.setFont(new Font("SansSerif", Font.PLAIN, 13)); DescriptionScrollPane.setViewportView(txtDescription); txtDescription.setWrapStyleWord(true); txtDescription.setLineWrap(true); txtDescription.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { calcNotifies(); } }); JLabel lblTags = new JLabel(LANG.getString("frmMain.Tags")); panel.add(lblTags, "3, 15, 4, 1, left, bottom"); lblTagslenght = new JLabel("(0/500)"); panel.add(lblTagslenght, "14, 15, 3, 1, right, top"); JScrollPane TagScrollPane = new JScrollPane(); panel.add(TagScrollPane, "3, 16, 14, 1, fill, fill"); txtTags = new JTextArea(); contextMenu.add(txtTags); txtTags.setFont(new Font("SansSerif", Font.PLAIN, 13)); TagScrollPane.setViewportView(txtTags); txtTags.setWrapStyleWord(true); txtTags.setLineWrap(true); txtTags.setBorder(BorderFactory.createEtchedBorder()); txtTags.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { calcNotifies(); } }); JLabel lblAccount = new JLabel(LANG.getString("frmMain.Account")); panel.add(lblAccount, "3, 18, 4, 1, left, bottom"); cmbAccount = new JComboBox<AccountType>(); panel.add(getCmbAccount(), "3, 19, 14, 1, fill, fill"); cmbAccount.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { changeUser(); } }); btnAddToQueue = new JButton(LANG.getString("frmMain.addtoQueue")); btnAddToQueue.setEnabled(false); panel.add(btnAddToQueue, "3, 21, 6, 1, fill, fill"); btnAddToQueue.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { queueButton(); } }); JLabel lblSelectVideo = new JLabel(); panel.add(lblSelectVideo, "3, 3, 4, 1, left, bottom"); lblSelectVideo.setText(LANG.getString("frmMain.selectVideoFile")); cmbFile = new JComboBox<String>(); cmbFile.setDropTarget(new DropTarget() { private static final long serialVersionUID = 8809983794742040683L; public synchronized void drop(DropTargetDropEvent evt) { try { evt.acceptDrop(DnDConstants.ACTION_COPY); @SuppressWarnings("unchecked") List<File> droppedFiles = (List<File>) evt.getTransferable() .getTransferData(DataFlavor.javaFileListFlavor); for (File file : droppedFiles) { cmbFile.removeAllItems(); cmbFile.addItem(file.getAbsolutePath()); } } catch (Exception ex) { LOG.error("Error dropping video file", ex); } } }); panel.add(cmbFile, "3, 4, 14, 1, fill, fill"); JButton btnSelectMovie = new JButton(); btnSelectMovie.setToolTipText("Select Video File"); panel.add(btnSelectMovie, "18, 4, center, top"); btnSelectMovie.setIcon(new ImageIcon(getClass().getResource("/film_add.png"))); JLabel lblTitle = new JLabel(LANG.getString("frmMain.Title")); panel.add(lblTitle, "3, 6, 4, 1, left, bottom"); JButton btnReset = new JButton(LANG.getString("frmMain.Reset")); btnReset.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { resetEdit(); } }); panel.add(btnReset, "11, 21, 6, 1, fill, fill"); btnSelectMovie.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { EditPanel edit = (EditPanel) ss1.contentPane; NativeJFileChooser chooser; if (edit.getTxtStartDir() != null && !edit.getTxtStartDir().equals("")) { chooser = new NativeJFileChooser(edit.getTxtStartDir().getText().trim()); } else { chooser = new NativeJFileChooser(); } int returnVal = chooser.showOpenDialog((Component) self); if (returnVal == JFileChooser.APPROVE_OPTION) { cmbFile.removeAllItems(); cmbFile.addItem(chooser.getSelectedFile().getAbsolutePath().toString()); } } }); mainTab.setLayout(mainTabLayout); mainTab.revalidate(); mainTab.repaint(); TabbedPane.addTab(LANG.getString("frmMain.Tabs.VideoSettings"), mainTab); }
From source file:beproject.MainGUI.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 a v a2s. c o m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { isSequelButtonGroup = new javax.swing.ButtonGroup(); categoryButtonGroup = new javax.swing.ButtonGroup(); jSplitPane2 = new javax.swing.JSplitPane(); jPanel2 = new javax.swing.JPanel(); movieNameTextField = new javax.swing.JTextField(); releaseDateTextField = new javax.swing.JFormattedTextField(); isSequelYesRadioButton = new javax.swing.JRadioButton(); isSequelNoRadioButton = new javax.swing.JRadioButton(); jLabel1 = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); cat1CheckBox = new javax.swing.JCheckBox(); cat2CheckBox = new javax.swing.JCheckBox(); cat3CheckBox = new javax.swing.JCheckBox(); cat4CheckBox = new javax.swing.JCheckBox(); cat5CheckBox = new javax.swing.JCheckBox(); scheduleButton = new javax.swing.JButton(); jLabel3 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jLabel13 = new javax.swing.JLabel(); jPanel6 = new javax.swing.JPanel(); actorTwitterHandleTextField = new javax.swing.JTextField(); actorNameTextField = new javax.swing.JTextField(); jLabel7 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel10 = new javax.swing.JLabel(); addButton = new javax.swing.JButton(); jLabel11 = new javax.swing.JLabel(); jLabel12 = new javax.swing.JLabel(); jLabel14 = new javax.swing.JLabel(); jLabel15 = new javax.swing.JLabel(); theatreTextField = new javax.swing.JTextField(); jLabel16 = new javax.swing.JLabel(); jTabbedPane2 = new javax.swing.JTabbedPane(); predictionPanel = new javax.swing.JPanel(); movieNamesComboBox = new javax.swing.JComboBox(); jScrollPane2 = new javax.swing.JScrollPane(); predictionTextArea = new javax.swing.JTextArea(); jLabel2 = new javax.swing.JLabel(); getPredictionButton = new javax.swing.JButton(); hypeAnalysisPanel = new javax.swing.JPanel(); jSplitPane1 = new javax.swing.JSplitPane(); jPanel3 = new javax.swing.JPanel(); jSplitPane3 = new javax.swing.JSplitPane(); sentimentPanel = new javax.swing.JPanel(); countryPanel = new javax.swing.JPanel(); timeLinePanel = new javax.swing.JPanel(); tweetsPanel = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); tweetTable = new javax.swing.JTable(); nextButton = new javax.swing.JButton(); prevButton = new javax.swing.JButton(); liveTweetsAnalysisPanel = new javax.swing.JPanel(); mapPanel = new javax.swing.JPanel(); jToolBar1 = new javax.swing.JToolBar(); twitterStatusLabel = new javax.swing.JLabel(); jSeparator2 = new javax.swing.JToolBar.Separator(); internetConnectionLabel = new javax.swing.JLabel(); jSeparator3 = new javax.swing.JToolBar.Separator(); databaseConnectionLabel = new javax.swing.JLabel(); jMenuBar1 = new javax.swing.JMenuBar(); fileMenu = new javax.swing.JMenu(); jMenuItem1 = new javax.swing.JMenuItem(); jMenu1 = new javax.swing.JMenu(); startStreamingCheckBoxMenuItem = new javax.swing.JCheckBoxMenuItem(); helpMenu = new javax.swing.JMenu(); ContentsMenuItem = new javax.swing.JMenuItem(); aboutMenuItem = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); setTitle("Hype Analyzer"); setBounds(new java.awt.Rectangle(0, 0, 500, 500)); setMinimumSize(null); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { formWindowClosing(evt); } }); addComponentListener(new java.awt.event.ComponentAdapter() { public void componentShown(java.awt.event.ComponentEvent evt) { formComponentShown(evt); } }); jSplitPane2.setDividerLocation(450); jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); movieNameTextField.setColumns(5); movieNameTextField.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { movieNameTextFieldMouseClicked(evt); } }); movieNameTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { movieNameTextFieldActionPerformed(evt); } }); movieNameTextField.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { movieNameTextFieldFocusGained(evt); } }); jPanel2.add(movieNameTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 10, 137, 30)); try { releaseDateTextField.setFormatterFactory( new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##-##-####"))); } catch (java.text.ParseException ex) { ex.printStackTrace(); } jPanel2.add(releaseDateTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 50, 137, 32)); isSequelButtonGroup.add(isSequelYesRadioButton); isSequelYesRadioButton.setText("Yes"); isSequelYesRadioButton.setName("isSequelRadio"); // NOI18N isSequelYesRadioButton.setOpaque(false); isSequelYesRadioButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { isSequelYesRadioButtonActionPerformed(evt); } }); jPanel2.add(isSequelYesRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 210, -1, -1)); isSequelButtonGroup.add(isSequelNoRadioButton); isSequelNoRadioButton.setSelected(true); isSequelNoRadioButton.setText("No"); isSequelNoRadioButton.setName("isSequelRadio"); // NOI18N jPanel2.add(isSequelNoRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 210, -1, -1)); jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel1.setText("Is Sequel?"); jPanel2.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(80, 210, -1, 20)); jPanel1.setBackground(new java.awt.Color(255, 255, 255)); jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jPanel1.setName("Category"); // NOI18N cat1CheckBox.setBackground(new java.awt.Color(255, 255, 255)); cat1CheckBox.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N cat1CheckBox.setText("Action"); cat2CheckBox.setBackground(new java.awt.Color(255, 255, 255)); cat2CheckBox.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N cat2CheckBox.setText("Animation"); cat3CheckBox.setBackground(new java.awt.Color(255, 255, 255)); cat3CheckBox.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N cat3CheckBox.setText("Thriller"); cat4CheckBox.setBackground(new java.awt.Color(255, 255, 255)); cat4CheckBox.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N cat4CheckBox.setText("Romance"); cat5CheckBox.setBackground(new java.awt.Color(255, 255, 255)); cat5CheckBox.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N cat5CheckBox.setText("Comedy"); 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(60, 60, 60).addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addComponent(cat5CheckBox) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel1Layout.createSequentialGroup().addComponent(cat3CheckBox) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 111, Short.MAX_VALUE) .addComponent(cat4CheckBox)) .addGroup(jPanel1Layout.createSequentialGroup().addComponent(cat1CheckBox) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(cat2CheckBox))) .addGap(111, 111, 111))))); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cat1CheckBox).addComponent(cat2CheckBox)) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(cat4CheckBox).addComponent(cat3CheckBox)) .addGap(18, 18, 18).addComponent(cat5CheckBox).addContainerGap(14, Short.MAX_VALUE))); jPanel2.add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 260, 430, 130)); scheduleButton.setText("Schedule"); scheduleButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { scheduleButtonActionPerformed(evt); } }); jPanel2.add(scheduleButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 460, -1, -1)); jLabel3.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel3.setText("Release Date:"); jPanel2.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 60, -1, -1)); jLabel5.setForeground(new java.awt.Color(255, 0, 0)); jLabel5.setText("*"); jPanel2.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 10, -1, -1)); jLabel6.setForeground(new java.awt.Color(255, 0, 0)); jLabel6.setText("*"); jPanel2.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 50, -1, -1)); jLabel8.setForeground(new java.awt.Color(255, 0, 0)); jLabel8.setText("*"); jPanel2.add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 210, -1, -1)); jLabel13.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel13.setText("Number of theatres movie is to be released:"); jPanel2.add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 400, -1, -1)); jPanel6.setBackground(new java.awt.Color(255, 255, 255)); jPanel6.setBorder(javax.swing.BorderFactory.createEtchedBorder()); actorNameTextField.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { actorNameTextFieldMouseClicked(evt); } }); actorNameTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { actorNameTextFieldActionPerformed(evt); } }); actorNameTextField.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { actorNameTextFieldFocusGained(evt); } }); jLabel7.setForeground(new java.awt.Color(255, 0, 0)); jLabel7.setText("*"); jLabel4.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel4.setText("Actor Name:"); jLabel10.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel10.setText("Actor Twitter Handle:"); addButton.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N addButton.setText("Add this actor"); addButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { addButtonActionPerformed(evt); } }); jLabel11.setForeground(new java.awt.Color(255, 0, 0)); jLabel11.setText("*"); javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6); jPanel6.setLayout(jPanel6Layout); jPanel6Layout.setHorizontalGroup(jPanel6Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel10).addComponent(jLabel4)) .addGap(28, 28, 28) .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup() .addComponent(actorTwitterHandleTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel11)) .addGroup(jPanel6Layout.createSequentialGroup() .addComponent(actorNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel7))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(addButton) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel7) .addComponent(actorNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(actorTwitterHandleTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel10)) .addComponent(jLabel11)) .addContainerGap(19, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE).addComponent(addButton, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(26, 26, 26))); jPanel2.add(jPanel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 100, -1, 100)); jLabel12.setForeground(new java.awt.Color(255, 0, 0)); jLabel12.setText("*"); jPanel2.add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 50, -1, -1)); jLabel14.setForeground(new java.awt.Color(255, 0, 0)); jLabel14.setText("*"); jPanel2.add(jLabel14, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 10, -1, -1)); jLabel15.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel15.setText("Movie Name: "); jPanel2.add(jLabel15, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 20, -1, -1)); theatreTextField.setColumns(5); theatreTextField.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { theatreTextFieldMouseClicked(evt); } }); theatreTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { theatreTextFieldActionPerformed(evt); } }); theatreTextField.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { theatreTextFieldFocusGained(evt); } }); jPanel2.add(theatreTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 420, 137, 30)); jLabel16.setForeground(new java.awt.Color(255, 0, 0)); jLabel16.setText("*"); jPanel2.add(jLabel16, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 420, -1, -1)); jSplitPane2.setLeftComponent(jPanel2); jTabbedPane2.setName(""); // NOI18N jTabbedPane2.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { jTabbedPane2StateChanged(evt); } }); predictionPanel.setName("predictionPanel"); // NOI18N predictionPanel.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentShown(java.awt.event.ComponentEvent evt) { predictionPanelComponentShown(evt); } }); movieNamesComboBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { movieNamesComboBoxActionPerformed(evt); } }); predictionTextArea.setColumns(20); predictionTextArea.setRows(5); jScrollPane2.setViewportView(predictionTextArea); jLabel2.setText("Prediction:"); getPredictionButton.setText("Get Prediction"); getPredictionButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { getPredictionButtonActionPerformed(evt); } }); javax.swing.GroupLayout predictionPanelLayout = new javax.swing.GroupLayout(predictionPanel); predictionPanel.setLayout(predictionPanelLayout); predictionPanelLayout.setHorizontalGroup( predictionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(movieNamesComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(predictionPanelLayout.createSequentialGroup() .addGroup(predictionPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(predictionPanelLayout.createSequentialGroup().addGap(20, 20, 20) .addComponent(jLabel2).addGap(0, 0, Short.MAX_VALUE)) .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING)) .addContainerGap()) .addGroup(predictionPanelLayout.createSequentialGroup().addGap(239, 239, 239) .addComponent(getPredictionButton).addContainerGap(158, Short.MAX_VALUE))); predictionPanelLayout.setVerticalGroup(predictionPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(predictionPanelLayout.createSequentialGroup() .addComponent(movieNamesComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(46, 46, 46).addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 258, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(getPredictionButton).addGap(0, 174, Short.MAX_VALUE))); movieNamesComboBox.getAccessibleContext().setAccessibleParent(predictionPanel); jTabbedPane2.addTab("Prediction", predictionPanel); hypeAnalysisPanel.setName("hypeAnalysisPanel"); // NOI18N hypeAnalysisPanel.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentShown(java.awt.event.ComponentEvent evt) { hypeAnalysisPanelComponentShown(evt); } }); hypeAnalysisPanel.setLayout(new java.awt.BorderLayout()); jSplitPane1.setDividerLocation(300); jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); jPanel3.setLayout(new java.awt.BorderLayout()); jSplitPane1.setTopComponent(jPanel3); jSplitPane3.setDividerLocation(300); sentimentPanel.setLayout(new java.awt.BorderLayout()); jSplitPane3.setLeftComponent(sentimentPanel); countryPanel.setLayout(new java.awt.BorderLayout()); jSplitPane3.setRightComponent(countryPanel); jSplitPane1.setRightComponent(jSplitPane3); hypeAnalysisPanel.add(jSplitPane1, java.awt.BorderLayout.CENTER); jTabbedPane2.addTab("Hype Analysis", hypeAnalysisPanel); timeLinePanel.setName("timeLinePanel"); // NOI18N timeLinePanel.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentHidden(java.awt.event.ComponentEvent evt) { timeLinePanelComponentHidden(evt); } public void componentShown(java.awt.event.ComponentEvent evt) { timeLinePanelComponentShown(evt); } }); timeLinePanel.setLayout(new java.awt.BorderLayout()); jTabbedPane2.addTab("Time Line", timeLinePanel); tweetsPanel.setName("tweetsPanel"); // NOI18N tweetsPanel.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentShown(java.awt.event.ComponentEvent evt) { tweetsPanelComponentShown(evt); } }); tweetTable.setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null }, { null, null } }, new String[] { "Tweet", "Polarity" }) { Class[] types = new Class[] { java.lang.String.class, java.lang.Integer.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]; } }); jScrollPane1.setViewportView(tweetTable); if (tweetTable.getColumnModel().getColumnCount() > 0) { tweetTable.getColumnModel().getColumn(0).setPreferredWidth(400); } nextButton.setText("Next>>"); nextButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { nextButtonActionPerformed(evt); } }); prevButton.setText("<<Prev"); prevButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { prevButtonActionPerformed(evt); } }); javax.swing.GroupLayout tweetsPanelLayout = new javax.swing.GroupLayout(tweetsPanel); tweetsPanel.setLayout(tweetsPanelLayout); tweetsPanelLayout .setHorizontalGroup(tweetsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(tweetsPanelLayout.createSequentialGroup().addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 476, Short.MAX_VALUE) .addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, tweetsPanelLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(prevButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(nextButton).addGap(35, 35, 35))); tweetsPanelLayout.setVerticalGroup(tweetsPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(tweetsPanelLayout.createSequentialGroup().addGap(31, 31, 31) .addGroup(tweetsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(prevButton).addComponent(nextButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 488, Short.MAX_VALUE) .addContainerGap())); jTabbedPane2.addTab("Tweets", tweetsPanel); liveTweetsAnalysisPanel.setName("liveTweetsAnalysisPanel"); // NOI18N liveTweetsAnalysisPanel.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentShown(java.awt.event.ComponentEvent evt) { liveTweetsAnalysisPanelComponentShown(evt); } }); liveTweetsAnalysisPanel.setLayout(new java.awt.BorderLayout()); jTabbedPane2.addTab("Live Tweet Analysis", liveTweetsAnalysisPanel); mapPanel.setName("mapPanel"); // NOI18N mapPanel.setLayout(new java.awt.BorderLayout()); jTabbedPane2.addTab("Map", mapPanel); jSplitPane2.setRightComponent(jTabbedPane2); jToolBar1.setRollover(true); jToolBar1.setFocusable(false); twitterStatusLabel.setText("TWITTER STATUS: Not gathering tweets | Running as Client"); jToolBar1.add(twitterStatusLabel); jToolBar1.add(jSeparator2); internetConnectionLabel.setText("No Internet Connection"); jToolBar1.add(internetConnectionLabel); jToolBar1.add(jSeparator3); databaseConnectionLabel.setText("No database detected"); jToolBar1.add(databaseConnectionLabel); fileMenu.setText("File"); jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.CTRL_MASK)); jMenuItem1.setText("Quit"); jMenuItem1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem1ActionPerformed(evt); } }); fileMenu.add(jMenuItem1); jMenuBar1.add(fileMenu); jMenu1.setText("Twitter"); startStreamingCheckBoxMenuItem.setText("Start Streaming"); startStreamingCheckBoxMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { startStreamingCheckBoxMenuItemActionPerformed(evt); } }); jMenu1.add(startStreamingCheckBoxMenuItem); jMenuBar1.add(jMenu1); helpMenu.setText("Help"); helpMenu.setName("Help"); // NOI18N helpMenu.setPreferredSize(new java.awt.Dimension(29, 19)); ContentsMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0)); ContentsMenuItem.setText("Contents"); helpMenu.add(ContentsMenuItem); aboutMenuItem.setText("About"); aboutMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { aboutMenuItemActionPerformed(evt); } }); helpMenu.add(aboutMenuItem); jMenuBar1.add(helpMenu); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jSplitPane2).addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addComponent(jSplitPane2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))); pack(); }
From source file:gtu.zcognos.DimensionUI.java
private void initGUI() { try {/*from w w w . ja va 2s . c o m*/ final SwingActionUtil swingUtil = (SwingActionUtil) SwingActionUtil.newInstance(this); { GroupLayout thisLayout = new GroupLayout((JComponent) getContentPane()); getContentPane().setLayout(thisLayout); this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); { projectId = new JTextField(); } { jLabel1 = new JLabel(); jLabel1.setText("PROJECT_ID"); } { create = new JButton(); create.setText("create"); create.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { swingUtil.invokeAction("create.actionPerformed", evt); } }); } { reportId = new JTextField(); } { jLabel8 = new JLabel(); jLabel8.setText("report id"); } { addDimensionFromDb = new JButton(); addDimensionFromDb.setText("add from db"); addDimensionFromDb.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { swingUtil.invokeAction("addFromDb.actionPerformed", evt); } }); } { dataSourceTable = new JTextField(); dataSourceTable.setText("rscdpg0901"); } { jLabel7 = new JLabel(); jLabel7.setText("data source table"); } { addDimension = new JButton(); addDimension.setText("add"); addDimension.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { swingUtil.invokeAction("add.actionPerformed", evt); } }); } { dimensionName = new JTextField(); } { jLabel6 = new JLabel(); jLabel6.setText("dimension chinese name"); } { jLabel5 = new JLabel(); jLabel5.setText("rscdzzzz id index"); } { String[] idx = new String[20]; for (int ii = 0; ii < idx.length; ii++) { idx[ii] = "id" + (ii + 1); } ComboBoxModel rscdzzzzIdIndexModel = new DefaultComboBoxModel(idx); rscdzzzzIdIndex = new JComboBox(); rscdzzzzIdIndex.setModel(rscdzzzzIdIndexModel); } { jLabel3 = new JLabel(); jLabel3.setText("Dimension"); } { jScrollPane1 = new JScrollPane(); { DefaultListModel dimensionListModel = new DefaultListModel(); dimensionList = new JList(); jScrollPane1.setViewportView(dimensionList); dimensionList.setModel(dimensionListModel); dimensionList.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent evt) { JListUtil.newInstance(dimensionList).defaultJListKeyPressed(evt); } }); } } { exportDir = new JButton(); exportDir.setText("export dir"); exportDir.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { swingUtil.invokeAction("exportDir.actionPerformed", evt); } }); } { category = new JTextField(); } { jLabel4 = new JLabel(); jLabel4.setText("category"); } { tableName = new JTextField(); } { jLabel2 = new JLabel(); jLabel2.setText("merge table name"); } thisLayout .setHorizontalGroup(thisLayout.createSequentialGroup().addContainerGap(12, 12) .addGroup(thisLayout.createParallelGroup() .addComponent(jLabel3, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 196, GroupLayout.PREFERRED_SIZE) .addGroup(thisLayout.createSequentialGroup().addGap(19).addGroup(thisLayout .createParallelGroup().addGroup(thisLayout.createSequentialGroup() .addComponent(exportDir, GroupLayout.PREFERRED_SIZE, 119, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent( addDimension, GroupLayout.PREFERRED_SIZE, 119, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(thisLayout.createParallelGroup().addComponent( addDimensionFromDb, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 191, GroupLayout.PREFERRED_SIZE) .addGroup(thisLayout.createSequentialGroup().addGap( 88) .addComponent(create, GroupLayout.PREFERRED_SIZE, 119, GroupLayout.PREFERRED_SIZE)))) .addGroup(thisLayout.createSequentialGroup().addGroup(thisLayout .createParallelGroup() .addComponent(jLabel6, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 196, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel5, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 196, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 196, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel8, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 196, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 196, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel7, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 196, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 196, GroupLayout.PREFERRED_SIZE)) .addGap(39) .addGroup(thisLayout.createParallelGroup() .addComponent(dimensionName, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 204, GroupLayout.PREFERRED_SIZE) .addComponent(rscdzzzzIdIndex, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 204, GroupLayout.PREFERRED_SIZE) .addComponent(category, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 204, GroupLayout.PREFERRED_SIZE) .addComponent(reportId, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 204, GroupLayout.PREFERRED_SIZE) .addComponent(tableName, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 204, GroupLayout.PREFERRED_SIZE) .addComponent(dataSourceTable, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 204, GroupLayout.PREFERRED_SIZE) .addComponent(projectId, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 204, GroupLayout.PREFERRED_SIZE))) .addComponent(jScrollPane1, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 436, GroupLayout.PREFERRED_SIZE)))) .addContainerGap(11, 11)); thisLayout.setVerticalGroup(thisLayout.createSequentialGroup().addContainerGap(12, 12) .addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(projectId, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(dataSourceTable, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel7, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(tableName, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(reportId, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel8, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(category, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(thisLayout.createParallelGroup() .addComponent(jLabel5, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(rscdzzzzIdIndex, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(dimensionName, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel6, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(thisLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(addDimension, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(exportDir, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(addDimensionFromDb, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGap(11) .addComponent(jScrollPane1, GroupLayout.PREFERRED_SIZE, 269, GroupLayout.PREFERRED_SIZE) .addGap(12).addComponent(create, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addContainerGap(9, 9)); } this.setSize(513, 632); swingUtil.addAction("exportDir.actionPerformed", new Action() { public void action(EventObject evt) throws Exception { File file = JFileChooserUtil.newInstance().selectDirectoryOnly().showOpenDialog() .getApproveSelectedFile(); if (file != null) { baseDir = file; } } }); swingUtil.addAction("addFromDb.actionPerformed", new Action() { public void action(EventObject evt) throws Exception { String project = projectId.getText(); Validate.notEmpty(project, "projectId is null"); Validate.notEmpty(dataSourceTable.getText(), "dataSourceTable is null"); DefaultListModel model = (DefaultListModel) dimensionList.getModel(); for (Dimension_ ddd : InformixDbConn.queryGetDaminsion(dataSourceTable.getText(), project)) { model.addElement(ddd); } } }); swingUtil.addAction("add.actionPerformed", new Action() { public void action(EventObject evt) throws Exception { // Validate.notEmpty(tableName.getText(), // "tableName is null"); Validate.notEmpty(category.getText(), "category is null"); Validate.notEmpty(dimensionName.getText(), "dimensionName is null"); Validate.notEmpty(dataSourceTable.getText(), "dataSourceTable is null"); // Validate.notEmpty(reportId.getText(), // "reportId is null"); String report_id = StringUtils.defaultString(reportId.getText(), projectId.getText()); String tName = tableName.getText(); if (StringUtils.isEmpty(tName)) { tName = randomTableName(); } DefaultListModel model = (DefaultListModel) dimensionList.getModel(); model.addElement(new Dimension_(dataSourceTable.getText(), tName, category.getText(), (String) rscdzzzzIdIndex.getSelectedItem(), dimensionName.getText(), report_id)); } }); swingUtil.addAction("create.actionPerformed", new Action() { public void action(EventObject evt) throws Exception { String project = projectId.getText(); Validate.notEmpty(project, "projectId is null"); Validate.notNull(baseDir, "exportDir is null"); File destDir = new File(baseDir, project); Map<String, Object> map = new HashMap<String, Object>(); List<Map<String, String>> llist = new ArrayList<Map<String, String>>(); int idx = 2; int categoryId = 1; DefaultListModel model = (DefaultListModel) dimensionList.getModel(); for (Enumeration<?> enu = model.elements(); enu.hasMoreElements();) { Dimension_ di = (Dimension_) enu.nextElement(); Map mmm = new HashMap(); mmm.put("rscdpg0901", di.dataSourceTable);// mmm.put("rscdpg0901a", di.tableName);// mmm.put("rscdpg0901a_category", di.category);// mmm.put("rscdpg0901a_report_id", di.reportId);// mmm.put("rscdzzzz_id", di.idIndex);// mmm.put("rscdpg0901a_dname", di.dimensionName);// llist.add(mmm); } map.put("PROJECT_ID", project); map.put("RSCDPG0901", llist); map.put("rscdpg0901", dataSourceTable.getText()); ConfigCopy.getInstance().applyBaseDir(baseDir).applyProjectId(project).execute(); Dimension.getInstance()// .applyDestDir(destDir.getAbsolutePath())// .applyParameter(map)// .execute(); JOptionPaneUtil.newInstance().iconInformationMessage() .showMessageDialog(project + " create completed!!\r\n dir : " // + destDir.getAbsolutePath(), project); Desktop.getDesktop().open(destDir); } }); } catch (Exception e) { e.printStackTrace(); } }
From source file:com.juanhg.triangle.TriangleApplet.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("Tensi\u00F3n:"); lblO1.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblTValue = new JLabel(); lblTValue.setText("0"); lblTValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel lblO2 = new JLabel("V:"); lblO2.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblVValue = new JLabel(); lblVValue.setText("0"); lblVValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblO3 = new JLabel("tfinal:"); lblO3.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblTfValue = new JLabel(); lblTfValue.setText("0"); lblTfValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel lblW = new JLabel("W:"); lblW.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblWValue = new JLabel(); lblWValue.setText("0"); lblWValue.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().addGap(22) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING, false) .addComponent(lblO2, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(lblO1, GroupLayout.DEFAULT_SIZE, 62, Short.MAX_VALUE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING, false) .addComponent(lblVValue, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(lblTValue, GroupLayout.DEFAULT_SIZE, 72, Short.MAX_VALUE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(lblO3, GroupLayout.DEFAULT_SIZE, 45, Short.MAX_VALUE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(lblTfValue, GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE)) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(lblW, GroupLayout.PREFERRED_SIZE, 45, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED).addComponent(lblWValue, GroupLayout.PREFERRED_SIZE, 115, GroupLayout.PREFERRED_SIZE))) .addContainerGap())); gl_panelOutputs//from w w w . ja v a2s .c o m .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.LEADING) .addGroup(gl_panelOutputs.createSequentialGroup().addComponent(lblO1) .addPreferredGap(ComponentPlacement.UNRELATED).addComponent(lblO2, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_panelOutputs.createSequentialGroup() .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE) .addComponent(lblTValue) .addComponent(lblO3, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent( lblTfValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelOutputs .createParallelGroup(Alignment.BASELINE) .addComponent(lblW, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblWValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addComponent(lblVValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)))) .addGap(107))); 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.LEADING) .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).addComponent( panelOutputs, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); gl_panel_control.setVerticalGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING) .addGroup(gl_panel_control.createSequentialGroup().addContainerGap() .addComponent(panelInputs, GroupLayout.DEFAULT_SIZE, 279, Short.MAX_VALUE) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(panelOutputs, GroupLayout.PREFERRED_SIZE, 105, GroupLayout.PREFERRED_SIZE) .addGap(13) .addComponent(panel_6, GroupLayout.PREFERRED_SIZE, 85, 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, 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(69, Short.MAX_VALUE))); panel_6.setLayout(gl_panel_6); JLabel lblNewLabel = new JLabel("GNU GENERAL PUBLIC LICENSE"); panelLicense.add(lblNewLabel); JLabel LabelI1 = new JLabel("Roz Est\u00E1tico"); LabelI1.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel labelI2 = new JLabel("Roz Din\u00E1mico"); labelI2.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel labelI3 = new JLabel("Masa"); labelI3.setFont(new Font("Tahoma", Font.PLAIN, 14)); JPanel panelTitle = new JPanel(); panelTitle.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null)); lblMudValue = new JLabel("0.1"); lblMudValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblMValue = new JLabel("10"); lblMValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblMueValue = new JLabel("0.4"); lblMueValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); sliderMue = new JSlider(); sliderMue.setMinimum(15); sliderMue.setMaximum(80); sliderMue.setMinorTickSpacing(1); sliderMue.setValue(40); sliderMue.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent event) { sliderI1Event(); } }); sliderMud = new JSlider(); sliderMud.setMinimum(5); sliderMud.setMaximum(15); sliderMud.setMinorTickSpacing(1); sliderMud.setValue(10); sliderMud.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { sliderI2Event(); } }); sliderIM = new JSlider(); sliderIM.setMinimum(1); sliderIM.setMaximum(20); sliderIM.setValue(10); sliderIM.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { sliderI3Event(); } }); JLabel lblI4 = new JLabel("\u00C1ngulo"); lblI4.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblZValue = new JLabel("45\u00BA"); lblZValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); sliderZ = new JSlider(); sliderZ.setMinimum(20); sliderZ.setMaximum(60); sliderZ.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent arg0) { sliderI4Event(); } }); sliderZ.setValue(45); sliderZ.setMinorTickSpacing(1); btnCilindro = new JButton(new ImageIcon(loadImage(cilindro))); btnCilindro.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { type = CILINDRO; btnCilindro.setEnabled(false); btnEsfera.setEnabled(true); btnCubo.setEnabled(true); chartTriangle.deleteAnnotation(pulleyAnnotation); pulleyAnnotation = chartTriangle.setImageAtPoint(pulleyImage1, xPulley, yPulley); updatePanels(); repaint(); } }); btnEsfera = new JButton(new ImageIcon(loadImage(esfera))); btnEsfera.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { type = ESFERA; btnCilindro.setEnabled(true); btnEsfera.setEnabled(false); btnCubo.setEnabled(true); chartTriangle.deleteAnnotation(pulleyAnnotation); pulleyAnnotation = chartTriangle.setImageAtPoint(pulleyImage2, xPulley, yPulley); updatePanels(); repaint(); } }); btnCubo = new JButton(new ImageIcon(loadImage(cubo))); btnCubo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { type = CUBO; btnCilindro.setEnabled(true); btnEsfera.setEnabled(true); btnCubo.setEnabled(false); chartTriangle.deleteAnnotation(pulleyAnnotation); pulleyAnnotation = chartTriangle.setImageAtPoint(pulleyImage3, xPulley, yPulley); updatePanels(); 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().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(lblMueValue, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE) .addComponent(lblMudValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE) .addComponent(lblMValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE)) .addGap(18) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING, false) .addComponent(sliderMue, 0, 0, Short.MAX_VALUE) .addComponent(sliderMud, 0, 0, Short.MAX_VALUE).addComponent( sliderIM, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE))) .addGroup(gl_panelInputs.createSequentialGroup() .addComponent(lblI4, GroupLayout.PREFERRED_SIZE, 120, GroupLayout.PREFERRED_SIZE) .addGap(18) .addComponent(lblZValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE) .addGap(18) .addComponent(sliderZ, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE))) .addGap(19)) .addGroup(Alignment.LEADING, gl_panelInputs.createSequentialGroup().addGap(35) .addComponent(btnCilindro, GroupLayout.PREFERRED_SIZE, 77, GroupLayout.PREFERRED_SIZE) .addGap(18) .addComponent(btnEsfera, GroupLayout.PREFERRED_SIZE, 77, GroupLayout.PREFERRED_SIZE) .addGap(18) .addComponent(btnCubo, GroupLayout.PREFERRED_SIZE, 77, GroupLayout.PREFERRED_SIZE) .addContainerGap(42, 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.createParallelGroup(Alignment.BASELINE) .addComponent(LabelI1).addComponent(lblMueValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addComponent(sliderMue, 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(lblMudValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addComponent(sliderMud, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGap(11) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING).addComponent(labelI3) .addComponent(lblMValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(sliderIM, 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(lblZValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(sliderZ, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGap(36) .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE) .addComponent(btnCubo, GroupLayout.PREFERRED_SIZE, 61, GroupLayout.PREFERRED_SIZE) .addComponent(btnEsfera, GroupLayout.PREFERRED_SIZE, 61, GroupLayout.PREFERRED_SIZE) .addComponent(btnCilindro, GroupLayout.PREFERRED_SIZE, 61, GroupLayout.PREFERRED_SIZE)) .addContainerGap())); 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, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel_visualizar, GroupLayout.PREFERRED_SIZE, 696, GroupLayout.PREFERRED_SIZE) .addContainerGap(149, Short.MAX_VALUE))); groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.TRAILING) .addGroup(groupLayout.createSequentialGroup().addContainerGap() .addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false) .addComponent(panel_visualizar, Alignment.TRAILING, 0, 0, Short.MAX_VALUE) .addComponent(panel_control, Alignment.TRAILING, GroupLayout.PREFERRED_SIZE, 568, Short.MAX_VALUE)) .addContainerGap())); JPanel panel = new JPanel(); panelGrafica = new JPanelGrafica(); GroupLayout gl_panel = new GroupLayout(panel); gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(Alignment.LEADING).addComponent(panelGrafica, GroupLayout.DEFAULT_SIZE, 686, Short.MAX_VALUE)); gl_panel.setVerticalGroup(gl_panel.createParallelGroup(Alignment.LEADING).addComponent(panelGrafica, GroupLayout.DEFAULT_SIZE, 567, Short.MAX_VALUE)); panel.setLayout(gl_panel); GroupLayout gl_panel_visualizar = new GroupLayout(panel_visualizar); gl_panel_visualizar.setHorizontalGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_visualizar.createSequentialGroup().addContainerGap() .addComponent(panel, GroupLayout.PREFERRED_SIZE, 414, GroupLayout.PREFERRED_SIZE) .addContainerGap(272, Short.MAX_VALUE))); gl_panel_visualizar.setVerticalGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_visualizar.createSequentialGroup().addContainerGap() .addComponent(panel, GroupLayout.DEFAULT_SIZE, 546, Short.MAX_VALUE).addContainerGap())); panel_visualizar.setLayout(gl_panel_visualizar); getContentPane().setLayout(groupLayout); }
From source file:it.isislab.dmason.util.SystemManagement.Worker.thrower.DMasonWorkerWithGui.java
private void initComponents() { scrollPane1 = new JScrollPane(); textArea = new JTextArea(); textArea.setEditable(false);/*from w w w. j a v a2 s . co m*/ btnConnect = new JButton(); label1 = new JLabel(); label2 = new JLabel(); cmbPort = new JComboBox(); label3 = new JLabel(); labelnumber = new JLabel(); lblLogo = new JLabel(); cmbIp = new JComboBox(); //======== this ======== setTitle(Release.PRODUCT_RELEASE + " Worker " + VERSION); Container contentPane = getContentPane(); //======== scrollPane1 ======== { scrollPane1.setViewportView(textArea); } //---- btnConnect ---- btnConnect.setText("Connect"); btnConnect.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnConnectOnClick(e); } }); //---- label1 ---- label1.setText("Server IP:"); //---- label2 ---- label2.setText("Server port:"); //---- label3 ---- label3.setText(""); //---- labelnumber ---- labelnumber.setText(""); //---- label4 ---- lblLogo.setText("Distributed Mason 'failed to load image'"); lblLogo.setIcon(new ImageIcon("resources/image/carmineworker.png")); //---- comboBox ---- cmbIp.setEditable(true); cmbPort.setEditable(true); try { Scanner in = new Scanner(new FileInputStream("resources/files/urlworker")); while (in.hasNext()) { String line = in.nextLine(); String[] args = line.split(":"); cmbIp.addItem(args[0]); cmbPort.addItem(args[1]); } } catch (Exception e) { System.out.println("No worker story found!"); } cmbIp.setSelectedIndex(0); cmbPort.setSelectedIndex(0); GroupLayout contentPaneLayout = new GroupLayout(contentPane); contentPane.setLayout(contentPaneLayout); contentPaneLayout.setHorizontalGroup(contentPaneLayout.createParallelGroup().addGroup(contentPaneLayout .createSequentialGroup().addContainerGap() .addGroup(contentPaneLayout.createParallelGroup() .addComponent(lblLogo, GroupLayout.PREFERRED_SIZE, 400, GroupLayout.PREFERRED_SIZE) .addGroup(contentPaneLayout.createParallelGroup() .addGroup(contentPaneLayout.createSequentialGroup() .addGroup(contentPaneLayout.createParallelGroup().addComponent(label2) .addComponent(label1)) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(contentPaneLayout .createParallelGroup(GroupLayout.Alignment.LEADING, false) .addComponent(cmbPort).addComponent(cmbIp, 0, 119, Short.MAX_VALUE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(contentPaneLayout.createParallelGroup() .addGroup(contentPaneLayout.createSequentialGroup() .addGap(78, 78, 78).addComponent(btnConnect)) .addGroup(contentPaneLayout.createSequentialGroup() .addGap(46, 46, 46).addComponent(label3) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(labelnumber, GroupLayout.PREFERRED_SIZE, 69, GroupLayout.PREFERRED_SIZE)))) .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup().addGap(9, 9, 9) .addComponent(scrollPane1, GroupLayout.PREFERRED_SIZE, 366, GroupLayout.PREFERRED_SIZE) .addGap(462, 462, 462)))) .addGap(20, 20, 20))); contentPaneLayout.setVerticalGroup(contentPaneLayout.createParallelGroup() .addGroup(contentPaneLayout.createSequentialGroup().addContainerGap(21, Short.MAX_VALUE) .addComponent(lblLogo, GroupLayout.PREFERRED_SIZE, 102, GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(contentPaneLayout.createParallelGroup().addComponent(label1) .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(btnConnect).addComponent(cmbIp, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.TRAILING) .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(label2).addComponent(cmbPort, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(label3).addComponent(labelnumber))) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(scrollPane1, GroupLayout.PREFERRED_SIZE, 238, GroupLayout.PREFERRED_SIZE) .addGap(16, 16, 16))); setSize(410, 495); setLocationRelativeTo(getOwner()); }
From source file:SuitaDetails.java
public void showSuiteLib() { JScrollPane jScrollPane1 = new JScrollPane(); JList jList1 = new JList(); JPanel libraries = new JPanel(); jScrollPane1.setViewportView(jList1); GroupLayout layout = new GroupLayout(libraries); libraries.setLayout(layout);// w ww . j a v a 2s.c o m layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)); layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)); try { Object[] s = (Object[]) RunnerRepository.getRPCClient().execute("getLibrariesList", new Object[] { RunnerRepository.user }); String[] libs = new String[s.length]; for (int i = 0; i < s.length; i++) { libs[i] = s[i].toString(); } ArrayList<Integer> ind = new ArrayList<Integer>(); jList1.setModel(new DefaultComboBoxModel(libs)); if (parent.getLibs() != null) { for (String st : parent.getLibs()) { for (int i = 0; i < libs.length; i++) { if (libs[i].equals(st)) { ind.add(new Integer(i)); } } } int[] indices = new int[ind.size()]; for (int i = 0; i < ind.size(); i++) { indices[i] = ind.get(i); } jList1.setSelectedIndices(indices); } } catch (Exception e) { System.out.println("There was an error on calling getLibrariesList on CE"); e.printStackTrace(); } int resp = (Integer) CustomDialog.showDialog(libraries, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, RunnerRepository.window, "Libraries", null); if (resp == JOptionPane.OK_OPTION) { Object[] val = jList1.getSelectedValues(); String[] libs = new String[val.length]; for (int s = 0; s < val.length; s++) { libs[s] = val[s].toString(); } parent.setLibs(libs); } }
From source file:com.juanhg.fridge.FridgeApplet.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("Tiempo On:"); lblO1.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblTValue = new JLabel(); lblTValue.setText("0"); lblTValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel lblO2 = new JLabel("Eficiencia:"); lblO2.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblEValue = new JLabel(); lblEValue.setText("0"); lblEValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel lblTiempoOff = new JLabel("Tiempo Off:"); lblTiempoOff.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblOffValue = new JLabel(); lblOffValue.setText("0"); lblOffValue.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, 351, Short.MAX_VALUE) .addGroup(gl_panelOutputs.createSequentialGroup().addGap(22) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addComponent(lblO2, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE) .addComponent(lblO1, GroupLayout.PREFERRED_SIZE, 77, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addComponent(lblEValue, GroupLayout.PREFERRED_SIZE, 65, GroupLayout.PREFERRED_SIZE) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(lblTValue, GroupLayout.PREFERRED_SIZE, 52, GroupLayout.PREFERRED_SIZE) .addGap(31) .addComponent(lblTiempoOff, GroupLayout.PREFERRED_SIZE, 77, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(lblOffValue, GroupLayout.DEFAULT_SIZE, 62, Short.MAX_VALUE))) .addContainerGap())); gl_panelOutputs/*w w w . ja v a 2 s. co m*/ .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.LEADING) .addComponent(lblOffValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblTiempoOff, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addGroup(gl_panelOutputs.createSequentialGroup() .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE) .addComponent(lblO1).addComponent(lblTValue)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE) .addComponent(lblO2, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblEValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)))))); 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.TRAILING) .addGroup(gl_panel_control.createSequentialGroup().addContainerGap() .addComponent(panelInputs, GroupLayout.PREFERRED_SIZE, 305, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panelOutputs, GroupLayout.PREFERRED_SIZE, 100, Short.MAX_VALUE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel_6, GroupLayout.PREFERRED_SIZE, 76, 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(Alignment.TRAILING, 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(69, Short.MAX_VALUE))); panel_6.setLayout(gl_panel_6); JLabel lblNewLabel = new JLabel("GNU GENERAL PUBLIC LICENSE"); panelLicense.add(lblNewLabel); JLabel LabelI1 = new JLabel("Potencia"); LabelI1.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel labelI2 = new JLabel("T1"); labelI2.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel labelI3 = new JLabel("T2"); labelI3.setFont(new Font("Tahoma", Font.PLAIN, 14)); JPanel panelTitle = new JPanel(); panelTitle.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null)); lblT1Value = new JLabel("20"); lblT1Value.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblT2Value = new JLabel("-15"); lblT2Value.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblPValue = new JLabel("700"); lblPValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); sliderP = new JSlider(); sliderP.setMinimum(500); sliderP.setMaximum(1000); sliderP.setMinorTickSpacing(50); sliderP.setValue(700); sliderP.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent event) { sliderI1Event(); } }); sliderT1 = new JSlider(); sliderT1.setMinimum(18); sliderT1.setMaximum(30); sliderT1.setMinorTickSpacing(1); sliderT1.setValue(20); sliderT1.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { sliderI2Event(); } }); sliderT2 = new JSlider(); sliderT2.setMinimum(10); sliderT2.setMaximum(30); sliderT2.setValue(15); sliderT2.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { sliderI3Event(); } }); JLabel lblQo = new JLabel("Qo"); lblQo.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblQcValue = new JLabel("25"); lblQcValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); sliderQc = new JSlider(); sliderQc.setMinimum(10); sliderQc.setMaximum(50); sliderQc.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent arg0) { sliderI4Event(); } }); sliderQc.setValue(25); sliderQc.setMinorTickSpacing(1); btn1 = new JButton("1"); btn1.setFont(new Font("Tahoma", Font.PLAIN, 21)); btn1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { btnMilk.setEnabled(false); btnFish.setEnabled(false); btnMetal.setEnabled(false); btn1.setEnabled(false); btn2.setEnabled(true); sliderQc.setEnabled(true); lblQcValue.setText("" + sliderQc.getValue()); } }); btn2 = new JButton("2"); btn2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { btnMilk.setEnabled(true); btnFish.setEnabled(true); btnMetal.setEnabled(true); btn1.setEnabled(true); btn2.setEnabled(false); phase = 2; sliderQc.setEnabled(false); lblQcValue.setText("-"); } }); btn2.setFont(new Font("Tahoma", Font.PLAIN, 21)); fishImage = loadImage(fish); btnFish = new JButton(new ImageIcon(fishImage)); btnFish.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { btnFishFunction(); } }); milkImage = loadImage(milk); btnMilk = new JButton(new ImageIcon(milkImage)); btnMilk.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { btnMilkFunction(); } }); metalImage = loadImage(metal); btnMetal = new JButton(new ImageIcon(metalImage)); btnMetal.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { btnMetalFunction(); } }); GroupLayout gl_panelInputs = new GroupLayout(panelInputs); gl_panelInputs .setHorizontalGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(panelTitle, GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE) .addGroup(gl_panelInputs.createSequentialGroup().addGap(38).addGroup(gl_panelInputs .createParallelGroup(Alignment.LEADING).addGroup( gl_panelInputs.createSequentialGroup().addGap(36) .addComponent(btn1, GroupLayout.PREFERRED_SIZE, 80, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(btn2, GroupLayout.PREFERRED_SIZE, 80, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_panelInputs.createSequentialGroup().addGroup(gl_panelInputs .createParallelGroup(Alignment.LEADING, false) .addComponent(lblQo, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(labelI3, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(labelI2, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(LabelI1, GroupLayout.DEFAULT_SIZE, 66, Short.MAX_VALUE)) .addGap(18) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING, false) .addGroup(gl_panelInputs.createSequentialGroup() .addGroup(gl_panelInputs .createParallelGroup(Alignment.LEADING) .addComponent(lblPValue, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE) .addComponent(lblT1Value, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE) .addComponent(lblT2Value, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE)) .addGap(18) .addGroup(gl_panelInputs .createParallelGroup(Alignment.LEADING, false) .addComponent(sliderT1, 0, 0, Short.MAX_VALUE) .addComponent(sliderP, GroupLayout.DEFAULT_SIZE, 134, Short.MAX_VALUE) .addComponent(sliderT2, 0, 0, Short.MAX_VALUE))) .addGroup(gl_panelInputs.createSequentialGroup() .addComponent(lblQcValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE) .addGap(18) .addComponent(sliderQc, 0, 0, Short.MAX_VALUE))))) .addContainerGap(14, Short.MAX_VALUE)) .addGroup(Alignment.TRAILING, gl_panelInputs.createSequentialGroup() .addContainerGap(28, Short.MAX_VALUE) .addComponent(btnFish, GroupLayout.PREFERRED_SIZE, 93, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(btnMilk, GroupLayout.PREFERRED_SIZE, 93, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(btnMetal, GroupLayout.PREFERRED_SIZE, 93, GroupLayout.PREFERRED_SIZE) .addGap(25))); 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(lblPValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addComponent(sliderP, 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(lblT1Value, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addComponent(sliderT1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGap(11) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING).addComponent(labelI3) .addComponent(lblT2Value, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(sliderT2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE) .addComponent(lblQo, 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(18) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(btn1, GroupLayout.PREFERRED_SIZE, 49, GroupLayout.PREFERRED_SIZE) .addComponent(btn2, GroupLayout.PREFERRED_SIZE, 49, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING, false) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(btnMetal, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE) .addComponent(btnMilk, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_panelInputs.createSequentialGroup().addGap(1).addComponent(btnFish, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addContainerGap(12, Short.MAX_VALUE))); 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, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panel_visualizar, GroupLayout.PREFERRED_SIZE, 398, GroupLayout.PREFERRED_SIZE) .addGap(452))); groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.TRAILING).addGroup(groupLayout .createSequentialGroup() .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING) .addGroup(Alignment.LEADING, groupLayout.createSequentialGroup().addGap(12).addComponent(panel_visualizar, GroupLayout.DEFAULT_SIZE, 567, Short.MAX_VALUE)) .addGroup(groupLayout.createSequentialGroup().addContainerGap().addComponent(panel_control, GroupLayout.PREFERRED_SIZE, 568, GroupLayout.PREFERRED_SIZE))) .addContainerGap())); JPanel panel = new JPanel(); panelGrafica = new JPanelGrafica(); GroupLayout gl_panel = new GroupLayout(panel); gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(Alignment.LEADING).addGap(0, 384, Short.MAX_VALUE) .addComponent(panelGrafica, GroupLayout.DEFAULT_SIZE, 384, Short.MAX_VALUE)); gl_panel.setVerticalGroup(gl_panel.createParallelGroup(Alignment.LEADING).addGap(0, 241, Short.MAX_VALUE) .addComponent(panelGrafica, GroupLayout.DEFAULT_SIZE, 241, Short.MAX_VALUE)); panel.setLayout(gl_panel); GroupLayout gl_panel_visualizar = new GroupLayout(panel_visualizar); gl_panel_visualizar.setHorizontalGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING) .addComponent(panel, GroupLayout.DEFAULT_SIZE, 398, Short.MAX_VALUE)); gl_panel_visualizar.setVerticalGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING) .addComponent(panel, GroupLayout.DEFAULT_SIZE, 567, Short.MAX_VALUE)); panel_visualizar.setLayout(gl_panel_visualizar); getContentPane().setLayout(groupLayout); }
From source file:com.alvermont.terraj.stargen.ui.StargenFrame.java
/** This method is called from within the constructor to * initialize the form./* w w w . java2 s.co m*/ * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { generateButton = new JButton(); jTabbedPane1 = new javax.swing.JTabbedPane(); jPanel1 = new javax.swing.JPanel(); nameCheckbox = new javax.swing.JCheckBox(); massCheckbox = new javax.swing.JCheckBox(); hipCheckbox = new javax.swing.JCheckBox(); lumCheckbox = new javax.swing.JCheckBox(); nameField = new javax.swing.JTextField(); hipSpinner = new javax.swing.JSpinner(); massSpinner = new javax.swing.JSpinner(); lumSpinner = new javax.swing.JSpinner(); seedCheckbox = new javax.swing.JCheckBox(); seedSpinner = new javax.swing.JSpinner(); jPanel2 = new javax.swing.JPanel(); classCheckbox = new javax.swing.JCheckBox(); subclassCheckbox = new javax.swing.JCheckBox(); lumClassCheckbox = new javax.swing.JCheckBox(); classCombo = new JComboBox<String>(); subclassCombo = new JComboBox<String>(); lumClassCombo = new JComboBox<String>(); jPanel3 = new javax.swing.JPanel(); distanceCheckbox = new javax.swing.JCheckBox(); ascensionCheckbox = new javax.swing.JCheckBox(); declinationCheckbox = new javax.swing.JCheckBox(); distanceSpinner = new javax.swing.JSpinner(); ascensionSpinner = new javax.swing.JSpinner(); declinationSpinner = new javax.swing.JSpinner(); resetButton = new javax.swing.JButton(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); loadMenuItem = new javax.swing.JMenuItem(); saveMenuItem = new javax.swing.JMenuItem(); jSeparator1 = new javax.swing.JSeparator(); exitMenuItem = new javax.swing.JMenuItem(); jMenu2 = new javax.swing.JMenu(); aboutItem = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Stargen Solar System Generator"); generateButton.setText("Generate ..."); generateButton.setToolTipText("Generate a solar system using the parameters in the dialog"); generateButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { generateButtonActionPerformed(evt); } }); nameCheckbox.setText("Name of Star"); nameCheckbox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); nameCheckbox.setMargin(new java.awt.Insets(0, 0, 0, 0)); nameCheckbox.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { nameCheckboxStateChanged(evt); } }); massCheckbox.setText("Stellar Mass (Sol = 1.0)"); massCheckbox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); massCheckbox.setMargin(new java.awt.Insets(0, 0, 0, 0)); massCheckbox.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { massCheckboxStateChanged(evt); } }); hipCheckbox.setText("Hipparcus Catalogue Number"); hipCheckbox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); hipCheckbox.setMargin(new java.awt.Insets(0, 0, 0, 0)); hipCheckbox.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { hipCheckboxStateChanged(evt); } }); lumCheckbox.setText("Stellar Luminosity (Sol = 1.0)"); lumCheckbox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); lumCheckbox.setMargin(new java.awt.Insets(0, 0, 0, 0)); lumCheckbox.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { lumCheckboxStateChanged(evt); } }); nameField.setText("Stargen"); nameField.setToolTipText("The name of the star and the system for use in output"); nameField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { nameFieldActionPerformed(evt); } }); nameField.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { nameFieldFocusLost(evt); } }); hipSpinner.setModel(new SpinnerNumberModel(500000, 0, 10000000, 1)); hipSpinner.setToolTipText("Stellar catalogue number used for Celestia output"); hipSpinner.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { hipSpinnerStateChanged(evt); } }); massSpinner.setModel(new SpinnerNumberModel(1.0, 0.1, 10000.0, 0.01)); massSpinner.setToolTipText("The stellar mass compared to our Sun"); massSpinner.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { massSpinnerStateChanged(evt); } }); lumSpinner.setModel(new SpinnerNumberModel(1.0, 0.1, 10000.0, 0.01)); lumSpinner.setToolTipText("The stellar luminosity compared to our Sun"); lumSpinner.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { lumSpinnerStateChanged(evt); } }); seedCheckbox.setText("Random number seed"); seedCheckbox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); seedCheckbox.setMargin(new java.awt.Insets(0, 0, 0, 0)); seedCheckbox.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { seedCheckboxStateChanged(evt); } }); seedSpinner.setModel(new SpinnerNumberModel((Number) new Long(0L), (Comparable<Long>) new Long(0L), (Comparable) Long.MAX_VALUE, (Number) new Long(1))); seedSpinner.setToolTipText("Select a specific seed value. The same seed always generates the same result"); seedSpinner.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { seedSpinnerStateChanged(evt); } }); org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel1Layout.createSequentialGroup().addContainerGap().add(jPanel1Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel1Layout.createSequentialGroup() .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(massCheckbox).add(hipCheckbox).add(lumCheckbox).add(seedCheckbox)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jPanel1Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(jPanel1Layout .createParallelGroup( org.jdesktop.layout.GroupLayout.LEADING, false) .add(massSpinner, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 184, Short.MAX_VALUE) .add(hipSpinner, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 184, Short.MAX_VALUE)) .add(lumSpinner, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 184, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(seedSpinner, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 184, Short.MAX_VALUE))) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup().add(nameCheckbox) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(nameField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE))) .addContainerGap())); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel1Layout.createSequentialGroup().addContainerGap() .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(nameField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(nameCheckbox)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(hipCheckbox).add(hipSpinner, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(9, 9, 9) .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(massCheckbox).add(massSpinner, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(lumCheckbox).add(lumSpinner, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(seedCheckbox).add(seedSpinner)) .addContainerGap(31, Short.MAX_VALUE))); jTabbedPane1.addTab("Basic", jPanel1); classCheckbox.setText("Spectral Class"); classCheckbox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); classCheckbox.setMargin(new java.awt.Insets(0, 0, 0, 0)); classCheckbox.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { classCheckboxStateChanged(evt); } }); subclassCheckbox.setText("Spectral Subclass"); subclassCheckbox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); subclassCheckbox.setMargin(new java.awt.Insets(0, 0, 0, 0)); subclassCheckbox.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { subclassCheckboxStateChanged(evt); } }); lumClassCheckbox.setText("Luminosity Class"); lumClassCheckbox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); lumClassCheckbox.setMargin(new java.awt.Insets(0, 0, 0, 0)); lumClassCheckbox.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { lumClassCheckboxStateChanged(evt); } }); classCombo.setModel( new javax.swing.DefaultComboBoxModel<String>(new String[] { "O", "B", "A", "F", "G", "K", "M" })); classCombo.setToolTipText("Select the spectral class of the star. O is the hottest."); classCombo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { classComboActionPerformed(evt); } }); subclassCombo.setModel(new javax.swing.DefaultComboBoxModel<String>( new String[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" })); subclassCombo.setToolTipText("Select the spectral subclass of the star"); subclassCombo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { subclassComboActionPerformed(evt); } }); lumClassCombo.setModel(new javax.swing.DefaultComboBoxModel<String>( new String[] { "Ia", "Ib", "II", "III", "IV", "V", "VI", "VII" })); lumClassCombo.setToolTipText("Select the luminosity class of the star"); lumClassCombo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { lumClassComboActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel2Layout.createSequentialGroup() .addContainerGap() .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(lumClassCheckbox).add(classCheckbox).add(subclassCheckbox)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 279, Short.MAX_VALUE) .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) .add(classCombo, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(subclassCombo, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(lumClassCombo, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel2Layout.createSequentialGroup().add(16, 16, 16) .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(classCheckbox).add(classCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(subclassCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(subclassCheckbox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 18, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(lumClassCheckbox).add(lumClassCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addContainerGap(75, Short.MAX_VALUE))); jTabbedPane1.addTab("Spectral", jPanel2); distanceCheckbox.setText("Distance (light years)"); distanceCheckbox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); distanceCheckbox.setMargin(new java.awt.Insets(0, 0, 0, 0)); distanceCheckbox.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { distanceCheckboxStateChanged(evt); } }); ascensionCheckbox.setText("Right Ascension (degrees)"); ascensionCheckbox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); ascensionCheckbox.setMargin(new java.awt.Insets(0, 0, 0, 0)); ascensionCheckbox.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { ascensionCheckboxStateChanged(evt); } }); declinationCheckbox.setText("Declination (degrees)"); declinationCheckbox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); declinationCheckbox.setMargin(new java.awt.Insets(0, 0, 0, 0)); declinationCheckbox.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { declinationCheckboxStateChanged(evt); } }); distanceSpinner.setModel(new SpinnerNumberModel(100.0, 0.0, 10000.0, 0.01)); distanceSpinner.setToolTipText("Set the distance of the star from Earth in light years"); distanceSpinner.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { distanceSpinnerStateChanged(evt); } }); ascensionSpinner.setModel(new SpinnerNumberModel(0.0, 0.0, 360.0, 0.01)); ascensionSpinner.setToolTipText("Set the right ascension of the star in degrees"); ascensionSpinner.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { ascensionSpinnerStateChanged(evt); } }); declinationSpinner.setModel(new SpinnerNumberModel(0.0, -90.0, 90.0, 0.01)); declinationSpinner.setToolTipText("Set the declination of the star in degrees"); declinationSpinner.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { declinationSpinnerStateChanged(evt); } }); org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3Layout.createSequentialGroup().addContainerGap() .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(distanceCheckbox).add(ascensionCheckbox).add(declinationCheckbox)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 201, Short.MAX_VALUE) .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(declinationSpinner).add(ascensionSpinner).add(distanceSpinner, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 76, Short.MAX_VALUE)) .addContainerGap())); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3Layout.createSequentialGroup().addContainerGap() .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(distanceCheckbox).add(distanceSpinner, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(ascensionCheckbox).add(ascensionSpinner, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(declinationCheckbox).add(declinationSpinner, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addContainerGap(86, Short.MAX_VALUE))); jTabbedPane1.addTab("Position", jPanel3); resetButton.setText("Reset All"); resetButton.setToolTipText("Reset all the parameters to their defaults"); resetButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { resetButtonActionPerformed(evt); } }); jMenu1.setText("File"); loadMenuItem.setText("Load Settings ..."); loadMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { loadMenuItemActionPerformed(evt); } }); jMenu1.add(loadMenuItem); saveMenuItem.setText("Save Settings ..."); saveMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveMenuItemActionPerformed(evt); } }); jMenu1.add(saveMenuItem); jMenu1.add(jSeparator1); exitMenuItem.setText("Exit"); exitMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exitMenuItemActionPerformed(evt); } }); jMenu1.add(exitMenuItem); jMenuBar1.add(jMenu1); jMenu2.setText("Help"); aboutItem.setText("About ..."); aboutItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { aboutItemActionPerformed(evt); } }); jMenu2.add(aboutItem); jMenuBar1.add(jMenu2); setJMenuBar(jMenuBar1); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup().addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup().add(resetButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 273, Short.MAX_VALUE) .add(generateButton)) .add(jTabbedPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 445, Short.MAX_VALUE)) .addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add( org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup().addContainerGap() .add(jTabbedPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 194, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 13, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(resetButton) .add(generateButton)) .addContainerGap())); java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); setBounds((screenSize.width - 473) / 2, (screenSize.height - 300) / 2, 473, 300); }
From source file:client.ui.FilePane.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./*from 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() { fileButtonPane = new JPanel(); uploadFileButton = new JButton(); downloadFileButton = new JButton(); deleteFileButton = new JButton(); renameFileButton = new JButton(); authorizationButton = new JButton(); jSeparator1 = new JSeparator(); addNoteButton = new JButton(); deleteNoteButton = new JButton(); jSeparator2 = new JSeparator(); targetIDField = new JTextField(); searchUserButton = new JButton(); returnButton = new JButton(); jSeparator3 = new JSeparator(); refreshButton = new JButton(); jSeparator4 = new JSeparator(); changePasswdButton = new JButton(); fileSplitPane = new JSplitPane(); jSplitPane2 = new JSplitPane(); fileInfoScroll = new JScrollPane(); fileInfoTable = new JTable(); noteDisplayScroll = new JScrollPane(); noteTable = new JTable(); jSplitPane1 = new JSplitPane(); fileDisplayScroll = new JScrollPane(); fileContentArea = new JTextArea(); noteInputScroll = new JScrollPane(); noteInputArea = new JTextArea(); FormListener formListener = new FormListener(); setForeground(new Color(240, 240, 240)); setFont(new Font("", 0, 12)); // NOI18N setMaximumSize(new Dimension(1366, 768)); setPreferredSize(new Dimension(1366, 700)); fileButtonPane.setMaximumSize(new Dimension(32767, 50)); fileButtonPane.setMinimumSize(new Dimension(404, 50)); uploadFileButton.setFont(new Font("", 0, 12)); // NOI18N uploadFileButton.setText(""); uploadFileButton.setActionCommand("JButton1"); uploadFileButton.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); uploadFileButton.setBorderPainted(false); uploadFileButton.setContentAreaFilled(false); uploadFileButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); uploadFileButton.setFocusPainted(false); uploadFileButton.setMaximumSize(new Dimension(30, 20)); uploadFileButton.setMinimumSize(new Dimension(30, 20)); uploadFileButton.addMouseListener(formListener); uploadFileButton.addActionListener(formListener); downloadFileButton.setFont(new Font("", 0, 12)); // NOI18N downloadFileButton.setText(""); downloadFileButton.setActionCommand("JButton1"); downloadFileButton.setBorder(null); downloadFileButton.setBorderPainted(false); downloadFileButton.setContentAreaFilled(false); downloadFileButton.setEnabled(false); downloadFileButton.setFocusPainted(false); downloadFileButton.setMaximumSize(new Dimension(30, 20)); downloadFileButton.setMinimumSize(new Dimension(30, 20)); downloadFileButton.setPreferredSize(new Dimension(30, 20)); downloadFileButton.addMouseListener(formListener); downloadFileButton.addActionListener(formListener); deleteFileButton.setFont(new Font("", 0, 12)); // NOI18N deleteFileButton.setText(""); deleteFileButton.setBorder(null); deleteFileButton.setBorderPainted(false); deleteFileButton.setContentAreaFilled(false); deleteFileButton.setEnabled(false); deleteFileButton.setFocusPainted(false); deleteFileButton.addMouseListener(formListener); deleteFileButton.addActionListener(formListener); renameFileButton.setFont(new Font("", 0, 12)); // NOI18N renameFileButton.setText("???"); renameFileButton.setBorder(null); renameFileButton.setBorderPainted(false); renameFileButton.setContentAreaFilled(false); renameFileButton.setEnabled(false); renameFileButton.setFocusPainted(false); renameFileButton.addMouseListener(formListener); renameFileButton.addActionListener(formListener); authorizationButton.setFont(new Font("", 0, 12)); // NOI18N authorizationButton.setText("??"); authorizationButton.setBorder(null); authorizationButton.setBorderPainted(false); authorizationButton.setContentAreaFilled(false); authorizationButton.setEnabled(false); authorizationButton.setFocusPainted(false); authorizationButton.addMouseListener(formListener); authorizationButton.addActionListener(formListener); jSeparator1.setOrientation(SwingConstants.VERTICAL); addNoteButton.setFont(new Font("", 0, 12)); // NOI18N addNoteButton.setText(""); addNoteButton.setActionCommand("JButton1"); addNoteButton.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); addNoteButton.setBorderPainted(false); addNoteButton.setContentAreaFilled(false); addNoteButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); addNoteButton.setEnabled(false); addNoteButton.setFocusPainted(false); addNoteButton.setMaximumSize(new Dimension(30, 20)); addNoteButton.setMinimumSize(new Dimension(30, 20)); addNoteButton.addMouseListener(formListener); addNoteButton.addActionListener(formListener); deleteNoteButton.setFont(new Font("", 0, 12)); // NOI18N deleteNoteButton.setText(""); deleteNoteButton.setActionCommand("JButton1"); deleteNoteButton.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); deleteNoteButton.setBorderPainted(false); deleteNoteButton.setContentAreaFilled(false); deleteNoteButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); deleteNoteButton.setEnabled(false); deleteNoteButton.setFocusPainted(false); deleteNoteButton.setMaximumSize(new Dimension(30, 20)); deleteNoteButton.setMinimumSize(new Dimension(30, 20)); deleteNoteButton.addMouseListener(formListener); deleteNoteButton.addActionListener(formListener); jSeparator2.setOrientation(SwingConstants.VERTICAL); targetIDField.setFont(new Font("", 0, 12)); // NOI18N searchUserButton.setFont(new Font("", 0, 12)); // NOI18N searchUserButton.setText(""); searchUserButton.setActionCommand("JButton1"); searchUserButton.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); searchUserButton.setBorderPainted(false); searchUserButton.setContentAreaFilled(false); searchUserButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); searchUserButton.setFocusPainted(false); searchUserButton.setMaximumSize(new Dimension(30, 20)); searchUserButton.setMinimumSize(new Dimension(30, 20)); searchUserButton.addMouseListener(formListener); searchUserButton.addActionListener(formListener); returnButton.setFont(new Font("", 0, 12)); // NOI18N returnButton.setText(""); returnButton.setActionCommand("JButton1"); returnButton.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); returnButton.setBorderPainted(false); returnButton.setContentAreaFilled(false); returnButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); returnButton.setFocusPainted(false); returnButton.setMaximumSize(new Dimension(30, 20)); returnButton.setMinimumSize(new Dimension(30, 20)); returnButton.addMouseListener(formListener); returnButton.addActionListener(formListener); jSeparator3.setOrientation(SwingConstants.VERTICAL); refreshButton.setFont(new Font("", 0, 12)); // NOI18N refreshButton.setText(""); refreshButton.setActionCommand("JButton1"); refreshButton.setBorder(null); refreshButton.setBorderPainted(false); refreshButton.setContentAreaFilled(false); refreshButton.setFocusPainted(false); refreshButton.setMaximumSize(new Dimension(30, 20)); refreshButton.setMinimumSize(new Dimension(30, 20)); refreshButton.setPreferredSize(new Dimension(30, 20)); refreshButton.addMouseListener(formListener); refreshButton.addActionListener(formListener); jSeparator4.setOrientation(SwingConstants.VERTICAL); changePasswdButton.setFont(new Font("", 0, 12)); // NOI18N changePasswdButton.setText("?"); changePasswdButton.setActionCommand("JButton1"); changePasswdButton.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); changePasswdButton.setBorderPainted(false); changePasswdButton.setContentAreaFilled(false); changePasswdButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); changePasswdButton.setFocusPainted(false); changePasswdButton.setMaximumSize(new Dimension(30, 20)); changePasswdButton.setMinimumSize(new Dimension(30, 20)); changePasswdButton.addMouseListener(formListener); changePasswdButton.addActionListener(formListener); GroupLayout fileButtonPaneLayout = new GroupLayout(fileButtonPane); fileButtonPane.setLayout(fileButtonPaneLayout); fileButtonPaneLayout.setHorizontalGroup(fileButtonPaneLayout .createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(fileButtonPaneLayout.createSequentialGroup() .addComponent(uploadFileButton, GroupLayout.PREFERRED_SIZE, 46, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(downloadFileButton, GroupLayout.PREFERRED_SIZE, 46, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(deleteFileButton, GroupLayout.PREFERRED_SIZE, 46, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(renameFileButton, GroupLayout.PREFERRED_SIZE, 57, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(authorizationButton, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(jSeparator1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(addNoteButton, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(deleteNoteButton, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(jSeparator2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(targetIDField, GroupLayout.PREFERRED_SIZE, 115, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(searchUserButton, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(returnButton, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(jSeparator3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(refreshButton, GroupLayout.PREFERRED_SIZE, 46, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(jSeparator4, GroupLayout.PREFERRED_SIZE, 2, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(changePasswdButton, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE) .addContainerGap(18, Short.MAX_VALUE))); fileButtonPaneLayout.setVerticalGroup(fileButtonPaneLayout .createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(GroupLayout.Alignment.TRAILING, fileButtonPaneLayout.createSequentialGroup().addContainerGap().addGroup(fileButtonPaneLayout .createParallelGroup(GroupLayout.Alignment.TRAILING).addComponent(jSeparator4) .addGroup(fileButtonPaneLayout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addGroup(fileButtonPaneLayout .createParallelGroup(GroupLayout.Alignment.TRAILING) .addComponent(changePasswdButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addGroup(fileButtonPaneLayout .createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(refreshButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addGroup(fileButtonPaneLayout .createParallelGroup( GroupLayout.Alignment.TRAILING, false) .addComponent(jSeparator2) .addGroup(fileButtonPaneLayout .createParallelGroup( GroupLayout.Alignment.BASELINE) .addComponent(addNoteButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addComponent(deleteNoteButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE)) .addComponent(jSeparator1) .addGroup(fileButtonPaneLayout .createParallelGroup( GroupLayout.Alignment.BASELINE) .addComponent(downloadFileButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addComponent(deleteFileButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addComponent(renameFileButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addComponent(authorizationButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addComponent(uploadFileButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE)) .addComponent(jSeparator3) .addGroup(GroupLayout.Alignment.LEADING, fileButtonPaneLayout.createParallelGroup( GroupLayout.Alignment.BASELINE) .addComponent(targetIDField) .addComponent(searchUserButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addComponent(returnButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE))))))) .addGap(15, 15, 15))); fileSplitPane.setBackground(new Color(255, 255, 255)); fileSplitPane.setDividerLocation(750); fileSplitPane.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); fileSplitPane.setMaximumSize(new Dimension(1366, 768)); fileSplitPane.setPreferredSize(new Dimension(701, 646)); jSplitPane2.setDividerLocation(400); jSplitPane2.setOrientation(JSplitPane.VERTICAL_SPLIT); jSplitPane2.setContinuousLayout(true); jSplitPane2.setMaximumSize(new Dimension(1366, 768)); fileInfoScroll.setBackground(new Color(255, 255, 255)); fileInfoScroll.setFont(new Font("", 0, 12)); // NOI18N fileInfoScroll.getViewport().setBackground(Color.WHITE); fileInfoScroll.addMouseListener(formListener); fileInfoTable.setAutoCreateRowSorter(true); fileInfoTable.setFont(new Font("", 0, 12)); // NOI18N fileInfoTable.setModel(fileTableModel); fileInfoTable.getTableHeader().setFont(new Font("", 0, 12)); fileInfoTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); fileInfoTable.setRowHeight(20); fileInfoTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); fileInfoTable.setShowHorizontalLines(false); fileInfoTable.setShowVerticalLines(false); fileInfoTable.addMouseListener(formListener); fileInfoTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent evt) { fileSelectedChanged(evt); } }); fileInfoScroll.setViewportView(fileInfoTable); jSplitPane2.setTopComponent(fileInfoScroll); noteDisplayScroll.setBackground(new Color(255, 255, 255)); noteDisplayScroll.setFont(new Font("", 0, 12)); // NOI18N noteDisplayScroll.getViewport().setBackground(Color.WHITE); noteDisplayScroll.addMouseListener(formListener); noteTable.setAutoCreateRowSorter(true); noteTable.setFont(new Font("", 0, 12)); // NOI18N noteTable.setModel(noteTableModel); noteTable.getTableHeader().setFont(new Font("", 0, 12)); noteTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); noteTable.setRowHeight(20); noteTable.setShowHorizontalLines(false); noteTable.setShowVerticalLines(false); noteTable.addMouseListener(formListener); noteTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent evt) { noteSelectedChanged(evt); } }); noteDisplayScroll.setViewportView(noteTable); jSplitPane2.setBottomComponent(noteDisplayScroll); fileSplitPane.setLeftComponent(jSplitPane2); jSplitPane1.setDividerLocation(500); jSplitPane1.setOrientation(JSplitPane.VERTICAL_SPLIT); fileDisplayScroll.setFont(new Font("", 0, 12)); // NOI18N fileDisplayScroll.setMinimumSize(new Dimension(30, 30)); fileContentArea.setEditable(false); fileContentArea.setColumns(20); fileContentArea.setFont(new Font("", 0, 12)); // NOI18N fileContentArea.setRows(5); fileContentArea.setToolTipText(""); fileContentArea .setBorder(BorderFactory.createTitledBorder(null, "", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, new Font("", 0, 12))); // NOI18N fileDisplayScroll.setViewportView(fileContentArea); jSplitPane1.setTopComponent(fileDisplayScroll); noteInputScroll.setFont(new Font("", 0, 12)); // NOI18N noteInputScroll.setMaximumSize(new Dimension(1366, 768)); noteInputScroll.setMinimumSize(new Dimension(30, 30)); noteInputArea.setColumns(20); noteInputArea.setFont(new Font("", 0, 12)); // NOI18N noteInputArea.setRows(5); noteInputArea.setToolTipText(""); noteInputArea .setBorder(BorderFactory.createTitledBorder(null, "", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, new Font("", 0, 12))); // NOI18N noteInputScroll.setViewportView(noteInputArea); jSplitPane1.setBottomComponent(noteInputScroll); fileSplitPane.setRightComponent(jSplitPane1); GroupLayout layout = new GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout .createSequentialGroup().addContainerGap() .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(fileSplitPane, GroupLayout.DEFAULT_SIZE, 1346, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addComponent(fileButtonPane, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(fileButtonPane, GroupLayout.PREFERRED_SIZE, 38, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(fileSplitPane, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addContainerGap())); }