private void prepareSearchArea() {
    searchPanes = new CollapsiblePanes();
    searchPanes.setLayout(new JideBoxLayout(searchPanes, JideBoxLayout.Y_AXIS));
    jspSearch.setViewportView(searchPanes);

    JPanel mypanel = new JPanel();
    mypanel.setLayout(new VerticalLayout(3));
    mypanel.setBackground(Color.WHITE);

    CollapsiblePane searchPane = new CollapsiblePane(SYSTools.xx(internalClassID));
    searchPane.setStyle(CollapsiblePane.PLAIN_STYLE);
    searchPane.setCollapsible(false);

    try {
      searchPane.setCollapsed(false);
    } catch (PropertyVetoException e) {
      OPDE.error(e);
    }

    GUITools.addAllComponents(mypanel, addCommands());

    searchPane.setContentPane(mypanel);

    searchPanes.add(searchPane);
    searchPanes.addExpansion();
  }
Beispiel #2
0
  /**
   * Set the value of content
   *
   * @param newVar the new value of content
   */
  private void setContent(final counts a, final connections cnc_a) {
    // Creates a new container
    content = frame.getContentPane();
    // sets the layout
    content.setLayout(new BorderLayout());

    this.setTaskbar(); // sets the taskbar
    // adding the taskbar to the bottom-part
    content.add(taskbar, BorderLayout.SOUTH);

    this.setDraw_pad(a, cnc_a, this.getTaskbar()); // sets the drawPad
    JScrollPane Padscroller = new JScrollPane();
    Padscroller.setWheelScrollingEnabled(true);
    Padscroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    Padscroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    Padscroller.setPreferredSize(new Dimension(200, 100));
    // Padscroller.setMinimumSize(new Dimension(200, 100));
    // Padscroller.setMaximumSize(new Dimension(200, 100));
    Padscroller.setViewportView(drawPad);
    content.add(Padscroller, BorderLayout.CENTER);

    this.setPanel(a, cnc_a); // sets the panel
    JScrollPane scroller = new JScrollPane(panel);
    scroller.setWheelScrollingEnabled(true);
    scroller.setPreferredSize(new Dimension(125, 80));
    scroller.setMinimumSize(new Dimension(125, 80));
    scroller.setMaximumSize(new Dimension(125, 80));
    // sets the scroller to the west portion
    content.add(scroller, BorderLayout.WEST);
    // content.add(panel, BorderLayout.WEST);
  }
  /** EdiDialog constructor comment. */
  public void show() {
    getContentPane().setLayout(new java.awt.BorderLayout());
    JScrollPane center = new JScrollPane();
    getContentPane().add(center, java.awt.BorderLayout.CENTER);
    list = new JList();
    list.setBackground(parentWindow.getBackground());
    DefaultListModel model = new DefaultListModel();
    list.setModel(model);
    for (int i = 0; i < DesignFrame.processingElements.length; i++) {
      model.addElement((String) DesignFrame.processingElements[i][0]);
    }

    // list.ActionListener((ActionListener) this);
    center.setViewportView(list);

    JPanel down = new JPanel();
    getContentPane().add(down, java.awt.BorderLayout.SOUTH);
    down.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT, 2, 2));
    bOK = new JButton("OK");
    bOK.addActionListener(this);
    bAdd = new JButton("Add");
    bAdd.addActionListener(this);
    bCancel = new JButton("Cancel");
    bCancel.addActionListener(this);
    down.add(bOK);
    down.add(bAdd);
    down.add(bCancel);
    pack();
    setSize(getWidth(), getHeight() * 2);

    list.addKeyListener(this);
    super.show();
  }
Beispiel #4
0
 public void updateHelper() {
   if (model.GuessORHint == 0) {
     label1.setText("Entered:");
   }
   if (model.GuessORHint == 1) {
     label1.setText("Hints:");
   }
   DefaultListModel<String> listTemp = new DefaultListModel<String>();
   if (model.GuessORHint == 0) {
     for (String str : model.haveEntered) {
       listTemp.addElement(str);
     }
   } else {
     if (model.hintWords != null) {
       for (String MM : model.hintWords) {
         if (MM == null) {
           listTemp.addElement("APPLE");
         } else {
           listTemp.addElement(MM);
         }
       }
     }
   }
   list.setModel(listTemp);
   scroll.setViewportView(list);
 }
 private JScrollPane getSelectedRobotsScrollPane() {
   if (selectedRobotsScrollPane == null) {
     selectedRobotsScrollPane = new JScrollPane();
     selectedRobotsScrollPane.setViewportView(getSelectedRobotsList());
   }
   return selectedRobotsScrollPane;
 }
  public SurrenderUI() {
    setType(Type.UTILITY);

    ExitB = new JButton("Exit");
    ExitB.setFont(new Font("Tahoma", Font.BOLD, 12));
    ExitB.setBackground(new Color(255, 215, 0));
    ExitB.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            dispose();
            new HSmain();
          }
        });
    ExitB.setBounds(461, 427, 296, 60);

    setTitle("Surrendering a Pet");
    Container pane = getContentPane();
    getContentPane().setLayout(null);
    pane.add(ExitB);

    txtSurrender = new JTextField();
    txtSurrender.setEditable(false);
    txtSurrender.setForeground(new Color(0, 0, 0));
    txtSurrender.setBackground(new Color(255, 215, 0));
    txtSurrender.setBounds(10, 11, 764, 50);
    txtSurrender.setHorizontalAlignment(SwingConstants.CENTER);
    txtSurrender.setFont(new Font("Lucida Handwriting", Font.BOLD, 18));
    txtSurrender.setText("Surrendering a Pet");
    getContentPane().add(txtSurrender);
    txtSurrender.setColumns(10);

    BackB = new JButton("Back");
    BackB.setFont(new Font("Tahoma", Font.BOLD, 12));
    BackB.setBackground(new Color(255, 215, 0));
    BackB.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            new AnimalServiceUI();
            dispose();
          }
        });
    BackB.setBounds(26, 427, 320, 60);
    getContentPane().add(BackB);

    scrollPane = new JScrollPane();
    scrollPane.setBounds(0, 72, 764, 329);
    getContentPane().add(scrollPane);

    JTextPane txtSurrenderInfo = new JTextPane();
    scrollPane.setViewportView(txtSurrenderInfo);
    txtSurrenderInfo.setForeground(new Color(0, 0, 0));
    txtSurrenderInfo.setEditable(false);
    txtSurrenderInfo.setFont(new Font("Times New Roman", Font.BOLD, 15));
    txtSurrenderInfo.setText(
        "\tThe Humane Society of Lamar cannot accept every animal brought to our shelter immediately. \r\nWe respect the difficult decision of owners to relinquish their pets, and the hard choices of those \r\ngood citizens who are trying to help a stray. We accept the surrender of pets as space allows. \r\nWe maintain a waiting list for all animals needing to be admitted to the shelter.\r\nAnimals are surrendered to our facility by appointment.\r\nWe admit at least 12 animals per week. We accept more animals as adoptions and space allow.\r\nNote that we cannot accept aggressive, sick or pregnant animals.\r\nPlease call 409-225-7981, and one of our adoption specialists will speak to you.\r\nAt times our waiting list will have up to 100 animals waiting for admission and it can take several weeks \r\nbefore we can admit your pet.\r\nPlease understand that our primary goal is to place as many animals in forever homes as possible, \r\ntherefore we must give every pet admitted to the shelter enough time to find a loving home. \r\nWe cannot guarantee placement of every animal admitted to the shelter.\r\n\t\r\n\tAdmission of any animal into the Humane Society of Lamar  is based on the animal\u2019s health, \r\nbehavior, and adoptability. When you bring your pets, please have:\r\n\r\n    *Any veterinary records\r\n    *Your pet\u2019s medications\r\n    *Special food or treats that your pet needs\r\n    *Your pet\u2019s bed, toys, leash and other belongings from home\r\n\r\nA staff member will evaluate the temperament of your pet. Once your pet has been screened, \r\nand the Humane Society of Lamar decides to accept your pet, we ask a donation to our shelter to be made. \r\nThis is not required, but will greatly help us care for your pet.");

    setSize(800, 553);
    setVisible(true);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
  }
  /**
   * Constructor for ListPanel. Sets up all the gui
   *
   * @param rp reference to the restaurant panel
   * @param type indicates if this is for customers or waiters
   */
  public ListPanel(RestaurantPizza rp, String type) {
    restPanel = rp;
    this.type = type;

    setLayout(new BoxLayout((Container) this, BoxLayout.Y_AXIS));
    add(new JLabel("<html><pre> <u>" + type + "</u><br></pre></html>"));

    addPersonText.setMaximumSize(new Dimension(super.getMaximumSize().width, MAX_TEXTFIELD_HEIGHT));
    add(addPersonText);
    if (type.equals("Customer")) {
      add(hungryCheckbox);
      addCustomerButton.addActionListener(this);
      add(addCustomerButton);
    }
    if (type.equals("Waiter")) {
      pauseButton.addActionListener(this);
      add(pauseButton);
      addWaiterButton.addActionListener(this);
      add(addWaiterButton);
    }

    view.setLayout(new GridLayout(0, NUM_BUTTONS_COLS, BUTTON_GAP_SIZE, BUTTON_GAP_SIZE));
    scrollPane.setViewportView(view);
    add(scrollPane);
  }
Beispiel #8
0
 public void actionPerformed(ActionEvent ae) {
   if (ae.getActionCommand() == "timer") {
     if (counter >= imagePaths.length) {
       timer.stop();
       counter = 0;
       PlayStopButton.setText("Play");
     } else {
       try {
         // if the array contains URLs
         if (imagePaths[counter].contains("http://")) {
           scrollPane.setToolTipText(imagePaths[counter]);
           imageIcon = new ImageIcon((new URL(imagePaths[counter++])));
           scrollPane.setViewportView(new JLabel(imageIcon));
         }
         // if the array contains local images
         else {
           image.setIcon(new ImageIcon(imagePaths[counter]));
           image.setToolTipText(imagePaths[counter++]);
         }
       } catch (MalformedURLException ex) {
         Logger.getLogger(Slideshow.class.getName()).log(Level.SEVERE, null, ex);
         image = new JLabel("?" + imagePaths);
       }
     }
   }
 }
  private void prepareSearchArea() {
    initPhase = true;
    searchPanes = new CollapsiblePanes();
    searchPanes.setLayout(new JideBoxLayout(searchPanes, JideBoxLayout.Y_AXIS));

    CollapsiblePane searchPane = new CollapsiblePane(SYSTools.xx(internalClassID));
    searchPane.setSlidingDirection(SwingConstants.SOUTH);
    searchPane.setStyle(CollapsiblePane.PLAIN_STYLE);
    searchPane.setCollapsible(false);

    try {
      searchPane.setCollapsed(false);
    } catch (PropertyVetoException e) {
      e
          .printStackTrace(); // To change body of catch statement use File | Settings | File
                              // Templates.
    }
    JPanel mypanel = new JPanel();
    mypanel.setLayout(new VerticalLayout(3));
    mypanel.setBackground(Color.WHITE);

    JideButton printButton =
        GUITools.createHyperlinkButton(
            "Drucken",
            SYSConst.icon22print2,
            new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent actionEvent) {
                SYSFilesTools.print(
                    ResInfoTools.getTXReport(
                        resident,
                        true,
                        false,
                        tbMedi.isSelected(),
                        tbBilanz.isSelected(),
                        tbBerichte.isSelected(),
                        true,
                        false,
                        true,
                        true),
                    true);
              }
            });
    mypanel.add(printButton);

    searchPane.setContentPane(mypanel);
    searchPanes.add(searchPane);
    searchPanes.add(addFilters());
    searchPanes.addExpansion();

    jspSearch.setViewportView(searchPanes);

    initPhase = false;
  }
