Example usage for java.beans PropertyChangeEvent getSource

List of usage examples for java.beans PropertyChangeEvent getSource

Introduction

In this page you can find the example usage for java.beans PropertyChangeEvent getSource.

Prototype

public Object getSource() 

Source Link

Document

The object on which the Event initially occurred.

Usage

From source file:org.tinymediamanager.ui.movies.MovieExtendedSearchPanel.java

/**
 * Instantiates a new movie extended search
 * /*from   w  w w  .ja v  a2s. c o  m*/
 * @param model
 *          the model
 */
public MovieExtendedSearchPanel(MovieSelectionModel model) {
    super();
    setOpaque(false);
    shadowAlpha = 100;
    arcs = new Dimension(10, 10);

    this.movieSelectionModel = model;
    Map<MovieSearchOptions, Object> savedSearchOptions = MovieModuleManager.MOVIE_SETTINGS.getUiFilters();

    // add a dummy mouse listener to prevent clicking through
    addMouseListener(new MouseAdapter() {
    });

    listCheckListener = new ListCheckListener() {
        @Override
        public void removeCheck(ListEvent event) {
            actionFilter.actionPerformed(new ActionEvent(event.getSource(), 1, "checked"));
        }

        @Override
        public void addCheck(ListEvent event) {
            actionFilter.actionPerformed(new ActionEvent(event.getSource(), 1, "checked"));
        }
    };

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

    JLabel lblFilterBy = new JLabel(BUNDLE.getString("movieextendedsearch.filterby")); //$NON-NLS-1$
    setComponentFont(lblFilterBy);
    add(lblFilterBy, "2, 2, 3, 1");

    cbFilterNewMovies = new JCheckBox("");
    cbFilterNewMovies.setUI(CHECKBOX_UI); // $hide$
    cbFilterNewMovies.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.NEW_MOVIES));
    cbFilterNewMovies.setAction(actionFilter);
    add(cbFilterNewMovies, "2, 4");

    lblNewMovies = new JLabel(BUNDLE.getString("movieextendedsearch.newmovies")); //$NON-NLS-1$
    setComponentFont(lblNewMovies);
    add(lblNewMovies, "4, 4, right, default");

    cbFilterDuplicates = new JCheckBox("");
    cbFilterDuplicates.setUI(CHECKBOX_UI); // $hide$
    cbFilterDuplicates.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.DUPLICATES));
    cbFilterDuplicates.setAction(actionFilter);
    add(cbFilterDuplicates, "2, 5");

    JLabel lblShowDuplicates = new JLabel(BUNDLE.getString("movieextendedsearch.duplicates")); //$NON-NLS-1$
    setComponentFont(lblShowDuplicates);
    add(lblShowDuplicates, "4, 5, right, default");

    cbFilterWatched = new JCheckBox("");
    cbFilterWatched.setUI(CHECKBOX_UI); // $hide$
    cbFilterWatched.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.WATCHED));
    cbFilterWatched.setAction(actionFilter);
    add(cbFilterWatched, "2, 6");

    JLabel lblWatchedFlag = new JLabel(BUNDLE.getString("movieextendedsearch.watched")); //$NON-NLS-1$
    setComponentFont(lblWatchedFlag);
    add(lblWatchedFlag, "4, 6, right, default");

    cbWatched = new SmallComboBox(WatchedFlag.values());
    setComponentFont(cbWatched);
    cbWatched.setAction(actionFilter);
    add(cbWatched, "6, 6, fill, default");

    cbFilterGenre = new JCheckBox("");
    cbFilterGenre.setUI(CHECKBOX_UI); // $hide$
    cbFilterGenre.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.GENRE));
    cbFilterGenre.setAction(actionFilter);
    add(cbFilterGenre, "2, 7");

    JLabel lblGenre = new JLabel(BUNDLE.getString("movieextendedsearch.genre")); //$NON-NLS-1$
    setComponentFont(lblGenre);
    add(lblGenre, "4, 7, right, default");

    cbGenre = new SmallComboBox(MediaGenres.values());
    setComponentFont(cbGenre);
    cbGenre.setAction(actionFilter);
    add(cbGenre, "6, 7, fill, default");

    cbFilterCertification = new JCheckBox("");
    cbFilterCertification.setUI(CHECKBOX_UI); // $hide$
    cbFilterCertification.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.CERTIFICATION));
    cbFilterCertification.setAction(actionFilter);
    add(cbFilterCertification, "2, 8");

    lblCertification = new JLabel(BUNDLE.getString("metatag.certification")); //$NON-NLS-1$
    setComponentFont(lblCertification);
    add(lblCertification, "4, 8, right, default");

    cbCertification = new SmallComboBox();
    setComponentFont(cbCertification);
    cbCertification.setAction(actionFilter);
    add(cbCertification, "6, 8, fill, default");

    cbFilterYear = new JCheckBox("");
    cbFilterYear.setUI(CHECKBOX_UI); // $hide$
    cbFilterYear.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.YEAR));
    cbFilterYear.setAction(actionFilter);
    add(cbFilterYear, "2, 9");

    lblYear = new JLabel(BUNDLE.getString("metatag.year")); //$NON-NLS-1$
    setComponentFont(lblYear);
    add(lblYear, "4, 9, right, default");

    int year = Calendar.getInstance().get(Calendar.YEAR);
    spYear = new JSpinner();
    setComponentFont(spYear);
    spYear.setUI(new SmallSpinnerUI());// $hide$
    spYear.setModel(new SpinnerNumberModel(year, 0, 3000, 1));
    spYear.setEditor(new JSpinner.NumberEditor(spYear, "#"));
    spYear.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            actionFilter.actionPerformed(null);
        }
    });
    add(spYear, "6, 9");

    cbFilterCast = new JCheckBox("");
    cbFilterCast.setUI(CHECKBOX_UI); // $hide$
    cbFilterCast.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.CAST));
    cbFilterCast.setAction(actionFilter);
    add(cbFilterCast, "2, 10");

    JLabel lblCastMember = new JLabel(BUNDLE.getString("movieextendedsearch.cast")); //$NON-NLS-1$
    setComponentFont(lblCastMember);
    add(lblCastMember, "4, 10, right, default");

    tfCastMember = new JTextField();
    setComponentFont(tfCastMember);
    tfCastMember.setBorder(new SmallTextFieldBorder());
    add(tfCastMember, "6, 10, fill, default");
    tfCastMember.setColumns(10);
    tfCastMember.getDocument().addDocumentListener(new DocumentListener() {
        public void changedUpdate(DocumentEvent e) {
            actionFilter.actionPerformed(null);
        }

        public void insertUpdate(DocumentEvent e) {
            actionFilter.actionPerformed(null);
        }

        public void removeUpdate(DocumentEvent e) {
            actionFilter.actionPerformed(null);
        }
    });

    cbFilterTag = new JCheckBox("");
    cbFilterTag.setUI(CHECKBOX_UI); // $hide$
    cbFilterTag.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.TAG));
    cbFilterTag.setAction(actionFilter);
    add(cbFilterTag, "2, 11");

    JLabel lblTag = new JLabel(BUNDLE.getString("movieextendedsearch.tag")); //$NON-NLS-1$
    setComponentFont(lblTag);
    add(lblTag, "4, 11, right, default");

    cbTag = new SmallCheckComboBox();
    cbTag.setTextFor(CheckComboBox.NONE, BUNDLE.getString("movieextendedsearch.tags.selected.none")); //$NON-NLS-1$
    cbTag.setTextFor(CheckComboBox.MULTIPLE, BUNDLE.getString("movieextendedsearch.tags.selected.multiple")); //$NON-NLS-1$
    cbTag.setTextFor(CheckComboBox.ALL, BUNDLE.getString("movieextendedsearch.tags.selected.all")); //$NON-NLS-1$
    cbTag.getModel().addListCheckListener(listCheckListener);
    add(cbTag, "6, 11, fill, default");

    cbFilterMovieset = new JCheckBox("");
    cbFilterMovieset.setUI(CHECKBOX_UI); // $hide$
    cbFilterMovieset.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.MOVIESET));
    cbFilterMovieset.setAction(actionFilter);
    add(cbFilterMovieset, "2, 12");

    JLabel lblMoviesInMovieset = new JLabel(BUNDLE.getString("movieextendedsearch.movieset")); //$NON-NLS-1$
    setComponentFont(lblMoviesInMovieset);
    add(lblMoviesInMovieset, "4, 12, right, default");

    cbMovieset = new SmallComboBox(MovieInMovieSet.values());
    setComponentFont(cbMovieset);
    cbMovieset.setAction(actionFilter);
    add(cbMovieset, "6, 12, fill, default");

    cbFilterVideoFormat = new JCheckBox("");
    cbFilterVideoFormat.setUI(CHECKBOX_UI); // $hide$
    cbFilterVideoFormat.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.VIDEO_FORMAT));
    cbFilterVideoFormat.setAction(actionFilter);
    add(cbFilterVideoFormat, "2, 13");

    JLabel lblVideoFormat = new JLabel(BUNDLE.getString("metatag.resolution")); //$NON-NLS-1$
    setComponentFont(lblVideoFormat);
    add(lblVideoFormat, "4, 13, right, default");

    cbVideoFormat = new SmallComboBox(getVideoFormats());
    setComponentFont(cbVideoFormat);
    cbVideoFormat.setAction(actionFilter);
    add(cbVideoFormat, "6, 13, fill, default");

    cbFilterVideoCodec = new JCheckBox("");
    cbFilterVideoCodec.setUI(CHECKBOX_UI); // $hide$
    cbFilterVideoCodec.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.VIDEO_CODEC));
    cbFilterVideoCodec.setAction(actionFilter);
    add(cbFilterVideoCodec, "2, 14");

    JLabel lblVideoCodec = new JLabel(BUNDLE.getString("metatag.videocodec")); //$NON-NLS-1$
    setComponentFont(lblVideoCodec);
    add(lblVideoCodec, "4, 14, right, default");

    cbVideoCodec = new SmallComboBox();
    setComponentFont(cbVideoCodec);
    cbVideoCodec.setAction(actionFilter);
    add(cbVideoCodec, "6, 14, fill, default");

    cbFilterVideo3D = new JCheckBox("");
    cbFilterVideo3D.setUI(CHECKBOX_UI); // $hide$
    cbFilterVideo3D.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.VIDEO_3D));
    cbFilterVideo3D.addActionListener(actionFilter);
    add(cbFilterVideo3D, "2, 15");

    JLabel lblVideo3D = new JLabel(BUNDLE.getString("metatag.3d")); //$NON-NLS-1$
    setComponentFont(lblVideo3D);
    add(lblVideo3D, "4, 15, right, default");

    cbFilterAudioCodec = new JCheckBox("");
    cbFilterAudioCodec.setUI(CHECKBOX_UI); // $hide$
    cbFilterAudioCodec.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.AUDIO_CODEC));
    cbFilterAudioCodec.setAction(actionFilter);
    add(cbFilterAudioCodec, "2, 16");

    JLabel lblAudioCodec = new JLabel(BUNDLE.getString("metatag.audiocodec")); //$NON-NLS-1$
    setComponentFont(lblAudioCodec);
    add(lblAudioCodec, "4, 16, right, default");

    cbAudioCodec = new SmallComboBox();
    setComponentFont(cbAudioCodec);
    cbAudioCodec.setAction(actionFilter);
    add(cbAudioCodec, "6, 16, fill, default");

    cbFilterDatasource = new JCheckBox("");
    cbFilterDatasource.setUI(CHECKBOX_UI); // $hide$
    cbFilterDatasource.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.DATASOURCE));
    cbFilterDatasource.setAction(actionFilter);
    add(cbFilterDatasource, "2, 17");

    JLabel lblDatasource = new JLabel(BUNDLE.getString("metatag.datasource")); //$NON-NLS-1$
    setComponentFont(lblDatasource);
    add(lblDatasource, "4, 17, right, default");

    cbDatasource = new SmallCheckComboBox();
    cbDatasource.setTextFor(CheckComboBox.NONE, BUNDLE.getString("checkcombobox.selected.none")); //$NON-NLS-1$
    cbDatasource.setTextFor(CheckComboBox.MULTIPLE, BUNDLE.getString("checkcombobox.selected.multiple")); //$NON-NLS-1$
    cbDatasource.setTextFor(CheckComboBox.ALL, BUNDLE.getString("checkcombobox.selected.all")); //$NON-NLS-1$
    cbDatasource.getModel().addListCheckListener(listCheckListener);
    add(cbDatasource, "6, 17, fill, default");

    cbFilterMediaSource = new JCheckBox("");
    cbFilterMediaSource.setUI(CHECKBOX_UI); // $hide$
    cbFilterMediaSource.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.MEDIA_SOURCE));
    cbFilterMediaSource.addActionListener(actionFilter);
    add(cbFilterMediaSource, "2, 18");

    JLabel lblMediaSource = new JLabel(BUNDLE.getString("metatag.source")); //$NON-NLS-1$
    setComponentFont(lblMediaSource);
    add(lblMediaSource, "4, 18, right, default");

    cbMediaSource = new SmallComboBox(MediaSource.values());
    setComponentFont(cbMediaSource);
    cbMediaSource.setAction(actionFilter);
    add(cbMediaSource, "6, 18, fill, default");

    cbFilterMissingMetadata = new JCheckBox("");
    cbFilterMissingMetadata.setUI(CHECKBOX_UI); // $hide$
    cbFilterMissingMetadata.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.MISSING_METADATA));
    cbFilterMissingMetadata.setAction(actionFilter);
    add(cbFilterMissingMetadata, "2, 19");

    JLabel lblMissingMetadata = new JLabel(BUNDLE.getString("movieextendedsearch.missingmetadata")); //$NON-NLS-1$
    setComponentFont(lblMissingMetadata);
    add(lblMissingMetadata, "4, 19, right, default");

    cbFilterMissingArtwork = new JCheckBox("");
    cbFilterMissingArtwork.setUI(CHECKBOX_UI); // $hide$
    cbFilterMissingArtwork.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.MISSING_ARTWORK));
    cbFilterMissingArtwork.setAction(actionFilter);
    add(cbFilterMissingArtwork, "2, 20");

    JLabel lblMissingArtwork = new JLabel(BUNDLE.getString("movieextendedsearch.missingartwork")); //$NON-NLS-1$
    setComponentFont(lblMissingArtwork);
    add(lblMissingArtwork, "4, 20, right, default");

    cbFilterMissingSubtitles = new JCheckBox("");
    cbFilterMissingSubtitles.setUI(CHECKBOX_UI); // $hide$
    cbFilterMissingSubtitles.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.MISSING_SUBTITLES));
    cbFilterMissingSubtitles.setAction(actionFilter);
    add(cbFilterMissingSubtitles, "2, 21");

    JLabel lblMissingSubtitles = new JLabel(BUNDLE.getString("movieextendedsearch.missingsubtitles")); //$NON-NLS-1$
    setComponentFont(lblMissingSubtitles);
    add(lblMissingSubtitles, "4, 21, right, default");

    cbFilterOffline = new JCheckBox("");
    cbFilterOffline.setUI(CHECKBOX_UI); // $hide$
    cbFilterOffline.setSelected(savedSearchOptions.containsKey(MovieSearchOptions.OFFLINE));
    cbFilterOffline.setAction(actionFilter);
    add(cbFilterOffline, "2, 22");

    lblOffline = new JLabel(BUNDLE.getString("movieextendedsearch.offline")); //$NON-NLS-1$
    setComponentFont(lblOffline);
    add(lblOffline, "4, 22, right, default");

    cbOffline = new SmallComboBox(OfflineMovie.values());
    cbOffline.setAction(actionFilter);
    add(cbOffline, "6, 22, fill, default");

    JSeparator separator = new JSeparator();
    add(separator, "2, 24, 5, 1");

    JLabel lblSortBy = new JLabel(BUNDLE.getString("movieextendedsearch.sortby")); //$NON-NLS-1$
    setComponentFont(lblSortBy);
    add(lblSortBy, "2, 26, 3, 1");

    cbSortColumn = new SmallComboBox(SortColumn.values());
    setComponentFont(cbSortColumn);
    cbSortColumn.setAction(actionSort);
    add(cbSortColumn, "2, 28, 3, 1, fill, default");

    cbSortOrder = new SmallComboBox(SortOrder.values());
    setComponentFont(cbSortOrder);
    cbSortOrder.setAction(actionSort);
    add(cbSortOrder, "6, 28, fill, default");

    PropertyChangeListener propertyChangeListener = new PropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            if (evt.getSource() instanceof MovieList && "tag".equals(evt.getPropertyName())) {
                buildAndInstallTagsArray();
            }
            if (evt.getSource() instanceof MovieList && "videoCodec".equals(evt.getPropertyName())) {
                buildAndInstallCodecArray();
            }
            if (evt.getSource() instanceof MovieList && "audioCodec".equals(evt.getPropertyName())) {
                buildAndInstallCodecArray();
            }
            if (evt.getSource() instanceof MovieSettings && "movieDataSource".equals(evt.getPropertyName())) {
                buildAndInstallDatasourceArray();
            }
            if (evt.getSource() instanceof MovieList && "certification".equals(evt.getPropertyName())) {
                buildAndInstallCertificationArray();
            }
        }
    };
    movieList.addPropertyChangeListener(propertyChangeListener);
    MovieModuleManager.MOVIE_SETTINGS.addPropertyChangeListener(propertyChangeListener);
    buildAndInstallTagsArray();
    buildAndInstallCodecArray();
    buildAndInstallDatasourceArray();
    buildAndInstallCertificationArray();
}

