예제 #1
0
  private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner non-commercial license
    dialogPane = new JPanel();
    contentPanel = new JPanel();
    apiLabel = new JLabel();
    panel4 = new JPanel();
    label9 = new JLabel();
    beanShellRadioButton = new JRadioButton();
    jrubyRadioButton = new JRadioButton();
    pythonRadioButton = new JRadioButton();
    javascriptRadioButton = new JRadioButton();
    loadExcelFileButton = new JButton();
    excelTextField = new JTextField();
    loadMapperScriptButton = new JButton();
    mapperScriptTextField = new JTextField();
    editScriptButton = new JButton();
    separator2 = new JSeparator();
    panel5 = new JPanel();
    createRepositoryCheckBox = new JCheckBox();
    repoShortNameTextField = new JTextField();
    repoNameTextField = new JTextField();
    repoCodeTextField = new JTextField();
    repoURLTextField = new JTextField();
    panel2 = new JPanel();
    label1 = new JLabel();
    label3 = new JLabel();
    label10 = new JLabel();
    locationsTextField = new JTextField();
    locationsLabel = new JLabel();
    label5 = new JLabel();
    subjectsTextField = new JTextField();
    subjectsLabel = new JLabel();
    label4 = new JLabel();
    namesTextField = new JTextField();
    namesLabel = new JLabel();
    label6 = new JLabel();
    accessionsTextField = new JTextField();
    accessionsLabel = new JLabel();
    label7 = new JLabel();
    digitalObjectsTextField = new JTextField();
    digitalObjectLabel = new JLabel();
    label8 = new JLabel();
    resourcesTextField = new JTextField();
    resourcesLabel = new JLabel();
    separator1 = new JSeparator();
    copyToASpaceButton = new JButton();
    hostLabel = new JLabel();
    hostTextField = new JTextField();
    simulateCheckBox = new JCheckBox();
    adminLabel = new JLabel();
    adminTextField = new JTextField();
    adminPasswordLabel = new JLabel();
    adminPasswordTextField = new JTextField();
    label2 = new JLabel();
    repositoryURITextField = new JTextField();
    developerModeCheckBox = new JCheckBox();
    outputConsoleLabel = new JLabel();
    copyProgressBar = new JProgressBar();
    scrollPane1 = new JScrollPane();
    consoleTextArea = new JTextArea();
    recordURIComboBox = new JComboBox();
    panel1 = new JPanel();
    paramsLabel = new JLabel();
    paramsTextField = new JTextField();
    viewRecordButton = new JButton();
    buttonBar = new JPanel();
    errorLogButton = new JButton();
    saveErrorsLabel = new JLabel();
    errorCountLabel = new JLabel();
    stopButton = new JButton();
    utillitiesButton = new JButton();
    okButton = new JButton();
    CellConstraints cc = new CellConstraints();

    // ======== this ========
    setTitle("Archives Space Excel Data Migrator");
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    // ======== dialogPane ========
    {
      dialogPane.setBorder(Borders.DIALOG_BORDER);
      dialogPane.setLayout(new BorderLayout());

      // ======== contentPanel ========
      {
        contentPanel.setLayout(
            new FormLayout(
                new ColumnSpec[] {
                  FormFactory.DEFAULT_COLSPEC,
                  FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                  new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                  FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                  new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                  FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                  FormFactory.DEFAULT_COLSPEC,
                  FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                  FormFactory.DEFAULT_COLSPEC
                },
                new RowSpec[] {
                  FormFactory.DEFAULT_ROWSPEC,
                  FormFactory.LINE_GAP_ROWSPEC,
                  FormFactory.DEFAULT_ROWSPEC,
                  FormFactory.LINE_GAP_ROWSPEC,
                  FormFactory.DEFAULT_ROWSPEC,
                  FormFactory.LINE_GAP_ROWSPEC,
                  FormFactory.DEFAULT_ROWSPEC,
                  FormFactory.LINE_GAP_ROWSPEC,
                  new RowSpec(RowSpec.TOP, Sizes.DEFAULT, FormSpec.NO_GROW),
                  FormFactory.LINE_GAP_ROWSPEC,
                  FormFactory.DEFAULT_ROWSPEC,
                  FormFactory.LINE_GAP_ROWSPEC,
                  FormFactory.DEFAULT_ROWSPEC,
                  FormFactory.LINE_GAP_ROWSPEC,
                  FormFactory.DEFAULT_ROWSPEC,
                  FormFactory.LINE_GAP_ROWSPEC,
                  FormFactory.DEFAULT_ROWSPEC,
                  FormFactory.LINE_GAP_ROWSPEC,
                  FormFactory.DEFAULT_ROWSPEC,
                  FormFactory.LINE_GAP_ROWSPEC,
                  FormFactory.DEFAULT_ROWSPEC,
                  FormFactory.LINE_GAP_ROWSPEC,
                  FormFactory.DEFAULT_ROWSPEC,
                  FormFactory.LINE_GAP_ROWSPEC,
                  FormFactory.DEFAULT_ROWSPEC
                }));

        // ---- apiLabel ----
        apiLabel.setText("  Archives Space Version: v1.1.0");
        apiLabel.setHorizontalTextPosition(SwingConstants.CENTER);
        apiLabel.setFont(new Font("Lucida Grande", Font.BOLD, 14));
        contentPanel.add(apiLabel, cc.xy(1, 1));

        // ======== panel4 ========
        {
          panel4.setLayout(
              new FormLayout(
                  new ColumnSpec[] {
                    new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                    FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                    new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                    FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                    new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                    FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                    new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                    FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                    new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW)
                  },
                  RowSpec.decodeSpecs("default")));

          // ---- label9 ----
          label9.setText("Select Script Type");
          panel4.add(label9, cc.xy(1, 1));

          // ---- beanShellRadioButton ----
          beanShellRadioButton.setText("Beanshell");
          beanShellRadioButton.setSelected(true);
          beanShellRadioButton.addActionListener(
              new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                  clearMapperScript();
                }
              });
          panel4.add(beanShellRadioButton, cc.xy(3, 1));

          // ---- jrubyRadioButton ----
          jrubyRadioButton.setText("JRuby");
          jrubyRadioButton.addActionListener(
              new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                  clearMapperScript();
                }
              });
          panel4.add(jrubyRadioButton, cc.xy(5, 1));

          // ---- pythonRadioButton ----
          pythonRadioButton.setText("Jython");
          pythonRadioButton.addActionListener(
              new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                  clearMapperScript();
                }
              });
          panel4.add(pythonRadioButton, cc.xy(7, 1));

          // ---- javascriptRadioButton ----
          javascriptRadioButton.setText("Javascript");
          javascriptRadioButton.addActionListener(
              new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                  clearMapperScript();
                }
              });
          panel4.add(javascriptRadioButton, cc.xy(9, 1));
        }
        contentPanel.add(panel4, cc.xywh(3, 1, 7, 1));

        // ---- loadExcelFileButton ----
        loadExcelFileButton.setText("Load Excel File");
        loadExcelFileButton.addActionListener(
            new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                loadExcelFileButtonActionPerformed();
              }
            });
        contentPanel.add(loadExcelFileButton, cc.xy(1, 3));
        contentPanel.add(excelTextField, cc.xywh(3, 3, 5, 1));

        // ---- loadMapperScriptButton ----
        loadMapperScriptButton.setText("Load Mapper Script");
        loadMapperScriptButton.addActionListener(
            new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                loadMapperScriptButtonActionPerformed();
              }
            });
        contentPanel.add(loadMapperScriptButton, cc.xy(1, 5));

        // ---- mapperScriptTextField ----
        mapperScriptTextField.addActionListener(
            new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                loadMapperScript();
              }
            });
        contentPanel.add(mapperScriptTextField, cc.xywh(3, 5, 5, 1));

        // ---- editScriptButton ----
        editScriptButton.setText("Edit");
        editScriptButton.addActionListener(
            new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                editScriptButtonActionPerformed();
              }
            });
        contentPanel.add(editScriptButton, cc.xy(9, 5));
        contentPanel.add(separator2, cc.xywh(1, 7, 9, 1));

        // ======== panel5 ========
        {
          panel5.setLayout(
              new FormLayout(
                  ColumnSpec.decodeSpecs("default:grow"),
                  new RowSpec[] {
                    FormFactory.DEFAULT_ROWSPEC,
                    FormFactory.LINE_GAP_ROWSPEC,
                    FormFactory.DEFAULT_ROWSPEC,
                    FormFactory.LINE_GAP_ROWSPEC,
                    FormFactory.DEFAULT_ROWSPEC,
                    FormFactory.LINE_GAP_ROWSPEC,
                    FormFactory.DEFAULT_ROWSPEC,
                    FormFactory.LINE_GAP_ROWSPEC,
                    FormFactory.DEFAULT_ROWSPEC
                  }));

          // ---- createRepositoryCheckBox ----
          createRepositoryCheckBox.setText("Create Repository");
          createRepositoryCheckBox.setSelected(true);
          panel5.add(createRepositoryCheckBox, cc.xy(1, 1));

          // ---- repoShortNameTextField ----
          repoShortNameTextField.setText("Repo Short Name 1");
          panel5.add(repoShortNameTextField, cc.xy(1, 3));

          // ---- repoNameTextField ----
          repoNameTextField.setText("Repo Name 1");
          panel5.add(repoNameTextField, cc.xy(1, 5));

          // ---- repoCodeTextField ----
          repoCodeTextField.setText("Organization Code 1");
          panel5.add(repoCodeTextField, cc.xy(1, 7));

          // ---- repoURLTextField ----
          repoURLTextField.setText("http://repository.url.org");
          panel5.add(repoURLTextField, cc.xy(1, 9));
        }
        contentPanel.add(panel5, cc.xy(1, 9));

        // ======== panel2 ========
        {
          panel2.setLayout(
              new FormLayout(
                  "default, default:grow, right:default",
                  "default, default, default, fill:default:grow, fill:default:grow, default, fill:default:grow"));

          // ---- label1 ----
          label1.setText("Record Type");
          panel2.add(label1, cc.xy(1, 1));

          // ---- label3 ----
          label3.setText("Spreadsheet Number (starting at 1)");
          panel2.add(label3, cc.xy(2, 1));

          // ---- label10 ----
          label10.setText("Locations");
          panel2.add(label10, cc.xy(1, 2));

          // ---- locationsTextField ----
          locationsTextField.setText("1");
          panel2.add(locationsTextField, cc.xy(2, 2));

          // ---- locationsLabel ----
          locationsLabel.setText("not supported");
          panel2.add(locationsLabel, cc.xy(3, 2));

          // ---- label5 ----
          label5.setText("Subjects");
          panel2.add(label5, cc.xy(1, 3));

          // ---- subjectsTextField ----
          subjectsTextField.setColumns(2);
          subjectsTextField.setText("2");
          panel2.add(subjectsTextField, cc.xy(2, 3));

          // ---- subjectsLabel ----
          subjectsLabel.setText("not supported");
          panel2.add(subjectsLabel, cc.xy(3, 3));

          // ---- label4 ----
          label4.setText("Names");
          panel2.add(label4, cc.xy(1, 4));

          // ---- namesTextField ----
          namesTextField.setColumns(12);
          namesTextField.setText("3");
          panel2.add(namesTextField, cc.xy(2, 4));

          // ---- namesLabel ----
          namesLabel.setText("not supported");
          panel2.add(namesLabel, cc.xy(3, 4));

          // ---- label6 ----
          label6.setText("Accessions");
          panel2.add(label6, cc.xy(1, 5));

          // ---- accessionsTextField ----
          accessionsTextField.setColumns(2);
          accessionsTextField.setText("4");
          panel2.add(accessionsTextField, cc.xy(2, 5));

          // ---- accessionsLabel ----
          accessionsLabel.setText("not supported");
          panel2.add(accessionsLabel, cc.xy(3, 5));

          // ---- label7 ----
          label7.setText("Digital Objects");
          panel2.add(label7, cc.xy(1, 6));

          // ---- digitalObjectsTextField ----
          digitalObjectsTextField.setColumns(2);
          digitalObjectsTextField.setText("5");
          panel2.add(digitalObjectsTextField, cc.xy(2, 6));

          // ---- digitalObjectLabel ----
          digitalObjectLabel.setText("not supported");
          panel2.add(digitalObjectLabel, cc.xy(3, 6));

          // ---- label8 ----
          label8.setText("Resources");
          panel2.add(label8, cc.xy(1, 7));

          // ---- resourcesTextField ----
          resourcesTextField.setText("6, 7");
          resourcesTextField.setColumns(2);
          panel2.add(resourcesTextField, cc.xy(2, 7));

          // ---- resourcesLabel ----
          resourcesLabel.setText("not supported");
          panel2.add(resourcesLabel, cc.xy(3, 7));
        }
        contentPanel.add(panel2, cc.xywh(3, 9, 7, 1));
        contentPanel.add(separator1, cc.xywh(1, 11, 9, 1));

        // ---- copyToASpaceButton ----
        copyToASpaceButton.setText("Copy To Archives Space");
        copyToASpaceButton.addActionListener(
            new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                CopyToASpaceButtonActionPerformed();
              }
            });
        contentPanel.add(copyToASpaceButton, cc.xy(1, 13));

        // ---- hostLabel ----
        hostLabel.setText("Archives Space Host");
        contentPanel.add(hostLabel, cc.xywh(3, 13, 2, 1));

        // ---- hostTextField ----
        hostTextField.setText("http://localhost:8089");
        contentPanel.add(hostTextField, cc.xywh(5, 13, 5, 1));

        // ---- simulateCheckBox ----
        simulateCheckBox.setText("Simulate REST Calls");
        simulateCheckBox.setSelected(true);
        contentPanel.add(simulateCheckBox, cc.xy(1, 15));

        // ---- adminLabel ----
        adminLabel.setText("Administrator User ID");
        contentPanel.add(adminLabel, cc.xy(3, 15));

        // ---- adminTextField ----
        adminTextField.setText("admin");
        contentPanel.add(adminTextField, cc.xywh(5, 15, 2, 1));

        // ---- adminPasswordLabel ----
        adminPasswordLabel.setText("Password");
        contentPanel.add(adminPasswordLabel, cc.xy(7, 15));

        // ---- adminPasswordTextField ----
        adminPasswordTextField.setText("admin");
        contentPanel.add(adminPasswordTextField, cc.xy(9, 15));

        // ---- label2 ----
        label2.setText("Target Repository URI");
        contentPanel.add(label2, cc.xy(3, 17));
        contentPanel.add(repositoryURITextField, cc.xywh(5, 17, 5, 1));

        // ---- developerModeCheckBox ----
        developerModeCheckBox.setText(
            "Developer Mode (Locations/Names/Subjects are copied once and random IDs are used other records)");
        contentPanel.add(developerModeCheckBox, cc.xywh(1, 19, 9, 1));

        // ---- outputConsoleLabel ----
        outputConsoleLabel.setText("Output Console:");
        contentPanel.add(outputConsoleLabel, cc.xy(1, 21));
        contentPanel.add(copyProgressBar, cc.xywh(3, 21, 7, 1));

        // ======== scrollPane1 ========
        {

          // ---- consoleTextArea ----
          consoleTextArea.setRows(12);
          scrollPane1.setViewportView(consoleTextArea);
        }
        contentPanel.add(scrollPane1, cc.xywh(1, 23, 9, 1));

        // ---- recordURIComboBox ----
        recordURIComboBox.setModel(
            new DefaultComboBoxModel(
                new String[] {
                  "/repositories",
                  "/users",
                  "/subjects",
                  "/agents/families/1",
                  "/agents/people/1",
                  "/agents/corporate_entities/1",
                  "/repositories/2/accessions/1",
                  "/repositories/2/resources/1",
                  "/repositories/2/archival_objects/1",
                  "/config/enumerations"
                }));
        recordURIComboBox.setEditable(true);
        contentPanel.add(recordURIComboBox, cc.xy(1, 25));

        // ======== panel1 ========
        {
          panel1.setLayout(new FlowLayout(FlowLayout.LEFT));

          // ---- paramsLabel ----
          paramsLabel.setText("Params");
          panel1.add(paramsLabel);

          // ---- paramsTextField ----
          paramsTextField.setColumns(20);
          panel1.add(paramsTextField);
        }
        contentPanel.add(panel1, cc.xywh(3, 25, 3, 1));

        // ---- viewRecordButton ----
        viewRecordButton.setText("View");
        viewRecordButton.addActionListener(
            new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                viewRecordButtonActionPerformed();
              }
            });
        contentPanel.add(viewRecordButton, cc.xywh(7, 25, 3, 1));
      }
      dialogPane.add(contentPanel, BorderLayout.CENTER);

      // ======== buttonBar ========
      {
        buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER);
        buttonBar.setLayout(
            new FormLayout(
                new ColumnSpec[] {
                  FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                  FormFactory.DEFAULT_COLSPEC,
                  FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                  FormFactory.DEFAULT_COLSPEC,
                  FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                  FormFactory.DEFAULT_COLSPEC,
                  FormFactory.GLUE_COLSPEC,
                  FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                  FormFactory.DEFAULT_COLSPEC,
                  FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                  FormFactory.DEFAULT_COLSPEC,
                  FormFactory.DEFAULT_COLSPEC,
                  FormFactory.DEFAULT_COLSPEC,
                  FormFactory.BUTTON_COLSPEC
                },
                RowSpec.decodeSpecs("pref")));

        // ---- errorLogButton ----
        errorLogButton.setText("View Error Log");
        errorLogButton.addActionListener(
            new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                errorLogButtonActionPerformed();
              }
            });
        buttonBar.add(errorLogButton, cc.xy(2, 1));

        // ---- saveErrorsLabel ----
        saveErrorsLabel.setText(" Errors: ");
        buttonBar.add(saveErrorsLabel, cc.xy(4, 1));

        // ---- errorCountLabel ----
        errorCountLabel.setText("N/A ");
        errorCountLabel.setForeground(Color.red);
        errorCountLabel.setFont(new Font("Lucida Grande", Font.BOLD, 13));
        buttonBar.add(errorCountLabel, cc.xy(6, 1));

        // ---- stopButton ----
        stopButton.setText("Cancel Copy");
        stopButton.setEnabled(false);
        stopButton.addActionListener(
            new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                stopButtonActionPerformed();
                stopButtonActionPerformed();
              }
            });
        buttonBar.add(stopButton, cc.xy(9, 1));

        // ---- utillitiesButton ----
        utillitiesButton.setText("Utilities");
        buttonBar.add(utillitiesButton, cc.xy(11, 1));

        // ---- okButton ----
        okButton.setText("Close");
        okButton.addActionListener(
            new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                okButtonActionPerformed();
              }
            });
        buttonBar.add(okButton, cc.xy(14, 1));
      }
      dialogPane.add(buttonBar, BorderLayout.SOUTH);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
    pack();
    setLocationRelativeTo(getOwner());

    // ---- buttonGroup1 ----
    ButtonGroup buttonGroup1 = new ButtonGroup();
    buttonGroup1.add(beanShellRadioButton);
    buttonGroup1.add(jrubyRadioButton);
    buttonGroup1.add(pythonRadioButton);
    buttonGroup1.add(javascriptRadioButton);
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
  }