Beispiel #10
0
  void initComponents() {
    JPanel mainPanel = new JPanel(new BorderLayout());
    JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));
    Color bgColor = Color.getHSBColor(0.58f, 0.17f, 0.95f);
    buttonPanel.setBackground(bgColor);
    Border empty = BorderFactory.createEmptyBorder(5, 5, 5, 5);
    buttonPanel.setBorder(empty);

    textField = new JTextField(75);
    buttonPanel.add(textField);

    buttonPanel.add(Box.createHorizontalStrut(10));
    searchPHI = new JButton("Search PHI");
    searchPHI.addActionListener(this);
    buttonPanel.add(searchPHI);

    buttonPanel.add(Box.createHorizontalStrut(10));
    searchTrial = new JButton("Search Trial IDs");
    searchTrial.addActionListener(this);
    buttonPanel.add(searchTrial);

    buttonPanel.add(Box.createHorizontalStrut(20));
    buttonPanel.add(Box.createHorizontalGlue());
    saveAs = new JCheckBox("Save As...");
    saveAs.setBackground(bgColor);
    buttonPanel.add(saveAs);

    mainPanel.add(buttonPanel, BorderLayout.NORTH);

    JScrollPane scrollPane = new JScrollPane();
    textPane = new ColorPane();
    // textPane.setEditable(false);
    scrollPane.setViewportView(textPane);
    mainPanel.add(scrollPane, BorderLayout.CENTER);

    JPanel footerPanel = new JPanel();
    footerPanel.setLayout(new BoxLayout(footerPanel, BoxLayout.X_AXIS));
    footerPanel.setBackground(bgColor);
    message = new JLabel("Ready...");
    footerPanel.add(message);
    mainPanel.add(footerPanel, BorderLayout.SOUTH);

    setTitle(windowTitle);
    addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent evt) {
            System.exit(0);
          }
        });
    getContentPane().add(mainPanel, BorderLayout.CENTER);
    pack();
    centerFrame();
  }
  /** Create and initialize the scrolling image */
  private void createAndInitScrollingImage() {
    scrollPane = new JScrollPane();

    BufferedImage bimg = picture.getBufferedImage();
    imageDisplay = new ImageDisplay(bimg);
    imageDisplay.addMouseMotionListener(this);
    imageDisplay.addMouseListener(this);
    imageDisplay.setToolTipText("Click a mouse button on a pixel to see the pixel information");
    scrollPane.setViewportView(imageDisplay);
    pictureFrame.getContentPane().add(scrollPane, BorderLayout.CENTER);
  }
  // -------------------------------------------------------------------------------------
  protected JPanel createScrolledPdfViewer(String clusterIdAs3DigitString) {
    final PdfDecoder pdfDecoder = new PdfDecoder();
    String urlString =
        baseUrl + "/" + imageFileNameBase + clusterIdAs3DigitString + imageFileNameSuffix;
    currentFile = urlString;

    System.out.println("url: " + urlString);
    try {
      pdfDecoder.openPdfFileFromURL(urlString);
      // System.out.println ("page count: " + pdfDecoder.getPageCount ());
      pdfDecoder.decodePage(1);
      pdfDecoder.setPageParameters(1.0f, 1, PAGE_ROTATION); // values scaling (1=100%). page number
      pdfDecoder.invalidate();
    } catch (Exception e) {
      e.printStackTrace();
    }

    final ViewerState viewerState = new ViewerState(pdfDecoder.getPageCount());

    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());
    JToolBar toolbar = new JToolBar();
    toolbar.setFloatable(false);
    panel.add(toolbar, BorderLayout.NORTH);

    JButton backButton = new JButton("<");
    backButton.setToolTipText("Back One page");
    toolbar.add(backButton);
    backButton.addActionListener(new BackButtonListener(pdfDecoder, viewerState));

    JButton forwardButton = new JButton(">");
    forwardButton.setToolTipText("Forward One page");
    toolbar.add(forwardButton);
    forwardButton.addActionListener(new ForwardButtonListener(pdfDecoder, viewerState));

    JButton zoomOutButton = new JButton("-");
    zoomOutButton.setToolTipText("Zoom Out");
    toolbar.add(zoomOutButton);
    zoomOutButton.addActionListener(new ZoomOutButtonListener(pdfDecoder, viewerState));

    JButton zoomInButton = new JButton("+");
    zoomInButton.setToolTipText("Zoom In");
    toolbar.add(zoomInButton);
    zoomInButton.addActionListener(new ZoomInButtonListener(pdfDecoder, viewerState));

    JScrollPane scrollPane = new JScrollPane();
    scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);

    scrollPane.setViewportView(pdfDecoder);
    panel.add(scrollPane, BorderLayout.CENTER);
    return panel;
  } // createScrolledPdfViewer
Beispiel #13
0
 /** Class constructor; creates a user interface and loads it with values from the props file. */
 public ControlPanel() {
   super();
   setLayout(new BorderLayout());
   Configuration config = Configuration.getInstance();
   config.setControlPanel(this);
   props = config.getProperties();
   profiles = new Profiles();
   profileLoader = new ProfileLoader();
   profileSaver = new ProfileSaver();
   profileDeleter = new ProfileDeleter();
   selectorPanel = new SelectorPanel();
   jsp = new JScrollPane();
   jsp.setViewportView(selectorPanel);
   this.add(jsp, BorderLayout.CENTER);
   footerPanel = new FooterPanel();
   this.add(footerPanel, BorderLayout.SOUTH);
   jsp.getVerticalScrollBar().setUnitIncrement(25);
   jsp.getVerticalScrollBar().setBlockIncrement(25);
 }
Beispiel #14
0
  public prueba() {
    setBorder(new LineBorder(new Color(0, 0, 0), 2, true));

    setBounds(0, 0, 800, 600);
    setOpaque(false);

    setLayout(null);

    JScrollPane scrollPane_1 = new JScrollPane();
    scrollPane_1.setBounds(new Rectangle(500, 0, 250, 400));
    scrollPane_1.setBounds(50, 50, 650, 450);
    add(scrollPane_1);
    leftTable = new JTable(new SimpleColorTableModel());
    leftTable.setBackground(new Color(153, 204, 255));
    scrollPane_1.setViewportView(leftTable);

    setupTable(leftTable);

    populate((SimpleColorTableModel) leftTable.getModel());

    setSize(800, 600);
  }
Beispiel #15
0
  private void initTable() {
    JScrollPane scrTraces = new JScrollPane();

    tblTraces = new JTable(tbmTraces);
    tbmTraces.adjustColumns(tblTraces);
    tblTraces.setAutoscrolls(false);

    tblTraces.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent e) {
            TracePanel.this.pnlTraceDetail.setTrace(
                dataSet, tbmTraces.get(tblTraces.getSelectedRow()));
          }
        });

    tblTraces.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

    scrTraces.setMinimumSize(new Dimension(200, 384));
    scrTraces.setViewportView(tblTraces);

    add(scrTraces, BorderLayout.CENTER);
  }
  private void initComponents() {
    chipPlatesPanel = new javax.swing.JPanel();
    scannerInput = new javax.swing.JTextField();
    jScrollPane1 = new javax.swing.JScrollPane();
    failedPlatesList = new javax.swing.JList(new DefaultListModel());
    removeSelectedButton = new javax.swing.JButton();
    locationPanel = new javax.swing.JPanel();
    userIdLabel = new javax.swing.JLabel();
    userIDComboBox = new javax.swing.JComboBox();
    userIDComboBox.setName("userIDComboBox");
    scanLabel = new javax.swing.JLabel();
    scanDestination = new javax.swing.JTextField();
    jScrollPane2 = new javax.swing.JScrollPane();
    destinationsList = new javax.swing.JList(new DefaultListModel());
    completeUnloadingButton = new javax.swing.JButton();
    locationRemoveAllButton = new javax.swing.JButton();
    locationRemoveSelectedButton = new javax.swing.JButton();
    removeAllButton = new javax.swing.JButton();

    jScrollPane2 = new javax.swing.JScrollPane(destinationsList);

    setTitle(UNLOAD_DECK);
    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

    chipPlatesPanel.setBorder(
        javax.swing.BorderFactory.createTitledBorder(SCAN_UNFILLED_CHIP_PLATES));
    scannerInput.setName("inputScanner");
    scannerInput.setText(BLANK);
    scannerInput.addActionListener(new DialogScannerAction());
    jScrollPane1.setViewportView(failedPlatesList);

    removeSelectedButton.setText(REMOVE_SELECTED);
    removeSelectedButton.setName(REMOVE_SELECTED);
    removeSelectedButton.addActionListener(new RemoveSelectedItemAction());
    removeAllButton.setText(REMOVE_ALL);
    removeAllButton.setName(REMOVE_ALL);
    removeAllButton.addActionListener(new RemoveAllAction());
    populateUserList(userIDComboBox);

    org.jdesktop.layout.GroupLayout scanUnfilledSeedPlatesPanelLayout =
        new org.jdesktop.layout.GroupLayout(chipPlatesPanel);
    chipPlatesPanel.setLayout(scanUnfilledSeedPlatesPanelLayout);
    scanUnfilledSeedPlatesPanelLayout.setHorizontalGroup(
        scanUnfilledSeedPlatesPanelLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                scanUnfilledSeedPlatesPanelLayout
                    .createSequentialGroup()
                    .addContainerGap()
                    .add(
                        scanUnfilledSeedPlatesPanelLayout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                jScrollPane1,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                246,
                                Short.MAX_VALUE)
                            .add(
                                scannerInput,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                246,
                                Short.MAX_VALUE)
                            .add(
                                org.jdesktop.layout.GroupLayout.TRAILING,
                                scanUnfilledSeedPlatesPanelLayout
                                    .createSequentialGroup()
                                    .add(
                                        removeAllButton,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        123,
                                        Short.MAX_VALUE)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        removeSelectedButton,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        117,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap()));
    scanUnfilledSeedPlatesPanelLayout.setVerticalGroup(
        scanUnfilledSeedPlatesPanelLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                scanUnfilledSeedPlatesPanelLayout
                    .createSequentialGroup()
                    .add(
                        scannerInput,
                        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(
                        jScrollPane1,
                        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(
                        scanUnfilledSeedPlatesPanelLayout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(removeSelectedButton)
                            .add(removeAllButton))
                    .addContainerGap(
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    locationPanel.setBorder(
        javax.swing.BorderFactory.createTitledBorder(SET_LOCATION_FOR_SEED_PLATES));
    userIdLabel.setText(USER_ID);
    scanLabel.setText(SCAN_DESTINATION);
    scanDestination.setText(BLANK);
    scanDestination.setName("scanDestination");
    scanDestination.addActionListener(new DestinationScanAction());
    locationRemoveAllButton.setText(REMOVE_ALL);
    locationRemoveAllButton.setName("Location_" + REMOVE_ALL);
    locationRemoveAllButton.addActionListener(new RemoveAllAction());
    locationRemoveSelectedButton.setText(REMOVE_SELECTED);
    locationRemoveSelectedButton.setName("Location_" + REMOVE_SELECTED);
    locationRemoveSelectedButton.addActionListener(new RemoveSelectedItemAction());

    org.jdesktop.layout.GroupLayout locationPanelLayout =
        new org.jdesktop.layout.GroupLayout(locationPanel);
    locationPanel.setLayout(locationPanelLayout);
    locationPanelLayout.setHorizontalGroup(
        locationPanelLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                locationPanelLayout
                    .createSequentialGroup()
                    .addContainerGap()
                    .add(
                        locationPanelLayout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                jScrollPane2,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                246,
                                Short.MAX_VALUE)
                            .add(
                                locationPanelLayout
                                    .createSequentialGroup()
                                    .add(
                                        locationPanelLayout
                                            .createParallelGroup(
                                                org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(scanLabel)
                                            .add(userIdLabel))
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        locationPanelLayout
                                            .createParallelGroup(
                                                org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(userIDComboBox, 0, 157, Short.MAX_VALUE)
                                            .add(
                                                scanDestination,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                157,
                                                Short.MAX_VALUE)))
                            .add(
                                org.jdesktop.layout.GroupLayout.TRAILING,
                                locationPanelLayout
                                    .createSequentialGroup()
                                    .add(
                                        locationRemoveAllButton,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        123,
                                        Short.MAX_VALUE)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(locationRemoveSelectedButton)))
                    .addContainerGap()));
    locationPanelLayout.setVerticalGroup(
        locationPanelLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                locationPanelLayout
                    .createSequentialGroup()
                    .add(
                        locationPanelLayout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(userIdLabel)
                            .add(
                                userIDComboBox,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                    .add(
                        locationPanelLayout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(scanLabel)
                            .add(
                                scanDestination,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                    .add(
                        jScrollPane2,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        111,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        locationPanelLayout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(locationRemoveSelectedButton)
                            .add(locationRemoveAllButton))
                    .addContainerGap(
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    completeUnloadingButton.setText(COMPLETE_UNLOADING);
    completeUnloadingButton.setName("completeUnloadingButton");
    completeUnloadingButton.addActionListener(new CompleteUnloadAction());

    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(
                                locationPanel,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, completeUnloadingButton)
                            .add(
                                chipPlatesPanel,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE))
                    .addContainerGap()));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .add(
                        chipPlatesPanel,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        217,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        locationPanel,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(completeUnloadingButton)
                    .addContainerGap()));
    pack();
  }
Beispiel #17
0
  private void initComponents(String channel) {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Evaluation license - Nick K
    searchBar = new JTextField();
    JScrollPane scrollPane2 = new JScrollPane();
    viewerTree = new JTree();

    // ======== this ========
    setTitle("Viewers");
    setIconImage(new ImageIcon(getClass().getResource("/image/icon.png")).getImage());
    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    setResizable(true);
    Container contentPane = getContentPane();

    // ---- searchBar ----
    searchBar.addKeyListener(
        new KeyAdapter() {
          @Override
          public void keyReleased(KeyEvent e) {
            String text = searchBar.getText();
            if (text != null) {
              text = text.trim();
              if (text.length() > 0) {
                if (!isFiltering) {
                  isFiltering = true;
                }
                buildFilteredModel(text);
              } else {
                isFiltering = false;
                setViewerTreeModel(defaultModel);
              }
            } else {
              isFiltering = false;
              setViewerTreeModel(defaultModel);
            }
          }
        });

    // ======== scrollPane2 ========
    {
      // ---- viewerTree ---
      default_root = new DefaultMutableTreeNode(channel);
      defaultModel = new DefaultTreeModel(default_root);
      filtered_root = new DefaultMutableTreeNode(channel);
      viewerTree.setShowsRootHandles(true);
      staff = new DefaultMutableTreeNode("Staff");
      admins = new DefaultMutableTreeNode("Admins");
      global_mods = new DefaultMutableTreeNode("Global Moderators");
      mods = new DefaultMutableTreeNode("Moderators");
      viewers = new DefaultMutableTreeNode("Viewers");
      setViewerTreeModel(defaultModel);
      viewerTree.addMouseListener(
          new MouseAdapter() {
            @Override
            public void mouseReleased(MouseEvent e) {
              if (e.isPopupTrigger()) {
                TreePath selPath = viewerTree.getPathForLocation(e.getX(), e.getY());
                if (selPath != null && selPath.getPathCount() == 3) {
                  // should be a name
                  DefaultMutableTreeNode nameNode =
                      (DefaultMutableTreeNode) selPath.getLastPathComponent();
                  ListenerName.createUserPopup(
                      channel, nameNode.getUserObject().toString(), viewerTree, e.getX(), e.getY());
                }
              }
            }
          });
      scrollPane2.setViewportView(viewerTree);
    }
    setMinimumSize(new Dimension(250, 490));
    GroupLayout contentPaneLayout = new GroupLayout(contentPane);
    contentPane.setLayout(contentPaneLayout);
    contentPaneLayout.setHorizontalGroup(
        contentPaneLayout
            .createParallelGroup()
            .addComponent(searchBar, GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE)
            .addComponent(scrollPane2, GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE));
    contentPaneLayout.setVerticalGroup(
        contentPaneLayout
            .createParallelGroup()
            .addGroup(
                GroupLayout.Alignment.TRAILING,
                contentPaneLayout
                    .createSequentialGroup()
                    .addComponent(
                        searchBar,
                        GroupLayout.PREFERRED_SIZE,
                        GroupLayout.DEFAULT_SIZE,
                        GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(scrollPane2, GroupLayout.DEFAULT_SIZE, 423, Short.MAX_VALUE)));
    addWindowListener(
        new WindowAdapter() {
          @Override
          public void windowClosing(WindowEvent e) {
            GUIMain.viewerLists.remove(channel);
          }
        });
    pack();
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
  }
Beispiel #18
0
  /** initialize GUI components */
  private JPanel initComponents() {
    JPanel panel = new JPanel();
    JScrollPane jScrollPane1 = new JScrollPane();
    JLabel jLabel1 = new JLabel();
    JLabel jLabel2 = new JLabel();

    jScrollPane1.setViewportView(jEditorPaneAbout);

    jButtonOk.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            jButtonOkActionPerformed(e);
          }
        });

    jButtonOk.setText("OK");
    jLabel1.setText("Application:");
    jLabel2.setText("Version:");

    jTextFieldApplication.setBackground(new Color(255, 255, 255));
    jTextFieldApplication.setEditable(false);
    jTextFieldApplication.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));

    jTextFieldVersion.setBackground(new Color(255, 255, 255));
    jTextFieldVersion.setEditable(false);
    jTextFieldVersion.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));

    jEditorPaneAbout.setEditable(false);

    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(panel);
    panel.setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                layout
                    .createSequentialGroup()
                    .add(
                        layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                layout
                                    .createSequentialGroup()
                                    .addContainerGap()
                                    .add(
                                        layout
                                            .createParallelGroup(
                                                org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(
                                                jScrollPane1,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                289,
                                                Short.MAX_VALUE)
                                            .add(
                                                layout
                                                    .createSequentialGroup()
                                                    .add(
                                                        layout
                                                            .createParallelGroup(
                                                                org.jdesktop.layout.GroupLayout
                                                                    .LEADING)
                                                            .add(
                                                                jTextFieldApplication,
                                                                org.jdesktop.layout.GroupLayout
                                                                    .PREFERRED_SIZE,
                                                                145,
                                                                org.jdesktop.layout.GroupLayout
                                                                    .PREFERRED_SIZE)
                                                            .add(jLabel1))
                                                    .add(4, 4, 4)
                                                    .add(
                                                        layout
                                                            .createParallelGroup(
                                                                org.jdesktop.layout.GroupLayout
                                                                    .LEADING)
                                                            .add(jLabel2)
                                                            .add(
                                                                jTextFieldVersion,
                                                                org.jdesktop.layout.GroupLayout
                                                                    .DEFAULT_SIZE,
                                                                140,
                                                                Short.MAX_VALUE)))))
                            .add(
                                layout
                                    .createSequentialGroup()
                                    .add(106, 106, 106)
                                    .add(
                                        jButtonOk,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        101,
                                        Short.MAX_VALUE)
                                    .add(94, 94, 94)))
                    .addContainerGap()));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .add(
                        layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel1)
                            .add(jLabel2))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(
                                jTextFieldApplication,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(
                                jTextFieldVersion,
                                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(
                        jScrollPane1,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        300,
                        Short.MAX_VALUE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(jButtonOk)
                    .addContainerGap()));
    return panel;
  }
