Example #1
0
 /** Create the panel */
 public VomsProxyInfoPanel() {
   super();
   setBorder(BORDER_DEFAULT_TITLE);
   setLayout(
       new FormLayout(
           new ColumnSpec[] {
             FormFactory.RELATED_GAP_COLSPEC,
             ColumnSpec.decode("65dlu"),
             FormFactory.RELATED_GAP_COLSPEC,
             ColumnSpec.decode("default:grow(1.0)"),
             FormFactory.RELATED_GAP_COLSPEC,
             FormFactory.DEFAULT_COLSPEC,
             FormFactory.RELATED_GAP_COLSPEC
           },
           new RowSpec[] {
             FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
             FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
             FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
             FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
             FormFactory.RELATED_GAP_ROWSPEC
           }));
   add(getLabel(), new CellConstraints(2, 2));
   add(getLabel_1(), new CellConstraints(2, 4));
   add(getLabel_2(), new CellConstraints(2, 6));
   add(getLabel_3(), new CellConstraints(2, 8));
   add(getIdentityTextField(), new CellConstraints(4, 2, 3, 1));
   add(getAuthenticatedTextField(), new CellConstraints(4, 4, 3, 1));
   add(getRemainingTextField(), new CellConstraints(4, 6, 3, 1));
   add(getVoTextField(), new CellConstraints(4, 8));
   add(getDetailsButton(), new CellConstraints(6, 8));
   //
   updateStatus();
 }
Example #2
0
  public TeamEntry(ITeam team, int relatedTeam) {
    setLayout(
        new FormLayout(
            new ColumnSpec[] {
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("default:grow"),
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("default:grow"),
            },
            new RowSpec[] {
              FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
            }));
    setBorder(
        new CompoundBorder(
            UIManager.getBorder("TitledBorder.aquaVariant"), new EmptyBorder(0, 5, 0, 5)));
    {
      JLabel lblTeamname = new JLabel("TeamName");
      if (team != null) {
        this.team = team;
        lblTeamname.setText(team.getName());
      }

      lblTeamname.setFont(new Font("Lucida Grande", Font.PLAIN, 11));
      add(lblTeamname, "2, 2, right, default");
    }
    {
      comboBox = new JComboBox();
      comboBox.setFont(new Font("Lucida Grande", Font.PLAIN, 11));
      comboBox.setModel(new DefaultComboBoxModel(new String[] {"Red", "Yellow", "Green", "Blue"}));
      if (relatedTeam >= 0 && relatedTeam < 4) {
        comboBox.setSelectedIndex(relatedTeam);
      }
      add(comboBox, "4, 2, fill, default");
    }
  }
 /**
  * Dumps the layout's column specifications to the console.
  *
  * @param layout the <code>FormLayout</code> to inspect
  */
 public static void dumpColumnSpecs(FormLayout layout) {
   System.out.print("COLUMN SPECS:");
   for (int col = 1; col <= layout.getColumnCount(); col++) {
     ColumnSpec colSpec = layout.getColumnSpec(col);
     System.out.print(colSpec.toShortString());
     if (col < layout.getColumnCount()) System.out.print(", ");
   }
   System.out.println();
 }
  /**
   * Returns an array of column specifications that is built from the given encoded column
   * specifications by flipping each column spec and reversing their order.
   *
   * @param encodedColumnSpecs the original comma-separated encoded column specifications
   * @return an array of flipped column specs in reversed order
   */
  public static String flip(String encodedColumnSpecs) {
    StringBuffer result = new StringBuffer();
    String separator = "";
    ColumnSpec[] flippedSpecs = flipped(ColumnSpec.decodeSpecs(encodedColumnSpecs));

    for (ColumnSpec spec : flippedSpecs) {
      result.append(separator);
      result.append(spec.encode());
      separator = ", ";
    }

    return result.toString();
  }
  /**
   * Flips the default alignment of the given column specification and returns a new column
   * specification object with the flipped alignment and the same size and growing behavior as the
   * original.
   *
   * @param spec the original column specification
   * @return the column specification with flipped default alignment
   */
  private static ColumnSpec flipped(ColumnSpec spec) {
    DefaultAlignment alignment = spec.getDefaultAlignment();

    if (alignment == ColumnSpec.LEFT) {
      alignment = ColumnSpec.RIGHT;
    } else {
      if (alignment == ColumnSpec.RIGHT) {
        alignment = ColumnSpec.LEFT;
      }
    }

    return new ColumnSpec(alignment, spec.getSize(), spec.getResizeWeight());
  }
  private void initActionsPanel() {
    JPanel actionPanel = new JPanel();
    getContentPane().add(actionPanel, BorderLayout.SOUTH);
    FormLayout layout =
        new FormLayout(
            new ColumnSpec[] {
              ColumnSpec.decode("default:grow"),
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("max(40dlu;default)"),
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("max(40dlu;default)"),
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("max(5dlu;default)"),
            },
            new RowSpec[] {
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              RowSpec.decode("max(5dlu;default)"),
            });
    actionPanel.setLayout(layout);

    JButton btnCancel = new JButton(MESSAGES.get("cancel"));
    btnCancel.addActionListener(e -> setVisible(false));
    actionPanel.add(btnCancel, "7, 1, 2, 1");

    JButton btnDefaults = new JButton(MESSAGES.get("load_defaults"));
    btnDefaults.addActionListener(
        new ActionListener() {

          @Override
          public void actionPerformed(ActionEvent e) {
            setDefaults();
          }
        });
    actionPanel.add(btnDefaults, "3, 1");

    JButton btnOk = new JButton(MESSAGES.get("ok"));
    btnOk.addActionListener(
        e -> {
          saveConfiguration();
          okPressed = true;
          setVisible(false);
        });
    actionPanel.add(btnOk, "11, 1, 2, 1");
  }
  public MediaFilesPanel(EventList<MediaFile> mediaFiles) {
    this.mediaFileEventList = mediaFiles;
    setLayout(
        new FormLayout(
            new ColumnSpec[] {
              ColumnSpec.decode("default:grow"),
            },
            new RowSpec[] {
              RowSpec.decode("default:grow"),
            }));

    mediaFileTableModel =
        new DefaultEventTableModel<MediaFile>(
            GlazedListsSwing.swingThreadProxyList(mediaFileEventList), new MediaTableFormat());
    tableFiles = new ZebraJTable(mediaFileTableModel);
    tableFiles.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

    LinkListener linkListener = new LinkListener();
    tableFiles.addMouseListener(linkListener);
    tableFiles.addMouseMotionListener(linkListener);

    scrollPaneFiles = ZebraJTable.createStripedJScrollPane(tableFiles);
    add(scrollPaneFiles, "1, 1, fill, fill");

    scrollPaneFiles.setViewportView(tableFiles);
  }
  /** Initialize the contents of the frame. */
  private void initialize() {
    frame = new JFrame();
    frame.setBounds(100, 100, 450, 300);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame
        .getContentPane()
        .setLayout(
            new FormLayout(
                new ColumnSpec[] {
                  FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                  ColumnSpec.decode("default:grow"),
                  FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                },
                new RowSpec[] {
                  FormFactory.RELATED_GAP_ROWSPEC,
                  RowSpec.decode("default:grow"),
                  FormFactory.LINE_GAP_ROWSPEC,
                  RowSpec.decode("default:grow"),
                  FormFactory.LINE_GAP_ROWSPEC,
                }));

    JPanel panel = new JPanel();
    frame.getContentPane().add(panel, "2, 2, fill, fill");

    openDialog = new FileDialog(this, "Open File", FileDialog.LOAD);

    JButton btnCharger = new JButton("Charger une partie");
    btnCharger.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            openDialog.setVisible(true);
            try {
              String dir = openDialog.getDirectory() + openDialog.getFile();
              Utilitaire.writeln(dir, textArea);
              jeu = new Kakuro(frame, dir);
              jeu.setVisible(true);
            } catch (NullPointerException point) {

            }
          }
        });
    panel.add(btnCharger);

    JButton btnNvlPartie = new JButton("Nouvelle Partie");
    panel.add(btnNvlPartie);
    btnNvlPartie.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            Random list = new Random();
            int seed = list.nextInt();
            new Utilitaire(Utilitaire.x, Utilitaire.y, seed);
            jeu = new Kakuro(frame);
            jeu.setVisible(true);
          }
        });

    textArea = new JTextArea();
    JScrollPane scrollPane = new JScrollPane(textArea);
    frame.getContentPane().add(scrollPane, "2, 4, fill, fill");
  }
Example #9
0
  public AddOnDetailsPanel(final AddOnProperties addOn, final String warning) {
    this.warning = warning;
    setLayout(
        new FormLayout(
            new ColumnSpec[] {
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("default:grow"),
            },
            new RowSpec[] {
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              RowSpec.decode("top:default:grow"),
            }));

    JLabel imageLabel = createImageLabel(addOn);
    add(imageLabel, "1, 2");
    JLabel title = createTitleLabel(addOn);
    add(title, "3, 2");
    JLabel author = createAuthorLabel(addOn);
    add(author, "3, 4");
    final Box box = Box.createHorizontalBox();
    box.add(new JLabel(getText("homepage")));
    box.add(createAddOnHomepageButton(addOn));
    add(box, "3, 6, left, default");
    JComponent details = createDetails(addOn);
    add(details, "3, 7");
  }
Example #10
0
  /** Create the panel. */
  public SlcsPanel(String url) {

    if ((url == null) || "".equals(url)) {
      this.url = DEFAULT_URL;
    } else {
      this.url = url;
    }
    setLayout(
        new FormLayout(
            new ColumnSpec[] {
              FormSpecs.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("default:grow"),
              FormSpecs.RELATED_GAP_COLSPEC,
            },
            new RowSpec[] {
              FormSpecs.RELATED_GAP_ROWSPEC,
              RowSpec.decode("default:grow"),
              FormSpecs.RELATED_GAP_ROWSPEC,
              FormSpecs.DEFAULT_ROWSPEC,
              FormSpecs.RELATED_GAP_ROWSPEC,
            }));
    add(getShibLoginPanel(), "2, 2, fill, fill");
    add(getLoginButton(), "2, 4, right, default");
    slcs = new SLCS(getShibLoginPanel());
    slcs.addSlcsListener(this);
    enablePanel(false);
    getShibLoginPanel().refreshIdpList();
  }
