Ejemplo n.º 1
0
  private void prepareComponent() {
    CloseEventHandler closeEventHandler = new CloseEventHandler();
    addWindowListener(closeEventHandler);

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

    JPanel contentPanel = new JPanel();
    // JPanel contentPanel = new FormDebugPanel();
    contentPane.add(contentPanel, BorderLayout.CENTER);

    CellConstraints cc = new CellConstraints();
    FormLayout layout =
        new FormLayout(
            "4dlu, d:grow, 4dlu", // columns
            "4dlu, p, 2dlu, fill:100dlu:grow, 4dlu, "
                + // rows
                "p, 2dlu, p, 4dlu"); // btn rows
    PanelBuilder contentPB = new PanelBuilder(layout, contentPanel);
    int columnCount = layout.getColumnCount();
    int rowCount = layout.getRowCount();

    JLabel label = new JLabel(Localizer.getString("MediaTypeCondEditor_ConditionToAdd"));
    contentPB.add(label, cc.xywh(2, 2, 1, 1));

    mediaTypeModel = new MediaTypeModel();
    mediaTypeTable = new JTable(mediaTypeModel);
    JTableHeader tableHeader = mediaTypeTable.getTableHeader();
    tableHeader.setResizingAllowed(false);
    tableHeader.setReorderingAllowed(false);
    // adjust column witdh of checkbox
    JCheckBox box = (JCheckBox) mediaTypeTable.getDefaultRenderer(Boolean.class);
    TableColumn column = mediaTypeTable.getColumnModel().getColumn(0);
    column.setMaxWidth(box.getPreferredSize().width + 2);
    column.setMinWidth(box.getPreferredSize().width + 2);
    mediaTypeTable.getColumnModel().getColumn(1).setCellRenderer(new MediaTypeCellRenderer());
    // ToolTipManager.sharedInstance().registerComponent( mediaTypeTable );
    contentPB.add(new JScrollPane(mediaTypeTable), cc.xywh(2, 4, 1, 1));

    // button bar
    contentPB.add(new JSeparator(), cc.xywh(1, rowCount - 3, columnCount, 1));

    JButton okBtn = new JButton(Localizer.getString("OK"));
    okBtn.addActionListener(new OkBtnListener());
    okBtn.setDefaultCapable(true);
    okBtn.setRequestFocusEnabled(true);

    JButton cancelBtn = new JButton(Localizer.getString("Cancel"));
    cancelBtn.addActionListener(closeEventHandler);

    JPanel btnPanel = ButtonBarFactory.buildOKCancelBar(okBtn, cancelBtn);
    contentPB.add(btnPanel, cc.xywh(2, rowCount - 1, columnCount - 2, 1));

    setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    getRootPane().setDefaultButton(okBtn);

    pack();
    setLocationRelativeTo(getParent());
  }
Ejemplo n.º 2
0
  public void addSeparator(String label) {
    addSpace(rowSpacing);
    addSpace(rowSpacing);

    layout.appendRow(rowSpec);
    int row = layout.getRowCount();

    if (StringUtils.isNullOrEmpty(label)) panel.add(new JSeparator(), cc.xywh(2, row, 3, 1));
    else panel.add(new JLabel(label), cc.xywh(2, row, 3, 1));

    addSpace(rowSpacing);
  }
Ejemplo n.º 3
0
  public void init(BarFormat format) {
    if (format == null) return;
    FormFormat form = format.getForm();
    if (form == null) return;
    List boxes = form.getBoxes();
    if (boxes == null || boxes.size() == 0) {
      return;
    }
    FormBoxLayout formBoxLayout = form.getLayout(zoom);
    FormLayout layout = new FormLayout(formBoxLayout.getColumnGrid(), formBoxLayout.getRowGrid());
    /// DefaultFormBuilder builder = new DefaultFormBuilder(this,layout);
    DefaultFormBuilder builder = new DefaultFormBuilder(layout, this);
    if (formBoxLayout.getBorder() == null) builder.setDefaultDialogBorder();
    else builder.setBorder(Borders.createEmptyBorder(formBoxLayout.getBorder()));
    CellConstraints cc = new CellConstraints();
    for (Iterator i = boxes.iterator(); i.hasNext(); ) {
      FormBox box = (FormBox) i.next();
      if (zoom < box.getMinZoom()) return;
      JComponent component;
      if (box.getFieldId() == null) component = new JLabel(Messages.getString(box.getTextId()));
      else {
        if (editor && !box.getField().isReadOnly()) {
          component = new ChangeAwareTextField();
          component.setBorder(null);
          // component.setOpaque(false);
        } else component = new JLabel();

        // if (box.getRow()==1&&!editor)
        // ((JLabel)component).setHorizontalAlignment(SwingConstants.CENTER);
        // bug workaround, not possible to center with classic method when rowSpan>1

        fieldComponents.put(box.getFieldId(), component);
      }
      Font font = formBoxLayout.getFont(box.getFont());
      if (font != null) component.setFont(font);
      String ba = box.getAlignment();
      int bc = box.getColumn();
      int br = box.getRow();
      int bcs = box.getColumnSpan();
      int brs = box.getRowSpan();
      try {
        builder.add(
            component, (ba == null) ? cc.xywh(bc, br, bcs, brs) : cc.xywh(bc, br, bcs, brs, ba));
      } catch (IndexOutOfBoundsException e) {
        log.fatal("box.Column(): " + bc);
        log.fatal("box.Row(): " + br);
        log.fatal("box.ColumnSpan(): " + bcs);
        log.fatal("box.RowSpan(): " + brs);
        log.fatal("box.Alignment(): " + ba);
        log.fatal("Occur Error: ", e);
      }
    }
  }
Ejemplo n.º 4
0
  protected JComponent createMasterPanel() {
    final FormLayout layout =
        new FormLayout(
            "l:p,2dlu,f:max(p;50dlu):g(.3) ,3dlu " + "l:p,2dlu,f:max(p;50dlu):g(.3) ", "");
    final DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();
    builder.setRowGroupingEnabled(true);
    builder.append("Fecha", fecha);
    builder.append("F. Pago", formaDePago, true);
    builder.append("Banco", bancoOrigen);
    builder.append("Referencia", referencia, true);
    builder.append("Cuenta Depósito", cuentaDeposito, true);
    builder.append("Importe", importe);
    builder.append("Pago", buildPagosbox(model.getPagoMPModel().getModel("depositoRow")), true);
    builder.append("Disponible", disponible);
    builder.append("Por pagar", saldoTotal);
    builder.append("Pendiente", saldoPendiente, true);

    final CellConstraints cc = new CellConstraints();
    builder.append("Comentario");
    builder.appendRow(new RowSpec("17dlu"));
    builder.add(new JScrollPane(comentario), cc.xywh(builder.getColumn(), builder.getRow(), 5, 2));
    builder.nextLine(2);
    builder.append("Condonar", condonar);
    builder.append("Tipo de Facturas", tipoDoctos, true);
    ComponentUtils.decorateSpecialFocusTraversal(builder.getPanel());
    return builder.getPanel();
  }
  public AnchorPointClassificationPanel(
      Object displacement, String title, List<QualifiedName> properties) {
    this.title = title;

    fixed = new JRadioButton();
    property = new JRadioButton();

    ButtonGroup bg = new ButtonGroup();
    bg.add(fixed);
    bg.add(property);

    propertyCBx = new JComboBox();
    propertyCBx.setRenderer(new PropertyNameRenderer());
    for (QualifiedName qn : properties) {
      propertyCBx.addItem(new PropertyName(qn));
    }
    propertyCBy = new JComboBox();
    propertyCBy.setRenderer(new PropertyNameRenderer());
    for (QualifiedName qn : properties) {
      propertyCBy.addItem(new PropertyName(qn));
    }

    anchorEditor = new AnchorEditor();

    if (displacement instanceof Pair<?, ?>) {
      property.setSelected(true);
      propertyCBx.setSelectedItem(((Pair<?, ?>) displacement).first);
      propertyCBy.setSelectedItem(((Pair<?, ?>) displacement).second);
    } else if (displacement instanceof Point2d) {
      fixed.setSelected(true);
      anchorEditor.setValue(((Point2d) displacement).x, ((Point2d) displacement).y);
    } else {
      fixed.setSelected(true);
    }
    if (properties == null || properties.isEmpty()) {
      propertyCBx.setEnabled(false);
      propertyCBy.setEnabled(false);
      property.setEnabled(false);
    }

    FormLayout fl =
        new FormLayout(
            "$rgap, 15dlu, left:default:grow(1.0)",
            "$sepheight, center:[20dlu,default], $ug, $sepheight, bottom:10dlu, center:$cpheight, bottom:10dlu,center:$cpheight");
    DefaultFormBuilder builder = new DefaultFormBuilder(fl);
    CellConstraints cc = new CellConstraints();
    builder.addSeparator(get("$MD11713"), cc.xyw(1, 1, 3));
    builder.add(fixed, cc.xy(2, 2));
    builder.add(anchorEditor, cc.xy(3, 2));

    builder.addSeparator(get("$MD11714"), cc.xyw(1, 4, 3));
    builder.add(property, cc.xywh(2, 5, 1, 4));
    builder.addLabel(get("$MD10835"), cc.xy(3, 5));
    builder.add(propertyCBx, cc.xy(3, 6));
    builder.addLabel(get("$MD10836"), cc.xy(3, 7));
    builder.add(propertyCBy, cc.xy(3, 8));
    add(builder.getPanel());
  }
  private JPanel createArchiveSearchFieldSubPanel() {

    FormLayout fl =
        new FormLayout(
            "pref,2dlu,pref:grow,5dlu,pref,2dlu,pref,5dlu,pref,2dlu,pref,5dlu,pref,2dlu,120px,5dlu,pref",
            "pref,2dlu,pref");
    JPanel searchPanel = new JPanel(fl);

    startDatePicker.getMonthView().setAntialiased(true);
    startDatePicker.getMonthView().setBoxPaddingX(1);
    startDatePicker.getMonthView().setBoxPaddingY(1);
    startDatePicker.getMonthView().setSelectionMode(JXMonthView.SelectionMode.SINGLE_SELECTION);
    startDatePicker.getEditor().setValue(null);
    startDatePicker.setLinkPanel(null);
    endDatePicker.getMonthView().setAntialiased(true);
    endDatePicker.getMonthView().setBoxPaddingX(1);
    endDatePicker.getMonthView().setBoxPaddingY(1);
    endDatePicker.getMonthView().setSelectionMode(JXMonthView.SelectionMode.SINGLE_SELECTION);
    endDatePicker.getEditor().setValue(null);
    endDatePicker.setLinkPanel(null);

    searchButton.setActionCommand("search");
    searchButton.addActionListener(this);
    clearFieldButton.setActionCommand("clear");
    clearFieldButton.addActionListener(this);

    CellConstraints cc = new CellConstraints();
    searchPanel.add(patientNameLabel, cc.xy(1, 1));
    searchPanel.add(patientNameField, cc.xy(3, 1));
    searchPanel.add(descriptionLabel, cc.xy(5, 1));
    searchPanel.add(descriptionField, cc.xywh(7, 1, 5, 1));
    searchPanel.add(startDateLabel, cc.xy(13, 1));
    searchPanel.add(startDatePicker, cc.xy(15, 1));
    searchPanel.add(clearFieldButton, cc.xy(17, 1));
    searchPanel.add(patientIDLabel, cc.xy(1, 3));
    searchPanel.add(patientIDField, cc.xy(3, 3));
    searchPanel.add(modalityLabel, cc.xy(5, 3));
    searchPanel.add(modalityField, cc.xy(7, 3));
    searchPanel.add(anatomyLabel, cc.xy(9, 3));
    searchPanel.add(anatomyField, cc.xy(11, 3));
    searchPanel.add(endDateLabel, cc.xy(13, 3));
    searchPanel.add(endDatePicker, cc.xy(15, 3));
    searchPanel.add(searchButton, cc.xy(17, 3));

    patientIDField.setActionCommand("search");
    patientIDField.addActionListener(this);
    patientNameField.setActionCommand("search");
    patientNameField.addActionListener(this);
    descriptionField.setActionCommand("search");
    descriptionField.addActionListener(this);
    modalityField.setActionCommand("search");
    modalityField.addActionListener(this);
    anatomyField.setActionCommand("search");
    anatomyField.addActionListener(this);

    return searchPanel;
  }