Beispiel #19
0
  /** 程式的GUI畫面配置,並登入按鈕、選項監聽。 */
  private void GUI() {
    JMenuBar menuBar = new JMenuBar();
    setJMenuBar(menuBar);

    JMenu fileMenu = new JMenu("File");
    menuBar.add(fileMenu);

    JMenuItem file_newMenuItem = new JMenuItem("New");
    file_newMenuItem.setIcon(
        new ImageIcon(
            DocumentEditGUI.class.getResource("/javax/swing/plaf/metal/icons/ocean/file.gif")));
    file_newMenuItem.addActionListener(new SystemFileNew());
    fileMenu.add(file_newMenuItem);

    JMenuItem file_openMenuItem = new JMenuItem("Open File...");
    file_openMenuItem.setIcon(
        new ImageIcon(
            DocumentEditGUI.class.getResource(
                "/com/sun/java/swing/plaf/windows/icons/TreeOpen.gif")));
    file_openMenuItem.addActionListener(new SystemFileOpen());
    fileMenu.add(file_openMenuItem);

    JMenu file_saveMenu = new JMenu("Save");
    fileMenu.add(file_saveMenu);

    JMenuItem file_save_saveMenuItem = new JMenuItem("Save");
    file_save_saveMenuItem.setIcon(
        new ImageIcon(
            DocumentEditGUI.class.getResource(
                "/com/sun/java/swing/plaf/windows/icons/FloppyDrive.gif")));
    file_save_saveMenuItem.addActionListener(new SystemFileSave());
    file_save_saveMenuItem.setAccelerator(
        KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_MASK));
    file_saveMenu.add(file_save_saveMenuItem);

    JMenuItem file_save_save_asMenuItem = new JMenuItem("Save as");
    file_save_save_asMenuItem.addActionListener(new SystemFileSaveAS());
    file_saveMenu.add(file_save_save_asMenuItem);

    JMenuItem file_save_save_allMenuItem = new JMenuItem("Save all");
    file_save_save_allMenuItem.setAccelerator(
        KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK));
    file_save_save_allMenuItem.addActionListener(new SystemFileSaveAll());
    file_saveMenu.add(file_save_save_allMenuItem);

    JMenu file_closeMenu = new JMenu("Close");
    fileMenu.add(file_closeMenu);

    JMenuItem file_close_closeMenuItem = new JMenuItem("Close File");
    file_close_closeMenuItem.addActionListener(new SystemFileClose());
    file_closeMenu.add(file_close_closeMenuItem);

    JMenuItem file_close_close_all_fileMenuItem = new JMenuItem("Close all File");
    file_close_close_all_fileMenuItem.addActionListener(new SystemFileCloseAll());
    file_closeMenu.add(file_close_close_all_fileMenuItem);

    JMenuItem file_exitMenuItem = new JMenuItem("Exit");
    file_exitMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F4, InputEvent.ALT_MASK));
    file_exitMenuItem.addActionListener(new SystemExit());
    fileMenu.add(file_exitMenuItem);

    JMenu editMenu = new JMenu("Edit");
    menuBar.add(editMenu);

    replace_searchMenuItem.addActionListener(replace_search);
    replace_searchMenuItem.setAccelerator(
        KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.CTRL_MASK));
    editMenu.add(replace_searchMenuItem);

    SystemEditCut_Copy_Paste cut_copy_paste = new SystemEditCut_Copy_Paste();
    cutMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_MASK));
    cutMenuItem.addActionListener(cut_copy_paste);
    editMenu.add(cutMenuItem);
    copyMenutem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK));

    copyMenutem.addActionListener(cut_copy_paste);
    editMenu.add(copyMenutem);
    pasteMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK));

    pasteMenuItem.addActionListener(cut_copy_paste);
    editMenu.add(pasteMenuItem);

    JMenuItem pathMenuItem = new JMenuItem("Default AutoSave-Path");
    pathMenuItem.addActionListener(new SystemEditSetPath());
    editMenu.add(pathMenuItem);

    JMenu helpMenu = new JMenu("Help");
    menuBar.add(helpMenu);

    JMenuItem HelpMenuItem = new JMenuItem("Help");
    HelpMenuItem.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            JOptionPane.showMessageDialog(null, help, "Help!", JOptionPane.INFORMATION_MESSAGE);
          }
        });
    helpMenu.add(HelpMenuItem);

    JMenuItem AboutNewMenuItem = new JMenuItem("About");
    AboutNewMenuItem.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            JOptionPane.showMessageDialog(null, about, "About...", JOptionPane.INFORMATION_MESSAGE);
          }
        });
    helpMenu.add(AboutNewMenuItem);

    JToolBar toolBar = new JToolBar();
    getContentPane().add(toolBar, BorderLayout.NORTH);

    scrollPane.setViewportView(td);
    JButton newFileButton = new JButton("New");
    newFileButton.setIcon(
        new ImageIcon(
            DocumentEditGUI.class.getResource("/javax/swing/plaf/metal/icons/ocean/file.gif")));
    newFileButton.setToolTipText("New File.");
    newFileButton.addActionListener(new SystemFileNew());
    toolBar.add(newFileButton);

    JButton openFileButton = new JButton("Open");
    openFileButton.setIcon(
        new ImageIcon(
            DocumentEditGUI.class.getResource(
                "/javax/swing/plaf/metal/icons/ocean/directory.gif")));
    openFileButton.setToolTipText("Open File.");
    openFileButton.addActionListener(new SystemFileOpen());
    toolBar.add(openFileButton);

    JButton save_asFileButton = new JButton("Save as");
    save_asFileButton.setToolTipText("Save as File.");
    save_asFileButton.addActionListener(new SystemFileSaveAS());
    toolBar.add(save_asFileButton);

    JButton saveFileButton = new JButton("Save");
    saveFileButton.setIcon(
        new ImageIcon(
            DocumentEditGUI.class.getResource("/javax/swing/plaf/metal/icons/ocean/floppy.gif")));
    saveFileButton.setToolTipText("Savet his File.");
    saveFileButton.addActionListener(new SystemFileSave());
    toolBar.add(saveFileButton);

    JButton save_allFileButton = new JButton("Save all");
    save_allFileButton.setToolTipText("Save all File.");
    save_allFileButton.addActionListener(new SystemFileSaveAll());
    toolBar.add(save_allFileButton);

    JButton closeButton = new JButton("Close");
    closeButton.setToolTipText("Close this file.");
    closeButton.addActionListener(new SystemFileClose());
    toolBar.add(closeButton);

    JButton close_allButton = new JButton("Close all");
    close_allButton.setToolTipText("Close al File.");
    close_allButton.addActionListener(new SystemFileCloseAll());
    toolBar.add(close_allButton);
  }
  // Initialize Components and set the layout of the dialog
  private void initComponents() {
    emailLabel = new JLabel();
    smtpLabel = new JLabel();
    smtpUserLabel = new JLabel();
    smtpPassword = new JPasswordField();
    smtp = new JTextField();
    smtpPort = new JTextField();
    smtpPsswdLabel = new JLabel();
    smtpUsername = new JTextField();
    jScrollPane1 = new JScrollPane();
    studentsTbl = new JXTable();
    ok = new JButton();
    cancel = new JButton();
    smtpPortLabel = new JLabel();
    email = new JTextField();

    setTitle("Send Email");
    setMinimumSize(new Dimension(100, 100));
    setResizable(false);

    emailLabel.setText("Source Email Address:");

    smtpLabel.setText("SMTP Server:");

    smtpUserLabel.setText("SMTP Username:"******"SMTP Password:"******"Send Email");
    ok.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            okActionPerformed(evt);
          }
        });

    cancel.setText("Cancel");
    cancel.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            cancelActionPerformed(evt);
          }
        });

    smtpPortLabel.setText("SMTP Port:");

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(ok)
                                    .addGap(18, 18, 18)
                                    .addComponent(cancel))
                            .addGroup(
                                layout
                                    .createParallelGroup(
                                        javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(
                                        jScrollPane1,
                                        javax.swing.GroupLayout.Alignment.LEADING,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        0,
                                        Short.MAX_VALUE)
                                    .addGroup(
                                        javax.swing.GroupLayout.Alignment.LEADING,
                                        layout
                                            .createSequentialGroup()
                                            .addGroup(
                                                layout
                                                    .createParallelGroup(
                                                        javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(smtpLabel)
                                                    .addComponent(smtpPortLabel))
                                            .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement
                                                    .UNRELATED)
                                            .addGroup(
                                                layout
                                                    .createParallelGroup(
                                                        javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(
                                                        layout
                                                            .createSequentialGroup()
                                                            .addGroup(
                                                                layout
                                                                    .createParallelGroup(
                                                                        javax.swing.GroupLayout
                                                                            .Alignment.LEADING)
                                                                    .addGroup(
                                                                        layout
                                                                            .createSequentialGroup()
                                                                            .addComponent(
                                                                                smtp,
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .PREFERRED_SIZE,
                                                                                90,
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .PREFERRED_SIZE)
                                                                            .addGap(18, 18, 18)
                                                                            .addComponent(
                                                                                smtpUserLabel))
                                                                    .addGroup(
                                                                        layout
                                                                            .createSequentialGroup()
                                                                            .addComponent(
                                                                                smtpPort,
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .PREFERRED_SIZE,
                                                                                90,
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .PREFERRED_SIZE)
                                                                            .addGap(18, 18, 18)
                                                                            .addComponent(
                                                                                smtpPsswdLabel)))
                                                            .addGap(18, 18, 18)
                                                            .addGroup(
                                                                layout
                                                                    .createParallelGroup(
                                                                        javax.swing.GroupLayout
                                                                            .Alignment.LEADING)
                                                                    .addComponent(
                                                                        smtpPassword,
                                                                        javax.swing.GroupLayout
                                                                            .PREFERRED_SIZE,
                                                                        90,
                                                                        javax.swing.GroupLayout
                                                                            .PREFERRED_SIZE)
                                                                    .addComponent(
                                                                        smtpUsername,
                                                                        javax.swing.GroupLayout
                                                                            .PREFERRED_SIZE,
                                                                        90,
                                                                        javax.swing.GroupLayout
                                                                            .PREFERRED_SIZE)))
                                                    .addGroup(
                                                        layout
                                                            .createSequentialGroup()
                                                            .addComponent(emailLabel)
                                                            .addPreferredGap(
                                                                javax.swing.LayoutStyle
                                                                    .ComponentPlacement.RELATED)
                                                            .addComponent(
                                                                email,
                                                                javax.swing.GroupLayout
                                                                    .PREFERRED_SIZE,
                                                                121,
                                                                javax.swing.GroupLayout
                                                                    .PREFERRED_SIZE))))))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                emailLabel,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                22,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                email,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(smtpLabel)
                            .addComponent(
                                smtp,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(smtpUserLabel)
                            .addComponent(
                                smtpUsername,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(smtpPortLabel)
                            .addGroup(
                                layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(
                                        smtpPort,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(
                                        smtpPassword,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(smtpPsswdLabel)))
                    .addGap(18, 18, 18)
                    .addComponent(
                        jScrollPane1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        131,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cancel)
                            .addComponent(ok))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    pack();
    setLocationRelativeTo(null);
  }
Beispiel #21
0
 public void reload() {
   this.remove(jsp);
   selectorPanel = new SelectorPanel();
   jsp.setViewportView(selectorPanel);
   this.add(jsp, BorderLayout.CENTER);
 }
  /**
   * Create the train module GUI (the dynamic and static windows). Both windows are HIDE_ON_CLOSE so
   * that closing them does not cause the train module to close.
   */
  public TrainModelUI() {
    try {
      JPanel emptyJPanel = new JPanel();
      emptyJPanel.add(new JLabel("            "));
      isPaused = true;

      // Setup the dynamicWindow.

      btnShowStaticValues = buildJButton("Show Static Values");
      btnSelectTrain = buildJButton("Select Train");
      btnPauseResume = buildJButton("Pause");
      btnPauseResume.setEnabled(false);
      btnSetManRecPower = buildJButton("Set Manual Received Power");
      btnToggleManRecPower = buildJButton("Toggle Manual Received Power");
      btnSetManDesSpdLmt = buildJButton("Set Manual Desired Speed Limit");
      btnToggleManDesSpdLmt = buildJButton("Toggle Manual Desired Speed Limit");
      btnToggleSignalPickupFailure = buildJButton("Toggle Signal Pickup Failure");
      btnToggleEngineFailure = buildJButton("Toggle Engine Failure");
      btnToggleBrakeFailure = buildJButton("Toggle Brake Failure");
      btnToggleServiceBrake = buildJButton("Toggle Service Brake");
      btnToggleEmergencyBrake = buildJButton("Toggle Emergency Brake");
      btnSetManLights = buildJButton("Set Manual Lights Status");
      btnToggleManLights = buildJButton("Toggle Manual Lights Status");
      btnSetManDoors = buildJButton("Set Manual Doors Status");
      btnToggleManDoors = buildJButton("Toggle Manual Doors Status");
      btnSetManTarTemperature = buildJButton("Set Manual Target Temp.");
      btnToggleManTarTemperature = buildJButton("Toggle Manual Target Temp.");

      jlTime = new JLabel("XX:XX:XX", JLabel.CENTER);
      jlCurVel = new JLabel("", JLabel.CENTER);
      jlCurAccel = new JLabel("", JLabel.CENTER);
      jlRecPowerTNC = new JLabel("", JLabel.CENTER);
      jlManRecPower = new JLabel("", JLabel.CENTER);
      jlToggleManRecPower = new JLabel("", JLabel.CENTER);
      jlPostedSpdLmt = new JLabel("", JLabel.CENTER);
      jlManDesSpdLmt = new JLabel("", JLabel.CENTER);
      jlToggleManDesSpdLmt = new JLabel("", JLabel.CENTER);
      jlGrade = new JLabel("", JLabel.CENTER);
      jlTotalMass = new JLabel("", JLabel.CENTER);
      jlPassengerCount = new JLabel("", JLabel.CENTER);
      jlCrewCount = new JLabel("", JLabel.CENTER);
      jlPosition = new JLabel("", JLabel.CENTER);
      jlToggleSignalPickupFailure = new JLabel("", JLabel.CENTER);
      jlToggleEngineFailure = new JLabel("", JLabel.CENTER);
      jlToggleBrakeFailure = new JLabel("", JLabel.CENTER);
      jlToggleServiceBrake = new JLabel("", JLabel.CENTER);
      jlToggleEmergencyBrake = new JLabel("", JLabel.CENTER);
      jlLights = new JLabel("", JLabel.CENTER);
      jlManLights = new JLabel("", JLabel.CENTER);
      jlToggleManLights = new JLabel("", JLabel.CENTER);
      jlDoors = new JLabel("", JLabel.CENTER);
      jlManDoors = new JLabel("", JLabel.CENTER);
      jlToggleManDoors = new JLabel("", JLabel.CENTER);
      jlCurTemperature = new JLabel("", JLabel.CENTER);
      jlTarTemperature = new JLabel("", JLabel.CENTER);
      jlManTarTemperature = new JLabel("", JLabel.CENTER);
      jlToggleManTarTemperature = new JLabel("", JLabel.CENTER);
      jlAnnouncement = new JLabel("", JLabel.CENTER);

      JPanel dwPanel1 = new JPanel();
      dwPanel1.setLayout(new GridLayout(18, 2));
      dwPanel1.add(buildJPanel(new JLabel("Current Velocity (m/s)", JLabel.CENTER)));
      dwPanel1.add(buildJPanel(jlCurVel));
      dwPanel1.add(buildJPanel(new JLabel("Current Acceleration (m/s^2)", JLabel.CENTER)));
      dwPanel1.add(buildJPanel(jlCurAccel));
      dwPanel1.add(buildJPanel(new JLabel("Received Power from TNC (W)", JLabel.CENTER)));
      dwPanel1.add(buildJPanel(jlRecPowerTNC));
      dwPanel1.add(buildJPanel(btnSetManRecPower));
      dwPanel1.add(buildJPanel(jlManRecPower));
      dwPanel1.add(buildJPanel(btnToggleManRecPower));
      dwPanel1.add(buildJPanel(jlToggleManRecPower));
      dwPanel1.add(buildJPanel(new JLabel("Speed Limit Posted on Signs (m/s)", JLabel.CENTER)));
      dwPanel1.add(buildJPanel(jlPostedSpdLmt));
      dwPanel1.add(buildJPanel(btnSetManDesSpdLmt));
      dwPanel1.add(buildJPanel(jlManDesSpdLmt));
      dwPanel1.add(buildJPanel(btnToggleManDesSpdLmt));
      dwPanel1.add(buildJPanel(jlToggleManDesSpdLmt));
      dwPanel1.add(buildJPanel(new JLabel("Relative Grade from TKM (%)", JLabel.CENTER)));
      dwPanel1.add(buildJPanel(jlGrade));
      dwPanel1.add(
          buildJPanel(new JLabel("Total Mass (inc. passengers/crew) (kg)", JLabel.CENTER)));
      dwPanel1.add(buildJPanel(jlTotalMass));
      dwPanel1.add(buildJPanel(new JLabel("Passenger Count", JLabel.CENTER)));
      dwPanel1.add(buildJPanel(jlPassengerCount));
      dwPanel1.add(buildJPanel(new JLabel("Crew Count", JLabel.CENTER)));
      dwPanel1.add(buildJPanel(jlCrewCount));
      dwPanel1.add(
          buildJPanel(new JLabel("Position from Onboard GPS ([block], m)", JLabel.CENTER)));
      dwPanel1.add(buildJPanel(jlPosition));
      dwPanel1.add(buildJPanel(btnToggleSignalPickupFailure));
      dwPanel1.add(buildJPanel(jlToggleSignalPickupFailure));
      dwPanel1.add(buildJPanel(btnToggleEngineFailure));
      dwPanel1.add(buildJPanel(jlToggleEngineFailure));
      dwPanel1.add(buildJPanel(btnToggleBrakeFailure));
      dwPanel1.add(buildJPanel(jlToggleBrakeFailure));
      dwPanel1.add(buildJPanel(btnToggleServiceBrake));
      dwPanel1.add(buildJPanel(jlToggleServiceBrake));
      dwPanel1.add(buildJPanel(btnToggleEmergencyBrake));
      dwPanel1.add(buildJPanel(jlToggleEmergencyBrake));
      JPanel dwPanel2 = new JPanel();
      dwPanel2.setLayout(new GridLayout(18, 2));
      dwPanel2.add(buildJPanel(new JLabel("Lights Status", JLabel.CENTER)));
      dwPanel2.add(buildJPanel(jlLights));
      dwPanel2.add(buildJPanel(btnSetManLights));
      dwPanel2.add(buildJPanel(jlManLights));
      dwPanel2.add(buildJPanel(btnToggleManLights));
      dwPanel2.add(buildJPanel(jlToggleManLights));
      dwPanel2.add(buildJPanel(new JLabel("Doors Status", JLabel.CENTER)));
      dwPanel2.add(buildJPanel(jlDoors));
      dwPanel2.add(buildJPanel(btnSetManDoors));
      dwPanel2.add(buildJPanel(jlManDoors));
      dwPanel2.add(buildJPanel(btnToggleManDoors));
      dwPanel2.add(buildJPanel(jlToggleManDoors));
      dwPanel2.add(buildJPanel(new JLabel("Current Temp. (degrees F)", JLabel.CENTER)));
      dwPanel2.add(buildJPanel(jlCurTemperature));
      dwPanel2.add(buildJPanel(new JLabel("Target Temp. from TNC (degrees F)", JLabel.CENTER)));
      dwPanel2.add(buildJPanel(jlTarTemperature));
      dwPanel2.add(buildJPanel(btnSetManTarTemperature));
      dwPanel2.add(buildJPanel(jlManTarTemperature));
      dwPanel2.add(buildJPanel(btnToggleManTarTemperature));
      dwPanel2.add(buildJPanel(jlToggleManTarTemperature));
      dwPanel2.add(buildJPanel(new JLabel("Announcement", JLabel.CENTER)));
      dwPanel2.add(buildJPanel(jlAnnouncement));

      JPanel primaryButtons = new JPanel();
      primaryButtons.setLayout(new GridLayout(1, 4));
      primaryButtons.add(btnShowStaticValues);
      primaryButtons.add(btnSelectTrain);
      primaryButtons.add(btnPauseResume);
      primaryButtons.add(buildJPanel(jlTime));

      JPanel jp = new JPanel();
      jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS));
      jp.add(primaryButtons);
      jp.add(emptyJPanel);
      jp.add(new JSeparator(JSeparator.HORIZONTAL));
      jp.add(dwPanel1);
      jp.add(new JSeparator(JSeparator.HORIZONTAL));
      jp.add(dwPanel2);

      jp.setMaximumSize(new Dimension(400, 700));

      JScrollPane dScroll = new JScrollPane(jp);
      dScroll.setViewportView(jp);

      dynamicWindow = new JFrame();
      dynamicWindow.setTitle("Train Model (Chris Paskie)   -   UI   (Train ID:   --)");
      dynamicWindow.setSize(600, 400);
      dynamicWindow.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
      dynamicWindow.add(dScroll);
      isVisible = false;
      dynamicWindow.setVisible(isVisible);

      // Setup the staticWindow.

      jlLength = new JLabel("", JLabel.CENTER);
      jlWidth = new JLabel("", JLabel.CENTER);
      jlHeight = new JLabel("", JLabel.CENTER);
      jlNumCars = new JLabel("", JLabel.CENTER);
      jlMotorPower = new JLabel("", JLabel.CENTER);
      jlMaxSpeed = new JLabel("", JLabel.CENTER);
      jlServiceBrakeDecel = new JLabel("", JLabel.CENTER);
      jlEmergencyBrakeDecel = new JLabel("", JLabel.CENTER);
      jlFrictionCoeff = new JLabel("", JLabel.CENTER);
      jlEmptyTrainMass = new JLabel("", JLabel.CENTER);
      jlPersonMass = new JLabel("", JLabel.CENTER);
      jlMaxSeatedCount = new JLabel("", JLabel.CENTER);
      jlMaxStandingCount = new JLabel("", JLabel.CENTER);
      jlMaxCrewCount = new JLabel("", JLabel.CENTER);

      JPanel swPanel = new JPanel();
      swPanel.setLayout(new GridLayout(14, 2));
      swPanel.add(buildJPanel(new JLabel("Length (m)", JLabel.CENTER)));
      swPanel.add(buildJPanel(jlLength));
      swPanel.add(buildJPanel(new JLabel("Width (m)", JLabel.CENTER)));
      swPanel.add(buildJPanel(jlWidth));
      swPanel.add(buildJPanel(new JLabel("Height (m)", JLabel.CENTER)));
      swPanel.add(buildJPanel(jlHeight));
      swPanel.add(buildJPanel(new JLabel("Number of Cars", JLabel.CENTER)));
      swPanel.add(buildJPanel(jlNumCars));
      swPanel.add(buildJPanel(new JLabel("Motor Power (W)", JLabel.CENTER)));
      swPanel.add(buildJPanel(jlMotorPower));
      swPanel.add(buildJPanel(new JLabel("Maximum Speed (m/s)", JLabel.CENTER)));
      swPanel.add(buildJPanel(jlMaxSpeed));
      swPanel.add(buildJPanel(new JLabel("Service Brake Deceleration (m/s^2)", JLabel.CENTER)));
      swPanel.add(buildJPanel(jlServiceBrakeDecel));
      swPanel.add(buildJPanel(new JLabel("Emergency Brake Deceleration (m/s^2)", JLabel.CENTER)));
      swPanel.add(buildJPanel(jlEmergencyBrakeDecel));
      swPanel.add(buildJPanel(new JLabel("Coefficient of Friction", JLabel.CENTER)));
      swPanel.add(buildJPanel(jlFrictionCoeff));
      swPanel.add(
          buildJPanel(new JLabel("Train Mass (not inc. passengers/crew) (kg)", JLabel.CENTER)));
      swPanel.add(buildJPanel(jlEmptyTrainMass));
      swPanel.add(buildJPanel(new JLabel("Mass Per Passenger/Crew (kg)", JLabel.CENTER)));
      swPanel.add(buildJPanel(jlPersonMass));
      swPanel.add(buildJPanel(new JLabel("Maximum Seated Passenger Count", JLabel.CENTER)));
      swPanel.add(buildJPanel(jlMaxSeatedCount));
      swPanel.add(buildJPanel(new JLabel("Maximum Standing Passenger Count", JLabel.CENTER)));
      swPanel.add(buildJPanel(jlMaxStandingCount));
      swPanel.add(buildJPanel(new JLabel("Maximum Crew Count", JLabel.CENTER)));
      swPanel.add(buildJPanel(jlMaxCrewCount));

      staticWindow = new JFrame();
      staticWindow.setTitle("Train Model (Chris Paskie)   -   Static Values   (Train ID:   --)");
      staticWindow.setSize(700, 600);
      staticWindow.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
      staticWindow.add(swPanel);
      isVisibleStatic = false;
      staticWindow.setVisible(isVisibleStatic);

      // Set up the TNC UI.
      if (!isSolo) {
        tncUI = new TNC_UI();
      }

    } catch (Exception e) {
      e.printStackTrace(System.err);
      JOptionPane.showMessageDialog(null, e, "Error", JOptionPane.ERROR_MESSAGE);
    }
  }
  /**
   * Constructor initialises the table and a popup tool, as well as initialising the required GUI
   * elements. It adds action listeners for the three main buttons, which include basic user input
   * validation checking.
   */
  public TableAttributeEditor(JFrame MyOwner) {
    // As usual, it is insanely hard to get the swing components to display
    // and work properly.  If JTable is not displayed in a scroll pane no headers are
    // displayed, and you have to do it manually.  (If you *do* display it
    // in a scrollbar, in this instance, it screws up sizing)
    // The broken header mis-feature is only mentioned in the tutorial,
    // not in the api doco - go figure.

    super();

    owner = MyOwner;

    // final JPanel mainPanel = (JPanel)this;

    tableData = new AttributeTableModel();

    attributeTable = new JTable(tableData);
    // attributeTable.setRowHeight(20);	// This may be needed, depends on how fussy people get about
    // the bottom of letters like 'y' getting cut off when the cell is selected - bug 3013.

    popupTableTool = new SmartPopupTableTool(attributeTable, tableData, (JXplorerBrowser) owner);

    // Set the renderer for the attribute type...
    final AttributeTypeCellRenderer typeRenderer = new AttributeTypeCellRenderer();

    attributeTable.setDefaultRenderer(AttributeNameAndType.class, typeRenderer);

    // Set the renderer for the attribute value...
    final AttributeValueCellRenderer valueRenderer = new AttributeValueCellRenderer();

    attributeTable.setDefaultRenderer(AttributeValue.class, valueRenderer);

    // Set the editor for the attribute value...
    myEditor = new AttributeValueCellEditor(owner);

    attributeTable.setDefaultEditor(AttributeValue.class, myEditor);

    attributeTable.getTableHeader().setReorderingAllowed(false);

    currentDN = null;

    JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
    buttonPanel.add(
        submit =
            new CBButton(
                CBIntText.get("Submit"), CBIntText.get("Submit your changes to the Directory.")));
    buttonPanel.add(
        reset =
            new CBButton(
                CBIntText.get("Reset"),
                CBIntText.get("Reset this entry i.e. cancels any changes.")));
    buttonPanel.add(
        changeClass =
            new CBButton(
                CBIntText.get("Change Classes"),
                CBIntText.get("Change the Object Class of this entry.")));
    buttonPanel.add(
        opAttrs =
            new CBButton(
                CBIntText.get("Properties"),
                CBIntText.get("View the Operational Attributes of this entry.")));

    // I don't really understand why we have to do this...
    // but without it these buttons over ride the default
    // button (Search Bar's search button), if they have
    // been clicked and the user hits the enter key?
    opAttrs.setDefaultCapable(false);
    submit.setDefaultCapable(false);
    reset.setDefaultCapable(false);
    changeClass.setDefaultCapable(false);

    setLayout(new BorderLayout(10, 10));

    tableScroller = new JScrollPane();
    attributeTable.setBackground(Color.white);
    tableScroller.setPreferredSize(new Dimension(300, 285));
    tableScroller.setViewportView(attributeTable);
    add(tableScroller, BorderLayout.CENTER);
    add(buttonPanel, BorderLayout.SOUTH);

    if ("true".equals(JXConfig.getProperty("lock.read.only")))
      title = CBIntText.get("Table Viewer");
    else title = CBIntText.get("Table Editor");

    setVisible(true);

    // triggers adding operational attributes of the current entry.
    opAttrs.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            displayOperationalAttributes();
          }
        });

    reset.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            myEditor.stopCellEditing();
            // tableData.reset();
            displayEntry(originalEntry, dataSource, false);
          }
        });

    submit.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            doSubmit();
          }
        });

    // This allows the user to change the objectclass attribute.
    // This is pretty tricky, because it changes what attributes are available.
    changeClass.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            changeClass();
          }
        });

    attributeTable.addMouseListener(
        new MouseAdapter() {
          public void mousePressed(MouseEvent e) {
            if (!doPopupStuff(e)) super.mousePressed(e);
          }

          public void mouseReleased(MouseEvent e) {
            if (!doPopupStuff(e)) super.mouseReleased(e);
          }

          // TODO need to have a way to call this from a keystroke...
          public boolean doPopupStuff(MouseEvent e) {
            if (e.isPopupTrigger() == false) return false;

            int row = attributeTable.rowAtPoint(new Point(e.getX(), e.getY()));

            attributeTable.clearSelection();
            attributeTable.addRowSelectionInterval(row, row);
            attributeTable.repaint();

            popupTableTool.registerCurrentRow(
                (AttributeNameAndType) attributeTable.getValueAt(row, 0),
                (AttributeValue) attributeTable.getValueAt(row, 1),
                row,
                tableData.getRDN()); // active path also set by valueChanged
            popupTableTool.show(attributeTable, e.getX(), e.getY());
            popupTableTool.registerCellEditor(myEditor); // TE: for bug fix 3107.
            return true;
          }
        });
  }
  /** GUI element creating and arrangment. Partially generated using NetBeans IDE GUI utilities. */
  @SuppressWarnings("unchecked")
  private void initComponents() {
    jButtonOldPackages = new JButton();
    jTextDate = new JTextField();
    jButtonSetLost = new JButton();
    jButtonSetFound = new JButton();
    jButtonShowLost = new JButton();
    jButtonExit = new JButton();
    jButtonReset = new JButton();
    jScrollPane1 = new JScrollPane();
    jListScans = new JList();
    jScrollPane2 = new JScrollPane();
    jListPackages = new JList();

    jButtonSetFound.setEnabled(false);
    jButtonSetLost.setEnabled(false);

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    jButtonOldPackages.setText("Timed out packages");
    jButtonOldPackages.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent event) {
            buttonOldPackagesActionPerformed(event);
          }
        });

    ListSelectionListener listSelectionListener =
        new ListSelectionListener() {
          public void valueChanged(ListSelectionEvent event) {
            jListPackagesActionPertformed(event);
          }
        };

    jButtonExit.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent event) {
            System.exit(0);
          }
        });

    jButtonSetLost.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent event) {
            buttonSetLostActionPerformed(event);
          }
        });

    jButtonSetFound.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent event) {
            buttonSetFoundActionPerformed(event);
          }
        });

    jButtonShowLost.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent event) {
            buttonShowLostActionPerformed(event);
          }
        });

    jButtonReset.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent event) {
            reset(event);
          }
        });

    jListPackages.addListSelectionListener(listSelectionListener);

    jButtonSetLost.setText("List as Lost");
    jButtonShowLost.setText("Lost Packages");
    jButtonSetFound.setText("List as Found");
    jButtonExit.setText("Logout");
    jButtonReset.setText("Reset");

    jScrollPane2.setViewportView(jListPackages);
    jScrollPane2.setPreferredSize(new Dimension(200, 200));
    jListPackages.setFixedCellWidth(400);

    jScrollPane1.setViewportView(jListScans);
    // Layout
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(
                        jScrollPane2,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        300,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(111, 111, 111)
                    .addComponent(
                        jScrollPane1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        300,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(111, 111, 111)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                jTextDate,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                120,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                jButtonSetLost, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(
                                jButtonOldPackages, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(
                                jButtonShowLost, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(
                                jButtonSetFound, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jButtonReset, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jButtonExit, javax.swing.GroupLayout.Alignment.TRAILING))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGap(42, 42, 42)
                                    .addComponent(
                                        jTextDate,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jButtonOldPackages)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jButtonSetLost)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jButtonSetFound)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jButtonShowLost)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jButtonReset)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jButtonExit))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addContainerGap()
                                    .addComponent(
                                        jScrollPane1,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        258,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(
                                jScrollPane2,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                289,
                                Short.MAX_VALUE))
                    .addContainerGap()));

    pack();
  }