Example #11
0
  public ContatoDialog() {
    setTitle(
        "Escola do Ministério Teocrátio - v"
            + br.com.dbcorp.escolaMinisterio.Params.propriedades().getProperty("versionName"));
    setResizable(false);
    setModal(true);
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);

    this.setPreferredSize(new Dimension(340, 147));
    this.setMinimumSize(new Dimension(340, 147));

    JPanel panel = new JPanel();
    getContentPane().add(panel, BorderLayout.SOUTH);

    JButton btnFechar = new JButton("Fechar");
    btnFechar.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            dispose();
          }
        });

    panel.add(btnFechar);

    JPanel panel_1 = new JPanel();
    getContentPane().add(panel_1, BorderLayout.CENTER);
    panel_1.setLayout(
        new FormLayout(
            new ColumnSpec[] {
              FormSpecs.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("default:grow"),
              FormSpecs.RELATED_GAP_COLSPEC,
            },
            new RowSpec[] {
              RowSpec.decode("5dlu"),
              FormSpecs.RELATED_GAP_ROWSPEC,
              FormSpecs.DEFAULT_ROWSPEC,
              FormSpecs.LINE_GAP_ROWSPEC,
              FormSpecs.DEFAULT_ROWSPEC,
              FormSpecs.LINE_GAP_ROWSPEC,
              FormSpecs.DEFAULT_ROWSPEC,
              FormSpecs.LINE_GAP_ROWSPEC,
            }));

    JLabel lblNewLabel = new JLabel("Contato para Informa\u00E7\u00F5es e Suporte:");
    lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
    panel_1.add(lblNewLabel, "2, 3");

    JLabel lblDavidPereiraB = new JLabel("David Barros - Congrega\u00E7\u00E3o Jd. Monte Carlos");
    lblDavidPereiraB.setHorizontalAlignment(SwingConstants.CENTER);
    panel_1.add(lblDavidPereiraB, "2, 5, center, default");

    JLabel lblEmailDavidpbarroshotmailcom = new JLabel("E-mail: [email protected]");
    panel_1.add(lblEmailDavidpbarroshotmailcom, "2, 7, center, default");

    this.centerScreen();
  }
  /** Create the panel. */
  public JContact() {
    // setPreferredSize(new Dimension(10, 10));
    setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));

    JPopupMenu popupMenu = new JPopupMenu();
    addPopup(this, popupMenu);

    JMenuItem mntmInfo = new JMenuItem("info");
    popupMenu.add(mntmInfo);
    setLayout(
        new FormLayout(
            new ColumnSpec[] {
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("max(35dlu;default)"),
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("max(47dlu;default)"),
            },
            new RowSpec[] {
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              RowSpec.decode("max(23dlu;default)"),
            }));

    contactName = new JLabel("ContactName");
    add(contactName, "2, 2, 3, 1");

    JPanel panel = new JPanel();
    add(panel, "2, 4, 3, 1, fill, fill");
    panel.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));

    java.net.URL callImageURL =
        JContact.class.getResource("/com/git/client/ui/ico/phone_small.png");
    btnCall = new JButton(new ImageIcon(callImageURL));
    btnCall.setContentAreaFilled(false);
    panel.add(btnCall);

    java.net.URL delUserImageURL =
        JContact.class.getResource("/com/git/client/ui/ico/user_delete_small.png");
    btnDel = new JButton(new ImageIcon(delUserImageURL));
    btnDel.setContentAreaFilled(false);
    panel.add(btnDel);
  }
Example #13
0
  private void initActionsPanel() {
    JPanel actionPanel = new JPanel();
    getContentPane().add(actionPanel, BorderLayout.SOUTH);
    FormLayout layout =
        new FormLayout(
            new ColumnSpec[] {
              ColumnSpec.decode("default:grow"),
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("max(40dlu;default)"),
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("max(40dlu;default)"),
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("max(5dlu;default)"),
            },
            new RowSpec[] {
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              RowSpec.decode("max(5dlu;default)"),
            });
    actionPanel.setLayout(layout);

    JButton btnCancel = new JButton(MESSAGES.get("cancel"));
    btnCancel.addActionListener(e -> setVisible(false));
    actionPanel.add(btnCancel, "7, 1, 2, 1");

    JButton btnOk = new JButton(MESSAGES.get("ok"));
    btnOk.addActionListener(
        e -> {
          checkSettingsChanged();
          saveConfiguration();
          okPressed = true;
          setVisible(false);
        });
    actionPanel.add(btnOk, "11, 1, 2, 1");
  }
  private JPanel createPopularPhrasePanel(int index) {
    JPanel popularPhrasePanel = new JPanel();
    popularPhrasePanel.setLayout(
        new FormLayout(
            new ColumnSpec[] {
              ColumnSpec.decode("default"),
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("default:grow"),
              FormFactory.DEFAULT_COLSPEC,
              ColumnSpec.decode("default")
            },
            new RowSpec[] {FormFactory.DEFAULT_ROWSPEC}));

    popularPhrasePanel.add(new JLabel("" + (index + 1)), "1, 1");

    textFields.add(new JTextField(PROPERTIES.getPopularPhrase(index)));
    popularPhrasePanel.add(textFields.get(index), "3, 1");

    JButton playButton = new JButton(Icon.getIcon("/icons/control_play.png"));
    playButton.addActionListener(
        a -> speeker.speek(Arrays.asList(textFields.get(index).getText())));
    popularPhrasePanel.add(playButton, "5, 1");
    return popularPhrasePanel;
  }
  public TableScannerCameraConfigurationWizard(TableScannerCamera camera) {
    this.camera = camera;

    panelGeneral = new JPanel();
    contentPanel.add(panelGeneral);
    panelGeneral.setBorder(
        new TitledBorder(
            new EtchedBorder(EtchedBorder.LOWERED, null, null),
            "General",
            TitledBorder.LEADING,
            TitledBorder.TOP,
            null,
            new Color(0, 0, 0)));
    panelGeneral.setLayout(
        new FormLayout(
            new ColumnSpec[] {
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("default:grow"),
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
            },
            new RowSpec[] {
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
            }));

    lblUrl = new JLabel("URL");
    panelGeneral.add(lblUrl, "2, 2, right, default");

    textFieldUrl = new JTextField();
    panelGeneral.add(textFieldUrl, "4, 2, 3, 1, fill, default");
    textFieldUrl.setColumns(10);

    lblCache = new JLabel("Cache");
    panelGeneral.add(lblCache, "2, 4");

    lblCacheInfo = new JLabel("");
    panelGeneral.add(lblCacheInfo, "4, 4");

    btnDelete = new JButton("Delete Cache");
    btnDelete.setAction(deleteCacheAction);
    panelGeneral.add(btnDelete, "6, 4");
  }
 /**
  * Returns an array of column specifications that is built from the given encoded column
  * specifications by flipping each column spec and reversing their order.
  *
  * @param encodedColumnSpecs the original comma-separated encoded column specifications
  * @return an array of flipped column specs in reversed order
  */
 private static ColumnSpec[] flipped(String encodedColumnSpecs) {
   return flipped(ColumnSpec.decodeSpecs(encodedColumnSpecs));
 }
  /** Instantiates a new tv show settings panel. */
  public TvShowSettingsPanel() {
    setLayout(
        new FormLayout(
            new ColumnSpec[] {
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("default:grow"),
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
            },
            new RowSpec[] {
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              RowSpec.decode("default:grow"),
            }));

    {
      JPanel panelTvShowDataSources = new JPanel();

      panelTvShowDataSources.setBorder(
          new TitledBorder(
              null,
              BUNDLE.getString("Settings.tvshowdatasource"),
              TitledBorder.LEADING,
              TitledBorder.TOP,
              null,
              null)); //$NON-NLS-1$
      add(panelTvShowDataSources, "2, 2, fill, top");
      panelTvShowDataSources.setLayout(
          new FormLayout(
              new ColumnSpec[] {
                FormFactory.RELATED_GAP_COLSPEC,
                FormFactory.DEFAULT_COLSPEC,
                FormFactory.RELATED_GAP_COLSPEC,
                ColumnSpec.decode("max(40dlu;default)"),
                FormFactory.RELATED_GAP_COLSPEC,
                ColumnSpec.decode("max(44dlu;default):grow"),
                FormFactory.RELATED_GAP_COLSPEC,
                FormFactory.DEFAULT_COLSPEC,
                FormFactory.RELATED_GAP_COLSPEC,
              },
              new RowSpec[] {
                FormFactory.RELATED_GAP_ROWSPEC,
                RowSpec.decode("160px:grow"),
                FormFactory.RELATED_GAP_ROWSPEC,
                FormFactory.DEFAULT_ROWSPEC,
                FormFactory.RELATED_GAP_ROWSPEC,
                FormFactory.DEFAULT_ROWSPEC,
                FormFactory.RELATED_GAP_ROWSPEC,
              }));

      JScrollPane scrollPane = new JScrollPane();
      panelTvShowDataSources.add(scrollPane, "2, 2, 5, 1, fill, fill");

      tableTvShowSources = new JTable();
      tableTvShowSources.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
      scrollPane.setViewportView(tableTvShowSources);

      JPanel panelTvShowSourcesButtons = new JPanel();
      panelTvShowDataSources.add(panelTvShowSourcesButtons, "8, 2, default, top");
      panelTvShowSourcesButtons.setLayout(
          new FormLayout(
              new ColumnSpec[] {
                FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,
              },
              new RowSpec[] {
                FormFactory.DEFAULT_ROWSPEC,
                FormFactory.RELATED_GAP_ROWSPEC,
                FormFactory.DEFAULT_ROWSPEC,
              }));

      JButton btnAdd = new JButton(BUNDLE.getString("Button.add")); // $NON-NLS-1$
      btnAdd.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent arg0) {
              File file =
                  TmmUIHelper.selectDirectory(
                      BUNDLE.getString("Settings.tvshowdatasource.folderchooser")); // $NON-NLS-1$
              if (file != null && file.exists() && file.isDirectory()) {
                settings.getTvShowSettings().addTvShowDataSources(file.getAbsolutePath());
              }
            }
          });

      panelTvShowSourcesButtons.add(btnAdd, "2, 1, fill, top");

      JButton btnRemove = new JButton(BUNDLE.getString("Button.remove")); // $NON-NLS-1$
      btnRemove.addActionListener(
          new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
              int row =
                  tableTvShowSources.convertRowIndexToModel(tableTvShowSources.getSelectedRow());
              if (row != -1) { // nothing selected
                String path = Globals.settings.getTvShowSettings().getTvShowDataSource().get(row);
                String[] choices = {
                  BUNDLE.getString("Button.continue"), BUNDLE.getString("Button.abort")
                }; //$NON-NLS-1$
                int decision =
                    JOptionPane.showOptionDialog(
                        null,
                        String.format(
                            BUNDLE.getString("Settings.tvshowdatasource.remove.info"), path),
                        BUNDLE.getString("Settings.datasource.remove"),
                        JOptionPane.YES_NO_OPTION,
                        JOptionPane.PLAIN_MESSAGE,
                        null,
                        choices,
                        BUNDLE.getString("Button.abort")); // $NON-NLS-1$
                if (decision == 0) {
                  setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                  Globals.settings.getTvShowSettings().removeTvShowDataSources(path);
                  setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                }
              }
            }
          });
      panelTvShowSourcesButtons.add(btnRemove, "2, 3, fill, top");

      JLabel lblDvdOrder = new JLabel(BUNDLE.getString("Settings.dvdorder")); // $NON-NLS-1$
      panelTvShowDataSources.add(lblDvdOrder, "2, 4, right, default");

      cbDvdOrder = new JCheckBox("");
      panelTvShowDataSources.add(cbDvdOrder, "4, 4");

      lblImageCache = new JLabel(BUNDLE.getString("Settings.imagecacheimport")); // $NON-NLS-1$
      panelTvShowDataSources.add(lblImageCache, "2, 6, right, default");

      chckbxImageCache = new JCheckBox("");
      panelTvShowDataSources.add(chckbxImageCache, "4, 6");

      lblImageCacheHint =
          new JLabel(BUNDLE.getString("Settings.imagecacheimporthint")); // $NON-NLS-1$
      TmmFontHelper.changeFont(lblImageCacheHint, 0.833);
      panelTvShowDataSources.add(lblImageCacheHint, "6, 6, 3, 1");
    }

    JPanel panel = new JPanel();
    add(panel, "2, 4, fill, fill");
    panel.setLayout(
        new FormLayout(
            new ColumnSpec[] {
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
            },
            new RowSpec[] {
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
            }));

    JLabel lblTraktTv = new JLabel(BUNDLE.getString("Settings.trakt")); // $NON-NLS-1$
    panel.add(lblTraktTv, "2, 2");

    chckbxTraktTv = new JCheckBox("");
    panel.add(chckbxTraktTv, "4, 2");
    btnClearTraktTvShows =
        new JButton(BUNDLE.getString("Settings.trakt.cleartvshows")); // $NON-NLS-1$
    btnClearTraktTvShows.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            int confirm =
                JOptionPane.showOptionDialog(
                    null,
                    BUNDLE.getString("Settings.trakt.cleartvshows.hint"),
                    BUNDLE.getString("Settings.trakt.cleartvshows"),
                    JOptionPane.YES_NO_OPTION,
                    JOptionPane.QUESTION_MESSAGE,
                    null,
                    null,
                    null); //$NON-NLS-1$
            if (confirm == JOptionPane.YES_OPTION) {
              TmmTask task = new ClearTraktTvTask(false, true);
              TmmTaskManager.getInstance().addUnnamedTask(task);
            }
          }
        });
    panel.add(btnClearTraktTvShows, "6, 2");

    initDataBindings();

    // column headings
    tableTvShowSources
        .getColumnModel()
        .getColumn(0)
        .setHeaderValue(BUNDLE.getString("Settings.source")); // $NON-NLS-1$

    if (!Globals.isDonator()) {
      chckbxTraktTv.setSelected(false);
      chckbxTraktTv.setEnabled(false);
      btnClearTraktTvShows.setEnabled(false);
    }
  }