From source file:org.eclipsetrader.directa.internal.core.connector.StreamingConnector.java

@Override
public void propertyChange(PropertyChangeEvent evt) {
    if (evt.getSource() instanceof IFeedIdentifier) {
        IFeedIdentifier identifier = (IFeedIdentifier) evt.getSource();
        synchronized (symbolSubscriptions) {
            for (FeedSubscription subscription : symbolSubscriptions.values()) {
                if (subscription.getIdentifier() == identifier) {
                    symbolSubscriptions.remove(subscription.getIdentifierType().getSymbol());
                    IdentifierType identifierType = IdentifiersList.getInstance().getIdentifierFor(identifier);
                    subscription.setIdentifierType(identifierType);
                    symbolSubscriptions.put(identifierType.getSymbol(), subscription);
                    subscriptionsChanged = true;
                    break;
                }/*  ww  w.j ava  2  s .  c om*/
            }
        }
    }
}

From source file:org.jitsi.videobridge.ConferenceSpeechActivity.java

/**
 * Notifies this instance that there was a change in the value of a property
 * of an object in which this instance is interested.
 *
 * @param ev a <tt>PropertyChangeEvent</tt> which specifies the object of
 * interest, the name of the property and the old and new values of that
 * property//from  www . j  a  v a 2  s.  c o m
 */