Beispiel #25
0
  private void init() throws Exception {
    this.setResizable(true);
    String title = "Edit owners";
    if (propText.size() == 0) {
      title += " (no propositions selected)";
    } else if (propText.size() == 1) {
      title +=
          " of proposition: \""
              + DiagramBase.prepareMessageLabel(
                  (String) propText.elementAt(0), DiagramBase.MAX_MESSAGELABEL_SIZE)
              + "\"";
    } else {
      title += " (" + propText.size() + " propositions selected)";
    }
    this.setTitle(title);
    masterPanel = new SizedPanel(600, 300);
    masterPanel.setLayout(new BorderLayout());
    this.getContentPane().add(masterPanel);
    //    okButton.setActionCommand("okButton");
    okButton.setMnemonic(KeyEvent.VK_C);
    buttonPanel.add(okButton);
    okButton.addActionListener(this);
    masterPanel.add(buttonPanel, BorderLayout.SOUTH);

    TablePanel ownerSourcePanel = new TablePanel(new BorderLayout());

    JPanel topSourcePanel = new JPanel(new BorderLayout());
    topSourcePanel.add(new JLabel("Owner name:", JLabel.LEFT), BorderLayout.NORTH);
    ownerText = new JTextField();
    topSourcePanel.add(ownerText, BorderLayout.CENTER);
    JPanel buttonSourcePanel = new JPanel();
    deleteSourceButton = new JButton("Delete");
    deleteSourceButton.setMnemonic(KeyEvent.VK_D);
    deleteSourceButton.addActionListener(this);
    addOwnerButton = new JButton("Add");
    addOwnerButton.setMnemonic(KeyEvent.VK_A);
    addOwnerButton.addActionListener(this);
    buttonSourcePanel.add(addOwnerButton);
    buttonSourcePanel.add(deleteSourceButton);
    topSourcePanel.add(buttonSourcePanel, BorderLayout.SOUTH);
    ownerSourcePanel.add(topSourcePanel, BorderLayout.SOUTH);

    ownerSourceTable = new JTable();
    ownerSourceScrollPane = new JScrollPane();
    ownerSourceScrollPane.setViewportView(ownerSourceTable);
    ownerSourcePanel.add(new JLabel("Available owners", JLabel.CENTER), BorderLayout.NORTH);
    ownerSourcePanel.add(ownerSourceScrollPane, BorderLayout.CENTER);
    ownerSourceTableModel = new OwnerSourceTableModel(araucaria, ownerSourceTable, this);
    ownerSourceTable.setModel(ownerSourceTableModel);
    ownerSourceTableModel.updateTable(araucaria.getArgument().getOwnerList());
    masterPanel.add(ownerSourcePanel, BorderLayout.WEST);

    TablePanel ownerNodesPanel = new TablePanel(new BorderLayout());
    ownerNodesTable = new JTable();
    ownerNodesScrollPane = new JScrollPane();
    ownerNodesScrollPane.setViewportView(ownerNodesTable);
    ownerNodesPanel.add(
        new JLabel("Owners assigned to proposition(s)", JLabel.CENTER), BorderLayout.NORTH);
    ownerNodesPanel.add(ownerNodesScrollPane, BorderLayout.CENTER);
    ownerNodesTableModel = new OwnerNodesTableModel(araucaria, ownerNodesTable);
    ownerNodesTable.setModel(ownerNodesTableModel);
    ownerNodesTableModel.updateTable(araucaria.getArgument().getSelectedVertexOwners());
    masterPanel.add(ownerNodesPanel, BorderLayout.EAST);

    setupArrows();
    JPanel arrowBox = new JPanel(new GridLayout(3, 1, 10, 10));
    if (propText.size() > 0) {
      arrowBox.add(leftArrow);
      arrowBox.add(rightArrow);
    }
    JPanel arrowPanel = new JPanel();
    arrowPanel.add(arrowBox);
    masterPanel.add(arrowPanel, BorderLayout.CENTER);
  }
  /**
   * 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 Windows Form
   * Designer. Otherwise, retrieving design might not work properly. Tip: If you must revise this
   * method, please backup this GUI file for JFrameBuilder to retrieve your design properly in
   * future, before revising this method.
   */
  private void initializeComponent() {
    jLabel1 = new JLabel();
    jLabel2 = new JLabel();
    jLabel3 = new JLabel();
    jLabel4 = new JLabel();
    jLabel5 = new JLabel();
    jLabel6 = new JLabel("Pets");
    jLabel7 = new JLabel("Drinking");
    jLabel8 = new JLabel("Smoking");
    jButton1 = new JButton("Back");

    passion = new JEditorPane();
    passion1 = new JScrollPane();
    books = new JEditorPane();
    books1 = new JScrollPane();
    movies = new JEditorPane();
    movies1 = new JScrollPane();
    /*
    jTextField1 = new JTextField();
    jTextField2 = new JTextField();
    jTextField3 = new JTextField();
    */
    jTextField4 = new JTextField();
    jTextField5 = new JTextField();
    jTextField6 = new JTextField();
    jTextField7 = new JTextField();
    jTextField8 = new JTextField();

    passion1.setViewportView(passion);
    books1.setViewportView(books);
    movies1.setViewportView(movies);

    contentPane = (JPanel) this.getContentPane();

    // set editable false

    passion.setEditable(false);
    books.setEditable(false);
    movies.setEditable(false);
    jTextField4.setEditable(false);
    jTextField5.setEditable(false);
    jTextField6.setEditable(false);
    jTextField7.setEditable(false);
    jTextField8.setEditable(false);

    //
    // jLabel1
    //
    jLabel1.setText("Passion");
    //
    // jLabel2
    //
    jLabel2.setText("Books");
    //
    // jLabel3
    //
    jLabel3.setText("Movies");
    //
    // jLabel4
    //
    jLabel4.setText("Living");
    //
    // jLabel5
    //
    jLabel5.setText("Fashion");
    //
    // jTextField1
    //

    /*
    jTextField1.addActionListener(new ActionListener() {
    	public void actionPerformed(ActionEvent e)
    	{
    		jTextField1_actionPerformed(e);
    	}

    });
    //
    // jTextField2
    //

    jTextField2.addActionListener(new ActionListener() {
    	public void actionPerformed(ActionEvent e)
    	{
    		jTextField2_actionPerformed(e);
    	}

    });
    //
    // jTextField3
    //

    jTextField3.addActionListener(new ActionListener() {
    	public void actionPerformed(ActionEvent e)
    	{
    		jTextField3_actionPerformed(e);
    	}

    });

    */
    //
    // jTextField4
    //

    jTextField4.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            jTextField4_actionPerformed(e);
          }
        });
    //
    // jTextField5
    //

    jTextField5.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            jTextField5_actionPerformed(e);
          }
        });

    jButton1.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            jButton1_actionPerformed(e);
          }
        });
    //
    // contentPane
    //
    contentPane.setLayout(null);
    contentPane.setBackground(new Color(158, 168, 237));
    addComponent(contentPane, jLabel1, 36, 97, 86, 26);
    addComponent(contentPane, jLabel2, 34, 238, 60, 18);
    addComponent(contentPane, jLabel3, 33, 373, 60, 18);
    addComponent(contentPane, jLabel4, 31, 440, 60, 18);
    addComponent(contentPane, jLabel5, 30, 484, 60, 18);
    addComponent(contentPane, jLabel6, 30, 527, 60, 18);
    addComponent(contentPane, jLabel7, 30, 567, 60, 18);
    addComponent(contentPane, jLabel8, 30, 612, 60, 18);
    addComponent(contentPane, passion1, 237, 59, 350, 96);
    addComponent(contentPane, books1, 236, 189, 350, 96);
    addComponent(contentPane, movies1, 236, 320, 350, 98);
    addComponent(contentPane, jTextField4, 237, 440, 350, 22);
    addComponent(contentPane, jTextField5, 237, 484, 350, 22);
    addComponent(contentPane, jTextField6, 237, 527, 350, 22);
    addComponent(contentPane, jTextField7, 237, 567, 350, 22);
    addComponent(contentPane, jTextField8, 237, 612, 350, 22);
    addComponent(contentPane, jButton1, 456, 654, 74, 25);

    //
    // viewprofile1
    //

    passion.setBackground(new Color(161, 247, 241));
    books.setBackground(new Color(244, 195, 103));
    movies.setBackground(new Color(239, 122, 247));
    jTextField4.setBackground(new Color(161, 247, 241));
    jTextField5.setBackground(new Color(244, 195, 103));
    jTextField6.setBackground(new Color(239, 122, 247));
    jTextField7.setBackground(new Color(161, 247, 241));
    jTextField8.setBackground(new Color(244, 195, 103));
    this.setTitle("viewprofile1 - extends JFrame");
    this.setLocation(new Point(0, 0));
    this.setSize(new Dimension(1024, 768));
  }