예제 #2
0
  private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Open Source Project license - unknown
    ResourceBundle bundle = ResourceBundle.getBundle("InformationDialog");
    JPanel dialogPane = new JPanel();
    JPanel contentPanel = new JPanel();
    iconLabel = new JLabel();
    pathLabel = new JLabel();
    JLabel labelFrom = new JLabel();
    fieldFrom = new JTextField();
    JLabel labelSize = new JLabel();
    fieldSize = new JTextField();
    JLabel labelDescription = new JLabel();
    JScrollPane scrollPane1 = new JScrollPane();
    descriptionArea = ComponentFactory.getTextArea();
    JPanel optionsPanel = new JPanel();
    JLabel saveToLabel = new JLabel();
    comboPath = new JComboBox();
    btnSelectPath = new JButton();
    progressBar = new JProgressBar();
    JLabel labelRemaining = new JLabel();
    remainingLabel = new JLabel();
    JLabel labelEstimateTime = new JLabel();
    estTimeLabel = new JLabel();
    JLabel labelCurrentSpeed = new JLabel();
    currentSpeedLabel = new JLabel();
    JLabel labelAverageSpeed = new JLabel();
    avgSpeedLabel = new JLabel();
    JXButtonPanel buttonBar = new JXButtonPanel();
    okButton = new JButton();
    cancelButton = new JButton();
    CellConstraints cc = new CellConstraints();

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

    // ======== dialogPane ========
    {
      dialogPane.setBorder(Borders.DIALOG);
      dialogPane.setLayout(new BorderLayout());

      // ======== contentPanel ========
      {

        // ---- iconLabel ----
        iconLabel.setText(bundle.getString("iconLabel.text"));

        // ---- pathLabel ----
        pathLabel.setText(bundle.getString("pathLabel.text"));
        pathLabel.setFont(new Font("Tahoma", Font.BOLD, 12));

        // ---- labelFrom ----
        labelFrom.setText(bundle.getString("labelFrom.text"));

        // ---- fieldFrom ----
        fieldFrom.setBorder(null);
        fieldFrom.setOpaque(false);
        fieldFrom.setText(bundle.getString("fieldFrom.text"));

        // ---- labelSize ----
        labelSize.setText(bundle.getString("labelSize.text"));

        // ---- fieldSize ----
        fieldSize.setBorder(null);
        fieldSize.setOpaque(false);

        // ---- labelDescription ----
        labelDescription.setText(bundle.getString("labelDescription.text"));

        // ======== scrollPane1 ========
        {
          scrollPane1.setViewportView(descriptionArea);
        }

        // ======== optionsPanel ========
        {

          // ---- saveToLabel ----
          saveToLabel.setText(bundle.getString("saveToLabel.text"));
          saveToLabel.setLabelFor(comboPath);

          // ---- comboPath ----
          comboPath.setEditable(true);

          // ---- btnSelectPath ----
          btnSelectPath.setText(bundle.getString("btnSelectPath.text"));

          PanelBuilder optionsPanelBuilder =
              new PanelBuilder(
                  new FormLayout(
                      new ColumnSpec[] {
                        FormSpecs.DEFAULT_COLSPEC,
                        FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                        new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                        FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                        FormSpecs.DEFAULT_COLSPEC
                      },
                      RowSpec.decodeSpecs("default")),
                  optionsPanel);

          optionsPanelBuilder.add(saveToLabel, cc.xy(1, 1));
          optionsPanelBuilder.add(comboPath, cc.xy(3, 1));
          optionsPanelBuilder.add(btnSelectPath, cc.xy(5, 1));
        }

        // ---- progressBar ----
        progressBar.setFont(new Font("Tahoma", Font.BOLD, 16));

        // ---- labelRemaining ----
        labelRemaining.setText(bundle.getString("labelRemaining.text"));

        // ---- remainingLabel ----
        remainingLabel.setText(bundle.getString("remainingLabel.text"));
        remainingLabel.setFont(new Font("Tahoma", Font.BOLD, 12));

        // ---- labelEstimateTime ----
        labelEstimateTime.setText(bundle.getString("labelEstimateTime.text"));

        // ---- estTimeLabel ----
        estTimeLabel.setText(bundle.getString("estTimeLabel.text"));
        estTimeLabel.setFont(new Font("Tahoma", Font.BOLD, 12));

        // ---- labelCurrentSpeed ----
        labelCurrentSpeed.setText(bundle.getString("labelCurrentSpeed.text"));

        // ---- currentSpeedLabel ----
        currentSpeedLabel.setText(bundle.getString("currentSpeedLabel.text"));
        currentSpeedLabel.setFont(new Font("Tahoma", Font.BOLD, 12));

        // ---- labelAverageSpeed ----
        labelAverageSpeed.setText(bundle.getString("labelAverageSpeed.text"));

        // ---- avgSpeedLabel ----
        avgSpeedLabel.setText(bundle.getString("avgSpeedLabel.text"));
        avgSpeedLabel.setFont(new Font("Tahoma", Font.BOLD, 12));

        PanelBuilder contentPanelBuilder =
            new PanelBuilder(
                new FormLayout(
                    new ColumnSpec[] {
                      new ColumnSpec(Sizes.dluX(49)),
                      FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                      FormSpecs.DEFAULT_COLSPEC,
                      FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                      new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                      FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                      FormSpecs.DEFAULT_COLSPEC,
                      FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                      ColumnSpec.decode("max(min;70dlu)")
                    },
                    new RowSpec[] {
                      FormSpecs.DEFAULT_ROWSPEC,
                      FormSpecs.LINE_GAP_ROWSPEC,
                      FormSpecs.DEFAULT_ROWSPEC,
                      FormSpecs.LINE_GAP_ROWSPEC,
                      FormSpecs.DEFAULT_ROWSPEC,
                      FormSpecs.LINE_GAP_ROWSPEC,
                      FormSpecs.DEFAULT_ROWSPEC,
                      FormSpecs.LINE_GAP_ROWSPEC,
                      new RowSpec(
                          RowSpec.FILL,
                          Sizes.bounded(Sizes.PREFERRED, Sizes.dluY(40), Sizes.dluY(50)),
                          FormSpec.DEFAULT_GROW),
                      FormSpecs.LINE_GAP_ROWSPEC,
                      FormSpecs.DEFAULT_ROWSPEC,
                      FormSpecs.LINE_GAP_ROWSPEC,
                      RowSpec.decode("fill:max(pref;20dlu)"),
                      FormSpecs.LINE_GAP_ROWSPEC,
                      FormSpecs.DEFAULT_ROWSPEC,
                      FormSpecs.LINE_GAP_ROWSPEC,
                      FormSpecs.DEFAULT_ROWSPEC
                    }),
                contentPanel);

        contentPanelBuilder.add(iconLabel, cc.xywh(1, 1, 1, 5));
        contentPanelBuilder.add(pathLabel, cc.xywh(3, 1, 7, 1));
        contentPanelBuilder.add(labelFrom, cc.xy(3, 3));
        contentPanelBuilder.add(fieldFrom, cc.xywh(5, 3, 5, 1));
        contentPanelBuilder.add(labelSize, cc.xy(3, 5));
        contentPanelBuilder.add(fieldSize, cc.xywh(5, 5, 3, 1));
        contentPanelBuilder.add(labelDescription, cc.xy(1, 7));
        contentPanelBuilder.add(scrollPane1, cc.xywh(1, 9, 9, 1));
        contentPanelBuilder.add(optionsPanel, cc.xywh(1, 11, 9, 1));
        contentPanelBuilder.add(progressBar, cc.xywh(1, 13, 9, 1));
        contentPanelBuilder.add(labelRemaining, cc.xy(1, 15));
        contentPanelBuilder.add(remainingLabel, cc.xywh(3, 15, 3, 1));
        contentPanelBuilder.add(labelEstimateTime, cc.xy(7, 15));
        contentPanelBuilder.add(estTimeLabel, cc.xy(9, 15));
        contentPanelBuilder.add(labelCurrentSpeed, cc.xy(1, 17));
        contentPanelBuilder.add(currentSpeedLabel, cc.xywh(3, 17, 3, 1));
        contentPanelBuilder.add(labelAverageSpeed, cc.xy(7, 17));
        contentPanelBuilder.add(avgSpeedLabel, cc.xy(9, 17));
      }
      dialogPane.add(contentPanel, BorderLayout.CENTER);

      // ======== buttonBar ========
      {
        buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0));

        // ---- okButton ----
        okButton.setText(bundle.getString("okButton.text"));

        // ---- cancelButton ----
        cancelButton.setText(bundle.getString("cancelButton.text"));

        PanelBuilder buttonBarBuilder =
            new PanelBuilder(
                new FormLayout(
                    new ColumnSpec[] {
                      new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                      FormSpecs.UNRELATED_GAP_COLSPEC,
                      ColumnSpec.decode("max(pref;55dlu)"),
                      FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                      FormSpecs.DEFAULT_COLSPEC
                    },
                    RowSpec.decodeSpecs("fill:pref")),
                buttonBar);
        ((FormLayout) buttonBar.getLayout()).setColumnGroups(new int[][] {{3, 5}});

        buttonBarBuilder.add(okButton, cc.xy(3, 1));
        buttonBarBuilder.add(cancelButton, cc.xy(5, 1));
      }
      dialogPane.add(buttonBar, BorderLayout.SOUTH);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
    pack();
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
  }
