示例#1
0
 /** Brings up the dialog to choose the photo to upload. */
 private void uploadPicture() {
   UploadPictureDialog d =
       new UploadPictureDialog(MetadataViewerAgent.getRegistry().getTaskBar().getFrame());
   d.addPropertyChangeListener(this);
   d.pack();
   UIUtilities.centerAndShow(d);
 }
示例#2
0
 /** Brings up a preview of the image or images to save. */
 void previewImage() {
   ImgSaverPreviewer preview = new ImgSaverPreviewer(this);
   setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
   createImages(uiDelegate.getSavingType());
   setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
   preview.initialize();
   UIUtilities.centerAndShow(preview);
 }
示例#3
0
 /** Brings up the server dialog to select an existing server or enter a new server address. */
 private void config() {
   ServerDialog d;
   String s = serverText.getText().trim();
   if (connectionSpeed) d = new ServerDialog(this, editor, s, speedIndex);
   else d = new ServerDialog(this, editor, s);
   if (editor.getRowCount() == 0 && configureServerName != null)
     editor.addRow(configureServerName);
   d.addPropertyChangeListener(this);
   UIUtilities.centerAndShow(d);
 }
 /** Launches a dialog to select the file to attach to the <code>DataObject</code>. */
 private void selectFileToAttach() {
   JFrame owner = MetadataViewerAgent.getRegistry().getTaskBar().getFrame();
   FileChooser chooser =
       new FileChooser(
           owner, FileChooser.LOAD, "Choose File", "Select the file to attach.", filters, true);
   chooser.setMultiSelectionEnabled(true);
   IconManager icons = IconManager.getInstance();
   chooser.setTitleIcon(icons.getIcon(IconManager.ATTACHMENT_48));
   chooser.setApproveButtonText("Attach");
   chooser.addPropertyChangeListener(FileChooser.APPROVE_SELECTION_PROPERTY, this);
   UIUtilities.centerAndShow(chooser);
 }
    /**
     * Opens a dialog box for users to choose a local file.
     *
     * @see ActionListener#actionPerformed(ActionEvent)
     */
    public void actionPerformed(ActionEvent e) {
      List<FileFilter> filters;
      filters = new ArrayList<FileFilter>();
      filters.add(new EditorFileFilter());

      FileChooser chooser =
          new FileChooser(
              null, FileChooser.LOAD, "Open File", "Choose a file to open in the Editor", filters);
      chooser.addPropertyChangeListener(
          FileChooser.APPROVE_SELECTION_PROPERTY, ProtocolLinkEditor.this);
      UIUtilities.centerAndShow(chooser);
    }
示例#6
0
  /**
   * Notifies that the image has been saved locally.
   *
   * @param name The path to the local file.
   */
  private void notifySave(String name) {
    NotificationDialog dialog =
        new NotificationDialog(this, "Save Image", getSaveMessage(name), true);
    dialog.addPropertyChangeListener(
        new PropertyChangeListener() {

          /** Opens the image with default viewer. */
          public void propertyChange(PropertyChangeEvent evt) {
            if (NotificationDialog.HYPERLINK_OPEN_PROPERTY.equals(evt.getPropertyName())) {
              UserNotifier un = ImViewerAgent.getRegistry().getUserNotifier();
              un.openApplication(null, (String) evt.getNewValue());
            }
          }
        });
    dialog.pack();
    UIUtilities.centerAndShow(dialog);
  }