@Override
public void propertyChange(PropertyChangeEvent ev) {
    // Cease to execute as soon as the Conference expires.
    Conference conference = getConference();

    if ((conference == null) || conference.isExpired())
        return;

    String propertyName = ev.getPropertyName();

    if (Conference.ENDPOINTS_PROPERTY_NAME.equals(propertyName)) {
        if (conference.equals(ev.getSource())) {
            synchronized (syncRoot) {
                endpointsChanged = true;
                maybeStartEventDispatcher();
            }
        }
    } else if (DominantSpeakerIdentification.DOMINANT_SPEAKER_PROPERTY_NAME.equals(propertyName)) {
        DominantSpeakerIdentification dominantSpeakerIdentification = this.dominantSpeakerIdentification;

        if ((dominantSpeakerIdentification != null) && dominantSpeakerIdentification.equals(ev.getSource())) {
            // TODO Auto-generated method stub
        }
    }
}

From source file:edu.ku.brc.specify.tasks.subpane.wb.ImageFrame.java

public void propertyChange(PropertyChangeEvent evt) {
    if (evt.getPropertyName().equals("alwaysOnTop") && evt.getSource() == this) {
        // the alwaysOnTop bahavior of the window changed... update the menu item
        alwaysOnTopMI.setSelected(this.isAlwaysOnTop());
    }//from   w ww.j a va 2s .  com
}