Beispiel #27
0
  private void initComponents() {
    try {
      for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
        if ("Nimbus".equals(info.getName())) {
          UIManager.setLookAndFeel(info.getClassName());
          break;
        }
      }
    } catch (Exception e) {
      // If Nimbus is not available, you can set the GUI to another look and feel.
    }

    usernameLabel = new JLabel();
    usernameField = new JTextField();
    chatroomScrollPane = new JScrollPane();
    chatroomArea = new JTextArea();
    chatMsgLabel = new JLabel();
    chatMsgField = new JTextField();
    chatIPLabel = new JLabel();
    chatIPField = new JTextField();
    portLabel = new JLabel();
    portField = new JTextField();
    joinButton = new JToggleButton();
    sendButton = new JButton();
    leaveButton = new JButton();
    exitButton = new JButton();

    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    usernameLabel.setText("Username:"******" ");

    chatroomArea.setEditable(false);
    chatroomArea.setColumns(20);
    chatroomArea.setRows(5);
    chatroomScrollPane.setViewportView(chatroomArea);

    chatMsgLabel.setText("Chat Message:");

    chatIPLabel.setText("Chat Group IP");

    chatIPField.setText("224.27.43.188");

    portLabel.setText("Port");

    portField.setText("4001");

    joinButton.setText("JOIN CHAT");
    joinButton.addActionListener(this);

    sendButton.setText("SEND MESSAGE");
    sendButton.addActionListener(this);

    leaveButton.setText("LEAVE CHAT");
    leaveButton.addActionListener(this);

    exitButton.setText("EXIT");
    exitButton.addActionListener(this);

    GroupLayout layout = new GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(GroupLayout.Alignment.LEADING)
                            .addGroup(
                                GroupLayout.Alignment.TRAILING,
                                layout
                                    .createSequentialGroup()
                                    .addGap(0, 0, Short.MAX_VALUE)
                                    .addComponent(usernameLabel)
                                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        usernameField,
                                        GroupLayout.PREFERRED_SIZE,
                                        83,
                                        GroupLayout.PREFERRED_SIZE))
                            .addComponent(chatroomScrollPane)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        layout
                                            .createParallelGroup(GroupLayout.Alignment.LEADING)
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addComponent(chatMsgLabel)
                                                    .addPreferredGap(
                                                        LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(
                                                        chatMsgField,
                                                        GroupLayout.PREFERRED_SIZE,
                                                        296,
                                                        GroupLayout.PREFERRED_SIZE))
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addGroup(
                                                        layout
                                                            .createParallelGroup(
                                                                GroupLayout.Alignment.TRAILING,
                                                                false)
                                                            .addComponent(
                                                                chatIPField,
                                                                GroupLayout.Alignment.LEADING)
                                                            .addComponent(
                                                                chatIPLabel,
                                                                GroupLayout.Alignment.LEADING,
                                                                GroupLayout.DEFAULT_SIZE,
                                                                GroupLayout.DEFAULT_SIZE,
                                                                Short.MAX_VALUE))
                                                    .addGap(18, 18, 18)
                                                    .addGroup(
                                                        layout
                                                            .createParallelGroup(
                                                                GroupLayout.Alignment.LEADING,
                                                                false)
                                                            .addComponent(
                                                                portField,
                                                                GroupLayout.DEFAULT_SIZE,
                                                                46,
                                                                Short.MAX_VALUE)
                                                            .addComponent(
                                                                portLabel,
                                                                GroupLayout.DEFAULT_SIZE,
                                                                GroupLayout.DEFAULT_SIZE,
                                                                Short.MAX_VALUE))
                                                    .addGap(18, 18, 18)
                                                    .addGroup(
                                                        layout
                                                            .createParallelGroup(
                                                                GroupLayout.Alignment.LEADING,
                                                                false)
                                                            .addGroup(
                                                                layout
                                                                    .createSequentialGroup()
                                                                    .addComponent(leaveButton)
                                                                    .addGap(18, 18, 18)
                                                                    .addComponent(
                                                                        exitButton,
                                                                        GroupLayout.DEFAULT_SIZE,
                                                                        GroupLayout.DEFAULT_SIZE,
                                                                        Short.MAX_VALUE))
                                                            .addGroup(
                                                                layout
                                                                    .createSequentialGroup()
                                                                    .addComponent(
                                                                        joinButton,
                                                                        GroupLayout.PREFERRED_SIZE,
                                                                        93,
                                                                        GroupLayout.PREFERRED_SIZE)
                                                                    .addGap(18, 18, 18)
                                                                    .addComponent(sendButton)))))
                                    .addGap(0, 8, Short.MAX_VALUE)))
                    .addContainerGap()));

    layout.setVerticalGroup(
        layout
            .createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(GroupLayout.Alignment.LEADING, false)
                            .addComponent(usernameField)
                            .addComponent(
                                usernameLabel,
                                GroupLayout.DEFAULT_SIZE,
                                GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE))
                    .addGap(3, 3, 3)
                    .addComponent(
                        chatroomScrollPane,
                        GroupLayout.PREFERRED_SIZE,
                        178,
                        GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                chatMsgLabel,
                                GroupLayout.DEFAULT_SIZE,
                                GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(
                                chatMsgField,
                                GroupLayout.PREFERRED_SIZE,
                                GroupLayout.DEFAULT_SIZE,
                                GroupLayout.PREFERRED_SIZE))
                    .addGroup(
                        layout
                            .createParallelGroup(GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(GroupLayout.Alignment.BASELINE)
                                            .addComponent(chatIPLabel)
                                            .addComponent(portLabel))
                                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(GroupLayout.Alignment.BASELINE)
                                            .addComponent(
                                                chatIPField,
                                                GroupLayout.PREFERRED_SIZE,
                                                GroupLayout.DEFAULT_SIZE,
                                                GroupLayout.PREFERRED_SIZE)
                                            .addComponent(
                                                portField,
                                                GroupLayout.PREFERRED_SIZE,
                                                GroupLayout.DEFAULT_SIZE,
                                                GroupLayout.PREFERRED_SIZE)))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGap(16, 16, 16)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                GroupLayout.Alignment.LEADING, false)
                                            .addComponent(
                                                joinButton,
                                                GroupLayout.DEFAULT_SIZE,
                                                GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                sendButton,
                                                GroupLayout.DEFAULT_SIZE,
                                                GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE))
                                    .addGap(8, 8, 8)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(GroupLayout.Alignment.BASELINE)
                                            .addComponent(leaveButton)
                                            .addComponent(exitButton))))
                    .addGap(17, 17, 17)));
    pack();
    setVisible(true);
  }