Ejemplo n.º 7
0
  public void display() throws SVNException {

    JPanel pnlMain = new JPanel(new FormLayout("r:p,2dlu,p:g", "p,2dlu:g,p,2dlu,p"));
    CellConstraints cc = new CellConstraints();
    frame = GuiHelper.createFrame(pnlMain, "Create Repository", null);

    Label lblWorkingCopy = new Label("Path:");
    Label sfWorkingCopy = new Label(createRepo.getPath());
    JButton btnClose = new JButton(new CloseAction(frame));
    lblStatus = new Label(" ");

    pnlMain.add(lblWorkingCopy, cc.xy(1, 1));
    pnlMain.add(sfWorkingCopy, cc.xy(3, 1));
    pnlMain.add(btnClose, cc.xywh(1, 3, 3, 1, CellConstraints.CENTER, CellConstraints.DEFAULT));
    pnlMain.add(lblStatus, cc.xywh(1, 5, 3, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));

    frame.execute();
  }
Ejemplo n.º 8
0
  private void initView() {
    // create widgets
    name =
        new TextAdapter(new JTextField()) {

          @Override
          protected void updateModel(String text) {
            setQueryName(text);
          }
        };

    queryRoot = Application.getWidgetFactory().createComboBox();
    AutoCompletion.enable(queryRoot);
    queryRoot.setRenderer(CellRenderers.listRendererWithIcons());

    qualifier =
        new ValidatorTextAdapter(new JTextField()) {

          @Override
          protected void updateModel(String text) {
            setQueryQualifier(text);
          }

          @Override
          protected void validate(String text) throws ValidationException {
            createQualifier(text);
          }
        };

    distinct = new JCheckBox();

    properties = new ObjectQueryPropertiesPanel(mediator);

    // assemble
    CellConstraints cc = new CellConstraints();
    FormLayout layout =
        new FormLayout(
            "right:max(80dlu;pref), 3dlu, fill:200dlu", "p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p");
    PanelBuilder builder = new PanelBuilder(layout);
    builder.setDefaultDialogBorder();

    builder.addSeparator("SelectQuery Settings", cc.xywh(1, 1, 3, 1));
    builder.addLabel("Query Name:", cc.xy(1, 3));
    builder.add(name.getComponent(), cc.xy(3, 3));
    builder.addLabel("Query Root:", cc.xy(1, 5));
    builder.add(queryRoot, cc.xy(3, 5));
    builder.addLabel("Qualifier:", cc.xy(1, 7));
    builder.add(qualifier.getComponent(), cc.xy(3, 7));
    builder.addLabel("Distinct:", cc.xy(1, 9));
    builder.add(distinct, cc.xy(3, 9));

    this.setLayout(new BorderLayout());
    this.add(builder.getPanel(), BorderLayout.NORTH);
    this.add(properties, BorderLayout.CENTER);
  }
Ejemplo n.º 9
0
  @Override
  protected void appendProperties(DefaultFormBuilder builder) {
    builder.append("Template", _template);
    builder.append(_templateButton);
    builder.nextLine();

    builder.append("Parameters");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");

    builder.nextLine();
    builder.append("");

    builder.nextRow(-6);
    JScrollPane scrollPane = new JScrollPane(_parameters);
    CellConstraints cc = new CellConstraints();
    builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 7));
    builder.nextRow(6);
    builder.nextLine();

    builder.append("Property Sets");
    builder.append(_propertySets, 3);
    builder.nextLine();

    builder.append("Properties");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");

    builder.nextLine();
    builder.append("");

    builder.nextRow(-6);
    scrollPane = new JScrollPane(_properties);
    builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 7));
    builder.nextRow(6);
    builder.nextLine();
  }
Ejemplo n.º 10
0
  private JPanel buildTextPanel() {
    FormLayout layout =
        new FormLayout("right:max(50dlu;pref), 3dlu, 50dlu", "p, 3dlu, p, 3dlu, p, 14dlu, 3dlu, p");
    layout.setRowGroups(new int[][] {{1, 3, 5}});

    PanelBuilder builder = new PanelBuilder(layout);
    builder.setDefaultDialogBorder();
    CellConstraints cc = new CellConstraints();
    builder.addLabel("JTextField", cc.xy(1, 1));
    builder.add(textField, cc.xy(3, 1));
    builder.addLabel("JPasswordField", cc.xy(1, 3));
    builder.add(passwordField, cc.xy(3, 3));
    builder.addLabel("JTextArea", cc.xy(1, 5));
    builder.add(new JScrollPane(textArea), cc.xywh(3, 5, 1, 2));
    builder.addLabel("JLabel", cc.xy(1, 8));
    builder.add(textLabel, cc.xy(3, 8));
    return builder.getPanel();
  }
  /**
   * Places the visual components correctly in the grid. Components being shown are the combo box
   * containing the templates, all file properties with their list of engines and the buttons
   */
  private void placeComponents() {
    FormLayout layout =
        new FormLayout("3px, 120, 5px, fill:p:grow, 3px", "3px, p, 5px, fill:p:grow, 3px");
    PanelBuilder builder = new PanelBuilder(layout);
    builder.setOpaque(true);

    CellConstraints cc = new CellConstraints();

    // create top panel with combo box and and buttons
    builder.add(lActivePlugins, cc.xywh(2, 2, 1, 3));
    builder.add(buildFilePropertyPreferencesPanel(), cc.xy(4, 2));
    builder.add(buildTagsPanel(), cc.xy(4, 4));

    // build the dialog
    setLayout(new GridLayout());
    removeAll();
    add(builder.getPanel());
  }
Ejemplo n.º 12
0
  /**
   * Builds the Track editor panel.
   *
   * <p>
   *
   * @return the panel to edit track info. AZ - FormLayout corrections
   */
  private JComponent buildTrackPanel() {
    FormLayout layout =
        new FormLayout(
            "right:max(14dlu;pref), 4dlu, left:20dlu, left:140dlu, 4dlu, left:25px, right:pref:grow",
            "4px, p, 4px, p, 4px, p, " + this.getSettings().getCoverSizeSmall() + "px");
    PanelBuilder builder = new PanelBuilder(layout);
    CellConstraints cc = new CellConstraints();

    builder.addLabel(Resources.getString("label.tracknumber") + ": ", cc.xy(1, 2));
    builder.add(trackNumber, cc.xy(3, 2));
    builder.add(albumImage, cc.xywh(7, 2, 1, 6, "right, top"));
    builder.addLabel(Resources.getString("label.title") + ": ", cc.xy(1, 4));
    builder.add(titleField, cc.xyw(3, 4, 2));
    builder.add(ComponentFactory.createTitleCaseButton(titleField), cc.xy(6, 4));
    builder.addLabel(Resources.getString("label.comment") + ": ", cc.xy(1, 6, "right, top"));
    builder.add(comment, cc.xyw(3, 6, 2));
    return new IconFeedbackPanel(
        getValidationModel().getValidationResultModel(), builder.getPanel());
  }
Ejemplo n.º 13
0
  /**
   * creates the find/replace JPanel and associates keyboard shortcuts for launching, displaying and
   * navigating the search panel
   */
  private void createFindAndReplacePanel() {
    setupKeyStrokeMappings();
    createFindPanel();
    createReplacePanel();

    statusInfo = createLabel("");
    builder.add(statusInfo, cc.xywh(11, 3, 4, 1));

    /*
    Font font = wrapSearchButton.getFont();
    font = new Font(font.getFontName(), font.getStyle(), font.getSize()-2);
    nextButton.setFont(font);
    previousButton.setFont(font);
    matchCaseButton.setFont(font);
    wrapSearchButton.setFont(font);
    replaceButton.setFont(font);
    replaceAllButton.setFont(font);

    font = findLabel.getFont();
    font = new Font(font.getFontName(), font.getStyle(), font.getSize()-2);
    findLabel.setFont(font);
    statusInfo.setFont(font);*/
  }
Ejemplo n.º 14
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
  }
  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
  }
Ejemplo n.º 16
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
  }
Ejemplo n.º 17
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
  }