From source file:dk.dma.epd.common.prototype.gui.route.RoutePropertiesDialogCommon.java

/** 
 * Called when one of the arrival and departure pickers changes value
 * @param evt the event/*w  w w.  j  a  v  a 2s  .  c  o m*/
 */
@Override
public void propertyChange(PropertyChangeEvent evt) {
    // Check if we are in a quiescent state
    if (quiescent) {
        return;
    }

    if (evt.getSource() == departurePicker) {
        Date date = ParseUtils.combineDateTime(departurePicker.getDate(), (Date) departureSpinner.getValue());
        route.setStarttime(date);
        adjustStartTime();
    } else if (evt.getSource() == arrivalPicker) {
        Date date = ParseUtils.combineDateTime(arrivalPicker.getDate(), (Date) arrivalSpinner.getValue());
        recalculateSpeeds(date);
    } else {
        return;
    }

    routeUpdated();
}

From source file:ome.formats.importer.gui.GuiImporter.java

/**
 * Display errors in import dialog /* w w w  .  jav a 2s.c  om*/
 * 
 * @param frame - parent frame
 */
private void importErrorsCollected(Component frame) {
    final JOptionPane optionPane = new JOptionPane(
            "\nYour import has produced one or more errors, " + "\nvisit the 'Import Errors' tab for details.",
            JOptionPane.WARNING_MESSAGE);
    final JDialog errorDialog = new JDialog(this, "Errors Collected", false);
    errorDialog.setContentPane(optionPane);

    optionPane.addPropertyChangeListener(new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent e) {
            String prop = e.getPropertyName();

            if (errorDialog.isVisible() && (e.getSource() == optionPane)
                    && (prop.equals(JOptionPane.VALUE_PROPERTY))) {
                errorDialog.dispose();
            }
        }
    });

    errorDialog.toFront();
    errorDialog.pack();
    errorDialog.setLocationRelativeTo(frame);
    errorDialog.setVisible(true);
}