Beispiel #28
0
  public ContextEditor(Context cntxt) {
    super("Edit User Context: " + localFileName(cntxt));
    ctxt = cntxt;
    windowNum = ctxt.languageName + " Context Editor";
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    listener = new CEListener(this);

    JPanel nameBox = new JPanel();
    nameBox.setLayout(new BoxLayout(nameBox, BoxLayout.LINE_AXIS));
    name = new JTextField(ctxt.languageName, 28);
    name.setMaximumSize(new Dimension(225, 22));
    name.addFocusListener(
        new java.awt.event.FocusAdapter() {

          public void focusLost(java.awt.event.FocusEvent evt) {
            nameFocusLost(evt);
          }
        });

    JLabel nameLabel = new JLabel("Language Name: ");
    nameBox.add(nameLabel);
    nameBox.add(name);

    JPanel folderBox = new JPanel();
    folderBox.setLayout(new BoxLayout(folderBox, BoxLayout.LINE_AXIS));
    folder = new JTextField(ctxt.editDirectory);
    folder.setMaximumSize(new Dimension(225, 22));
    //        folder.addActionListener(listener);
    //        folder.setActionCommand("folder edit");
    folder.addFocusListener(
        new java.awt.event.FocusAdapter() {

          public void focusLost(java.awt.event.FocusEvent evt) {
            folderFocusLost(evt);
          }
        });

    JLabel folderLabel = new JLabel("SILK file folder: ");
    folderBox.add(folderLabel);
    folderBox.add(folder);

    JPanel nameFolderBox = new JPanel();
    nameFolderBox.setLayout(new BoxLayout(nameFolderBox, BoxLayout.PAGE_AXIS));
    nameBox.setAlignmentX(0.5f);
    nameFolderBox.add(nameBox);
    nameFolderBox.add(Box.createRigidArea(new Dimension(0, 4)));
    nameFolderBox.add(folderBox);
    nameFolderBox.setAlignmentX(0.5f);

    buildPopulationBox();

    JPanel btnBoxUDPs = new JPanel(), subBoxUDP = new JPanel();
    btnBoxUDPs.setLayout(new BoxLayout(btnBoxUDPs, BoxLayout.PAGE_AXIS));
    subBoxUDP.setLayout(new BoxLayout(subBoxUDP, BoxLayout.LINE_AXIS));
    int numUDPs = 0;
    if (ctxt.userDefinedProperties != null) {
      numUDPs = ctxt.userDefinedProperties.size();
    }
    String plur = "ies";
    if (numUDPs == 1) {
      plur = "y";
    }
    JLabel udpLabel = new JLabel("Has " + numUDPs + " User-Defined Propert" + plur);
    subBoxUDP.add(udpLabel);
    JButton addUDP = new JButton("Add UDP");
    addUDP.setActionCommand("add UDP");
    addUDP.addActionListener(listener);
    subBoxUDP.add(addUDP);
    btnBoxUDPs.add(subBoxUDP);
    if (numUDPs > 0) {
      Dimension sizer = new Dimension(250, 50);
      String[] udpMenu = genUDPMenu();
      UDPick = new JComboBox(udpMenu);
      UDPick.addActionListener(listener);
      UDPick.setActionCommand("view/edit UDP");
      UDPick.setMinimumSize(sizer);
      UDPick.setMaximumSize(sizer);
      UDPick.setBorder(
          BorderFactory.createTitledBorder(
              BorderFactory.createLineBorder(Color.blue), "View/Edit UDPs"));
      btnBoxUDPs.add(UDPick);
    } //  end of if-any-UDPs-exist

    JPanel domThs = new JPanel();
    domThs.setLayout(new BoxLayout(domThs, BoxLayout.PAGE_AXIS));
    domThs.setBorder(
        BorderFactory.createTitledBorder(
            BorderFactory.createLineBorder(Color.blue), "Kinship System Domain Theories"));
    domThs.setAlignmentX(0.5f);
    JPanel dtRefBtnBox = new JPanel();
    dtRefBtnBox.setLayout(new BoxLayout(dtRefBtnBox, BoxLayout.LINE_AXIS));
    dtRefBtnBox.setAlignmentX(0.0f);
    JLabel dtRefLabel = new JLabel("Terms of Reference ");
    dtRefBtnBox.add(dtRefLabel);
    if (ctxt.domTheoryRefExists()) {
      JButton dtRefEdit = new JButton("Edit Theory");
      dtRefEdit.setActionCommand("edit dtRef");
      dtRefEdit.addActionListener(listener);
      dtRefBtnBox.add(dtRefEdit);
      //            JButton dtRefDelete = new JButton("Delete Theory");
      //            dtRefDelete.setActionCommand("dtRef delete");
      //            dtRefDelete.addActionListener(listener);
      //            dtRefBtnBox.add(dtRefDelete);
    } //  end of if-dt-exists
    else { //  if does not exist
      JLabel dtRefNone = new JLabel("< None >");
      dtRefBtnBox.add(dtRefNone);
      //            JButton dtRefAdd = new JButton("Add Theory");
      //            dtRefAdd.setActionCommand("dtRef add");
      //            dtRefAdd.addActionListener(listener);
      //            dtRefBtnBox.add(dtRefAdd);
    } //  end of does-not-exist
    domThs.add(dtRefBtnBox);

    JPanel dtAddrBtnBox = new JPanel();
    dtAddrBtnBox.setLayout(new BoxLayout(dtAddrBtnBox, BoxLayout.LINE_AXIS));
    dtAddrBtnBox.setAlignmentX(0.0f);
    JLabel dtAddrLabel = new JLabel("Terms of Address ");
    dtAddrBtnBox.add(dtAddrLabel);
    if (ctxt.domTheoryAdrExists()) {
      JButton dtAddrEdit = new JButton("Edit Theory");
      dtAddrEdit.setActionCommand("edit dtAddr");
      dtAddrEdit.addActionListener(listener);
      dtAddrBtnBox.add(dtAddrEdit);
      //            JButton dtAddrViewList = new JButton("Delete Theory");
      //            dtAddrViewList.setActionCommand("dtAddr delete");
      //            dtAddrViewList.addActionListener(listener);
      //            dtAddrBtnBox.add(dtAddrViewList);
    } //  end of if-dt-exists
    else { //  if does not exist
      JLabel dtAddrNone = new JLabel("< None >");
      dtAddrBtnBox.add(dtAddrNone);
      //            JButton dtAddrAdd = new JButton("Add Theory");
      //            dtAddrAdd.setActionCommand("dtAddr add");
      //            dtAddrAdd.addActionListener(listener);
      //            dtAddrBtnBox.add(dtAddrAdd);
    } //  end of does-not-exist
    domThs.add(dtAddrBtnBox);
    // End of the left hand portion
    // Right hand portion follows. it is narrower.

    JPanel polyBox = new JPanel();
    polyBox.setLayout(new BoxLayout(polyBox, BoxLayout.PAGE_AXIS));
    polyBox.setAlignmentX(0.5f);
    JLabel polyLabelA = new JLabel("Polygamy");
    JLabel polyLabelB = new JLabel("Permitted?");
    JRadioButton yesPoly = new JRadioButton("Yes");
    yesPoly.setActionCommand("polygamy yes");
    yesPoly.addActionListener(listener);
    JRadioButton noPoly = new JRadioButton("No");
    noPoly.setActionCommand("polygamy no");
    noPoly.addActionListener(listener);
    if (cntxt.polygamyPermit) {
      yesPoly.setSelected(true);
    } else {
      noPoly.setSelected(true);
    }
    ButtonGroup polyBtns = new ButtonGroup();
    polyBtns.add(yesPoly);
    polyBtns.add(noPoly);
    polyBox.add(polyLabelA);
    polyBox.add(polyLabelB);
    polyBox.add(yesPoly);
    polyBox.add(noPoly);

    JPanel matrixBox = new JPanel();
    matrixBox.setLayout(new BoxLayout(matrixBox, BoxLayout.PAGE_AXIS));
    matrixBox.setAlignmentX(0.5f);
    JLabel matrixLabelA = new JLabel("Kin Term Matrix");
    JLabel matrixLabelC = new JLabel(ctxt.indSerNumGen + " rows");
    JLabel matrixLabelD = new JLabel(ctxt.ktm.numberOfKinTerms() + " terms");
    matrixLabelA.setAlignmentX(0.5f);
    matrixLabelC.setAlignmentX(0.5f);
    matrixLabelD.setAlignmentX(0.5f);
    JButton matrixEditBtn = new JButton("Edit Matrix");
    matrixEditBtn.setEnabled(false);
    matrixEditBtn.setActionCommand("edit matrix");
    matrixEditBtn.addActionListener(listener);
    matrixEditBtn.setAlignmentX(0.5f);
    matrixBox.add(matrixLabelA);
    matrixBox.add(matrixLabelC);
    matrixBox.add(matrixLabelD);
    matrixBox.add(matrixEditBtn);

    JPanel distinctBox = new JPanel();
    distinctBox.setLayout(new BoxLayout(distinctBox, BoxLayout.PAGE_AXIS));
    distinctBox.setAlignmentX(0.5f);
    JLabel distinctLabelA = new JLabel("Distinct Terms");
    JLabel distinctLabelB = new JLabel("of Address");
    distinctLabelA.setAlignmentX(0.5f);
    distinctLabelB.setAlignmentX(0.5f);
    JRadioButton yesDistinct = new JRadioButton("Yes");
    yesDistinct.setActionCommand("distinct yes");
    yesDistinct.addActionListener(listener);
    JRadioButton noDistinct = new JRadioButton("No");
    noDistinct.setActionCommand("distinct no");
    noDistinct.addActionListener(listener);
    yesDistinct.setAlignmentX(0.5f);
    noDistinct.setAlignmentX(0.5f);
    if (ctxt.distinctAdrTerms) {
      yesDistinct.setSelected(true);
    } else {
      noDistinct.setSelected(true);
    }
    ButtonGroup distinctBtns = new ButtonGroup();
    distinctBtns.add(yesDistinct);
    distinctBtns.add(noDistinct);
    distinctBox.add(distinctLabelA);
    distinctBox.add(distinctLabelB);
    distinctBox.add(yesDistinct);
    distinctBox.add(noDistinct);

    /*
     * NOTE: It should be possible to put all these elements directly into
     * the ContentPane. But that doesn't work; the layout is truly ugly and
     * stuff gets stacked on top of other stuff. What works is to put
     * everything into a JPanel with BoxLayout. Then put the JPanel into
     * ContentPane.
     */
    JPanel leftCol = new JPanel();
    leftCol.setLayout(new BoxLayout(leftCol, BoxLayout.PAGE_AXIS));
    leftCol.add(nameFolderBox);
    leftCol.add(Box.createRigidArea(new Dimension(0, 4)));
    leftCol.add(populationBox);
    leftCol.add(Box.createRigidArea(new Dimension(0, 8)));
    leftCol.add(btnBoxUDPs);
    leftCol.add(Box.createRigidArea(new Dimension(0, 8)));
    leftCol.add(domThs);
    leftCol.add(new JLabel(" "));

    JPanel rightCol = new JPanel();
    rightCol.setLayout(new BoxLayout(rightCol, BoxLayout.PAGE_AXIS));
    rightCol.setBorder(
        BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.blue), "Options"));
    rightCol.add(Box.createRigidArea(new Dimension(0, 20)));
    rightCol.add(polyBox);
    rightCol.add(Box.createRigidArea(new Dimension(0, 20)));
    rightCol.add(matrixBox);
    int high = (numUDPs > 0 ? 120 : 20);
    rightCol.add(Box.createRigidArea(new Dimension(0, high)));
    rightCol.add(distinctBox);

    JPanel commentBox = new JPanel();
    commentBox.setLayout(new BoxLayout(commentBox, BoxLayout.PAGE_AXIS));
    commentBox.setBorder(
        BorderFactory.createTitledBorder(
            BorderFactory.createLineBorder(Color.blue), "Notes on this culture:"));
    JScrollPane commentsPane = new JScrollPane();
    comments = new JTextArea();
    comments.setColumns(20);
    comments.setEditable(true);
    comments.setRows(3);
    comments.setText(PersonPanel.restoreLineBreaks(ctxt.comments));
    comments.getDocument().addDocumentListener(new CommentListener());
    commentsPane.setViewportView(comments);
    commentBox.add(commentsPane);

    JPanel guts = new JPanel(); // Holds the guts of this window
    guts.setLayout(new BoxLayout(guts, BoxLayout.LINE_AXIS));
    guts.add(leftCol);
    guts.add(Box.createRigidArea(new Dimension(10, 4)));
    guts.add(rightCol);

    JPanel wholeThing = new JPanel();
    wholeThing.setLayout(new BoxLayout(wholeThing, BoxLayout.PAGE_AXIS));
    wholeThing.add(Box.createRigidArea(new Dimension(0, 4)));
    wholeThing.add(guts);
    wholeThing.add(Box.createRigidArea(new Dimension(0, 8)));
    wholeThing.add(commentBox);
    wholeThing.add(Box.createRigidArea(new Dimension(0, 4)));

    getContentPane().add(wholeThing);

    addInternalFrameListener(this);
    setSize(600, 620);
    setVisible(true);
  } //  end of ContextEditor constructor