Ejemplo n.º 18
0
  public TemplateEditor() {
    super("OME Notes Template Editor");

    pictureHandler = new PictureTransferHandler();
    icons = new Hashtable[0];
    fields = new Hashtable[0];

    // set up the menu bar

    JMenuBar menubar = new JMenuBar();

    JMenu file = new JMenu("File");

    JMenuItem newFile = new JMenuItem("New...");
    newFile.setActionCommand("new");
    newFile.addActionListener(this);
    file.add(newFile);

    JMenuItem openFile = new JMenuItem("Open");
    openFile.setActionCommand("open");
    openFile.addActionListener(this);
    file.add(openFile);

    JMenuItem saveFile = new JMenuItem("Save");
    saveFile.setActionCommand("save");
    saveFile.addActionListener(this);
    file.add(saveFile);

    JMenuItem quit = new JMenuItem("Quit");
    quit.setActionCommand("quit");
    quit.addActionListener(this);
    file.add(quit);

    menubar.add(file);

    setJMenuBar(menubar);

    // set up the toolbar

    JToolBar toolbar = new JToolBar();
    toolbar.setFloatable(false);

    JButton tab = new JButton("New Tab");
    tab.addActionListener(this);
    tab.setActionCommand("prompt tab");

    JButton row = new JButton("Add Row");
    row.addActionListener(this);
    row.setActionCommand("add row");

    JButton col = new JButton("Add Column");
    col.addActionListener(this);
    col.setActionCommand("add col");

    JButton remove = new JButton("Remove this tab");
    remove.addActionListener(this);
    remove.setActionCommand("removeTab");

    toolbar.add(tab);
    toolbar.add(row);
    toolbar.add(col);
    toolbar.add(remove);

    // set up the rest of the window

    CellConstraints cc = new CellConstraints();

    FormLayout layout =
        new FormLayout(
            "pref:grow,pref,pref:grow,pref:grow,pref:grow",
            "pref,5dlu:grow,pref:grow,pref:grow,pref:grow");

    JPanel contentPane = new JPanel(layout);

    contentPane.add(toolbar, cc.xywh(1, 1, 5, 1));

    tabPane = new JTabbedPane();
    contentPane.add(tabPane, cc.xywh(3, 2, 3, 4));

    FormLayout componentLayout =
        new FormLayout(
            "pref:grow,pref:grow", "pref:grow,pref:grow,pref:grow,pref:grow,pref:grow,pref:grow");
    componentPane = new JPanel(componentLayout);

    componentPane.add(new JLabel("Field Choices"), cc.xywh(1, 1, 2, 1));

    try {
      for (int i = 0; i < COMPONENTS.length; i++) {
        JLabel label = new JLabel(COMPONENT_NAMES[i]);
        componentPane.add(label, cc.xy(1, i + 2));

        JPanel panel = new JPanel();
        JComponent component = (JComponent) COMPONENTS[i].newInstance();
        component.setPreferredSize(new Dimension(64, 25));
        component.setEnabled(false);
        panel.add(component);

        DraggableIcon img = new DraggableIcon(panel, -1, -1);
        img.setTransferHandler(pictureHandler);
        img.setEditable(false);

        componentPane.add(img, cc.xy(2, i + 2));
      }
    } catch (Exception e) {
      error("Failed to create field list", e);
    }

    contentPane.add(componentPane, cc.xywh(1, 2, 1, 4));

    setContentPane(contentPane);
    setSize(new Dimension(768, 768));
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    setVisible(true);
  }
  private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner non-commercial license
    label_subjectScopeNote = new JLabel();
    scrollPane1 = new JScrollPane();
    descritpion =
        ATBasicComponentFactory.createTextArea(
            detailsModel.getModel(IndexItems.PROPERTYNAME_ITEM_VALUE));
    label_subjectScopeNote2 = new JLabel();
    type =
        ATBasicComponentFactory.createComboBox(
            detailsModel, IndexItems.PROPERTYNAME_ITEM_TYPE, IndexItems.class);
    label_subjectScopeNote3 = new JLabel();
    reference = new JComboBox();
    label_subjectScopeNote4 = new JLabel();
    referenceText =
        ATBasicComponentFactory.createTextField(
            detailsModel.getModel(IndexItems.PROPERTYNAME_REFERENCE_TEXT));
    CellConstraints cc = new CellConstraints();

    // ======== this ========
    setBorder(Borders.DLU4_BORDER);
    setBackground(new Color(234, 201, 250));
    setOpaque(false);
    setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
    setLayout(
        new FormLayout(
            new ColumnSpec[] {
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
              new ColumnSpec("max(default;400px):grow")
            },
            new RowSpec[] {
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.LINE_GAP_ROWSPEC,
              new RowSpec(RowSpec.TOP, Sizes.DEFAULT, FormSpec.NO_GROW),
              FormFactory.LINE_GAP_ROWSPEC,
              new RowSpec(RowSpec.TOP, Sizes.DEFAULT, FormSpec.NO_GROW),
              FormFactory.LINE_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC
            }));

    // ---- label_subjectScopeNote ----
    label_subjectScopeNote.setText("Value");
    label_subjectScopeNote.setVerticalAlignment(SwingConstants.TOP);
    label_subjectScopeNote.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
    ATFieldInfo.assignLabelInfo(
        label_subjectScopeNote, IndexItems.class, IndexItems.PROPERTYNAME_ITEM_VALUE);
    add(label_subjectScopeNote, cc.xywh(1, 1, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP));

    // ======== scrollPane1 ========
    {
      scrollPane1.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
      scrollPane1.setMaximumSize(new Dimension(32767, 100));
      scrollPane1.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));

      // ---- descritpion ----
      descritpion.setRows(4);
      descritpion.setLineWrap(true);
      descritpion.setTabSize(20);
      descritpion.setWrapStyleWord(true);
      scrollPane1.setViewportView(descritpion);
    }
    add(scrollPane1, cc.xy(3, 1));

    // ---- label_subjectScopeNote2 ----
    label_subjectScopeNote2.setText("Type");
    label_subjectScopeNote2.setVerticalAlignment(SwingConstants.TOP);
    label_subjectScopeNote2.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
    ATFieldInfo.assignLabelInfo(
        label_subjectScopeNote2, IndexItems.class, IndexItems.PROPERTYNAME_ITEM_TYPE);
    add(
        label_subjectScopeNote2,
        cc.xywh(1, 3, 1, 1, CellConstraints.DEFAULT, CellConstraints.CENTER));

    // ---- type ----
    type.setMaximumSize(new Dimension(50, 27));
    type.setOpaque(false);
    type.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
    add(type, cc.xywh(3, 3, 1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));

    // ---- label_subjectScopeNote3 ----
    label_subjectScopeNote3.setText("Reference");
    label_subjectScopeNote3.setVerticalAlignment(SwingConstants.TOP);
    label_subjectScopeNote3.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
    ATFieldInfo.assignLabelInfo(
        label_subjectScopeNote3, IndexItems.class, IndexItems.PROPERTYNAME_REFERENCE);
    add(
        label_subjectScopeNote3,
        cc.xywh(1, 5, 1, 1, CellConstraints.DEFAULT, CellConstraints.CENTER));

    // ---- reference ----
    reference.setMaximumSize(new Dimension(50, 27));
    reference.setOpaque(false);
    reference.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
    reference.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            referenceActionPerformed(e);
          }
        });
    add(reference, cc.xywh(3, 5, 1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));

    // ---- label_subjectScopeNote4 ----
    label_subjectScopeNote4.setText("Reference Text");
    label_subjectScopeNote4.setVerticalAlignment(SwingConstants.TOP);
    label_subjectScopeNote4.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
    ATFieldInfo.assignLabelInfo(
        label_subjectScopeNote4, IndexItems.class, IndexItems.PROPERTYNAME_REFERENCE_TEXT);
    add(
        label_subjectScopeNote4,
        cc.xywh(1, 7, 1, 1, CellConstraints.DEFAULT, CellConstraints.CENTER));
    add(referenceText, cc.xy(3, 7));
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
  }
Ejemplo n.º 20
0
  private JXPanel getContent() {
    //                 1     2     3     4      5     6    7     8      9
    String xwerte = "10dlu,200dlu,40dlu,120dlu,40dlu,65dlu,2dlu,60dlu,10dlu";
    //                1    2   3  4   5  6  7   8  9  10  11   12   13
    String ywerte = "10dlu,p,2dlu,p,2dlu,p,2dlu,p,2dlu,p,2dlu:g,2dlu,p,10dlu";
    FormLayout lay = new FormLayout(xwerte, ywerte);
    CellConstraints cc = new CellConstraints();
    JXPanel jpan = new JXPanel();
    jpan.setLayout(lay);
    /** * rechte Seite ** */
    tfs[0] = new JRtaTextField("DATUM", true);
    tfs[0].setText(DatFunk.sHeute());
    tfs[1] = new JRtaTextField("DATUM", true);
    tfs[1].setText(DatFunk.sHeute());
    tfs[2] = new JRtaTextField("nix", true);
    JLabel lab = new JLabel("neues Kassenbuch erzeugen");
    jpan.add(lab, cc.xyw(6, 2, 3));
    lab = new JLabel("von Datum");
    jpan.add(lab, cc.xy(6, 4));
    jpan.add(tfs[0], cc.xy(8, 4));
    lab = new JLabel("bis Datum");
    jpan.add(lab, cc.xy(6, 6));
    jpan.add(tfs[1], cc.xy(8, 6));
    lab = new JLabel("Name d. Kassenbuches");
    jpan.add(lab, cc.xy(6, 8));
    jpan.add(tfs[2], cc.xy(8, 8));
    buts[1] = ButtonTools.macheButton("erzeugen", "newtable", al);
    jpan.add(buts[1], cc.xy(8, 10));
    /** **Mitte*** */
    lab = new JLabel("bislang vorhandene Kassenbücher");
    jpan.add(lab, cc.xy(4, 2));

    kbvorhanden = new JList();
    JScrollPane jscr = JCompTools.getTransparentScrollPane(kbvorhanden);
    jscr.validate();
    jpan.add(jscr, cc.xywh(4, 4, 1, 8, CellConstraints.DEFAULT, CellConstraints.FILL));
    new SwingWorker<Void, Void>() {
      @Override
      protected Void doInBackground() throws Exception {
        long zeit = System.currentTimeMillis();
        while (!RehaKassenbuch.DbOk) {
          Thread.sleep(50);
          if (System.currentTimeMillis() - zeit > 10000) {
            break;
          }
        }
        if (RehaKassenbuch.DbOk) {
          doKBErmitteln();
        } else {
          System.exit(0);
        }
        return null;
      }
    }.execute();
    buts[0] = ButtonTools.macheButton("löschen", "deletetable", al);
    jpan.add(buts[0], cc.xy(4, 13));

    /** * Linke Seite ** */
    lab = new JLabel("");
    lab.setIcon(new ImageIcon(RehaKassenbuch.progHome + "icons/GutenbergBibel.png"));
    jpan.add(lab, cc.xywh(2, 2, 1, 11, CellConstraints.DEFAULT, CellConstraints.CENTER));

    jpan.validate();
    return jpan;
  }
Ejemplo n.º 21
0
  protected void appendProperties(DefaultFormBuilder builder) {
    builder.appendSeparator("Runtime Status");

    builder.append("Status");
    builder.append(_currentStatus, 3);
    builder.nextLine();

    builder.append("Published Endpoints");
    builder.append(_currentEndpoints, 3);
    builder.nextLine();

    builder.appendSeparator("Configuration");

    builder.append("Description");
    builder.nextLine();
    builder.append("");
    builder.nextRow(-2);
    CellConstraints cc = new CellConstraints();
    JScrollPane scrollPane = new JScrollPane(_description);
    builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 3));
    builder.nextRow(2);
    builder.nextLine();

    builder.append("Adapter ID");
    builder.append(_id, 3);
    builder.nextLine();

    builder.append("Replica Group");
    builder.append(_replicaGroupId, 3);
    builder.nextLine();

    builder.append("Priority");
    builder.append(_priority, 3);
    builder.nextLine();

    builder.append("Endpoints");
    builder.append(_endpoints, 3);
    builder.nextLine();

    builder.append("Published Endpoints");
    builder.append(_publishedEndpoints, 3);
    builder.nextLine();

    builder.append("", _registerProcess);
    builder.nextLine();
    builder.append("", _serverLifetime);
    builder.nextLine();

    builder.append("Well-known Objects");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextRow(-6);
    scrollPane = new JScrollPane(_objects);
    builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 7));
    builder.nextRow(6);
    builder.nextLine();

    builder.append("Allocatable Objects");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextRow(-6);
    scrollPane = new JScrollPane(_allocatables);
    builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 7));
    builder.nextRow(6);
    builder.nextLine();
  }