Example #18
0
 /** Create the dialog. */
 public ElfUnpacker() {
   setTitle("ELF Unpacker");
   setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
   setBounds(100, 100, 450, 220);
   getContentPane().setLayout(new BorderLayout());
   contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
   getContentPane().add(contentPanel, BorderLayout.CENTER);
   contentPanel.setLayout(
       new FormLayout(
           new ColumnSpec[] {
             FormFactory.RELATED_GAP_COLSPEC,
             ColumnSpec.decode("default:grow"),
             FormFactory.RELATED_GAP_COLSPEC,
             ColumnSpec.decode("default:grow"),
             FormFactory.RELATED_GAP_COLSPEC,
             FormFactory.DEFAULT_COLSPEC,
           },
           new RowSpec[] {
             FormFactory.RELATED_GAP_ROWSPEC,
             FormFactory.DEFAULT_ROWSPEC,
             FormFactory.RELATED_GAP_ROWSPEC,
             FormFactory.DEFAULT_ROWSPEC,
             FormFactory.RELATED_GAP_ROWSPEC,
             FormFactory.DEFAULT_ROWSPEC,
             FormFactory.RELATED_GAP_ROWSPEC,
             FormFactory.DEFAULT_ROWSPEC,
             FormFactory.RELATED_GAP_ROWSPEC,
             FormFactory.DEFAULT_ROWSPEC,
           }));
   {
     JLabel lblElfFile = new JLabel("Elf File :");
     contentPanel.add(lblElfFile, "2, 2, 3, 1");
   }
   {
     textElf = new JTextField();
     contentPanel.add(textElf, "2, 4, 3, 1, fill, default");
     textElf.setColumns(10);
   }
   {
     JButton button = new JButton("...");
     button.addActionListener(
         new ActionListener() {
           public void actionPerformed(ActionEvent arg0) {
             String file = chooseElf();
             if (!file.equals("ERROR")) {
               try {
                 if (file.toLowerCase().endsWith("sin")) {
                   SinFile sin = new SinFile(file);
                   if (sin.getIdent().equals("elf")) {
                     sin.dumpImage();
                     file = sin.getImage();
                     elf = new ElfParser(sin.getImage());
                     textElf.setText(file);
                     textParts.setText(Integer.toString(elf.getNbParts()));
                     btnDumpData.setEnabled(true);
                   } else {
                     textElf.setText("");
                     textParts.setText("");
                     btnDumpData.setEnabled(false);
                     MyLogger.getLogger().error(sin.getFile() + " does not contain elf data");
                   }
                 } else {
                   elf = new ElfParser(file);
                   textElf.setText(file);
                   textParts.setText(Integer.toString(elf.getNbParts()));
                   btnDumpData.setEnabled(true);
                 }
               } catch (Exception e) {
                 e.printStackTrace();
               }
             }
           }
         });
     contentPanel.add(button, "6, 4");
   }
   {
     JLabel lblPartitionInfo = new JLabel("Number of parts :");
     contentPanel.add(lblPartitionInfo, "2, 6, 3, 1");
   }
   {
     textParts = new JTextField();
     contentPanel.add(textParts, "2, 8, 3, 1, fill, default");
     textParts.setColumns(10);
   }
   {
     btnDumpData = new JButton("Unpack");
     btnDumpData.addActionListener(
         new ActionListener() {
           public void actionPerformed(ActionEvent arg0) {
             try {
               elf.unpack();
             } catch (Exception e) {
               MyLogger.getLogger().error(e.getMessage());
             }
           }
         });
     btnDumpData.setEnabled(false);
     contentPanel.add(btnDumpData, "2, 10, center, center");
   }
   {
     JPanel buttonPane = new JPanel();
     buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
     getContentPane().add(buttonPane, BorderLayout.SOUTH);
     {
       JButton okButton = new JButton("Close");
       okButton.addActionListener(
           new ActionListener() {
             public void actionPerformed(ActionEvent arg0) {
               dispose();
             }
           });
       okButton.setActionCommand("OK");
       buttonPane.add(okButton);
       getRootPane().setDefaultButton(okButton);
     }
   }
 }