예제 #3
0
  private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Evaluation license - RP Talusan
    dialogPane = new JPanel();
    contentPanel = new JPanel();
    textTestRadio = new JRadioButton();
    scrollPane1 = new JScrollPane();
    testTextArea = new JTextPane();
    classTestRadio = new JRadioButton();
    testClassField = new JTextField();
    buttonBar = new JPanel();
    okButton = new JButton();
    cancelButton = new JButton();
    testClassHiddenField = new JTextField();
    CellConstraints cc = new CellConstraints();

    // ======== this ========
    String title = "Edit Test Rig";
    if (qualifiedFileName != null && !"".equals(qualifiedFileName))
      title = "Edit " + XJUtils.getLastPathComponent(qualifiedFileName) + " Test Rig";
    if (grammarLanguage != null && !"".equals(grammarLanguage)) title += " for " + grammarLanguage;
    setTitle(title);

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

    // ======== dialogPane ========
    {
      dialogPane.setBorder(Borders.DIALOG_BORDER);
      dialogPane.setMinimumSize(new Dimension(340, 250));
      dialogPane.setLayout(new BorderLayout());

      // ======== contentPanel ========
      {
        contentPanel.setLayout(
            new FormLayout(
                new ColumnSpec[] {
                  new ColumnSpec(ColumnSpec.RIGHT, Sizes.DEFAULT, FormSpec.NO_GROW),
                  FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                  FormFactory.DEFAULT_COLSPEC,
                  FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                  new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW)
                },
                new RowSpec[] {
                  FormFactory.DEFAULT_ROWSPEC,
                  FormFactory.LINE_GAP_ROWSPEC,
                  FormFactory.DEFAULT_ROWSPEC,
                  FormFactory.LINE_GAP_ROWSPEC,
                  new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                  FormFactory.LINE_GAP_ROWSPEC,
                  FormFactory.DEFAULT_ROWSPEC
                }));

        // ---- textTestRadio ----
        textTestRadio.setText("Text:");
        contentPanel.add(textTestRadio, cc.xy(1, 1));

        // ======== scrollPane1 ========
        {
          scrollPane1.setPreferredSize(new Dimension(300, 200));
          scrollPane1.setViewportView(testTextArea);
        }
        contentPanel.add(scrollPane1, cc.xywh(3, 1, 3, 5));

        // ---- classTestRadio ----
        classTestRadio.setText("Class:");
        contentPanel.add(classTestRadio, cc.xy(1, 7));

        // ---- testClassField ----
        testClassField.addFocusListener(
            new FocusAdapter() {
              @Override
              public void focusGained(FocusEvent e) {
                if (TEXT_FULLY_QUALIFIED_CLASS_NAME.equals(testClassField.getText())) {
                  testClassField.setForeground(Color.BLACK);
                  testClassField.setText("");
                }
              }

              @Override
              public void focusLost(FocusEvent e) {
                testClassHiddenField.setText(testClassField.getText());
                if ("".equals(testClassField.getText())) {
                  testClassField.setForeground(Color.LIGHT_GRAY);
                  testClassField.setText(TEXT_FULLY_QUALIFIED_CLASS_NAME);
                }
              }
            });
        contentPanel.add(testClassField, cc.xywh(3, 7, 3, 1));
      }
      dialogPane.add(contentPanel, BorderLayout.CENTER);

      // ======== buttonBar ========
      {
        buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER);
        buttonBar.setLayout(
            new FormLayout(
                new ColumnSpec[] {
                  FormFactory.GLUE_COLSPEC,
                  FormFactory.BUTTON_COLSPEC,
                  FormFactory.RELATED_GAP_COLSPEC,
                  FormFactory.BUTTON_COLSPEC
                },
                RowSpec.decodeSpecs("pref")));

        // ---- okButton ----
        okButton.setText("OK");
        buttonBar.add(okButton, cc.xy(2, 1));

        // ---- cancelButton ----
        cancelButton.setText("Cancel");
        buttonBar.add(cancelButton, cc.xy(4, 1));
      }
      dialogPane.add(buttonBar, BorderLayout.SOUTH);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
    setSize(625, 395);

    // ---- buttonGroup1 ----
    ButtonGroup buttonGroup1 = new ButtonGroup();
    buttonGroup1.add(textTestRadio);
    buttonGroup1.add(classTestRadio);
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
  }