Ejemplo n.º 22
0
  /**
   * Called when preparing this settings pane for display the first time. Can be overriden to
   * implement the look of the settings pane.
   */
  @Override
  protected void prepareComponent() {
    FormLayout layout =
        new FormLayout(
            "10dlu, right:d, 2dlu, d, 2dlu:grow", // columns
            "p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p"); // rows
    layout.setRowGroups(new int[][] {{3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23}});
    setLayout(layout);

    PanelBuilder builder = new PanelBuilder(layout, this);
    CellConstraints cc = new CellConstraints();

    builder.addSeparator(Localizer.getString("GeneralDownloadSettings"), cc.xywh(1, 1, 5, 1));

    JLabel label =
        builder.addLabel(
            Localizer.getString("DownloadSettings_TotalParallelDownloads") + ": ", cc.xy(2, 3));
    label.setToolTipText(Localizer.getString("DownloadSettings_TTTTotalParallelDownloads"));
    totalWorkersTF =
        new IntegerTextField(DownloadPrefs.MaxTotalDownloadWorker.get().toString(), 6, 2);
    totalWorkersTF.setToolTipText(
        Localizer.getString("DownloadSettings_TTTTotalParallelDownloads"));
    builder.add(totalWorkersTF, cc.xy(4, 3));

    label =
        builder.addLabel(
            Localizer.getString("DownloadSettings_ParallelDownloadsPerFile") + ": ", cc.xy(2, 5));
    label.setToolTipText(Localizer.getString("DownloadSettings_TTTParallelDownloadsPerFile"));
    workerPerDownloadTF =
        new IntegerTextField(DownloadPrefs.MaxWorkerPerDownload.get().toString(), 6, 2);
    workerPerDownloadTF.setToolTipText(
        Localizer.getString("DownloadSettings_TTTParallelDownloadsPerFile"));
    builder.add(workerPerDownloadTF, cc.xy(4, 5));

    label =
        builder.addLabel(
            Localizer.getString("DownloadSettings_InitialSegmentSizeKb") + ": ", cc.xy(2, 7));
    label.setToolTipText(Localizer.getString("DownloadSettings_TTTInitialSegmentSizeKb"));
    initialSegmentSizeTF =
        new IntegerTextField(
            String.valueOf(DownloadPrefs.SegmentInitialSize.get().intValue() / 1024), 6, 4);
    initialSegmentSizeTF.setToolTipText(
        Localizer.getString("DownloadSettings_TTTInitialSegmentSizeKb"));
    builder.add(initialSegmentSizeTF, cc.xy(4, 7));

    label =
        builder.addLabel(
            Localizer.getString("DownloadSettings_SegmentTransferTimeSec") + ": ", cc.xy(2, 9));
    label.setToolTipText(Localizer.getString("DownloadSettings_TTTSegmentTransferTimeSec"));
    segmentTransferTimeTF =
        new IntegerTextField(DownloadPrefs.SegmentTransferTargetTime.get().toString(), 6, 3);
    segmentTransferTimeTF.setToolTipText(
        Localizer.getString("DownloadSettings_TTTSegmentTransferTimeSec"));
    builder.add(segmentTransferTimeTF, cc.xy(4, 9));

    builder.addLabel(Localizer.getString("PushTimeout") + ": ", cc.xy(2, 11));
    pushTimeoutTF =
        new IntegerTextField(
            String.valueOf(DownloadPrefs.PushRequestTimeout.get().intValue() / 1000), 6, 3);
    builder.add(pushTimeoutTF, cc.xy(4, 11));

    readoutMagmaChkbx =
        new JCheckBox(
            Localizer.getString("DownloadSettings_ReadoutDownloadedMagmas"),
            DownloadPrefs.AutoReadoutMagmaFiles.get().booleanValue());
    readoutMagmaChkbx.setToolTipText(
        Localizer.getString("DownloadSettings_TTTReadoutDownloadedMagmas"));
    builder.add(readoutMagmaChkbx, cc.xywh(2, 13, 4, 1));

    readoutMetalinkChkbx =
        new JCheckBox(
            Localizer.getString("DownloadSettings_ReadoutDownloadedMetalink"),
            DownloadPrefs.AutoReadoutMetalinkFiles.get().booleanValue());
    readoutMetalinkChkbx.setToolTipText(
        Localizer.getString("DownloadSettings_TTTReadoutDownloadedMetalink"));
    builder.add(readoutMetalinkChkbx, cc.xywh(2, 15, 4, 1));

    readoutRSSChkbx =
        new JCheckBox(
            Localizer.getString("DownloadSettings_ReadoutDownloadedRSS"),
            DownloadPrefs.AutoReadoutRSSFiles.get().booleanValue());
    readoutRSSChkbx.setToolTipText(Localizer.getString("DownloadSettings_TTTReadoutDownloadedRSS"));
    builder.add(readoutRSSChkbx, cc.xywh(2, 17, 4, 1));

    silentSubscriptionsChkbx =
        new JCheckBox(
            Localizer.getString("DownloadSettings_DownloadSubscriptionsSilently"),
            SubscriptionPrefs.DownloadSilently.get().booleanValue());
    silentSubscriptionsChkbx.setToolTipText(
        Localizer.getString("DownloadSettings_TTTDownloadSubscriptionsSilently"));
    builder.add(silentSubscriptionsChkbx, cc.xywh(2, 19, 4, 1));

    removeCompletedDownloadsChkbx =
        new JCheckBox(
            Localizer.getString("DownloadSettings_AutoRemoveCompletedDownloads"),
            DownloadPrefs.AutoRemoveCompleted.get().booleanValue());
    removeCompletedDownloadsChkbx.setToolTipText(
        Localizer.getString("DownloadSettings_TTTAutoRemoveCompletedDownloads"));
    builder.add(removeCompletedDownloadsChkbx, cc.xywh(2, 21, 4, 1));

    enableHitSnoopingChkbx =
        new JCheckBox(
            Localizer.getString("DownloadSettings_EnableHitSnooping"),
            ConnectionPrefs.EnableQueryHitSnooping.get().booleanValue());
    enableHitSnoopingChkbx.setToolTipText(
        Localizer.getString("DownloadSettings_TTTEnableHitSnooping"));
    builder.add(enableHitSnoopingChkbx, cc.xywh(2, 23, 4, 1));

    initConfigValues();
    refreshEnableState();
  }