Example #19
0
  /** Wielka litania do Pana naszego Swing'a. */
  private void createGUI() {
    GridBagLayout gridBagLayout = new GridBagLayout();
    gridBagLayout.columnWidths = new int[] {0, 0, 0, 0, 0};
    gridBagLayout.rowHeights = new int[] {0, 0, 0, 0};
    gridBagLayout.columnWeights = new double[] {1.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
    gridBagLayout.rowWeights = new double[] {0.0, 1.0, 0.0, Double.MIN_VALUE};
    setLayout(gridBagLayout);

    cBox_accountList = new JComboBox<String>();
    GridBagConstraints gbc_cBox_accountList = new GridBagConstraints();
    gbc_cBox_accountList.fill = GridBagConstraints.HORIZONTAL;
    gbc_cBox_accountList.insets = new Insets(0, 0, 5, 5);
    gbc_cBox_accountList.gridx = 0;
    gbc_cBox_accountList.gridy = 0;
    add(cBox_accountList, gbc_cBox_accountList);

    cBox_accountList.addActionListener(this);

    btn_edit = new JButton("Edytuj");
    GridBagConstraints gbc_btn_edit = new GridBagConstraints();
    gbc_btn_edit.insets = new Insets(0, 0, 5, 5);
    gbc_btn_edit.gridx = 1;
    gbc_btn_edit.gridy = 0;
    add(btn_edit, gbc_btn_edit);

    btn_rmv = new JButton("Usuń");
    GridBagConstraints gbc_btn_rmv = new GridBagConstraints();
    gbc_btn_rmv.insets = new Insets(0, 0, 5, 5);
    gbc_btn_rmv.gridx = 2;
    gbc_btn_rmv.gridy = 0;
    add(btn_rmv, gbc_btn_rmv);

    btn_add = new JButton("Dodaj");
    GridBagConstraints gbc_btn_add = new GridBagConstraints();
    gbc_btn_add.insets = new Insets(0, 0, 5, 0);
    gbc_btn_add.gridx = 3;
    gbc_btn_add.gridy = 0;
    add(btn_add, gbc_btn_add);

    JPanel panel_accountData = new JPanel();
    GridBagConstraints gbc_panel_accountData = new GridBagConstraints();
    gbc_panel_accountData.insets = new Insets(0, 0, 5, 0);
    gbc_panel_accountData.gridwidth = 4;
    gbc_panel_accountData.fill = GridBagConstraints.BOTH;
    gbc_panel_accountData.gridx = 0;
    gbc_panel_accountData.gridy = 1;
    add(panel_accountData, gbc_panel_accountData);

    panel_accountData.setLayout(
        new FormLayout(
            new ColumnSpec[] {
              FormSpecs.RELATED_GAP_COLSPEC,
              FormSpecs.DEFAULT_COLSPEC,
              FormSpecs.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("default:grow"),
            },
            new RowSpec[] {
              FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
              FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
              FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
              FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
              FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
            }));

    lbl_name = new JLabel("ImiÄ™");
    panel_accountData.add(lbl_name, "2, 2, right, default");

    txt_name = new JTextField();
    txt_name.setEditable(false);
    panel_accountData.add(txt_name, "4, 2, fill, default");
    txt_name.setColumns(10);

    lbl_surname = new JLabel("Nazwisko");
    panel_accountData.add(lbl_surname, "2, 4, right, default");

    txt_surname = new JTextField();
    txt_surname.setEditable(false);
    panel_accountData.add(txt_surname, "4, 4, fill, default");
    txt_surname.setColumns(10);

    lbl_password = new JLabel("Hasło");
    panel_accountData.add(lbl_password, "2, 6, right, default");

    lbl_login = new JLabel("Login");
    panel_accountData.add(lbl_login, "2, 8, right, default");

    txt_password = new JTextField();
    txt_password.setEditable(false);
    panel_accountData.add(txt_password, "4, 6, fill, default");
    txt_password.setColumns(10);

    txt_login = new JTextField();
    txt_login.setEditable(false);
    panel_accountData.add(txt_login, "4, 8, fill, default");
    txt_login.setColumns(10);

    lbl_gmail = new JLabel("Gmail");
    panel_accountData.add(lbl_gmail, "2, 10, right, default");

    txt_gmail = new JTextField();
    txt_gmail.setEditable(false);
    panel_accountData.add(txt_gmail, "4, 10, fill, default");
    txt_gmail.setColumns(10);

    btn_add.setActionCommand("add");
    btn_rmv.setActionCommand("rmv");
    btn_edit.setActionCommand("edit");

    btn_add.addActionListener(this);
    btn_rmv.addActionListener(this);
    btn_edit.addActionListener(this);

    lbl_result = new JLabel(actionNumber + "");
    GridBagConstraints gbc_lbl_result = new GridBagConstraints();
    gbc_lbl_result.gridwidth = 4;
    gbc_lbl_result.fill = GridBagConstraints.HORIZONTAL;
    gbc_lbl_result.insets = new Insets(0, 0, 0, 5);
    gbc_lbl_result.gridx = 0;
    gbc_lbl_result.gridy = 2;
    add(lbl_result, gbc_lbl_result);
  }
Example #20
0
  private void initComponent() {
    setBackground(Color.WHITE);
    setForeground(Color.WHITE);
    setBounds(100, 100, 400, 300);
    contentPane = new JPanel();
    contentPane.setBackground(Color.WHITE);
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    setContentPane(contentPane);
    contentPane.setLayout(
        new FormLayout(
            new ColumnSpec[] {
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("default:grow"),
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("default:grow"),
            },
            new RowSpec[] {
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              RowSpec.decode("default:grow"),
            }));

    JLabel lblCriteriaName = new JLabel("Criteria Name : ");
    lblCriteriaName.setBackground(Color.WHITE);
    lblCriteriaName.setFont(new Font("Tahoma", Font.BOLD, 18));
    contentPane.add(lblCriteriaName, "6, 8, right, default");

    txtCriteriaName = new JTextField();
    txtCriteriaName.setFont(new Font("Tahoma", Font.PLAIN, 18));
    txtCriteriaName.setText("criteria name");
    contentPane.add(txtCriteriaName, "8, 8, fill, default");
    txtCriteriaName.setColumns(10);

    panel = new JPanel();
    panel.setBackground(Color.WHITE);
    contentPane.add(panel, "6, 14, 3, 1, fill, fill");

    btnDelete = new JButton("Delete");
    panel.add(btnDelete);

    btnSave = new JButton("Save");
    panel.add(btnSave);
  }
  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
  }
  private void initializeGUIComponents() {
    setLayout(
        new FormLayout(
            new ColumnSpec[] {
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("max(37dlu;default):grow"),
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("default:grow"),
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("default:grow"),
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("max(15dlu;default)"),
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("max(0dlu;default):grow"),
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("default:grow"),
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
            },
            new RowSpec[] {
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
            }));

    JLabel lblType = new JLabel("Type:");
    add(lblType, "4, 4");

    cbType = new JComboBox<Address>();
    cbType.addActionListener(cbController);
    cbTypeModel = new DefaultComboBoxModel<Address>();
    add(cbType, "6, 4, 7, 1, fill, default");

    JLabel lblStreet = new JLabel("Street 1:");
    add(lblStreet, "6, 6, right, default");

    tfStreet1 = new JTextField();
    tfStreet1.setEditable(false);
    add(tfStreet1, "8, 6, 13, 1, fill, default");
    tfStreet1.setColumns(10);

    JLabel lblStreet_1 = new JLabel("Street 2:");
    add(lblStreet_1, "6, 8, right, default");

    tfStreet2 = new JTextField();
    tfStreet2.setEditable(false);
    add(tfStreet2, "8, 8, 13, 1, fill, default");
    tfStreet2.setColumns(10);

    JLabel lblCity = new JLabel("City:");
    add(lblCity, "6, 10, right, default");

    tfCity = new JTextField();
    tfCity.setEditable(false);
    add(tfCity, "8, 10, 13, 1, fill, top");
    tfCity.setColumns(10);

    JLabel lblZipcode = new JLabel("Zipcode:");
    add(lblZipcode, "6, 12, right, default");

    tfZipcode = new JTextField();
    tfZipcode.setEditable(false);
    add(tfZipcode, "8, 12, 7, 1, fill, top");
    tfZipcode.setColumns(10);

    JButton btnEdit = new JButton("Edit");
    add(btnEdit, "20, 12");
  }
 /** Create the dialog. */
 public ResizeSelectGUI() {
   addWindowListener(
       new WindowAdapter() {
         public void windowClosing(WindowEvent e) {
           result = "";
           dispose();
         }
       });
   setResizable(false);
   setModalityType(ModalityType.APPLICATION_MODAL);
   setTitle("Unit resize");
   setBounds(100, 100, 187, 132);
   getContentPane()
       .setLayout(
           new FormLayout(
               new ColumnSpec[] {
                 FormFactory.RELATED_GAP_COLSPEC,
                 FormFactory.RELATED_GAP_COLSPEC,
                 FormFactory.DEFAULT_COLSPEC,
                 FormFactory.RELATED_GAP_COLSPEC,
                 ColumnSpec.decode("max(91dlu;default)"),
                 FormFactory.RELATED_GAP_COLSPEC,
                 FormFactory.RELATED_GAP_COLSPEC,
               },
               new RowSpec[] {
                 FormFactory.RELATED_GAP_ROWSPEC,
                 FormFactory.RELATED_GAP_ROWSPEC,
                 FormFactory.DEFAULT_ROWSPEC,
                 FormFactory.RELATED_GAP_ROWSPEC,
                 RowSpec.decode("32px"),
                 RowSpec.decode("33px"),
               }));
   {
     lblNewLabel = new JLabel("Enter new size");
     getContentPane().add(lblNewLabel, "3, 3, 3, 1");
   }
   {
     textField = new JTextField();
     getContentPane().add(textField, "3, 5, 3, 1, fill, default");
     textField.setColumns(10);
   }
   {
     JPanel buttonPane = new JPanel();
     buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
     getContentPane().add(buttonPane, "1, 6, 5, 1, fill, top");
     {
       okButton = new JButton("OK");
       okButton.addActionListener(
           new ActionListener() {
             public void actionPerformed(ActionEvent arg0) {
               try {
                 int resultint = Integer.parseInt(textField.getText());
                 if (textField.getText().length() > 0) {
                   result = textField.getText();
                   dispose();
                 } else {
                   AskBox.showOKbox("You must enter a value. Otherwise, cancel");
                 }
               } catch (Exception e) {
                 AskBox.showOKbox("Size must be an integer");
               }
             }
           });
       okButton.setActionCommand("OK");
       buttonPane.add(okButton);
       getRootPane().setDefaultButton(okButton);
     }
     {
       cancelButton = new JButton("Cancel");
       cancelButton.addActionListener(
           new ActionListener() {
             public void actionPerformed(ActionEvent e) {
               result = "";
               dispose();
             }
           });
       cancelButton.setActionCommand("Cancel");
       buttonPane.add(cancelButton);
     }
   }
 }