From source file:ome.formats.importer.gui.GuiImporter.java

/**
 * Display errors in candidates dialog/* w  w  w  .j  a  v  a  2s. c om*/
 * 
 * @param frame - parent frame
 */
public void candidateErrorsCollected(Component frame) {
    errors_pending = false;
    final JOptionPane optionPane = new JOptionPane(
            "\nAdding these files to the queue has produced one or more errors and some"
                    + "\n files will not be displayed on the queue. View the 'Import Errors' tab for details.",
            JOptionPane.WARNING_MESSAGE);
    final JDialog errorDialog = new JDialog(this, "Errors Collected", true);
    errorDialog.setContentPane(optionPane);

    optionPane.addPropertyChangeListener(new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent e) {
            String prop = e.getPropertyName();

            if (errorDialog.isVisible() && (e.getSource() == optionPane)
                    && (prop.equals(JOptionPane.VALUE_PROPERTY))) {
                errorDialog.dispose();
            }
        }
    });

    errorDialog.toFront();
    errorDialog.pack();
    errorDialog.setLocationRelativeTo(frame);
    errorDialog.setVisible(true);
}

From source file:ome.formats.importer.gui.GuiImporter.java

/**
 * Display failed sending errors dialog/*from www  . j  av a  2  s . co m*/
 * 
 * @param frame - parent frame
 */