Ejemplo n.º 23
0
  /** Fancies up the importer dialog to look much nicer. */
  private void rebuildDialog(GenericDialog gd) {
    // extract GUI components from dialog and add listeners
    List<Checkbox> boxes = null;
    List<Choice> choices = null;
    List<Label> labels = null;
    Label colorModeLabel = null;
    Label stackFormatLabel = null;
    Label stackOrderLabel = null;
    Component[] c = gd.getComponents();
    if (c != null) {
      boxes = new ArrayList<Checkbox>();
      choices = new ArrayList<Choice>();
      labels = new ArrayList<Label>();
      for (int i = 0; i < c.length; i++) {
        if (c[i] instanceof Checkbox) {
          Checkbox item = (Checkbox) c[i];
          item.addFocusListener(this);
          item.addItemListener(this);
          item.addMouseListener(this);
          boxes.add(item);
        } else if (c[i] instanceof Choice) {
          Choice item = (Choice) c[i];
          item.addFocusListener(this);
          item.addItemListener(this);
          item.addMouseListener(this);
          choices.add(item);
        } else if (c[i] instanceof Label) labels.add((Label) c[i]);
      }
      int boxIndex = 0, choiceIndex = 0, labelIndex = 0;
      autoscaleBox = boxes.get(boxIndex++);
      colorModeChoice = choices.get(choiceIndex++);
      colorModeLabel = labels.get(labelIndex++);
      concatenateBox = boxes.get(boxIndex++);
      cropBox = boxes.get(boxIndex++);
      groupFilesBox = boxes.get(boxIndex++);
      ungroupFilesBox = boxes.get(boxIndex++);
      openAllSeriesBox = boxes.get(boxIndex++);
      boxIndex++; // quiet
      // recordBox         = boxes.get(boxIndex++);
      showMetadataBox = boxes.get(boxIndex++);
      showOMEXMLBox = boxes.get(boxIndex++);
      showROIsBox = boxes.get(boxIndex++);
      specifyRangesBox = boxes.get(boxIndex++);
      splitZBox = boxes.get(boxIndex++);
      splitTBox = boxes.get(boxIndex++);
      splitCBox = boxes.get(boxIndex++);
      stackFormatChoice = choices.get(choiceIndex++);
      stackFormatLabel = labels.get(labelIndex++);
      stackOrderChoice = choices.get(choiceIndex++);
      stackOrderLabel = labels.get(labelIndex++);
      swapDimsBox = boxes.get(boxIndex++);
      virtualBox = boxes.get(boxIndex++);
      stitchTilesBox = boxes.get(boxIndex++);
    }
    verifyOptions(null);

    // TODO: The info table and focus logic could be split into
    // its own class, rather than being specific to this dialog.

    // associate information for each option
    infoTable = new HashMap<Component, String>();
    infoTable.put(autoscaleBox, options.getAutoscaleInfo());
    infoTable.put(colorModeChoice, options.getColorModeInfo());
    infoTable.put(colorModeLabel, options.getColorModeInfo());
    infoTable.put(concatenateBox, options.getConcatenateInfo());
    infoTable.put(cropBox, options.getCropInfo());
    infoTable.put(groupFilesBox, options.getGroupFilesInfo());
    infoTable.put(ungroupFilesBox, options.getUngroupFilesInfo());
    infoTable.put(openAllSeriesBox, options.getOpenAllSeriesInfo());
    // infoTable.put(recordBox, options.getRecordInfo());
    infoTable.put(showMetadataBox, options.getShowMetadataInfo());
    infoTable.put(showOMEXMLBox, options.getShowOMEXMLInfo());
    infoTable.put(showROIsBox, options.getShowROIsInfo());
    infoTable.put(specifyRangesBox, options.getSpecifyRangesInfo());
    infoTable.put(splitZBox, options.getSplitFocalPlanesInfo());
    infoTable.put(splitTBox, options.getSplitTimepointsInfo());
    infoTable.put(splitCBox, options.getSplitChannelsInfo());
    infoTable.put(stackFormatChoice, options.getStackFormatInfo());
    infoTable.put(stackFormatLabel, options.getStackFormatInfo());
    infoTable.put(stackOrderChoice, options.getStackOrderInfo());
    infoTable.put(stackOrderLabel, options.getStackOrderInfo());
    infoTable.put(swapDimsBox, options.getSwapDimensionsInfo());
    infoTable.put(virtualBox, options.getVirtualInfo());
    infoTable.put(stitchTilesBox, options.getStitchTilesInfo());

    // rebuild dialog using FormLayout to organize things more nicely

    String cols =
        // first column
        "pref, 3dlu, pref:grow, "
            +
            // second column
            "10dlu, pref, "
            +
            // third column
            "10dlu, fill:150dlu";

    String rows =
        // Stack viewing        | Metadata viewing
        "pref, 3dlu, pref, 3dlu, pref, 3dlu, pref, "
            +
            // Dataset organization | Memory management
            "9dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu, pref, "
            + "3dlu, pref, "
            +
            // Color options        | Split into separate windows
            "9dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu, pref";

    // TODO: Change "Use virtual stack" and "Record modifications to virtual
    // stack" checkboxes to "Stack type" choice with options:
    //   "Normal", "Virtual" or "Smart virtual"

    PanelBuilder builder = new PanelBuilder(new FormLayout(cols, rows));
    CellConstraints cc = new CellConstraints();

    // populate 1st column
    int row = 1;
    builder.addSeparator("Stack viewing", cc.xyw(1, row, 3));
    row += 2;
    builder.add(stackFormatLabel, cc.xy(1, row));
    builder.add(stackFormatChoice, cc.xy(3, row));
    row += 2;
    builder.add(stackOrderLabel, cc.xy(1, row));
    builder.add(stackOrderChoice, cc.xy(3, row));
    row += 4;
    builder.addSeparator("Dataset organization", cc.xyw(1, row, 3));
    row += 2;
    builder.add(groupFilesBox, xyw(cc, 1, row, 3));
    row += 2;
    builder.add(ungroupFilesBox, xyw(cc, 1, row, 3));
    row += 2;
    builder.add(swapDimsBox, xyw(cc, 1, row, 3));
    row += 2;
    builder.add(openAllSeriesBox, xyw(cc, 1, row, 3));
    row += 2;
    builder.add(concatenateBox, xyw(cc, 1, row, 3));
    row += 2;
    builder.add(stitchTilesBox, xyw(cc, 1, row, 3));
    row += 2;
    builder.addSeparator("Color options", cc.xyw(1, row, 3));
    row += 2;
    builder.add(colorModeLabel, cc.xy(1, row));
    builder.add(colorModeChoice, cc.xy(3, row));
    row += 2;
    builder.add(autoscaleBox, xyw(cc, 1, row, 3));
    row += 2;

    // populate 2nd column
    row = 1;
    builder.addSeparator("Metadata viewing", cc.xy(5, row));
    row += 2;
    builder.add(showMetadataBox, xyw(cc, 5, row, 1));
    row += 2;
    builder.add(showOMEXMLBox, xyw(cc, 5, row, 1));
    row += 2;
    builder.add(showROIsBox, xyw(cc, 5, row, 1));
    row += 2;
    builder.addSeparator("Memory management", cc.xy(5, row));
    row += 2;
    builder.add(virtualBox, xyw(cc, 5, row, 1));
    row += 2;
    // builder.add(recordBox, xyw(cc, 5, row, 1));
    // row += 2;
    builder.add(specifyRangesBox, xyw(cc, 5, row, 1));
    row += 2;
    builder.add(cropBox, xyw(cc, 5, row, 1));
    row += 4;
    builder.addSeparator("Split into separate windows", cc.xy(5, row));
    row += 2;
    builder.add(splitCBox, xyw(cc, 5, row, 1));
    row += 2;
    builder.add(splitZBox, xyw(cc, 5, row, 1));
    row += 2;
    builder.add(splitTBox, xyw(cc, 5, row, 1));
    // row += 4;

    // information section
    builder.addSeparator("Information", cc.xy(7, 1));
    // row += 2;
    infoPane = new JEditorPane();
    infoPane.setContentType("text/html");
    infoPane.setEditable(false);
    infoPane.setText("<html>" + INFO_DEFAULT);
    builder.add(new JScrollPane(infoPane), cc.xywh(7, 3, 1, row));
    // row += 2;

    gd.removeAll();
    gd.add(builder.getPanel());

    WindowTools.addScrollBars(gd);
    gd.setBackground(Color.white); // HACK: workaround for JPanel in a Dialog
  }
  private JPanel createDirectoryPanel() {

    dirTreeTable = new JXTreeTable(new FileSystemModel());
    dirTreeTable.setHorizontalScrollEnabled(true);
    dirTreeTable.setRootVisible(false);
    dirTreeTable.setShowsRootHandles(true);
    dirTreeTable.setShowHorizontalLines(true);
    dirTreeTable.setShowVerticalLines(true);
    dirTreeTable.setColumnMargin(1);
    dirTreeTable.setColumnControlVisible(false);
    dirTreeTable.setRolloverEnabled(true);
    dirTreeTable.setScrollsOnExpand(true);
    dirTreeTable.setTreeCellRenderer(new TreeTableCellRenderer());
    dirTreeTable.setAutoCreateColumnsFromModel(false);
    // dirTreeTable.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);

    ListSelectionModel lsm = dirTreeTable.getSelectionModel();
    lsm.addListSelectionListener(this);

    CompoundHighlighter cp = new CompoundHighlighter();
    cp.addHighlighter(
        new AlternateRowHighlighter(new Color(20, 30, 45), new Color(0, 10, 25), Color.white));
    cp.addHighlighter(new HierarchicalColumnHighlighter(new Color(40, 50, 65), Color.white));

    dirTreeTable.setHighlighters(cp);
    for (int i = 0; i < DIRECTORY_COLUMN_WIDTH.length; i++) {
      TableColumn column = dirTreeTable.getColumnModel().getColumn(i);
      column.setPreferredWidth(DIRECTORY_COLUMN_WIDTH[i]);
      column.setHeaderRenderer(new TableHeaderRenderer(Color.black));
    }

    JScrollPane treeTableScrollPane =
        new JScrollPane(
            dirTreeTable,
            JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
            JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    treeTableScrollPane.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
    treeTableScrollPane.setPreferredSize(new Dimension(807, 450));
    JLabel directoryLabel = new JLabel("File explorer");
    JSeparator separator1 = new JSeparator();
    separator1.setPreferredSize(new Dimension(785, 5));

    FormLayout fl =
        new FormLayout(
            "pref,2dlu,pref,10px,pref,2dlu,pref,5px,pref,2dlu,pref,5px,pref,2dlu,pref,pref:grow",
            "pref,5px,pref,2dlu,pref,2px,pref");
    CellConstraints cc = new CellConstraints();

    JPanel dirOptionPanel = new JPanel(fl);
    JLabel dirOptionsLabel = new JLabel("File explorer options");
    JSeparator separator2 = new JSeparator();
    separator2.setPreferredSize(new Dimension(300, 5));
    JLabel openAsLabel = new JLabel("Open as", JLabel.TRAILING);

    JLabel rawFileLabel = new JLabel("Raw file parameters");
    JSeparator separator3 = new JSeparator();
    separator3.setPreferredSize(new Dimension(380, 5));

    imageWidthLabel.setEnabled(false);
    imageHeightLabel.setEnabled(false);
    bitsAllocatedLabel.setEnabled(false);
    bitsStoredLabel.setEnabled(false);
    fileOffsetLabel.setEnabled(false);
    numImagesLabel.setEnabled(false);

    imageWidthTextField.setEnabled(false);
    imageHeightTextField.setEnabled(false);
    bitsAllocatedTextField.setEnabled(false);
    bitsStoredTextField.setEnabled(false);
    fileOffsetTextField.setEnabled(false);
    numImagesTextField.setEnabled(false);
    openAsComboBox.addActionListener(this);

    dirOptionPanel.add(dirOptionsLabel, cc.xywh(1, 1, 3, 1));
    dirOptionPanel.add(separator2, cc.xywh(1, 3, 3, 1));
    dirOptionPanel.add(openAsLabel, cc.xy(1, 5));
    dirOptionPanel.add(openAsComboBox, cc.xy(3, 5));
    dirOptionPanel.add(recurseCheckBox, cc.xy(3, 7));

    dirOptionPanel.add(rawFileLabel, cc.xywh(5, 1, 11, 1));
    dirOptionPanel.add(separator3, cc.xywh(5, 3, 12, 1));
    dirOptionPanel.add(imageWidthLabel, cc.xy(5, 5));
    dirOptionPanel.add(imageWidthTextField, cc.xy(7, 5));
    dirOptionPanel.add(imageHeightLabel, cc.xy(5, 7));
    dirOptionPanel.add(imageHeightTextField, cc.xy(7, 7));
    dirOptionPanel.add(bitsAllocatedLabel, cc.xy(9, 5));
    dirOptionPanel.add(bitsAllocatedTextField, cc.xy(11, 5));
    dirOptionPanel.add(bitsStoredLabel, cc.xy(9, 7));
    dirOptionPanel.add(bitsStoredTextField, cc.xy(11, 7));
    dirOptionPanel.add(fileOffsetLabel, cc.xy(13, 5));
    dirOptionPanel.add(fileOffsetTextField, cc.xy(15, 5));
    dirOptionPanel.add(numImagesLabel, cc.xy(13, 7));
    dirOptionPanel.add(numImagesTextField, cc.xy(15, 7));

    openDirButton.setEnabled(false);
    closeDirButton.setSelected(true);
    SpringLayout buttonLayout = new SpringLayout();
    JPanel buttonPanel = new JPanel(buttonLayout);
    buttonPanel.setOpaque(false);
    buttonPanel.add(openDirButton);
    buttonPanel.add(closeDirButton);
    buttonLayout.putConstraint(
        SpringLayout.NORTH, openDirButton, 0, SpringLayout.NORTH, buttonPanel);
    buttonLayout.putConstraint(SpringLayout.WEST, openDirButton, 0, SpringLayout.WEST, buttonPanel);
    buttonLayout.putConstraint(
        SpringLayout.NORTH, closeDirButton, 0, SpringLayout.NORTH, buttonPanel);
    buttonLayout.putConstraint(
        SpringLayout.WEST, closeDirButton, 5, SpringLayout.EAST, openDirButton);
    buttonLayout.putConstraint(
        SpringLayout.EAST, buttonPanel, 0, SpringLayout.EAST, closeDirButton);
    buttonLayout.putConstraint(
        SpringLayout.SOUTH, buttonPanel, 0, SpringLayout.SOUTH, closeDirButton);

    SpringLayout layout = new SpringLayout();
    JPanel dirPanel = new JPanel(layout);
    dirPanel.add(dirOptionPanel);
    dirPanel.add(directoryLabel);
    dirPanel.add(separator1);
    dirPanel.add(treeTableScrollPane);
    dirPanel.add(buttonPanel);

    layout.putConstraint(SpringLayout.NORTH, dirOptionPanel, 0, SpringLayout.NORTH, dirPanel);
    layout.putConstraint(SpringLayout.WEST, dirOptionPanel, 0, SpringLayout.WEST, dirPanel);
    layout.putConstraint(SpringLayout.NORTH, directoryLabel, 0, SpringLayout.SOUTH, dirOptionPanel);
    layout.putConstraint(SpringLayout.WEST, directoryLabel, 0, SpringLayout.WEST, dirPanel);
    layout.putConstraint(SpringLayout.NORTH, separator1, 5, SpringLayout.SOUTH, directoryLabel);
    layout.putConstraint(SpringLayout.WEST, separator1, 0, SpringLayout.WEST, dirPanel);
    layout.putConstraint(
        SpringLayout.NORTH, treeTableScrollPane, 5, SpringLayout.SOUTH, separator1);
    layout.putConstraint(SpringLayout.WEST, treeTableScrollPane, 0, SpringLayout.WEST, dirPanel);
    layout.putConstraint(
        SpringLayout.NORTH, buttonPanel, 5, SpringLayout.SOUTH, treeTableScrollPane);
    layout.putConstraint(SpringLayout.EAST, buttonPanel, 0, SpringLayout.EAST, dirPanel);
    layout.putConstraint(SpringLayout.EAST, dirPanel, 5, SpringLayout.EAST, separator1);
    layout.putConstraint(SpringLayout.SOUTH, dirPanel, 0, SpringLayout.SOUTH, buttonPanel);
    return dirPanel;
  }
Ejemplo n.º 25
0
  private void initialize() throws Exception {
    jlblName.setText("Nome:");
    jlblResume.setText("Sumário:");
    jlblDataIni.setText("De:");
    jlblDataFim.setText("Até:");
    jlblScope.setText("Âmbito:");
    jlblSource.setText("Fonte:");
    jlblTheme.setText("Tema:");
    jlblTheme1.setText("Sub-Tema:");
    jbtnLessOptions.setText("Menos Opções");
    jlblAplicability.setText("Aplicabilidade:");
    jlblHasLegReq.setText("Com RL:");
    jlblEffective.setText("Vigente:");
    jlblOther.setText("Rev. /N.V.");

    jcheckEffective.setSelected(true);
    ;

    jpnlContent.setOpaque(false);
    FormLayout formLayout =
        new FormLayout(
            "5px, right:pref, 4dlu, 150dlu:grow, 35dlu, 4dlu, center:pref, 5px",
            "5px, pref, 4dlu, pref,4dlu, pref,4dlu, pref,4dlu, pref,4dlu, pref,4dlu, pref, 4dlu, 40dlu,4dlu, pref,4dlu, pref,5px");
    jpnlContent.setLayout(formLayout);

    FormLayout formLayout2 =
        new FormLayout(
            "30dlu, right:pref, 4dlu,pref, 40dlu, right:pref, 4dlu,pref, 5px", "5px, pref, 5px");

    FormLayout formLayout3 =
        new FormLayout(
            "30dlu, right:pref, 4dlu,pref, 40dlu, right:pref, 4dlu,pref, 5px",
            "5px, pref, 4dlu, pref, 5px");

    JPanel datePrev = new JPanel();
    datePrev.setOpaque(false);
    datePrev.setLayout(formLayout2);

    JPanel checkBoxs = new JPanel();
    checkBoxs.setOpaque(false);
    checkBoxs.setLayout(formLayout3);

    //   formLayout.setRowGroups(new int[][] { {2, 4,8,10,12,14}
    // });
    CellConstraints cc = new CellConstraints();

    jpnlContent.add(jlblName, cc.xy(2, 2));
    jpnlContent.add(jtfldName, cc.xyw(4, 2, 2));

    jpnlContent.add(jlblResume, cc.xy(2, 4));
    jpnlContent.add(jtfldResume, cc.xyw(4, 4, 2));
    jdpckDataIni.setSelectedDate(null);
    jdpckDataFim.setSelectedDate(null);

    datePrev.setBorder(BorderFactory.createTitledBorder(""));
    ((TitledBorder) datePrev.getBorder()).setTitleFont(new Font("Dialog", Font.PLAIN, 12));
    datePrev.add(jlblDataIni, cc.xy(2, 2));
    datePrev.add(jdpckDataIni, cc.xy(4, 2));
    datePrev.add(jlblDataFim, cc.xy(6, 2));
    datePrev.add(jdpckDataFim, cc.xy(8, 2));

    jpnlContent.add(datePrev, cc.xyw(2, 6, 6));

    jpnlContent.add(jlblScope, cc.xy(2, 8));
    jpnlContent.add(jtfldScope, cc.xyw(4, 8, 2));

    jpnlContent.add(jlblSource, cc.xy(2, 10));
    jpnlContent.add(jtfldSource, cc.xyw(4, 10, 2));

    jpnlContent.add(jlblTheme, cc.xy(2, 12));
    jpnlContent.add(jtfldTheme, cc.xyw(4, 12, 2));

    jpnlContent.add(jlblTheme1, cc.xy(2, 14));
    jpnlContent.add(jtfldTheme1, cc.xyw(4, 14, 2));

    checkBoxs.setBorder(BorderFactory.createTitledBorder(""));
    ((TitledBorder) checkBoxs.getBorder()).setTitleFont(new Font("Dialog", Font.PLAIN, 12));
    checkBoxs.add(jlblAplicability, cc.xy(2, 2));
    checkBoxs.add(jcheckAplicability, cc.xy(4, 2));
    checkBoxs.add(jlblHasLegReq, cc.xy(6, 2));
    checkBoxs.add(jcheckHasLegReq, cc.xy(8, 2));
    checkBoxs.add(jlblEffective, cc.xy(2, 4));
    checkBoxs.add(jcheckEffective, cc.xy(4, 4));
    checkBoxs.add(jlblOther, cc.xy(6, 4));
    checkBoxs.add(jcheckOther, cc.xy(8, 4));

    jpnlContent.add(checkBoxs, cc.xywh(2, 16, 4, 3));

    jpnlContent.add(jbtnSearch, cc.xywh(7, 16, 1, 3, CellConstraints.FILL, CellConstraints.FILL));
    jpnlContent.add(jbtnLessOptions, cc.xyw(5, 20, 3, CellConstraints.FILL, CellConstraints.FILL));

    add(jpnlContent, BorderLayout.CENTER);
  }
  /** build graphically the appearance of resolve symbols manager */
  public void buildAndShow(String text) {
    if (this.importManager == null) return;

    List<String> unresolvedSymbols = this.importManager.getParser().getUnresolvedSymbols(text);

    this.addWindowListener(
        new WindowAdapter() {
          public void windowClosed(WindowEvent e) {
            ImportManagerUI.this.hasCanceled = true;
          }
        });

    FormLayout lay = new FormLayout("pref, fill:pref:grow", "");
    JPanel panel = new JPanel(lay);
    CellConstraints cc = new CellConstraints();

    if (unresolvedSymbols == null) return;

    JComboBox currentCombo = null;
    if (this.importManager.getServiceProvider() != null) {
      String currentSymbol = null;
      int index = 1;
      for (Iterator<String> symbols = unresolvedSymbols.iterator(); symbols.hasNext(); ) {
        currentSymbol = symbols.next();
        /* build the corresponding list of packages */
        List<String> packageList =
            this.importManager.getServiceProvider().getPackagesNameContainingClass(currentSymbol);

        if (packageList == null) continue;

        if (packageList.size() == 0) continue;
        if (packageList.size() == 1) {
          this.importManager.addImportPart(currentSymbol, packageList.get(0));
          continue;
        }

        /* update layout */
        lay.appendRow(new RowSpec("pref"));

        currentCombo = new JComboBox(packageList.toArray());

        /** feed Map */
        if (this.mappings == null) this.mappings = new HashMap<String, JComboBox>();

        this.mappings.put(currentSymbol, currentCombo);

        panel.add(
            new JLabel("<html><b><code>" + currentSymbol + "</code></b> </html>"), cc.xy(1, index));
        panel.add(currentCombo, cc.xy(2, index, cc.FILL, cc.FILL));

        index += 1;
      }

      if (index == 1) return;

      /* add valid and cancel buttons */
      JButton valid = new JButton("OK");
      valid.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              ImportManagerUI.this.setVisible(false);
            }
          });

      JButton cancel = new JButton("Cancel");
      cancel.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              ImportManagerUI.this.setVisible(false);
              ImportManagerUI.this.hasCanceled = true;
            }
          });

      JPanel panelValid = new JPanel(new FormLayout("pref, 4px, pref", "pref"));
      panelValid.add(valid, cc.xy(1, 1));
      panelValid.add(cancel, cc.xy(3, 1));

      lay.appendRow(new RowSpec("5px"));
      lay.appendRow(new RowSpec("pref"));

      panel.add(panelValid, cc.xywh(1, index + 1, 2, 1, cc.RIGHT, cc.DEFAULT));
    }

    this.setContentPane(panel);

    int x = ((int) Toolkit.getDefaultToolkit().getScreenSize().getWidth()) - this.getWidth();
    int y = ((int) Toolkit.getDefaultToolkit().getScreenSize().getHeight()) - this.getHeight();
    this.setLocation(x / 2, y / 2);

    this.pack();
    this.setVisible(true);

    if (!this.hasCanceled()) {
        /* complete the information of the import manager */
      String currentKey = null;
      for (Iterator<String> keys = this.mappings.keySet().iterator(); keys.hasNext(); ) {
        currentKey = keys.next();

        this.importManager.addImportPart(
            currentKey, this.mappings.get(currentKey).getSelectedItem().toString());
      }
    }
  }