예제 #4
0
  private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Evaluation license - Ryan Paul Talusan
    dialogPane = new JPanel();
    contentPanel = new JPanel();
    label1 = new JLabel();
    grammarNameField = new JTextField();
    label2 = new JLabel();
    grammarTypeComboBox = new JComboBox();
    lexicalItemPanel = new JPanel();
    lexLeftPanel = new JPanel();
    cbIdentifier = new JCheckBox();
    cbInteger = new JCheckBox();
    cbFloat = new JCheckBox();
    cbComments = new JCheckBox();
    commentsPanel = new JPanel();
    cbSingleLine = new JCheckBox();
    cbMultiLine = new JCheckBox();
    lexRightPanel = new JPanel();
    cbString = new JCheckBox();
    stringPanel = new JPanel();
    singleQuoteRadio = new JRadioButton();
    doubleQuoteRadio = new JRadioButton();
    cbCharacters = new JCheckBox();
    cbWhiteSpace = new JCheckBox();
    wsPanel = new JPanel();
    cbTabChar = new JCheckBox();
    cbNewlineChar = new JCheckBox();
    cbCarriageReturnChar = new JCheckBox();
    buttonBar = new JPanel();
    okButton = new JButton();
    cancelButton = new JButton();
    CellConstraints cc = new CellConstraints();

    // ======== this ========
    setTitle("New Grammar Wizard");
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    // ======== dialogPane ========
    {
      dialogPane.setBorder(Borders.DIALOG_BORDER);
      dialogPane.setLayout(new BorderLayout());

      // ======== contentPanel ========
      {
        contentPanel.setLayout(
            new FormLayout(
                new ColumnSpec[] {
                  FormFactory.RELATED_GAP_COLSPEC,
                  FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                  new ColumnSpec(ColumnSpec.RIGHT, Sizes.DEFAULT, FormSpec.NO_GROW),
                  FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                  FormFactory.DEFAULT_COLSPEC,
                  FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                  new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW)
                },
                new RowSpec[] {
                  FormFactory.DEFAULT_ROWSPEC,
                  FormFactory.LINE_GAP_ROWSPEC,
                  FormFactory.DEFAULT_ROWSPEC,
                  FormFactory.UNRELATED_GAP_ROWSPEC,
                  new RowSpec(RowSpec.TOP, Sizes.DEFAULT, RowSpec.DEFAULT_GROW)
                }));

        // ---- label1 ----
        label1.setText("Grammar Name:");
        contentPanel.add(label1, cc.xy(3, 1));
        contentPanel.add(grammarNameField, cc.xywh(5, 1, 3, 1));

        // ---- label2 ----
        label2.setText("Type:");
        contentPanel.add(label2, cc.xy(3, 3));

        // ---- grammarTypeComboBox ----
        grammarTypeComboBox.setModel(
            new DefaultComboBoxModel(
                new String[] {"Parser", "Lexer", "Tree Grammar", "Combined Grammar"}));
        grammarTypeComboBox.setSelectedIndex(3);
        grammarTypeComboBox.addActionListener(
            new ActionListener() {
              public void actionPerformed(ActionEvent event) {
                switch (grammarTypeComboBox.getSelectedIndex()) {
                  case GRAMMAR_TYPE_PARSER:
                  case GRAMMAR_TYPE_TREE_GRAMMAR:
                    cbIdentifier.setEnabled(false);
                    cbInteger.setEnabled(false);
                    cbFloat.setEnabled(false);
                    cbComments.setEnabled(false);
                    cbSingleLine.setEnabled(false);
                    cbMultiLine.setEnabled(false);
                    cbString.setEnabled(false);
                    cbCharacters.setEnabled(false);
                    cbWhiteSpace.setEnabled(false);
                    cbTabChar.setEnabled(false);
                    cbNewlineChar.setEnabled(false);
                    cbCarriageReturnChar.setEnabled(false);
                    break;
                  case GRAMMAR_TYPE_LEXER:
                  case GRAMMAR_TYPE_COMBINED_GRAMMAR:
                    cbIdentifier.setEnabled(true);
                    cbInteger.setEnabled(true);
                    cbFloat.setEnabled(true);
                    cbComments.setEnabled(true);
                    if (cbComments.isSelected()) {
                      cbSingleLine.setEnabled(true);
                      cbMultiLine.setEnabled(true);
                    }
                    cbString.setEnabled(true);
                    cbCharacters.setEnabled(true);
                    cbWhiteSpace.setEnabled(true);
                    if (cbWhiteSpace.isSelected()) {
                      cbTabChar.setEnabled(true);
                      cbNewlineChar.setEnabled(true);
                      cbCarriageReturnChar.setEnabled(true);
                    }
                    break;
                }
              }
            });
        contentPanel.add(grammarTypeComboBox, cc.xy(5, 3));

        // ======== lexicalItemPanel ========
        {
          lexicalItemPanel.setBorder(
              new TitledBorder(
                  null,
                  "Lexical Items",
                  TitledBorder.DEFAULT_JUSTIFICATION,
                  TitledBorder.DEFAULT_POSITION));
          lexicalItemPanel.setLayout(
              new FormLayout(
                  new ColumnSpec[] {
                    new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                    FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                    new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW)
                  },
                  new RowSpec[] {new RowSpec(RowSpec.TOP, Sizes.DEFAULT, RowSpec.DEFAULT_GROW)}));

          // ======== lexLeftPanel ========
          {
            lexLeftPanel.setLayout(
                new FormLayout(
                    new ColumnSpec[] {
                      new ColumnSpec(ColumnSpec.DEFAULT, Sizes.dluX(10), FormSpec.NO_GROW),
                      new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                      FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                      new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW)
                    },
                    new RowSpec[] {
                      FormFactory.DEFAULT_ROWSPEC,
                      FormFactory.LINE_GAP_ROWSPEC,
                      FormFactory.DEFAULT_ROWSPEC,
                      FormFactory.LINE_GAP_ROWSPEC,
                      FormFactory.DEFAULT_ROWSPEC,
                      FormFactory.LINE_GAP_ROWSPEC,
                      FormFactory.DEFAULT_ROWSPEC,
                      FormFactory.LINE_GAP_ROWSPEC,
                      FormFactory.DEFAULT_ROWSPEC
                    }));

            // ---- cbIdentifier ----
            cbIdentifier.setText("Identifier");
            lexLeftPanel.add(cbIdentifier, cc.xywh(1, 1, 2, 1));

            // ---- cbInteger ----
            cbInteger.setText("Integer");
            lexLeftPanel.add(cbInteger, cc.xywh(1, 3, 2, 1));

            // ---- cbFloat ----
            cbFloat.setText("Float");
            lexLeftPanel.add(cbFloat, cc.xywh(1, 5, 2, 1));

            // ---- cbComments ----
            cbComments.setText("Comments");
            lexLeftPanel.add(cbComments, cc.xywh(1, 7, 2, 1));
            cbComments.addActionListener(
                new ActionListener() {
                  public void actionPerformed(ActionEvent event) {
                    if (cbComments.isSelected()) {
                      cbSingleLine.setEnabled(true);
                      cbMultiLine.setEnabled(true);
                    } else {
                      cbSingleLine.setEnabled(false);
                      cbMultiLine.setEnabled(false);
                    }
                  }
                });

            // ======== commentsPanel ========
            {
              commentsPanel.setBorder(
                  new TitledBorder(
                      null,
                      null,
                      TitledBorder.DEFAULT_JUSTIFICATION,
                      TitledBorder.DEFAULT_POSITION));
              commentsPanel.setLayout(
                  new FormLayout(
                      new ColumnSpec[] {FormFactory.DEFAULT_COLSPEC},
                      new RowSpec[] {
                        FormFactory.DEFAULT_ROWSPEC,
                        FormFactory.LINE_GAP_ROWSPEC,
                        FormFactory.DEFAULT_ROWSPEC
                      }));

              // ---- cbSingleLine ----
              cbSingleLine.setText("Single-line ( //... )");
              cbSingleLine.setEnabled(false);
              cbSingleLine.setSelected(true);
              commentsPanel.add(cbSingleLine, cc.xy(1, 1));
              cbSingleLine.addActionListener(
                  new ActionListener() {
                    public void actionPerformed(ActionEvent event) {
                      if (!cbSingleLine.isSelected() && !cbMultiLine.isSelected()) {
                        cbComments.setSelected(false);
                        cbSingleLine.setEnabled(false);
                        cbMultiLine.setEnabled(false);
                        cbSingleLine.setSelected(true);
                        cbMultiLine.setSelected(true);
                      }
                    }
                  });

              // ---- cbMultiLine ----
              cbMultiLine.setText("Multi-line ( /* .. */ )");
              cbMultiLine.setEnabled(false);
              cbMultiLine.setSelected(true);
              commentsPanel.add(cbMultiLine, cc.xy(1, 3));
              cbMultiLine.addActionListener(
                  new ActionListener() {
                    public void actionPerformed(ActionEvent event) {
                      if (!cbSingleLine.isSelected() && !cbMultiLine.isSelected()) {
                        cbComments.setSelected(false);
                        cbSingleLine.setEnabled(false);
                        cbMultiLine.setEnabled(false);
                        cbSingleLine.setSelected(true);
                        cbMultiLine.setSelected(true);
                      }
                    }
                  });
            }
            lexLeftPanel.add(commentsPanel, cc.xy(2, 9));
          }
          lexicalItemPanel.add(lexLeftPanel, cc.xy(1, 1));

          // ======== lexRightPanel ========
          {
            lexRightPanel.setLayout(
                new FormLayout(
                    new ColumnSpec[] {
                      new ColumnSpec(ColumnSpec.DEFAULT, Sizes.dluX(10), FormSpec.NO_GROW),
                      new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                      FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                      new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW)
                    },
                    new RowSpec[] {
                      FormFactory.DEFAULT_ROWSPEC,
                      FormFactory.LINE_GAP_ROWSPEC,
                      FormFactory.DEFAULT_ROWSPEC,
                      FormFactory.LINE_GAP_ROWSPEC,
                      FormFactory.DEFAULT_ROWSPEC,
                      FormFactory.LINE_GAP_ROWSPEC,
                      FormFactory.DEFAULT_ROWSPEC,
                      FormFactory.LINE_GAP_ROWSPEC,
                      FormFactory.DEFAULT_ROWSPEC,
                      FormFactory.LINE_GAP_ROWSPEC,
                      FormFactory.DEFAULT_ROWSPEC
                    }));

            // ---- cbString ----
            cbString.setText("String");
            lexRightPanel.add(cbString, cc.xywh(1, 1, 2, 1));
            cbString.addActionListener(
                new ActionListener() {
                  public void actionPerformed(ActionEvent event) {
                    if (cbString.isSelected()) {
                      singleQuoteRadio.setEnabled(true);
                      doubleQuoteRadio.setEnabled(true);
                    } else {
                      singleQuoteRadio.setEnabled(false);
                      doubleQuoteRadio.setEnabled(false);
                    }
                  }
                });

            // ======== stringPanel ========
            {
              stringPanel.setBorder(new EtchedBorder());
              stringPanel.setLayout(
                  new FormLayout(
                      new ColumnSpec[] {FormFactory.DEFAULT_COLSPEC},
                      new RowSpec[] {
                        FormFactory.DEFAULT_ROWSPEC,
                        FormFactory.LINE_GAP_ROWSPEC,
                        FormFactory.DEFAULT_ROWSPEC
                      }));

              // ---- singleQuoteRadio ----
              singleQuoteRadio.setText("Single quotes ( 'sample string' )");
              singleQuoteRadio.setEnabled(false);
              stringPanel.add(singleQuoteRadio, cc.xy(1, 1));

              // ---- doubleQuoteRadio ----
              doubleQuoteRadio.setText("Double quotes ( \"sample string\" )");
              doubleQuoteRadio.setEnabled(false);
              doubleQuoteRadio.setSelected(true);
              stringPanel.add(doubleQuoteRadio, cc.xy(1, 3));
            }
            lexRightPanel.add(stringPanel, cc.xy(2, 3));

            // ---- cbCharacters ----
            cbCharacters.setText("Character");
            lexRightPanel.add(cbCharacters, cc.xywh(1, 5, 2, 1));

            // ---- cbWhiteSpace ----
            cbWhiteSpace.setText("White Space");
            lexRightPanel.add(cbWhiteSpace, cc.xywh(1, 7, 3, 1));

            // ======== wsPanel ========
            {
              wsPanel.setBorder(new EtchedBorder());
              wsPanel.setLayout(
                  new FormLayout(
                      new ColumnSpec[] {FormFactory.DEFAULT_COLSPEC},
                      new RowSpec[] {
                        FormFactory.DEFAULT_ROWSPEC,
                        FormFactory.LINE_GAP_ROWSPEC,
                        FormFactory.DEFAULT_ROWSPEC,
                        FormFactory.LINE_GAP_ROWSPEC,
                        FormFactory.DEFAULT_ROWSPEC
                      }));

              // ---- cbTabChar ----
              cbTabChar.setText("Tab character ( /t )");
              cbTabChar.setEnabled(false);
              cbTabChar.setSelected(true);
              wsPanel.add(cbTabChar, cc.xy(1, 1));

              // ---- cbNewlineChar ----
              cbNewlineChar.setText("Newline character ( /n )");
              cbNewlineChar.setEnabled(false);
              cbNewlineChar.setSelected(true);
              wsPanel.add(cbNewlineChar, cc.xy(1, 3));

              // ---- cbCarriageReturnChar ----
              cbCarriageReturnChar.setText("Carriage-return character ( /r )");
              cbCarriageReturnChar.setEnabled(false);
              cbCarriageReturnChar.setSelected(true);
              wsPanel.add(cbCarriageReturnChar, cc.xy(1, 5));
            }
            lexRightPanel.add(wsPanel, cc.xy(2, 9));
          }
          lexicalItemPanel.add(lexRightPanel, cc.xy(3, 1));
        }
        contentPanel.add(lexicalItemPanel, cc.xywh(3, 5, 5, 1));
      }
      dialogPane.add(contentPanel, BorderLayout.CENTER);

      // ======== buttonBar ========
      {
        buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER);
        buttonBar.setLayout(
            new FormLayout(
                new ColumnSpec[] {
                  FormFactory.GLUE_COLSPEC,
                  FormFactory.BUTTON_COLSPEC,
                  FormFactory.RELATED_GAP_COLSPEC,
                  FormFactory.BUTTON_COLSPEC
                },
                RowSpec.decodeSpecs("pref")));

        // ---- okButton ----
        okButton.setText("OK");
        buttonBar.add(okButton, cc.xy(2, 1));

        // ---- cancelButton ----
        cancelButton.setText("Cancel");
        buttonBar.add(cancelButton, cc.xy(4, 1));
      }
      dialogPane.add(buttonBar, BorderLayout.SOUTH);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
    pack();

    // ---- buttonGroup1 ----
    ButtonGroup buttonGroup1 = new ButtonGroup();
    buttonGroup1.add(singleQuoteRadio);
    buttonGroup1.add(doubleQuoteRadio);
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
  }