Beispiel #29
0
  private void initComponents() {

    dialogPane = new JPanel();
    contentPanel = new JPanel();
    scrollPane1 = new JScrollPane();
    table = new JTable();
    filterPanel = new JPanel();
    filterLabel = new JLabel();
    filterTextField = new JTextField();
    rowCountLabel = new JLabel();
    buttonBar = new JPanel();
    okButton = new JButton();
    cancelButton = new JButton();

    getRootPane().setDefaultButton(okButton);

    final String filterToolTip =
        "Enter multiple filter strings separated by commas.  e.g.  GM12878, ChipSeq";
    filterLabel.setToolTipText(filterToolTip);
    filterTextField.setToolTipText(filterToolTip);

    // ======== this ========
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    // ======== dialogPane ========

    dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12));
    dialogPane.setLayout(new BorderLayout());

    // ======== contentPanel ========

    contentPanel.setLayout(new BorderLayout(0, 10));

    // ======== scrollPane1 ========

    scrollPane1.setViewportView(table);

    contentPanel.add(scrollPane1, BorderLayout.CENTER);

    // ======== panel1 ========

    filterPanel.setLayout(new JideBoxLayout(filterPanel, JideBoxLayout.X_AXIS, 5));

    // ---- label1 ----
    filterLabel.setText("Filter:");
    filterPanel.add(filterLabel, JideBoxLayout.FIX);

    // ---- filterTextField ----
    filterPanel.add(filterTextField, JideBoxLayout.VARY);

    rowCountLabel.setHorizontalAlignment(JLabel.RIGHT);
    JPanel sillyPanel = new JPanel();
    sillyPanel.setLayout(new JideBoxLayout(sillyPanel, JideBoxLayout.X_AXIS, 0));
    sillyPanel.setPreferredSize(new Dimension(100, 28));
    sillyPanel.add(rowCountLabel, JideBoxLayout.VARY);

    filterPanel.add(sillyPanel, JideBoxLayout.FIX);

    contentPanel.add(filterPanel, BorderLayout.NORTH);

    dialogPane.add(contentPanel, BorderLayout.CENTER);

    // ======== buttonBar ========

    buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0));
    buttonBar.setLayout(new GridBagLayout());
    ((GridBagLayout) buttonBar.getLayout()).columnWidths = new int[] {0, 85, 80};
    ((GridBagLayout) buttonBar.getLayout()).columnWeights = new double[] {1.0, 0.0, 0.0};

    // ---- okButton ----
    okButton.setText("Load");
    okButton.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            loadButtonActionPerformed(e);
          }
        });
    buttonBar.add(
        okButton,
        new GridBagConstraints(
            1,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(0, 0, 0, 5),
            0,
            0));

    // ---- cancelButton ----
    cancelButton.setText("Cancel");
    cancelButton.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            cancelButtonActionPerformed(e);
          }
        });
    buttonBar.add(
        cancelButton,
        new GridBagConstraints(
            2,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(0, 0, 0, 0),
            0,
            0));

    dialogPane.add(buttonBar, BorderLayout.SOUTH);

    contentPane.add(dialogPane, BorderLayout.CENTER);
    setSize(700, 620);
    setLocationRelativeTo(getOwner());
  }
 /**
  * Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR
  * call it in your code!
  *
  * @noinspection ALL
  */
 private void $$$setupUI$$$() {
   contentPane = new JPanel();
   contentPane.setLayout(new GridLayoutManager(4, 1, new Insets(10, 10, 10, 10), -1, -1));
   final JPanel panel1 = new JPanel();
   panel1.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
   contentPane.add(
       panel1,
       new GridConstraints(
           3,
           0,
           1,
           1,
           GridConstraints.ANCHOR_SOUTH,
           GridConstraints.FILL_HORIZONTAL,
           GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
           1,
           null,
           null,
           null,
           0,
           false));
   final JPanel panel2 = new JPanel();
   panel2.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1));
   panel1.add(
       panel2,
       new GridConstraints(
           1,
           0,
           1,
           1,
           GridConstraints.ANCHOR_EAST,
           GridConstraints.FILL_VERTICAL,
           GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
           GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
           null,
           null,
           null,
           0,
           false));
   btImport = new JButton();
   btImport.setText("Import");
   panel2.add(
       btImport,
       new GridConstraints(
           0,
           0,
           1,
           1,
           GridConstraints.ANCHOR_CENTER,
           GridConstraints.FILL_HORIZONTAL,
           GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
           GridConstraints.SIZEPOLICY_FIXED,
           null,
           null,
           null,
           0,
           false));
   btCancel = new JButton();
   btCancel.setEnabled(false);
   btCancel.setText("Cancel");
   panel2.add(
       btCancel,
       new GridConstraints(
           0,
           1,
           1,
           1,
           GridConstraints.ANCHOR_CENTER,
           GridConstraints.FILL_HORIZONTAL,
           GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
           GridConstraints.SIZEPOLICY_FIXED,
           null,
           null,
           null,
           0,
           false));
   btClose = new JButton();
   btClose.setText("Close");
   panel2.add(
       btClose,
       new GridConstraints(
           0,
           2,
           1,
           1,
           GridConstraints.ANCHOR_CENTER,
           GridConstraints.FILL_HORIZONTAL,
           GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
           GridConstraints.SIZEPOLICY_FIXED,
           null,
           null,
           null,
           0,
           false));
   final JSeparator separator1 = new JSeparator();
   panel1.add(
       separator1,
       new GridConstraints(
           0,
           0,
           1,
           1,
           GridConstraints.ANCHOR_NORTH,
           GridConstraints.FILL_HORIZONTAL,
           GridConstraints.SIZEPOLICY_WANT_GROW,
           GridConstraints.SIZEPOLICY_WANT_GROW,
           null,
           null,
           null,
           0,
           false));
   final JPanel panel3 = new JPanel();
   panel3.setLayout(new GridLayoutManager(4, 4, new Insets(0, 0, 0, 0), -1, -1));
   contentPane.add(
       panel3,
       new GridConstraints(
           0,
           0,
           1,
           1,
           GridConstraints.ANCHOR_CENTER,
           GridConstraints.FILL_BOTH,
           GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
           GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
           null,
           null,
           null,
           0,
           false));
   final JLabel label1 = new JLabel();
   label1.setText("File path:");
   panel3.add(
       label1,
       new GridConstraints(
           1,
           0,
           1,
           1,
           GridConstraints.ANCHOR_EAST,
           GridConstraints.FILL_NONE,
           GridConstraints.SIZEPOLICY_FIXED,
           GridConstraints.SIZEPOLICY_FIXED,
           null,
           null,
           null,
           0,
           false));
   tfFilePath = new JTextField();
   panel3.add(
       tfFilePath,
       new GridConstraints(
           1,
           1,
           1,
           2,
           GridConstraints.ANCHOR_WEST,
           GridConstraints.FILL_HORIZONTAL,
           GridConstraints.SIZEPOLICY_WANT_GROW,
           GridConstraints.SIZEPOLICY_FIXED,
           null,
           new Dimension(150, -1),
           null,
           0,
           false));
   btBrowse = new JButton();
   btBrowse.setText("Browse");
   panel3.add(
       btBrowse,
       new GridConstraints(
           1,
           3,
           1,
           1,
           GridConstraints.ANCHOR_CENTER,
           GridConstraints.FILL_HORIZONTAL,
           GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
           GridConstraints.SIZEPOLICY_FIXED,
           null,
           null,
           null,
           0,
           false));
   final JLabel label2 = new JLabel();
   label2.setText("Delimiter:");
   panel3.add(
       label2,
       new GridConstraints(
           2,
           0,
           1,
           1,
           GridConstraints.ANCHOR_EAST,
           GridConstraints.FILL_NONE,
           GridConstraints.SIZEPOLICY_FIXED,
           GridConstraints.SIZEPOLICY_FIXED,
           null,
           null,
           null,
           0,
           false));
   cmbDelimiter = new JComboBox();
   cmbDelimiter.setEditable(true);
   final DefaultComboBoxModel defaultComboBoxModel1 = new DefaultComboBoxModel();
   defaultComboBoxModel1.addElement(",");
   defaultComboBoxModel1.addElement("|");
   defaultComboBoxModel1.addElement("-");
   defaultComboBoxModel1.addElement(":");
   cmbDelimiter.setModel(defaultComboBoxModel1);
   panel3.add(
       cmbDelimiter,
       new GridConstraints(
           2,
           1,
           1,
           2,
           GridConstraints.ANCHOR_WEST,
           GridConstraints.FILL_HORIZONTAL,
           GridConstraints.SIZEPOLICY_CAN_GROW,
           GridConstraints.SIZEPOLICY_FIXED,
           null,
           null,
           null,
           0,
           false));
   final JLabel label3 = new JLabel();
   label3.setText("Table name:");
   panel3.add(
       label3,
       new GridConstraints(
           0,
           0,
           1,
           1,
           GridConstraints.ANCHOR_EAST,
           GridConstraints.FILL_NONE,
           GridConstraints.SIZEPOLICY_FIXED,
           GridConstraints.SIZEPOLICY_FIXED,
           null,
           null,
           null,
           0,
           false));
   tfTableName = new JTextField();
   panel3.add(
       tfTableName,
       new GridConstraints(
           0,
           1,
           1,
           2,
           GridConstraints.ANCHOR_WEST,
           GridConstraints.FILL_HORIZONTAL,
           GridConstraints.SIZEPOLICY_WANT_GROW,
           GridConstraints.SIZEPOLICY_FIXED,
           null,
           new Dimension(150, -1),
           null,
           0,
           false));
   final JPanel panel4 = new JPanel();
   panel4.setLayout(new GridLayoutManager(3, 1, new Insets(0, 0, 0, 0), -1, -1));
   panel3.add(
       panel4,
       new GridConstraints(
           3,
           0,
           1,
           4,
           GridConstraints.ANCHOR_CENTER,
           GridConstraints.FILL_BOTH,
           GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
           GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
           null,
           null,
           null,
           0,
           false));
   final JPanel panel5 = new JPanel();
   panel5.setLayout(new GridLayoutManager(2, 4, new Insets(0, 0, 0, 0), -1, -1));
   panel4.add(
       panel5,
       new GridConstraints(
           0,
           0,
           1,
           1,
           GridConstraints.ANCHOR_CENTER,
           GridConstraints.FILL_BOTH,
           GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
           GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
           null,
           null,
           null,
           0,
           false));
   final JLabel label4 = new JLabel();
   label4.setText("Select types for columns:");
   panel5.add(
       label4,
       new GridConstraints(
           1,
           0,
           1,
           1,
           GridConstraints.ANCHOR_WEST,
           GridConstraints.FILL_NONE,
           GridConstraints.SIZEPOLICY_FIXED,
           GridConstraints.SIZEPOLICY_FIXED,
           null,
           null,
           null,
           0,
           false));
   final Spacer spacer1 = new Spacer();
   panel5.add(
       spacer1,
       new GridConstraints(
           1,
           1,
           1,
           1,
           GridConstraints.ANCHOR_CENTER,
           GridConstraints.FILL_HORIZONTAL,
           GridConstraints.SIZEPOLICY_WANT_GROW,
           1,
           null,
           null,
           null,
           0,
           false));
   btRemoveColumn = new JButton();
   btRemoveColumn.setEnabled(false);
   btRemoveColumn.setText("Remove");
   panel5.add(
       btRemoveColumn,
       new GridConstraints(
           1,
           3,
           1,
           1,
           GridConstraints.ANCHOR_CENTER,
           GridConstraints.FILL_HORIZONTAL,
           GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
           GridConstraints.SIZEPOLICY_FIXED,
           null,
           null,
           null,
           0,
           false));
   btAddColumn = new JButton();
   btAddColumn.setText("Add...");
   panel5.add(
       btAddColumn,
       new GridConstraints(
           1,
           2,
           1,
           1,
           GridConstraints.ANCHOR_EAST,
           GridConstraints.FILL_NONE,
           GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
           GridConstraints.SIZEPOLICY_FIXED,
           null,
           null,
           null,
           0,
           false));
   final JSeparator separator2 = new JSeparator();
   panel5.add(
       separator2,
       new GridConstraints(
           0,
           0,
           1,
           4,
           GridConstraints.ANCHOR_CENTER,
           GridConstraints.FILL_BOTH,
           GridConstraints.SIZEPOLICY_WANT_GROW,
           GridConstraints.SIZEPOLICY_WANT_GROW,
           null,
           null,
           null,
           0,
           false));
   final JScrollPane scrollPane1 = new JScrollPane();
   panel4.add(
       scrollPane1,
       new GridConstraints(
           1,
           0,
           1,
           1,
           GridConstraints.ANCHOR_CENTER,
           GridConstraints.FILL_BOTH,
           GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
           GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
           null,
           new Dimension(400, 200),
           null,
           0,
           false));
   rowsTable = new JTable();
   scrollPane1.setViewportView(rowsTable);
   final JLabel label5 = new JLabel();
   label5.setFont(new Font(label5.getFont().getName(), Font.BOLD, label5.getFont().getSize()));
   label5.setText("* Note: data for not listed columns will be treated as of String type.");
   panel4.add(
       label5,
       new GridConstraints(
           2,
           0,
           1,
           1,
           GridConstraints.ANCHOR_SOUTHWEST,
           GridConstraints.FILL_NONE,
           GridConstraints.SIZEPOLICY_FIXED,
           GridConstraints.SIZEPOLICY_FIXED,
           null,
           null,
           null,
           0,
           false));
   final JSeparator separator3 = new JSeparator();
   contentPane.add(
       separator3,
       new GridConstraints(
           1,
           0,
           1,
           1,
           GridConstraints.ANCHOR_CENTER,
           GridConstraints.FILL_BOTH,
           GridConstraints.SIZEPOLICY_WANT_GROW,
           GridConstraints.SIZEPOLICY_WANT_GROW,
           null,
           null,
           null,
           0,
           false));
   final JPanel panel6 = new JPanel();
   panel6.setLayout(new GridLayoutManager(2, 3, new Insets(0, 0, 0, 0), -1, -1));
   contentPane.add(
       panel6,
       new GridConstraints(
           2,
           0,
           1,
           1,
           GridConstraints.ANCHOR_CENTER,
           GridConstraints.FILL_BOTH,
           GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
           GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
           null,
           null,
           null,
           0,
           false));
   final JLabel label6 = new JLabel();
   label6.setText("Written rows:");
   panel6.add(
       label6,
       new GridConstraints(
           1,
           0,
           1,
           1,
           GridConstraints.ANCHOR_EAST,
           GridConstraints.FILL_NONE,
           GridConstraints.SIZEPOLICY_FIXED,
           GridConstraints.SIZEPOLICY_FIXED,
           null,
           null,
           null,
           0,
           false));
   final Spacer spacer2 = new Spacer();
   panel6.add(
       spacer2,
       new GridConstraints(
           1,
           2,
           1,
           1,
           GridConstraints.ANCHOR_CENTER,
           GridConstraints.FILL_HORIZONTAL,
           GridConstraints.SIZEPOLICY_WANT_GROW,
           1,
           null,
           null,
           null,
           0,
           false));
   writtenRowsCount = new JLabel();
   writtenRowsCount.setText("?");
   panel6.add(
       writtenRowsCount,
       new GridConstraints(
           1,
           1,
           1,
           1,
           GridConstraints.ANCHOR_WEST,
           GridConstraints.FILL_NONE,
           GridConstraints.SIZEPOLICY_FIXED,
           GridConstraints.SIZEPOLICY_FIXED,
           null,
           null,
           null,
           0,
           false));
   final JLabel label7 = new JLabel();
   label7.setText("Read rows:");
   panel6.add(
       label7,
       new GridConstraints(
           0,
           0,
           1,
           1,
           GridConstraints.ANCHOR_EAST,
           GridConstraints.FILL_NONE,
           GridConstraints.SIZEPOLICY_FIXED,
           GridConstraints.SIZEPOLICY_FIXED,
           null,
           null,
           null,
           0,
           false));
   readRowsCount = new JLabel();
   readRowsCount.setText("?");
   panel6.add(
       readRowsCount,
       new GridConstraints(
           0,
           1,
           1,
           1,
           GridConstraints.ANCHOR_WEST,
           GridConstraints.FILL_NONE,
           GridConstraints.SIZEPOLICY_FIXED,
           GridConstraints.SIZEPOLICY_FIXED,
           null,
           null,
           null,
           0,
           false));
 }