Ejemplo n.º 27
0
  private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner non-commercial license
    sortNameDisplay =
        ATBasicComponentFactory.createTextField(
            detailsModel.getModel(Names.PROPERTYNAME_SORT_NAME));
    tabbedPane = new JTabbedPane();
    detailsContainer = new JPanel();
    detailsPanel = new JPanel();
    separator3 = new JSeparator();
    descriptionPanel = new JPanel();
    label_nameDescriptionNote2 = new JLabel();
    nameDescriptionType =
        ATBasicComponentFactory.createComboBox(
            detailsModel, Names.PROPERTYNAME_DESCRIPTION_TYPE, Names.class);
    label_nameDescriptionNote = new JLabel();
    scrollPane2 = new JScrollPane();
    nameDescriptionNote =
        ATBasicComponentFactory.createTextArea(
            detailsModel.getModel(Names.PROPERTYNAME_DESCRIPTION_NOTE));
    label_nameCitation = new JLabel();
    scrollPane23 = new JScrollPane();
    nameCitation =
        ATBasicComponentFactory.createTextArea(detailsModel.getModel(Names.PROPERTYNAME_CITATION));
    nonPreferredNamePanel = new JPanel();
    label_subjectScopeNote4 = new JLabel();
    scrollPane1 = new JScrollPane();
    nonPreferredNamesTable =
        new DomainSortableTable(NonPreferredNames.class, NonPreferredNames.PROPERTYNAME_SORT_NAME);
    panel1 = new JPanel();
    addNonPreferredNameButton = new JButton();
    removeNonPreferredNameButton = new JButton();
    separator1 = new JSeparator();
    label_subjectScopeNote3 = new JLabel();
    scrollPane5 = new JScrollPane();
    accessionsTable =
        new DomainSortableTable(Accessions.class, Accessions.PROPERTYNAME_ACCESSION_NUMBER);
    separator2 = new JSeparator();
    label_subjectScopeNote2 = new JLabel();
    scrollPane4 = new JScrollPane();
    resourcesTable =
        new ResourceAndComponentLinkTable(
            Resources.class, Resources.PROPERTYNAME_RESOURCE_IDENTIFIER);
    label1 = new JLabel();
    separator4 = new JSeparator();
    label_subjectScopeNote5 = new JLabel();
    scrollPane6 = new JScrollPane();
    digitalObjectsTable =
        new DomainSortableTable(DigitalObjects.class, DigitalObjects.PROPERTYNAME_METS_IDENTIFIER);
    contactInfoPanel = new JPanel();
    label_nameContactAddress3 = new JLabel();
    salutation =
        ATBasicComponentFactory.createTextField(
            detailsModel.getModel(Names.PROPERTYNAME_SALUTATION));
    label_nameContactAddress1 = new JLabel();
    nameContactAddress1 =
        ATBasicComponentFactory.createTextField(
            detailsModel.getModel(Names.PROPERTYNAME_CONTACT_ADDRESS_1));
    label_nameContactAddress2 = new JLabel();
    nameContactAddress2 =
        ATBasicComponentFactory.createTextField(
            detailsModel.getModel(Names.PROPERTYNAME_CONTACT_ADDRESS_2));
    label_nameContactCity = new JLabel();
    nameContactCity =
        ATBasicComponentFactory.createTextField(
            detailsModel.getModel(Names.PROPERTYNAME_CONTACT_CITY));
    label_nameContactRegion = new JLabel();
    nameContactRegion =
        ATBasicComponentFactory.createTextField(
            detailsModel.getModel(Names.PROPERTYNAME_CONTACT_REGION));
    label_nameContactMailCode = new JLabel();
    nameContactMailCode =
        ATBasicComponentFactory.createTextField(
            detailsModel.getModel(Names.PROPERTYNAME_CONTACT_MAIL_CODE));
    label_nameContactCountry = new JLabel();
    nameContactCountry =
        ATBasicComponentFactory.createTextField(
            detailsModel.getModel(Names.PROPERTYNAME_CONTACT_COUNTRY));
    label_nameContactPhone = new JLabel();
    nameContactPhone =
        ATBasicComponentFactory.createTextField(
            detailsModel.getModel(Names.PROPERTYNAME_CONTACT_PHONE));
    label_nameContactFax = new JLabel();
    nameContactFax =
        ATBasicComponentFactory.createTextField(
            detailsModel.getModel(Names.PROPERTYNAME_CONTACT_FAX));
    label_nameContactEmail = new JLabel();
    nameContactEmail =
        ATBasicComponentFactory.createTextField(
            detailsModel.getModel(Names.PROPERTYNAME_CONTACT_EMAIL));
    label_nameContactName = new JLabel();
    nameContactName =
        ATBasicComponentFactory.createTextField(
            detailsModel.getModel(Names.PROPERTYNAME_CONTACT_NAME));
    label_nameContactNotes = new JLabel();
    scrollPane3 = new JScrollPane();
    nameContactNotesTable = new DomainSortedTable(NameContactNotes.class);
    panel2 = new JPanel();
    addNoteButton = new JButton();
    removeContactNoteButton = new JButton();
    CellConstraints cc = new CellConstraints();

    // ======== this ========
    setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
    setBackground(new Color(200, 205, 232));
    setPreferredSize(new Dimension(900, 500));
    setBorder(Borders.DLU4_BORDER);
    setLayout(new FormLayout("default:grow", "default, fill:default:grow"));

    // ---- sortNameDisplay ----
    sortNameDisplay.setEditable(false);
    sortNameDisplay.setBorder(null);
    sortNameDisplay.setForeground(new Color(0, 0, 102));
    sortNameDisplay.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
    sortNameDisplay.setSelectionColor(new Color(204, 0, 51));
    sortNameDisplay.setOpaque(false);
    add(sortNameDisplay, cc.xy(1, 1));

    // ======== tabbedPane ========
    {
      tabbedPane.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
      tabbedPane.setBackground(new Color(200, 205, 232));
      tabbedPane.setOpaque(true);

      // ======== detailsContainer ========
      {
        detailsContainer.setBackground(new Color(200, 205, 232));
        detailsContainer.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
                }));

        // ======== detailsPanel ========
        {
          detailsPanel.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
          detailsPanel.setBackground(new Color(200, 205, 232));
          detailsPanel.setLayout(
              new FormLayout(
                  new ColumnSpec[] {
                    new ColumnSpec(ColumnSpec.RIGHT, Sizes.DEFAULT, FormSpec.NO_GROW),
                    FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                    new ColumnSpec("max(default;300px):grow"),
                    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,
                    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
                  }));
        }
        detailsContainer.add(detailsPanel, cc.xy(1, 1));

        // ---- separator3 ----
        separator3.setBackground(new Color(220, 220, 232));
        separator3.setForeground(new Color(147, 131, 86));
        separator3.setMinimumSize(new Dimension(1, 10));
        separator3.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        detailsContainer.add(separator3, cc.xy(1, 3));

        // ======== descriptionPanel ========
        {
          descriptionPanel.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
          descriptionPanel.setBackground(new Color(200, 205, 232));
          descriptionPanel.setLayout(
              new FormLayout(
                  new ColumnSpec[] {
                    FormFactory.DEFAULT_COLSPEC,
                    FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                    new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW)
                  },
                  new RowSpec[] {
                    new RowSpec(RowSpec.TOP, Sizes.DEFAULT, FormSpec.NO_GROW),
                    FormFactory.LINE_GAP_ROWSPEC,
                    new RowSpec(RowSpec.TOP, Sizes.DEFAULT, FormSpec.NO_GROW),
                    FormFactory.LINE_GAP_ROWSPEC,
                    new RowSpec(RowSpec.TOP, Sizes.DEFAULT, FormSpec.NO_GROW)
                  }));

          // ---- label_nameDescriptionNote2 ----
          label_nameDescriptionNote2.setText("Name Description Type");
          label_nameDescriptionNote2.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
          ATFieldInfo.assignLabelInfo(
              label_nameDescriptionNote2, Names.class, Names.PROPERTYNAME_DESCRIPTION_TYPE);
          descriptionPanel.add(label_nameDescriptionNote2, cc.xy(1, 1));

          // ---- nameDescriptionType ----
          nameDescriptionType.setOpaque(false);
          nameDescriptionType.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
          descriptionPanel.add(
              nameDescriptionType,
              cc.xywh(3, 1, 1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));

          // ---- label_nameDescriptionNote ----
          label_nameDescriptionNote.setText("Description Note");
          label_nameDescriptionNote.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
          ATFieldInfo.assignLabelInfo(
              label_nameDescriptionNote, Names.class, Names.PROPERTYNAME_DESCRIPTION_NOTE);
          descriptionPanel.add(label_nameDescriptionNote, cc.xy(1, 3));

          // ======== scrollPane2 ========
          {
            scrollPane2.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
            scrollPane2.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));

            // ---- nameDescriptionNote ----
            nameDescriptionNote.setRows(8);
            nameDescriptionNote.setLineWrap(true);
            nameDescriptionNote.setWrapStyleWord(true);
            nameDescriptionNote.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
            scrollPane2.setViewportView(nameDescriptionNote);
          }
          descriptionPanel.add(scrollPane2, cc.xy(3, 3));

          // ---- label_nameCitation ----
          label_nameCitation.setText("Citation(s)");
          label_nameCitation.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
          ATFieldInfo.assignLabelInfo(label_nameCitation, Names.class, Names.PROPERTYNAME_CITATION);
          descriptionPanel.add(label_nameCitation, cc.xy(1, 5));

          // ======== scrollPane23 ========
          {
            scrollPane23.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
            scrollPane23.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));

            // ---- nameCitation ----
            nameCitation.setRows(8);
            nameCitation.setLineWrap(true);
            nameCitation.setWrapStyleWord(true);
            nameCitation.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
            scrollPane23.setViewportView(nameCitation);
          }
          descriptionPanel.add(scrollPane23, cc.xy(3, 5));
        }
        detailsContainer.add(descriptionPanel, cc.xy(1, 5));
      }
      tabbedPane.addTab("Details", detailsContainer);

      // ======== nonPreferredNamePanel ========
      {
        nonPreferredNamePanel.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        nonPreferredNamePanel.setBackground(new Color(200, 205, 232));
        nonPreferredNamePanel.setLayout(
            new FormLayout(
                ColumnSpec.decodeSpecs("default:grow"),
                new RowSpec[] {
                  FormFactory.DEFAULT_ROWSPEC,
                  FormFactory.LINE_GAP_ROWSPEC,
                  new RowSpec(RowSpec.CENTER, Sizes.DEFAULT, FormSpec.DEFAULT_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,
                  new RowSpec(RowSpec.CENTER, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                  FormFactory.LINE_GAP_ROWSPEC,
                  FormFactory.DEFAULT_ROWSPEC,
                  FormFactory.LINE_GAP_ROWSPEC,
                  FormFactory.DEFAULT_ROWSPEC,
                  FormFactory.LINE_GAP_ROWSPEC,
                  new RowSpec(RowSpec.CENTER, Sizes.DEFAULT, FormSpec.DEFAULT_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
                }));

        // ---- label_subjectScopeNote4 ----
        label_subjectScopeNote4.setText("Non-Preferred Forms");
        label_subjectScopeNote4.setVerticalAlignment(SwingConstants.TOP);
        label_subjectScopeNote4.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        nonPreferredNamePanel.add(
            label_subjectScopeNote4,
            cc.xywh(1, 1, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP));

        // ======== scrollPane1 ========
        {
          scrollPane1.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
          scrollPane1.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));

          // ---- nonPreferredNamesTable ----
          nonPreferredNamesTable.setPreferredScrollableViewportSize(new Dimension(450, 120));
          nonPreferredNamesTable.addMouseListener(
              new MouseAdapter() {
                @Override
                public void mouseClicked(MouseEvent e) {
                  nonPreferredNamesTableMouseClicked(e);
                }
              });
          scrollPane1.setViewportView(nonPreferredNamesTable);
        }
        nonPreferredNamePanel.add(
            scrollPane1, cc.xywh(1, 3, 1, 1, CellConstraints.DEFAULT, CellConstraints.FILL));

        // ======== panel1 ========
        {
          panel1.setBackground(new Color(231, 188, 251));
          panel1.setOpaque(false);
          panel1.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
          panel1.setLayout(
              new FormLayout(
                  new ColumnSpec[] {
                    FormFactory.DEFAULT_COLSPEC,
                    FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                    FormFactory.DEFAULT_COLSPEC
                  },
                  RowSpec.decodeSpecs("default")));

          // ---- addNonPreferredNameButton ----
          addNonPreferredNameButton.setText("Add Non-Preferred Form");
          addNonPreferredNameButton.setOpaque(false);
          addNonPreferredNameButton.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
          addNonPreferredNameButton.addActionListener(
              new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                  addNonPreferredNameButtonActionPerformed();
                }
              });
          panel1.add(addNonPreferredNameButton, cc.xy(1, 1));

          // ---- removeNonPreferredNameButton ----
          removeNonPreferredNameButton.setText("Remove Non-Preferred Form");
          removeNonPreferredNameButton.setOpaque(false);
          removeNonPreferredNameButton.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
          removeNonPreferredNameButton.addActionListener(
              new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                  removeNonPreferredNameButtonActionPerformed();
                }
              });
          panel1.add(removeNonPreferredNameButton, cc.xy(3, 1));
        }
        nonPreferredNamePanel.add(
            panel1, cc.xywh(1, 5, 1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT));

        // ---- separator1 ----
        separator1.setBackground(new Color(220, 220, 232));
        separator1.setForeground(new Color(147, 131, 86));
        separator1.setMinimumSize(new Dimension(1, 10));
        separator1.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        nonPreferredNamePanel.add(separator1, cc.xy(1, 7));

        // ---- label_subjectScopeNote3 ----
        label_subjectScopeNote3.setText("Accessions");
        label_subjectScopeNote3.setVerticalAlignment(SwingConstants.TOP);
        label_subjectScopeNote3.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        nonPreferredNamePanel.add(
            label_subjectScopeNote3,
            cc.xywh(1, 9, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP));

        // ======== scrollPane5 ========
        {
          scrollPane5.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
          scrollPane5.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));

          // ---- accessionsTable ----
          accessionsTable.setPreferredScrollableViewportSize(new Dimension(450, 120));
          scrollPane5.setViewportView(accessionsTable);
        }
        nonPreferredNamePanel.add(scrollPane5, cc.xy(1, 11));

        // ---- separator2 ----
        separator2.setBackground(new Color(220, 220, 232));
        separator2.setForeground(new Color(147, 131, 86));
        separator2.setMinimumSize(new Dimension(1, 10));
        separator2.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        nonPreferredNamePanel.add(separator2, cc.xy(1, 13));

        // ---- label_subjectScopeNote2 ----
        label_subjectScopeNote2.setText("Resources");
        label_subjectScopeNote2.setVerticalAlignment(SwingConstants.TOP);
        label_subjectScopeNote2.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        nonPreferredNamePanel.add(label_subjectScopeNote2, cc.xy(1, 15));

        // ======== scrollPane4 ========
        {
          scrollPane4.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
          scrollPane4.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));

          // ---- resourcesTable ----
          resourcesTable.setPreferredScrollableViewportSize(new Dimension(450, 120));
          scrollPane4.setViewportView(resourcesTable);
        }
        nonPreferredNamePanel.add(scrollPane4, cc.xy(1, 17));

        // ---- label1 ----
        label1.setText("Resources in Red have the subject term linked at the component level");
        label1.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        nonPreferredNamePanel.add(label1, cc.xy(1, 19));

        // ---- separator4 ----
        separator4.setBackground(new Color(220, 220, 232));
        separator4.setForeground(new Color(147, 131, 86));
        separator4.setMinimumSize(new Dimension(1, 10));
        separator4.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        nonPreferredNamePanel.add(separator4, cc.xy(1, 21));

        // ---- label_subjectScopeNote5 ----
        label_subjectScopeNote5.setText("Digital Objects");
        label_subjectScopeNote5.setVerticalAlignment(SwingConstants.TOP);
        label_subjectScopeNote5.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        nonPreferredNamePanel.add(label_subjectScopeNote5, cc.xy(1, 23));

        // ======== scrollPane6 ========
        {
          scrollPane6.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
          scrollPane6.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));

          // ---- digitalObjectsTable ----
          digitalObjectsTable.setPreferredScrollableViewportSize(new Dimension(450, 120));
          scrollPane6.setViewportView(digitalObjectsTable);
        }
        nonPreferredNamePanel.add(scrollPane6, cc.xy(1, 25));
      }
      tabbedPane.addTab(
          "Non-Preferred Forms, Accessions, Resources & Digital Objects", nonPreferredNamePanel);

      // ======== contactInfoPanel ========
      {
        contactInfoPanel.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        contactInfoPanel.setBackground(new Color(200, 205, 232));
        contactInfoPanel.setBorder(Borders.DLU2_BORDER);
        contactInfoPanel.setLayout(
            new FormLayout(
                new ColumnSpec[] {
                  FormFactory.DEFAULT_COLSPEC,
                  FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                  new ColumnSpec("max(default;100px):grow"),
                  FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                  FormFactory.DEFAULT_COLSPEC,
                  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,
                  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,
                  FormFactory.LINE_GAP_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
                }));

        // ---- label_nameContactAddress3 ----
        label_nameContactAddress3.setText("Salutation");
        label_nameContactAddress3.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        ATFieldInfo.assignLabelInfo(
            label_nameContactAddress3, Names.class, Names.PROPERTYNAME_SALUTATION);
        contactInfoPanel.add(label_nameContactAddress3, cc.xy(1, 1));

        // ---- salutation ----
        salutation.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        contactInfoPanel.add(salutation, cc.xywh(3, 1, 9, 1));

        // ---- label_nameContactAddress1 ----
        label_nameContactAddress1.setText("Address");
        label_nameContactAddress1.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        ATFieldInfo.assignLabelInfo(
            label_nameContactAddress1, Names.class, Names.PROPERTYNAME_CONTACT_ADDRESS_1);
        contactInfoPanel.add(label_nameContactAddress1, cc.xy(1, 3));

        // ---- nameContactAddress1 ----
        nameContactAddress1.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        contactInfoPanel.add(nameContactAddress1, cc.xywh(3, 3, 9, 1));

        // ---- label_nameContactAddress2 ----
        label_nameContactAddress2.setText("Address");
        label_nameContactAddress2.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        ATFieldInfo.assignLabelInfo(
            label_nameContactAddress2, Names.class, Names.PROPERTYNAME_CONTACT_ADDRESS_2);
        contactInfoPanel.add(label_nameContactAddress2, cc.xy(1, 5));

        // ---- nameContactAddress2 ----
        nameContactAddress2.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        contactInfoPanel.add(nameContactAddress2, cc.xywh(3, 5, 9, 1));

        // ---- label_nameContactCity ----
        label_nameContactCity.setText("City");
        label_nameContactCity.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        ATFieldInfo.assignLabelInfo(
            label_nameContactCity, Names.class, Names.PROPERTYNAME_CONTACT_CITY);
        contactInfoPanel.add(label_nameContactCity, cc.xy(1, 7));

        // ---- nameContactCity ----
        nameContactCity.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        contactInfoPanel.add(nameContactCity, cc.xy(3, 7));

        // ---- label_nameContactRegion ----
        label_nameContactRegion.setText("Region");
        label_nameContactRegion.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        ATFieldInfo.assignLabelInfo(
            label_nameContactRegion, Names.class, Names.PROPERTYNAME_CONTACT_REGION);
        contactInfoPanel.add(label_nameContactRegion, cc.xy(5, 7));

        // ---- nameContactRegion ----
        nameContactRegion.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        contactInfoPanel.add(nameContactRegion, cc.xy(7, 7));

        // ---- label_nameContactMailCode ----
        label_nameContactMailCode.setText("Mail Code");
        label_nameContactMailCode.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        ATFieldInfo.assignLabelInfo(
            label_nameContactMailCode, Names.class, Names.PROPERTYNAME_CONTACT_MAIL_CODE);
        contactInfoPanel.add(label_nameContactMailCode, cc.xy(9, 7));

        // ---- nameContactMailCode ----
        nameContactMailCode.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        contactInfoPanel.add(nameContactMailCode, cc.xy(11, 7));

        // ---- label_nameContactCountry ----
        label_nameContactCountry.setText("Country");
        label_nameContactCountry.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        ATFieldInfo.assignLabelInfo(
            label_nameContactCountry, Names.class, Names.PROPERTYNAME_CONTACT_COUNTRY);
        contactInfoPanel.add(label_nameContactCountry, cc.xy(1, 9));

        // ---- nameContactCountry ----
        nameContactCountry.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        contactInfoPanel.add(nameContactCountry, cc.xywh(3, 9, 9, 1));

        // ---- label_nameContactPhone ----
        label_nameContactPhone.setText("Telephone");
        label_nameContactPhone.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        ATFieldInfo.assignLabelInfo(
            label_nameContactPhone, Names.class, Names.PROPERTYNAME_CONTACT_PHONE);
        contactInfoPanel.add(label_nameContactPhone, cc.xy(1, 11));

        // ---- nameContactPhone ----
        nameContactPhone.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        contactInfoPanel.add(nameContactPhone, cc.xywh(3, 11, 5, 1));

        // ---- label_nameContactFax ----
        label_nameContactFax.setText("FAX");
        label_nameContactFax.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        ATFieldInfo.assignLabelInfo(
            label_nameContactFax, Names.class, Names.PROPERTYNAME_CONTACT_FAX);
        contactInfoPanel.add(label_nameContactFax, cc.xy(9, 11));

        // ---- nameContactFax ----
        nameContactFax.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        contactInfoPanel.add(nameContactFax, cc.xy(11, 11));

        // ---- label_nameContactEmail ----
        label_nameContactEmail.setText("e-mail");
        label_nameContactEmail.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        ATFieldInfo.assignLabelInfo(
            label_nameContactEmail, Names.class, Names.PROPERTYNAME_CONTACT_EMAIL);
        contactInfoPanel.add(label_nameContactEmail, cc.xy(1, 13));

        // ---- nameContactEmail ----
        nameContactEmail.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        contactInfoPanel.add(nameContactEmail, cc.xywh(3, 13, 9, 1));

        // ---- label_nameContactName ----
        label_nameContactName.setText("Contact");
        label_nameContactName.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        ATFieldInfo.assignLabelInfo(
            label_nameContactName, Names.class, Names.PROPERTYNAME_CONTACT_NAME);
        contactInfoPanel.add(label_nameContactName, cc.xy(1, 15));

        // ---- nameContactName ----
        nameContactName.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        contactInfoPanel.add(nameContactName, cc.xywh(3, 15, 9, 1));

        // ---- label_nameContactNotes ----
        label_nameContactNotes.setText("Notes");
        label_nameContactNotes.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
        contactInfoPanel.add(
            label_nameContactNotes,
            cc.xywh(1, 17, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP));

        // ======== scrollPane3 ========
        {
          scrollPane3.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
          scrollPane3.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));

          // ---- nameContactNotesTable ----
          nameContactNotesTable.setPreferredScrollableViewportSize(new Dimension(450, 150));
          nameContactNotesTable.addMouseListener(
              new MouseAdapter() {
                @Override
                public void mousePressed(MouseEvent e) {
                  nameContactNotesTableMousePressed(e);
                }

                @Override
                public void mouseReleased(MouseEvent e) {
                  nameContactNotesTableMouseReleased(e);
                }

                @Override
                public void mouseClicked(MouseEvent e) {
                  nameContactNotesTableMouseClicked(e);
                }
              });
          scrollPane3.setViewportView(nameContactNotesTable);
        }
        contactInfoPanel.add(scrollPane3, cc.xywh(3, 17, 9, 1));

        // ======== panel2 ========
        {
          panel2.setBackground(new Color(231, 188, 251));
          panel2.setOpaque(false);
          panel2.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
          panel2.setLayout(
              new FormLayout(
                  new ColumnSpec[] {
                    FormFactory.DEFAULT_COLSPEC,
                    FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                    FormFactory.DEFAULT_COLSPEC
                  },
                  RowSpec.decodeSpecs("default")));

          // ---- addNoteButton ----
          addNoteButton.setText("Add Note");
          addNoteButton.setOpaque(false);
          addNoteButton.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
          addNoteButton.addActionListener(
              new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                  addNoteButtonActionPerformed();
                }
              });
          panel2.add(addNoteButton, cc.xy(1, 1));

          // ---- removeContactNoteButton ----
          removeContactNoteButton.setText("Remove Contact Note");
          removeContactNoteButton.setOpaque(false);
          removeContactNoteButton.setFont(new Font("Trebuchet MS", Font.PLAIN, 13));
          removeContactNoteButton.addActionListener(
              new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                  removeContactNoteButtonActionPerformed();
                }
              });
          panel2.add(removeContactNoteButton, cc.xy(3, 1));
        }
        contactInfoPanel.add(
            panel2, cc.xywh(3, 19, 9, 1, CellConstraints.CENTER, CellConstraints.DEFAULT));
      }
      tabbedPane.addTab("Contact Info", contactInfoPanel);
    }
    add(tabbedPane, cc.xy(1, 2));
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
  }