public void sendingErrorsFailed(Component frame) {
    final JOptionPane optionPane = new JOptionPane(
            "\nDue to an error we were not able to send your error messages."
                    + "\nto our feedback server. Please try again.",
            JOptionPane.WARNING_MESSAGE);

    final JDialog failedDialog = new JDialog(this, "Feedback Failed!", true);

    failedDialog.setContentPane(optionPane);

    optionPane.addPropertyChangeListener(new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent e) {
            String prop = e.getPropertyName();

            if (failedDialog.isVisible() && (e.getSource() == optionPane)
                    && (prop.equals(JOptionPane.VALUE_PROPERTY))) {
                failedDialog.dispose();
            }
        }
    });

    failedDialog.toFront();
    failedDialog.pack();
    failedDialog.setLocationRelativeTo(frame);
    failedDialog.setVisible(true);
}

From source file:org.apache.catalina.loader.WebappLoader.java

/**
 * Process property change events from our associated Context.
 *
 * @param event The property change event that has occurred
 *///from www.j a  v  a  2s  . c  o m
public void propertyChange(PropertyChangeEvent event) {

    // Validate the source of this event
    if (!(event.getSource() instanceof Context))
        return;
    Context context = (Context) event.getSource();

    // Process a relevant property change
    if (event.getPropertyName().equals("reloadable")) {
        try {
            setReloadable(((Boolean) event.getNewValue()).booleanValue());
        } catch (NumberFormatException e) {
            log.error(sm.getString("webappLoader.reloadable", event.getNewValue().toString()));
        }
    }

}

From source file:edu.ku.brc.specify.tasks.RecordSetTask.java

public void propertyChange(PropertyChangeEvent evt) {
    if (evt.getSource() instanceof RolloverCommand) {
        RolloverCommand roc = (RolloverCommand) evt.getSource();
        renameRecordSet(roc, (RecordSetIFace) roc.getData(), (String) evt.getOldValue(),
                (String) evt.getNewValue());
    }//  w w  w.ja  va 2s.co m
}