Example #24
0
 /** Create the dialog. */
 public EncDecGUI() {
   setName("EncDecGUI");
   setResizable(false);
   setModal(true);
   setTitle("Decryption wizard");
   setBounds(100, 100, 615, 300);
   getContentPane().setLayout(new BorderLayout());
   contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
   getContentPane().add(contentPanel, BorderLayout.CENTER);
   contentPanel.setLayout(
       new FormLayout(
           new ColumnSpec[] {
             FormFactory.RELATED_GAP_COLSPEC,
             ColumnSpec.decode("50dlu"),
             FormFactory.RELATED_GAP_COLSPEC,
             ColumnSpec.decode("51dlu:grow"),
             FormFactory.RELATED_GAP_COLSPEC,
             ColumnSpec.decode("max(48dlu;default)"),
             FormFactory.RELATED_GAP_COLSPEC,
             ColumnSpec.decode("42dlu"),
             FormFactory.RELATED_GAP_COLSPEC,
             ColumnSpec.decode("53dlu:grow"),
           },
           new RowSpec[] {
             FormFactory.RELATED_GAP_ROWSPEC,
             FormFactory.DEFAULT_ROWSPEC,
             FormFactory.RELATED_GAP_ROWSPEC,
             FormFactory.DEFAULT_ROWSPEC,
             FormFactory.RELATED_GAP_ROWSPEC,
             FormFactory.DEFAULT_ROWSPEC,
             FormFactory.RELATED_GAP_ROWSPEC,
             FormFactory.DEFAULT_ROWSPEC,
             FormFactory.RELATED_GAP_ROWSPEC,
             FormFactory.DEFAULT_ROWSPEC,
             FormFactory.RELATED_GAP_ROWSPEC,
             RowSpec.decode("max(24dlu;default)"),
             FormFactory.RELATED_GAP_ROWSPEC,
             RowSpec.decode("default:grow"),
             FormFactory.RELATED_GAP_ROWSPEC,
             RowSpec.decode("default:grow"),
           }));
   addWindowListener(
       new WindowAdapter() {
         public void windowClosing(WindowEvent e) {
           listToConvertModel.removeAllElements();
           dispose();
         }
       });
   {
     JLabel lblSourceFolder = new JLabel("Source folder :");
     lblSourceFolder.setName("lblSourceFolder");
     contentPanel.add(lblSourceFolder, "2, 2, 3, 1, left, default");
   }
   {
     textField = new JTextField();
     textField.setEditable(false);
     contentPanel.add(textField, "2, 4, 7, 1, fill, default");
     textField.setColumns(10);
   }
   {
     JButton button = new JButton("...");
     button.addActionListener(
         new ActionListener() {
           public void actionPerformed(ActionEvent e) {
             doChoose();
           }
         });
     contentPanel.add(button, "10, 4, right, center");
   }
   {
     JLabel lblFiles = new JLabel("Files");
     lblFiles.setName("lblFiles");
     contentPanel.add(lblFiles, "2, 8, 3, 1, center, default");
   }
   {
     JLabel lblFilesToConvert = new JLabel("Files to convert");
     lblFilesToConvert.setName("lblFilesToConvert");
     contentPanel.add(lblFilesToConvert, "8, 8, 3, 1, center, default");
   }
   {
     JScrollPane scrollPane = new JScrollPane();
     contentPanel.add(scrollPane, "2, 10, 3, 7, fill, fill");
     {
       listFiles = new JList();
       listFiles.setModel(sortedFilesModel);
       scrollPane.setViewportView(listFiles);
     }
   }
   {
     JScrollPane scrollPane = new JScrollPane();
     contentPanel.add(scrollPane, "8, 10, 3, 7, fill, fill");
     {
       listToConvert = new JList();
       listToConvert.setModel(sortedToConvertModel);
       scrollPane.setViewportView(listToConvert);
     }
   }
   {
     JButton button = new JButton("->");
     button.addActionListener(
         new ActionListener() {
           public void actionPerformed(ActionEvent e) {
             Object[] values = listFiles.getSelectedValues();
             for (int i = 0; i < values.length; i++) {
               listToConvertModel.addElement(values[i]);
               listFilesModel.removeElement(values[i]);
             }
           }
         });
     contentPanel.add(button, "6, 12, center, center");
   }
   {
     JButton button = new JButton("<-");
     button.addActionListener(
         new ActionListener() {
           public void actionPerformed(ActionEvent e) {
             Object[] values = listToConvert.getSelectedValues();
             for (int i = 0; i < values.length; i++) {
               listToConvertModel.removeElement(values[i]);
               listFilesModel.addElement(values[i]);
             }
           }
         });
     contentPanel.add(button, "6, 14, center, center");
   }
   {
     JPanel buttonPane = new JPanel();
     buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
     getContentPane().add(buttonPane, BorderLayout.SOUTH);
     {
       JButton okButton = new JButton("OK");
       okButton.setName("okButton");
       okButton.addActionListener(
           new ActionListener() {
             public void actionPerformed(ActionEvent arg0) {
               dispose();
             }
           });
       okButton.setActionCommand("OK");
       buttonPane.add(okButton);
       getRootPane().setDefaultButton(okButton);
     }
     {
       JButton cancelButton = new JButton("Cancel");
       cancelButton.setName("cancelButton");
       cancelButton.addActionListener(
           new ActionListener() {
             public void actionPerformed(ActionEvent arg0) {
               listToConvertModel.removeAllElements();
               dispose();
             }
           });
       cancelButton.setActionCommand("Cancel");
       buttonPane.add(cancelButton);
     }
   }
   setLanguage();
 }
  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
  }