Ejemplo n.º 28
0
  @Override
  protected void appendProperties(DefaultFormBuilder builder) {
    CellConstraints cc = new CellConstraints();

    builder.append("Hostname");
    builder.append(_hostname, 3);
    builder.nextLine();

    builder.appendSeparator("Deployed Applications");
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextRow(-14);
    JScrollPane scrollPane = new JScrollPane(_applications);
    scrollPane.setToolTipText(_applications.getToolTipText());
    builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 14));
    builder.nextRow(14);
    builder.nextLine();

    builder.appendSeparator("Dynamic Well-Known Objects");
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextRow(-14);
    scrollPane = new JScrollPane(_objects);
    scrollPane.setToolTipText(_objects.getToolTipText());
    builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 14));
    builder.nextRow(14);
    builder.nextLine();

    builder.appendSeparator("Dynamic Object Adapters");
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextRow(-14);
    scrollPane = new JScrollPane(_adapters);
    scrollPane.setToolTipText(_adapters.getToolTipText());
    builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 14));
    builder.nextRow(14);
    builder.nextLine();
  }
Ejemplo n.º 29
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
  }
  /** Constructor. Creates all of the internal UI contents. */
  public BioGeomancerResultsDisplay() {
    String rowDef =
        UIHelper.createDuplicateJGoodiesDef("p", "2px", 13)
            + ",20px,p:g"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    setLayout(new FormLayout("p,10px,400px,10px,C:p:g", rowDef)); // $NON-NLS-1$

    CellConstraints cc = new CellConstraints();

    int rowIndex = 1;
    idField =
        addRow(cc, getResourceString("BioGeomancerResultsDisplay.ID"), 1, rowIndex); // $NON-NLS-1$
    rowIndex += 2;
    countryField =
        addRow(
            cc,
            getResourceString("BioGeomancerResultsDisplay.COUNTRY"),
            1,
            rowIndex); //$NON-NLS-1$
    rowIndex += 2;
    adm1Field =
        addRow(
            cc, getResourceString("BioGeomancerResultsDisplay.ADM1"), 1, rowIndex); // $NON-NLS-1$
    rowIndex += 2;
    adm2Field =
        addRow(
            cc, getResourceString("BioGeomancerResultsDisplay.ADM2"), 1, rowIndex); // $NON-NLS-1$
    rowIndex += 2;
    localityField =
        addRow(
            cc,
            getResourceString("BioGeomancerResultsDisplay.LOCALITY"),
            1,
            rowIndex); //$NON-NLS-1$
    rowIndex += 2;

    countryBoundingBoxField =
        addRow(
            cc,
            getResourceString("BioGeomancerResultsDisplay.COUNTRY_BOUNDING_BOX"),
            1,
            rowIndex); //$NON-NLS-1$
    rowIndex += 2;
    matchedCountField =
        addRow(
            cc,
            getResourceString("BioGeomancerResultsDisplay.MATCHED_CNT"),
            1,
            rowIndex); //$NON-NLS-1$
    rowIndex += 2;
    boundingBoxField =
        addRow(
            cc,
            getResourceString("BioGeomancerResultsDisplay.BOUNDING_BOX"),
            1,
            rowIndex); //$NON-NLS-1$
    rowIndex += 2;
    boundingBoxCentroidField =
        addRow(
            cc,
            getResourceString("BioGeomancerResultsDisplay.BOUNDING_BOX_CENTROID"),
            1,
            rowIndex); //$NON-NLS-1$
    rowIndex += 2;
    centroidErrorRadiusField =
        addRow(
            cc,
            getResourceString("BioGeomancerResultsDisplay.CENTROID_ERROR_RADIUS"),
            1,
            rowIndex); //$NON-NLS-1$
    rowIndex += 2;
    centroidErrorRadiusUnitsField =
        addRow(
            cc,
            getResourceString("BioGeomancerResultsDisplay.CENTROID_ERROR_RADIUS_UNITS"),
            1,
            rowIndex); //$NON-NLS-1$
    rowIndex += 2;
    multiPointMatchField =
        addRow(
            cc,
            getResourceString("BioGeomancerResultsDisplay.MULTI_POINT_MATCH"),
            1,
            rowIndex); //$NON-NLS-1$
    rowIndex += 2;
    weightedCentroidField =
        addRow(
            cc,
            getResourceString("BioGeomancerResultsDisplay.WEIGHTED_CENTROID"),
            1,
            rowIndex); //$NON-NLS-1$
    rowIndex += 2;

    mapLabel =
        createLabel(getResourceString("BioGeomancerResultsDisplay.LOADING_MAP")); // $NON-NLS-1$
    add(mapLabel, cc.xywh(5, 1, 1, 25));

    mapLabel.setPreferredSize(new Dimension(MAP_WIDTH, MAP_HEIGHT));

    bgResultsTable = new JTable();
    bgResultsTable.setShowVerticalLines(false);
    bgResultsTable.setShowHorizontalLines(false);
    bgResultsTable.setRowSelectionAllowed(true);
    bgResultsTable.setDefaultRenderer(String.class, new BiColorTableCellRenderer(false));

    mapLabel.setText(""); // $NON-NLS-1$

    add(UIHelper.createScrollPane(bgResultsTable), cc.xywh(1, rowIndex, 5, 1));
    rowIndex += 2;
  }