예제 #5
0
  private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Evaluation license - Andrey Lubchuck
    dialogPane = new JPanel();
    contentPanel = new JPanel();
    scrollPane1 = new JScrollPane();
    textPane1 = new JTextPane();
    button1 = new JButton();
    buttonBar = new JPanel();
    okButton = new JButton();
    cancelButton = new JButton();

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

    // ======== dialogPane ========
    {
      dialogPane.setBorder(Borders.createEmptyBorder("7dlu, 7dlu, 7dlu, 7dlu"));

      // JFormDesigner evaluation mark
      dialogPane.setBorder(
          new javax.swing.border.CompoundBorder(
              new javax.swing.border.TitledBorder(
                  new javax.swing.border.EmptyBorder(0, 0, 0, 0),
                  "JFormDesigner Evaluation",
                  javax.swing.border.TitledBorder.CENTER,
                  javax.swing.border.TitledBorder.BOTTOM,
                  new java.awt.Font("Dialog", java.awt.Font.BOLD, 12),
                  java.awt.Color.red),
              dialogPane.getBorder()));
      dialogPane.addPropertyChangeListener(
          new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent e) {
              if ("border".equals(e.getPropertyName())) throw new RuntimeException();
            }
          });

      dialogPane.setLayout(new BorderLayout());

      // ======== contentPanel ========
      {
        contentPanel.setLayout(
            new FormLayout("17*(default, $lcgap), default", "6*(default, $lgap), default"));

        // ======== scrollPane1 ========
        {
          scrollPane1.setViewportView(textPane1);
        }
        contentPanel.add(scrollPane1, CC.xywh(4, 5, 12, 1));

        // ---- button1 ----
        button1.setText("text");
        button1.setMaximumSize(new Dimension(83, 23));
        button1.setMinimumSize(new Dimension(83, 23));
        contentPanel.add(button1, CC.xywh(21, 11, 11, 1, CC.CENTER, CC.DEFAULT));
      }
      dialogPane.add(contentPanel, BorderLayout.NORTH);

      // ======== buttonBar ========
      {
        buttonBar.setBorder(Borders.createEmptyBorder("5dlu, 0dlu, 0dlu, 0dlu"));
        buttonBar.setLayout(
            new FormLayout("$lcgap, default, $glue, $button, $rgap, $button", "pref"));

        // ---- okButton ----
        okButton.setText("OK");
        buttonBar.add(okButton, CC.xy(4, 1));

        // ---- cancelButton ----
        cancelButton.setText("Cancel");
        cancelButton.setMaximumSize(new Dimension(85, 23));
        cancelButton.setMinimumSize(new Dimension(85, 23));
        buttonBar.add(cancelButton, CC.xy(6, 1));
      }
      dialogPane.add(buttonBar, BorderLayout.SOUTH);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
    pack();
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
  }
  private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner non-commercial license
    dialogPane = new JPanel();
    contentPanel = new JPanel();
    labelAngleThreshold = new JLabel();
    spinnerAngle = new JSpinner();
    labelSpeed = new JLabel();
    spinnerSpeed = new JSpinner();
    labelReactionTime = new JLabel();
    spinnerReactionTime = new JSpinner();
    buttonOK = new JButton();
    buttonCancel = new JButton();
    buttonDefault = new JButton();
    CellConstraints cc = new CellConstraints();

    // ======== this ========
    setResizable(false);
    setTitle("Advanced Warper");
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    // ======== dialogPane ========
    {
      dialogPane.setBorder(Borders.DIALOG_BORDER);
      dialogPane.setLayout(new BorderLayout());

      // ======== contentPanel ========
      {
        contentPanel.setLayout(
            new FormLayout("2*(50dlu, $lcgap), 50dlu", "3*(default, $lgap), default"));

        // ---- labelAngleThreshold ----
        labelAngleThreshold.setText("Angle Threshold in Degree");
        contentPanel.add(labelAngleThreshold, cc.xywh(1, 1, 3, 1));

        // ---- spinnerAngle ----
        spinnerAngle.setModel(new SpinnerNumberModel(10, 0, 180, 1));
        contentPanel.add(spinnerAngle, cc.xy(5, 1));

        // ---- labelSpeed ----
        labelSpeed.setText("minimal Speed in Pixel/ms");
        contentPanel.add(labelSpeed, cc.xywh(1, 3, 3, 1));

        // ---- spinnerSpeed ----
        spinnerSpeed.setModel(new SpinnerNumberModel(0.0, 0.0, 2.147483647E9, 1.0));
        contentPanel.add(spinnerSpeed, cc.xy(5, 3));

        // ---- labelReactionTime ----
        labelReactionTime.setText("Reaction Time in ms");
        contentPanel.add(labelReactionTime, cc.xywh(1, 5, 3, 1));

        // ---- spinnerReactionTime ----
        spinnerReactionTime.setModel(new SpinnerNumberModel(0, 0, 2147483647, 1));
        contentPanel.add(spinnerReactionTime, cc.xy(5, 5));

        // ---- buttonOK ----
        buttonOK.setText("OK");
        contentPanel.add(buttonOK, cc.xy(1, 7));

        // ---- buttonCancel ----
        buttonCancel.setText("Cancel");
        contentPanel.add(buttonCancel, cc.xy(3, 7));

        // ---- buttonDefault ----
        buttonDefault.setText("Default");
        buttonDefault.addActionListener(
            new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent e) {
                buttonDefaultActionPerformed(e);
              }
            });
        contentPanel.add(buttonDefault, cc.xy(5, 7));
      }
      dialogPane.add(contentPanel, BorderLayout.CENTER);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
    pack();
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
  }