Example #26
0
  /** Create the panel. */
  public PayPal() {
    setLayout(
        new FormLayout(
            new ColumnSpec[] {
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("default:grow"),
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("max(87dlu;default)"),
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("max(78dlu;default):grow"),
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("left:max(27dlu;default)"),
            },
            new RowSpec[] {
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              RowSpec.decode("max(21dlu;default)"),
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
            }));

    JLabel lblWelcomeToPaypal = new JLabel("ENTER PAYMENT DETAILS ");
    lblWelcomeToPaypal.setFont(new Font("Tahoma", Font.BOLD, 15));
    add(lblWelcomeToPaypal, "6, 4, 5, 1, center, default");

    paymentMessage = new JLabel("");
    add(paymentMessage, "6, 6, 5, 1");

    JLabel lblAgreementNumber = new JLabel("Agreement Number");
    add(lblAgreementNumber, "4, 8, right, default");

    setTextField_9(new JTextField());
    add(getTextField_9(), "6, 8, fill, default");
    getTextField_9().setColumns(10);

    JLabel lblYourTotalBill = new JLabel("Your Total Bill");
    add(lblYourTotalBill, "10, 8, right, default");

    setTextField_8(new JTextField());
    add(getTextField_8(), "12, 8, fill, default");
    getTextField_8().setColumns(10);

    JLabel lblPleaseProvideYour = new JLabel("BILLING ADDRESS");
    lblPleaseProvideYour.setFont(new Font("Tahoma", Font.BOLD, 12));
    add(lblPleaseProvideYour, "6, 12, 5, 1, center, default");

    JLabel lblAdressLine = new JLabel("Adress Line 1");
    add(lblAdressLine, "4, 14, right, default");

    addressLine1 = new JTextField();
    add(addressLine1, "6, 14, fill, default");
    addressLine1.setColumns(10);

    JLabel lblCity = new JLabel("City");
    add(lblCity, "10, 14, right, default");

    city = new JTextField();
    city.setColumns(10);
    add(city, "12, 14, fill, default");

    JLabel lblAddressLine = new JLabel("Address line 2");
    add(lblAddressLine, "4, 16, right, default");

    addressLine2 = new JTextField();
    add(addressLine2, "6, 16, fill, default");
    addressLine2.setColumns(10);

    JLabel lblProvincestate = new JLabel("Province/State Code");
    add(lblProvincestate, "10, 16, right, default");

    province = new JTextField();
    province.setColumns(10);
    add(province, "12, 16, fill, default");

    JLabel lblPostalcode = new JLabel("PostalCode");
    add(lblPostalcode, "4, 18, right, default");

    postalcode = new JTextField();
    postalcode.setColumns(10);
    add(postalcode, "6, 18, fill, default");

    JLabel lblCountry = new JLabel("Country Code");
    add(lblCountry, "10, 18, right, default");

    country = new JTextField();
    country.setColumns(10);
    add(country, "12, 18, fill, default");

    JLabel lblCreditCardDetails = new JLabel("CREDIT CARD DETAILS");
    lblCreditCardDetails.setFont(new Font("Tahoma", Font.BOLD, 12));
    add(lblCreditCardDetails, "6, 22, 5, 1, center, default");

    JLabel lblCreditCardNumber = new JLabel("Credit Card number");
    add(lblCreditCardNumber, "4, 24, right, default");

    creditcardno = new JPasswordField();
    add(creditcardno, "6, 24, fill, default");
    creditcardno.setColumns(10);

    JLabel lblExpiryDate = new JLabel("Expiry Month");
    add(lblExpiryDate, "10, 24, right, default");

    expiryMonth = new JComboBox();
    String months[] = (new DateFormatSymbols()).getMonths();
    expiryMonth.setModel(new DefaultComboBoxModel(months));
    add(expiryMonth, "12, 24, fill, default");

    JLabel lblCardType = new JLabel("Card Type");
    add(lblCardType, "4, 26, right, default");

    cardType = new JComboBox();
    cardType.setModel(
        new DefaultComboBoxModel(new String[] {"Mastercard", "Visa", "American Express"}));
    add(cardType, "6, 26, fill, default");

    JLabel lblExpiryYear = new JLabel("Expiry Year (e.g. 2014)");
    add(lblExpiryYear, "10, 26, right, default");

    expiryYear = new JTextField();
    add(expiryYear, "12, 26, fill, default");
    expiryYear.setColumns(10);

    JLabel lblCvv = new JLabel("CVV");
    add(lblCvv, "4, 28, right, default");

    cvv = new JPasswordField();
    add(cvv, "6, 28, fill, default");
    cvv.setColumns(10);

    JLabel lblNameOnCard = new JLabel("Name on Card (Firstname)");
    add(lblNameOnCard, "10, 28, right, default");

    firstname = new JTextField();
    add(firstname, "12, 28, fill, default");
    firstname.setColumns(10);

    JLabel lblLastname = new JLabel("Lastname");
    add(lblLastname, "10, 30, right, default");

    lastname = new JTextField();
    add(lastname, "12, 30, fill, default");
    lastname.setColumns(10);

    btnProcessPayment = new JButton("Process Payment");
    // btnProcessPayment.addActionListener();
    add(btnProcessPayment, "6, 32, 5, 1, center, default");
  }
  /**
   * Instantiates a new movie information panel.
   *
   * @param movieSelectionModel the movie selection model
   */
  public MovieInformationPanel(MovieSelectionModel movieSelectionModel) {
    this.movieSelectionModel = movieSelectionModel;

    setLayout(
        new FormLayout(
            new ColumnSpec[] {
              ColumnSpec.decode("450px:grow"),
            },
            new RowSpec[] {
              RowSpec.decode("fill:default:grow"),
            }));

    splitPaneVertical = new JSplitPane();
    splitPaneVertical.setBorder(null);
    splitPaneVertical.setResizeWeight(0.9);
    splitPaneVertical.setContinuousLayout(true);
    splitPaneVertical.setOneTouchExpandable(true);
    splitPaneVertical.setOrientation(JSplitPane.VERTICAL_SPLIT);
    add(splitPaneVertical, "1, 1, fill, fill");

    panelTop = new JPanel();
    panelTop.setBorder(null);
    splitPaneVertical.setTopComponent(panelTop);
    panelTop.setLayout(
        new FormLayout(
            new ColumnSpec[] {
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("200px:grow"),
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
            },
            new RowSpec[] {
              RowSpec.decode("fill:default"), RowSpec.decode("top:pref:grow"),
            }));

    JPanel panelMovieHeader = new JPanel();
    panelTop.add(panelMovieHeader, "2, 1, 3, 1, fill, top");
    panelMovieHeader.setBorder(null);
    panelMovieHeader.setLayout(new BorderLayout(0, 0));

    JPanel panelMovieTitle = new JPanel();
    panelMovieHeader.add(panelMovieTitle, BorderLayout.NORTH);
    panelMovieTitle.setLayout(new BorderLayout(0, 0));
    lblMovieName = new JLabel("");
    TmmFontHelper.changeFont(lblMovieName, 1.33, Font.BOLD);
    panelMovieTitle.add(lblMovieName);

    JPanel panelRatingTagline = new JPanel();
    panelMovieHeader.add(panelRatingTagline, BorderLayout.CENTER);
    panelRatingTagline.setLayout(
        new FormLayout(
            new ColumnSpec[] {
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
              FormFactory.UNRELATED_GAP_COLSPEC,
              ColumnSpec.decode("25px:grow"),
            },
            new RowSpec[] {
              FormFactory.LINE_GAP_ROWSPEC, RowSpec.decode("24px"), FormFactory.DEFAULT_ROWSPEC,
            }));

    lblRating = new JLabel("");
    panelRatingTagline.add(lblRating, "2, 2, left, center");

    lblVoteCount = new JLabel("");
    panelRatingTagline.add(lblVoteCount, "3, 2, left, center");

    panelRatingStars = new StarRater(10, 1);
    panelRatingTagline.add(panelRatingStars, "1, 2, left, top");
    panelRatingStars.setEnabled(false);

    lblTop250 = new JLabel("");
    panelRatingTagline.add(lblTop250, "5, 2, left, default");

    lblTagline = new JLabel();
    panelRatingTagline.add(lblTagline, "1, 3, 5, 1, default, center");

    panelMovieLogos = new JPanel();
    panelMovieHeader.add(panelMovieLogos, BorderLayout.EAST);

    lblCertificationImage = new JLabel();
    panelMovieLogos.add(lblCertificationImage);

    JLayeredPane layeredPaneImages = new JLayeredPane();
    panelTop.add(layeredPaneImages, "1, 2, 4, 1, fill, fill");
    layeredPaneImages.setLayout(
        new FormLayout(
            new ColumnSpec[] {
              ColumnSpec.decode("max(10px;default)"),
              ColumnSpec.decode("left:120px:grow"),
              ColumnSpec.decode("default:grow(10)"),
            },
            new RowSpec[] {
              RowSpec.decode("max(10px;default)"),
              RowSpec.decode("top:180px:grow"),
              RowSpec.decode("fill:80px:grow(3)"),
            }));

    lblMovieBackground = new ImageLabel(false, true);
    lblMovieBackground.setAlternativeText(BUNDLE.getString("image.notfound.fanart")); // $NON-NLS-1$
    lblMovieBackground.enableLightbox();
    layeredPaneImages.add(lblMovieBackground, "1, 1, 3, 3, fill, fill");

    lblMoviePoster = new ImageLabel();
    lblMoviePoster.setAlternativeText(BUNDLE.getString("image.notfound.poster")); // $NON-NLS-1$
    lblMoviePoster.enableLightbox();
    layeredPaneImages.setLayer(lblMoviePoster, 1);
    layeredPaneImages.add(lblMoviePoster, "2, 2, fill, fill");

    lblWatchedImage = new JLabel();
    lblWatchedImage.setOpaque(false);
    layeredPaneImages.setLayer(lblWatchedImage, 2);
    layeredPaneImages.add(lblWatchedImage, "2, 2, left, top");

    JPanel panelGenres = new MovieGenresPanel(movieSelectionModel);
    layeredPaneImages.setLayer(panelGenres, 2);
    layeredPaneImages.add(panelGenres, "2, 2, 2, 2, right, bottom");

    JPanel panelLogos = new JPanel();
    panelLogos.setOpaque(false);
    layeredPaneImages.setLayer(panelLogos, 2);
    layeredPaneImages.add(panelLogos, "2, 2, 2, 2, right, top");
    panelLogos.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));

    lblMediaLogoResolution = new JLabel("");
    panelLogos.add(lblMediaLogoResolution);

    lblMediaLogoVideoCodec = new JLabel("");
    panelLogos.add(lblMediaLogoVideoCodec);

    lblMediaLogoAudio = new JLabel("");
    panelLogos.add(lblMediaLogoAudio);

    JPanel panelBottom = new JPanel();
    panelBottom.setLayout(
        new FormLayout(
            new ColumnSpec[] {
              ColumnSpec.decode("300px:grow"),
            },
            new RowSpec[] {
              FormFactory.LINE_GAP_ROWSPEC, RowSpec.decode("fill:min:grow"),
            }));

    tabbedPaneMovieDetails = new JTabbedPane(JTabbedPane.TOP);
    panelBottom.add(tabbedPaneMovieDetails, "1, 2, fill, fill");
    splitPaneVertical.setBottomComponent(panelBottom);

    panelDetails = new MovieDetailsPanel(movieSelectionModel);
    tabbedPaneMovieDetails.addTab(
        BUNDLE.getString("metatag.details"), null, panelDetails, null); // $NON-NLS-1$

    panelOverview = new JPanel();
    tabbedPaneMovieDetails.addTab(
        BUNDLE.getString("metatag.plot"), null, panelOverview, null); // $NON-NLS-1$
    panelOverview.setLayout(
        new FormLayout(
            new ColumnSpec[] {
              ColumnSpec.decode("200px:grow"),
            },
            new RowSpec[] {
              FormFactory.LINE_GAP_ROWSPEC, RowSpec.decode("fill:default:grow"),
            }));
    // panelMovieDetails.add(tabbedPaneMovieDetails, "2, 3, fill, fill");

    JScrollPane scrollPaneOverview = new JScrollPane();
    scrollPaneOverview.setBorder(null);
    panelOverview.add(scrollPaneOverview, "1, 2, fill, fill");

    tpOverview = new JTextPane();
    tpOverview.setOpaque(false);
    tpOverview.setEditable(false);
    scrollPaneOverview.setViewportView(tpOverview);

    panelMovieCrew = new MovieCrewPanel(movieSelectionModel);
    tabbedPaneMovieDetails.addTab(
        BUNDLE.getString("metatag.crew"), null, panelMovieCrew, null); // $NON-NLS-1$

    MovieActorPanel panelMovieActors = new MovieActorPanel(movieSelectionModel);
    tabbedPaneMovieDetails.addTab(
        BUNDLE.getString("metatag.cast"), null, panelMovieActors, null); // $NON-NLS-1$

    panelMediaInformation = new MovieMediaInformationPanel(movieSelectionModel);
    tabbedPaneMovieDetails.addTab(
        BUNDLE.getString("metatag.mediainformation"),
        null,
        panelMediaInformation,
        null); //$NON-NLS-1$

    panelMediaFiles = new MovieMediaFilesPanel(movieSelectionModel);
    tabbedPaneMovieDetails.addTab(
        BUNDLE.getString("metatag.mediafiles"), null, panelMediaFiles, null); // $NON-NLS-1$

    final List<MediaFile> mediaFiles = new ArrayList<MediaFile>();
    final ImagePanel panelArtwork = new ImagePanel(mediaFiles);
    tabbedPaneMovieDetails.addTab(
        BUNDLE.getString("metatag.artwork"), null, panelArtwork, null); // $NON-NLS-1$

    panelMovieTrailer = new MovieTrailerPanel(movieSelectionModel);
    tabbedPaneMovieDetails.addTab(
        BUNDLE.getString("metatag.trailer"), null, panelMovieTrailer, null); // $NON-NLS-1$

    // beansbinding init
    initDataBindings();

    // manual coded binding
    PropertyChangeListener propertyChangeListener =
        new PropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent propertyChangeEvent) {
            String property = propertyChangeEvent.getPropertyName();
            Object source = propertyChangeEvent.getSource();
            // react on selection of a movie and change of a movie
            if (source instanceof MovieSelectionModel
                || (source instanceof Movie && MEDIA_FILES.equals(property))) {
              Movie movie = null;
              if (source instanceof MovieSelectionModel) {
                movie = ((MovieSelectionModel) source).getSelectedMovie();
              }
              if (source instanceof Movie) {
                movie = (Movie) source;
              }

              if (movie != null) {
                if (movie.getTop250() > 0) {
                  lblTop250.setText("Top 250: #" + movie.getTop250());
                } else {
                  lblTop250.setText("");
                }
                lblMovieBackground.setImagePath(movie.getArtworkFilename(MediaFileType.FANART));
                lblMoviePoster.setImagePath(movie.getArtworkFilename(MediaFileType.POSTER));

                synchronized (mediaFiles) {
                  mediaFiles.clear();
                  for (MediaFile mediafile : movie.getMediaFiles()) {
                    if (mediafile.isGraphic()) {
                      mediaFiles.add(mediafile);
                    }
                  }
                  panelArtwork.rebuildPanel();
                }
              }
            }
            if ((source.getClass() == Movie.class && FANART.equals(property))) {
              Movie movie = (Movie) source;
              lblMovieBackground.clearImage();
              lblMovieBackground.setImagePath(movie.getArtworkFilename(MediaFileType.FANART));
            }
            if ((source.getClass() == Movie.class && POSTER.equals(property))) {
              Movie movie = (Movie) source;
              lblMoviePoster.clearImage();
              lblMoviePoster.setImagePath(movie.getArtworkFilename(MediaFileType.POSTER));
            }
            if ((source.getClass() == Movie.class && TOP250.equals(property))) {
              Movie movie = (Movie) source;
              if (movie.getTop250() > 0) {
                lblTop250.setText(
                    BUNDLE.getString("metatag.top250") + ": #" + movie.getTop250()); // $NON-NLS-1$
              } else {
                lblTop250.setText("");
              }
            }
          }
        };

    movieSelectionModel.addPropertyChangeListener(propertyChangeListener);
  }
Example #28
0
  AuctionClientPanel() {
    super();
    this.setPreferredSize(new Dimension(500, 700));
    this.setLayout(
        new FormLayout(
            new ColumnSpec[] {
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("default:grow"),
              ColumnSpec.decode("165px:grow"),
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("max(70dlu;default):grow"),
              FormFactory.RELATED_GAP_COLSPEC,
              ColumnSpec.decode("max(18dlu;default):grow"),
              FormFactory.RELATED_GAP_COLSPEC,
              FormFactory.DEFAULT_COLSPEC,
            },
            new RowSpec[] {
              FormFactory.MIN_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.LINE_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              RowSpec.decode("top:default"),
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              RowSpec.decode("max(50dlu;default)"),
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
              FormFactory.RELATED_GAP_ROWSPEC,
              RowSpec.decode("max(50dlu;default):grow"),
              FormFactory.RELATED_GAP_ROWSPEC,
              FormFactory.DEFAULT_ROWSPEC,
            }));

    JLabel lblServerAddress = new JLabel("Server Address:");
    add(lblServerAddress, "3, 3, left, default");

    serverAddressField = new JTextField();
    serverAddressField.setText("192.168.222.135");
    add(serverAddressField, "5, 3, fill, default");
    serverAddressField.setColumns(10);

    JButton btnConnect = new JButton("Connect");
    btnConnect.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent e) {
            // Connect to the server
            onConnectClicked();
          }
        });
    add(btnConnect, "7, 3");

    JLabel lblServerPort = new JLabel("Server Port:");
    add(lblServerPort, "3, 5, left, default");

    serverPortField = new JTextField();
    serverPortField.setText("1050");
    add(serverPortField, "5, 5, fill, default");
    serverPortField.setColumns(10);

    JLabel lblUsername = new JLabel("Username:"******"3, 9, left, top");
    usernameField.setEnabled(false);
    this.add(usernameField, "5, 9");
    usernameField.setColumns(10);

    btnLogIn = new JButton("Log In");
    btnLogIn.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent e) {
            if (btnLogIn.isEnabled()) {
              onLoginClicked();
            }
          }
        });
    btnLogIn.setEnabled(false);
    this.add(btnLogIn, "7, 9");

    JLabel lblPassword = new JLabel("Password:"******"3, 11, left, top");

    passwordField = new JTextField();
    passwordField.setEnabled(false);
    this.add(passwordField, "5, 11, fill, default");
    passwordField.setColumns(10);

    JLabel lblAvailableAuctions = new JLabel("Available Auctions");
    this.add(lblAvailableAuctions, "3, 13");

    btnRefresh = new JButton("Refresh");
    btnRefresh.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent e) {
            if (btnRefresh.isEnabled()) {
              onRefreshClicked();
            }
          }
        });
    btnRefresh.setEnabled(false);
    this.add(btnRefresh, "7, 13");

    JLabel lblSell = new JLabel("Sell:");
    this.add(lblSell, "3, 15");
    this.add(lblBid, "5, 15");

    sellListModel = new DefaultListModel();

    bidListModel = new DefaultListModel();

    scrollPane_4 = new JScrollPane();
    add(scrollPane_4, "3, 17, fill, fill");
    sellList = new JList(sellListModel);
    sellList.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent e) {
            if (sellList.isEnabled()) {
              // onSellListSelectionChanged();
            }
          }
        });
    scrollPane_4.setViewportView(sellList);
    sellList.addListSelectionListener(
        new ListSelectionListener() {
          public void valueChanged(ListSelectionEvent arg0) {
            if (sellList.isEnabled()) {
              onSellListSelectionChanged();
            }
          }
        });
    sellList.setEnabled(false);
    sellList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    scrollPane_3 = new JScrollPane();
    add(scrollPane_3, "5, 17, fill, fill");
    bidList = new JList(bidListModel);
    bidList.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent e) {
            if (bidList.isEnabled()) {
              // onBidListSelectionChanged();
            }
          }
        });
    scrollPane_3.setViewportView(bidList);
    bidList.addListSelectionListener(
        new ListSelectionListener() {
          public void valueChanged(ListSelectionEvent e) {
            if (bidList.isEnabled()) {
              onBidListSelectionChanged();
            }
          }
        });
    bidList.setEnabled(false);
    bidList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    scrollPane_2 = new JScrollPane();
    add(scrollPane_2, "3, 19, fill, fill");

    sellAuctionDescription = new JTextArea();
    scrollPane_2.setViewportView(sellAuctionDescription);
    sellAuctionDescription.setLineWrap(true);
    sellAuctionDescription.setWrapStyleWord(true);
    sellAuctionDescription.setEditable(false);

    scrollPane_1 = new JScrollPane();
    add(scrollPane_1, "5, 19, fill, fill");

    bidAuctionDescription = new JTextArea();
    scrollPane_1.setViewportView(bidAuctionDescription);
    bidAuctionDescription.setLineWrap(true);
    bidAuctionDescription.setWrapStyleWord(true);
    bidAuctionDescription.setEditable(false);

    JLabel lblSellerCommands = new JLabel("Seller Commands");
    this.add(lblSellerCommands, "3, 21");

    btnCreateNewAuction = new JButton("New Auction");
    btnCreateNewAuction.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent e) {
            if (btnCreateNewAuction.isEnabled()) {
              onCreateNewAuctionClicked();
            }
          }
        });
    btnCreateNewAuction.setEnabled(false);
    btnCreateNewAuction.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {}
        });
    this.add(btnCreateNewAuction, "3, 23");

    txtDescription = new JTextField();
    txtDescription.setEnabled(false);
    txtDescription.setText("Description");
    this.add(txtDescription, "5, 23, fill, default");
    txtDescription.setColumns(10);

    txtStartingPrice = new JTextField();
    txtStartingPrice.setEnabled(false);
    txtStartingPrice.setText("Starting Price");
    this.add(txtStartingPrice, "7, 23, fill, default");
    txtStartingPrice.setColumns(10);

    btnSellItem = new JButton("Sell Item");
    btnSellItem.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent e) {
            if (btnSellItem.isEnabled()) {
              onSellItemClick();
            }
          }
        });
    btnSellItem.setEnabled(false);
    this.add(btnSellItem, "3, 25");

    JLabel lblBidderCommands = new JLabel("Bidder Commands");
    this.add(lblBidderCommands, "3, 29");

    btnBid = new JButton("Bid");
    btnBid.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent e) {
            if (btnBid.isEnabled()) {
              onBidClicked();
            }
          }
        });
    btnBid.setEnabled(false);
    this.add(btnBid, "3, 31");

    txtBidPrice = new JTextField();
    txtBidPrice.setEnabled(false);
    txtBidPrice.setText("Bid Price");
    this.add(txtBidPrice, "5, 31, fill, default");
    txtBidPrice.setColumns(10);

    JScrollPane scrollPane = new JScrollPane();
    add(scrollPane, "3, 35, 5, 1, fill, fill");

    infoBox = new JTextArea();
    infoBox.setEditable(false);
    scrollPane.setViewportView(infoBox);
    infoBox.setText("Welcome to Auction Client 1.0");

    this.setVisible(true);
  }
Example #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
  }
Example #30
0
  /** Main function for building the merge entry JPanel */
  private void initialize() {

    joint = new TreeSet<>(one.getFieldNames());
    joint.addAll(two.getFieldNames());

    // Remove field starting with __
    TreeSet<String> toberemoved = new TreeSet<>();
    for (String field : joint) {
      if (field.startsWith("__")) {
        toberemoved.add(field);
      }
    }

    for (String field : toberemoved) {
      joint.remove(field);
    }

    // Create storage arrays
    rb = new JRadioButton[3][joint.size() + 1];
    ButtonGroup[] rbg = new ButtonGroup[joint.size() + 1];
    identical = new Boolean[joint.size() + 1];
    jointStrings = new String[joint.size()];

    // Create main layout
    String colSpecMain =
        "left:pref, 5px, center:3cm:grow, 5px, center:pref, 3px, center:pref, 3px, center:pref, 5px, center:3cm:grow";
    String colSpecMerge =
        "left:pref, 5px, fill:3cm:grow, 5px, center:pref, 3px, center:pref, 3px, center:pref, 5px, fill:3cm:grow";
    String rowSpec = "pref, pref, 10px, fill:5cm:grow, 10px, pref, 10px, fill:3cm:grow";
    StringBuilder rowBuilder = new StringBuilder("");
    for (int i = 0; i < joint.size(); i++) {
      rowBuilder.append("pref, ");
    }
    rowBuilder.append("pref");

    FormLayout mainLayout = new FormLayout(colSpecMain, rowSpec);
    FormLayout mergeLayout = new FormLayout(colSpecMerge, rowBuilder.toString());
    mainPanel.setLayout(mainLayout);
    mergePanel.setLayout(mergeLayout);

    JLabel label = new JLabel(Localization.lang("Use"));
    Font font = label.getFont();
    label.setFont(font.deriveFont(font.getStyle() | Font.BOLD));

    mainPanel.add(label, cc.xyw(4, 1, 7, "center, bottom"));

    // Set headings
    JLabel headingLabels[] = new JLabel[6];
    for (int i = 0; i < 6; i++) {
      headingLabels[i] = new JLabel(columnHeadings[i]);
      font = headingLabels[i].getFont();
      headingLabels[i].setFont(font.deriveFont(font.getStyle() | Font.BOLD));
      mainPanel.add(headingLabels[i], cc.xy(1 + (i * 2), 2));
    }

    mainPanel.add(new JSeparator(), cc.xyw(1, 3, 11));

    // Start with entry type
    EntryType type1 = one.getType();
    EntryType type2 = two.getType();

    mergedEntry.setType(type1);
    label = new JLabel(Localization.lang("Entry type"));
    font = label.getFont();
    label.setFont(font.deriveFont(font.getStyle() | Font.BOLD));
    mergePanel.add(label, cc.xy(1, 1));

    JTextArea type1ta = new JTextArea(type1.getName());
    type1ta.setEditable(false);
    mergePanel.add(type1ta, cc.xy(3, 1));
    if (type1.compareTo(type2) != 0) {
      identical[0] = false;
      rbg[0] = new ButtonGroup();
      for (int k = 0; k < 3; k += 2) {
        rb[k][0] = new JRadioButton();
        rbg[0].add(rb[k][0]);
        mergePanel.add(rb[k][0], cc.xy(5 + (k * 2), 1));
        rb[k][0].addChangeListener(
            new ChangeListener() {

              @Override
              public void stateChanged(ChangeEvent e) {
                updateAll();
              }
            });
      }
      rb[0][0].setSelected(true);
    } else {
      identical[0] = true;
    }
    JTextArea type2ta = new JTextArea(type2.getName());
    type2ta.setEditable(false);
    mergePanel.add(type2ta, cc.xy(11, 1));

    // For all fields in joint add a row and possibly radio buttons
    int row = 2;
    int maxLabelWidth = -1;
    int tmpLabelWidth = 0;
    for (String field : joint) {
      jointStrings[row - 2] = field;
      label = new JLabel(CaseChangers.UPPER_FIRST.format(field));
      font = label.getFont();
      label.setFont(font.deriveFont(font.getStyle() | Font.BOLD));
      mergePanel.add(label, cc.xy(1, row));
      String string1 = one.getField(field);
      String string2 = two.getField(field);
      identical[row - 1] = false;
      if ((string1 != null) && (string2 != null)) {
        if (string1.equals(string2)) {
          identical[row - 1] = true;
        }
      }

      tmpLabelWidth = label.getPreferredSize().width;
      if (tmpLabelWidth > maxLabelWidth) {
        maxLabelWidth = tmpLabelWidth;
      }

      if ("abstract".equals(field) || "review".equals(field)) {
        // Treat the abstract and review fields special
        JTextArea tf = new JTextArea();
        tf.setLineWrap(true);
        tf.setEditable(false);
        JScrollPane jsptf = new JScrollPane(tf);

        mergeLayout.setRowSpec(row, RowSpec.decode("center:2cm:grow"));
        mergePanel.add(jsptf, cc.xy(3, row, "f, f"));
        tf.setText(string1);
        tf.setCaretPosition(0);

      } else {
        JTextArea tf = new JTextArea(string1);
        mergePanel.add(tf, cc.xy(3, row));
        tf.setCaretPosition(0);
        tf.setEditable(false);
      }

      // Add radio buttons if the two entries do not have identical fields
      if (!identical[row - 1]) {
        rbg[row - 1] = new ButtonGroup();
        for (int k = 0; k < 3; k++) {
          rb[k][row - 1] = new JRadioButton();
          rbg[row - 1].add(rb[k][row - 1]);
          mergePanel.add(rb[k][row - 1], cc.xy(5 + (k * 2), row));
          rb[k][row - 1].addChangeListener(
              new ChangeListener() {

                @Override
                public void stateChanged(ChangeEvent e) {
                  updateAll();
                }
              });
        }
        if (string1 != null) {
          mergedEntry.setField(field, string1);
          rb[0][row - 1].setSelected(true);
          if (string2 == null) {
            rb[2][row - 1].setEnabled(false);
          }
        } else {
          rb[0][row - 1].setEnabled(false);
          mergedEntry.setField(field, string2);
          rb[2][row - 1].setSelected(true);
        }
      } else {
        mergedEntry.setField(field, string1);
      }
      if ("abstract".equals(field) || "review".equals(field)) {
        // Again, treat abstract and review special
        JTextArea tf = new JTextArea();
        tf.setLineWrap(true);
        tf.setEditable(false);
        JScrollPane jsptf = new JScrollPane(tf);

        mergePanel.add(jsptf, cc.xy(11, row, "f, f"));
        tf.setText(string2);
        tf.setCaretPosition(0);

      } else {
        JTextArea tf = new JTextArea(string2);
        mergePanel.add(tf, cc.xy(11, row));
        tf.setCaretPosition(0);
        tf.setEditable(false);
      }

      row++;
    }

    JScrollPane scrollPane =
        new JScrollPane(
            mergePanel,
            JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    scrollPane.setBorder(BorderFactory.createEmptyBorder());
    mainPanel.add(scrollPane, cc.xyw(1, 4, 11));
    mainPanel.add(new JSeparator(), cc.xyw(1, 5, 11));

    // Synchronize column widths
    String rbAlign[] = {"right", "center", "left"};
    mainLayout.setColumnSpec(1, ColumnSpec.decode(Integer.toString(maxLabelWidth) + "px"));
    Integer maxRBWidth = -1;
    Integer tmpRBWidth;
    for (int k = 0; k < 3; k++) {
      tmpRBWidth = headingLabels[k + 2].getPreferredSize().width;
      if (tmpRBWidth > maxRBWidth) {
        maxRBWidth = tmpRBWidth;
      }
    }
    for (int k = 0; k < 3; k++) {
      mergeLayout.setColumnSpec(
          5 + (k * 2), ColumnSpec.decode(rbAlign[k] + ":" + maxRBWidth + "px"));
    }

    // Setup a PreviewPanel and a Bibtex source box for the merged entry
    label = new JLabel(Localization.lang("Merged entry"));
    font = label.getFont();
    label.setFont(font.deriveFont(font.getStyle() | Font.BOLD));
    mainPanel.add(label, cc.xyw(1, 6, 6));

    String layoutString = Globals.prefs.get(JabRefPreferences.PREVIEW_0);
    pp = new PreviewPanel(null, mergedEntry, null, new MetaData(), layoutString);
    // JScrollPane jsppp = new JScrollPane(pp, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
    // JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    mainPanel.add(pp, cc.xyw(1, 8, 6));

    label = new JLabel(Localization.lang("Merged BibTeX source code"));
    font = label.getFont();
    label.setFont(font.deriveFont(font.getStyle() | Font.BOLD));
    mainPanel.add(label, cc.xyw(8, 6, 4));

    jta = new JTextArea();
    jta.setLineWrap(true);
    JScrollPane jspta = new JScrollPane(jta);
    mainPanel.add(jspta, cc.xyw(8, 8, 4));
    jta.setEditable(false);
    StringWriter sw = new StringWriter();
    try {
      new BibtexEntryWriter(new LatexFieldFormatter(), false).write(mergedEntry, sw);
    } catch (IOException ex) {
      LOGGER.error("Error in entry" + ": " + ex.getMessage(), ex);
    }
    jta.setText(sw.getBuffer().toString());
    jta.setCaretPosition(0);

    // Add some margin around the layout
    mainLayout.appendRow(RowSpec.decode("10px"));
    mainLayout.appendColumn(ColumnSpec.decode("10px"));
    mainLayout.insertRow(1, RowSpec.decode("10px"));
    mainLayout.insertColumn(1, ColumnSpec.decode("10px"));

    if (mainPanel.getHeight() > DIM.height) {
      mainPanel.setSize(new Dimension(mergePanel.getWidth(), DIM.height));
    }
    if (mainPanel.getWidth() > DIM.width) {
      mainPanel.setSize(new Dimension(DIM.width, mergePanel.getHeight()));
    }

    // Everything done, allow any action to actually update the merged entry
    doneBuilding = true;

    // Show what we've got
    mainPanel.setVisible(true);
    javax.swing.SwingUtilities.invokeLater(
        new Runnable() {
          @Override
          public void run() {
            scrollPane.getVerticalScrollBar().setValue(0);
          }
        });
  }