Example usage for java.beans PropertyChangeEvent getOldValue

List of usage examples for java.beans PropertyChangeEvent getOldValue

Introduction

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

Prototype

public Object getOldValue() 

Source Link

Document

Gets the old value for the property, expressed as an Object.

Usage

From source file:controlador.ControladorReportes.java

private boolean verificarRangoFechas(PropertyChangeEvent e, JXDatePicker jxdpFecha) {
    boolean respuesta = true;
    Date desde = reportes.getJXDPDesde().getDate();
    Date hasta = reportes.getJXDPHasta().getDate();

    if (desde.compareTo(hasta) > 0) {
        jxdpFecha.setDate((Date) e.getOldValue());
        JOptionPane.showMessageDialog(reportes, "El rango de fechas no es vlido!", "Error",
                JOptionPane.ERROR_MESSAGE, null);
        respuesta = false;// w  ww. j a  v a2 s. c  o  m
    }

    return respuesta;
}

From source file:org.jboss.tools.openshift.internal.ui.wizard.deployimage.DeployImageWizardModel.java

@Override
public void propertyChange(PropertyChangeEvent evt) {
    if (evt != null) {
        firePropertyChange(evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
    }/* ww w.  j a  v a 2 s. c o  m*/
}

From source file:org.jaffa.flexfields.FlexBean.java

/**
 * Adds a default PropertyChangeListener to the listener list.
 *//*from   www .ja  v  a  2 s.c  o m*/
private void addPropertyChangeListener() {
    addPropertyChangeListener(new PropertyChangeListener() {

        public void propertyChange(PropertyChangeEvent evt) {
            valueChanged(evt.getPropertyName(), evt.getOldValue());
            if (log.isDebugEnabled())
                log.debug("Field '" + evt.getPropertyName() + "' updated from '" + evt.getOldValue() + "' to '"
                        + evt.getNewValue() + "'");
        }
    });
}

From source file:org.openvpms.web.component.im.edit.IMTableCollectionEditor.java

/**
 * Invoked when the editor changes components.
 *
 * @param event the property change event
 *///ww w.j  a v  a 2s.  c  o  m
protected void onComponentChange(PropertyChangeEvent event) {
    Component oldValue = (Component) event.getOldValue();
    Component newValue = (Component) event.getNewValue();
    editBox.remove(oldValue);
    editBox.add(newValue);
    changeFocusGroup(getCurrentEditor());
}

From source file:edu.ku.brc.specify.ui.DBObjSearchPanel.java

public void propertyChange(PropertyChangeEvent evt) {
    if (evt.getPropertyName().equals("selection")) {
        Integer numRowsSelected = (Integer) evt.getOldValue();
        if (numRowsSelected > 0) {
            idList = etrb.getListOfIds(false);
        } else {//  ww w .  j  a  va 2  s .co m
            idList = null;
        }
        updateUIControls();

    } else if (evt.getPropertyName().equals("doubleClick")) {
        okBtn.doClick();

    } else if (evt.getPropertyName().equals("loaded")) {
        // If there is only one returned, then select it and focus the OK defult btn
        if (evt.getNewValue() != null && ((Integer) evt.getNewValue()) == 1) {
            ESResultsTablePanel etrbPanel = (ESResultsTablePanel) etrb;
            etrbPanel.getTable().setRowSelectionInterval(0, 0);
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    okBtn.requestFocus();
                }
            });

        }
    }
}

From source file:com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep.java

public void propertyChange(PropertyChangeEvent arg0) {
    if (arg0.getSource() == wsdlOperation) {
        if (arg0.getPropertyName().equals(Operation.NAME_PROPERTY)) {
            requestStepConfig.setOperation((String) arg0.getNewValue());
        }/* www  .j  a  va2  s  .co  m*/
    } else if (arg0.getSource() == wsdlOperation.getInterface()) {
        if (arg0.getPropertyName().equals(Interface.NAME_PROPERTY)) {
            requestStepConfig.setInterface((String) arg0.getNewValue());
        }
    } else {
        notifyPropertyChanged(arg0.getPropertyName(), arg0.getOldValue(), arg0.getNewValue());
    }
}

From source file:org.jspresso.framework.application.frontend.action.lov.LovAction.java

/**
 * Feed context with dialog.//from ww w .  jav a 2s .co  m
 *
 * @param erqDescriptor
 *     the erq descriptor
 * @param queryComponent
 *     the query component
 * @param lovView
 *     the lov view
 * @param actionHandler
 *     the action handler
 * @param context
 *     the context
 */
protected void feedContextWithDialog(IReferencePropertyDescriptor<IComponent> erqDescriptor,
        IQueryComponent queryComponent, IView<E> lovView, final IActionHandler actionHandler,
        final Map<String, Object> context) {
    getViewConnector(context).setConnectorValue(getViewConnector(context).getConnectorValue());

    if (!context.containsKey(ModalDialogAction.DIALOG_ACTIONS)) {
        List<IDisplayableAction> actions = new ArrayList<>();
        actions.add(getOkAction());
        if (getCreateAction() != null) {
            actions.add(getCreateAction());
        }
        actions.add(getFindAction());
        actions.add(getCancelAction());
        context.put(ModalDialogAction.DIALOG_ACTIONS, actions);
    }
    context.put(ModalDialogAction.DIALOG_TITLE,
            getI18nName(getTranslationProvider(context), getLocale(context)) + " : "
                    + erqDescriptor.getReferencedDescriptor().getI18nName(getTranslationProvider(context),
                            getLocale(context)));
    context.put(ModalDialogAction.DIALOG_VIEW, lovView);
    if (lovView instanceof ICompositeView<?>) {
        context.put(ModalDialogAction.DIALOG_FOCUSED_COMPONENT,
                ((ICompositeView<E>) lovView).getChildren().get(1).getPeer());
    }

    if (pagingAction != null) {
        PropertyChangeListener paginationListener = new PropertyChangeListener() {

            @Override
            public void propertyChange(PropertyChangeEvent evt) {
                if (evt.getOldValue() != null && evt.getNewValue() != null) {
                    try {
                        context.put(AbstractQbeAction.PAGINATE, null);
                        actionHandler.execute(pagingAction, context);
                    } finally {
                        context.remove(AbstractQbeAction.PAGINATE);
                    }
                }
            }
        };
        queryComponent.addPropertyChangeListener(IPageable.PAGE, paginationListener);
    }
}

From source file:org.jcurl.zui.piccolo.BroomPromptSimple.java

public void propertyChange(final PropertyChangeEvent evt) {
    log.debug(evt.getPropertyName());/*from  ww  w .j ava2 s  .c o m*/
    if ("broom".equals(evt.getPropertyName()))
        setBroom((Point2D) evt.getNewValue());
    else if ("idx16".equals(evt.getPropertyName()))
        setIdx16((Integer) evt.getNewValue());
    else if ("outTurn".equals(evt.getPropertyName()))
        setOutTurn((Boolean) evt.getNewValue());
    else if ("splitTimeMillis".equals(evt.getPropertyName())) {
        final BoundedRangeModel os = (BoundedRangeModel) evt.getOldValue();
        if (os != null)
            os.removeChangeListener(this);
        setSlider((BoundedRangeModel) evt.getNewValue());
    }
}

From source file:org.jcurl.demo.tactics.sg.BroomPromptScenario.java

public void propertyChange(final PropertyChangeEvent evt) {
    if (evt.getSource() == model) {
        if ("idx16".equals(evt.getPropertyName()))
            syncIndexM2V((Integer) evt.getNewValue(), pie);
        else if ("outTurn".equals(evt.getPropertyName()))
            syncHandleM2V((Boolean) evt.getNewValue(), handle);
        else if ("broom".equals(evt.getPropertyName()))
            syncBroomM2V((Point2D) evt.getNewValue(), scene);
        else if ("splitTimeMillis".equals(evt.getPropertyName())) {
            final BoundedRangeModel os = (BoundedRangeModel) evt.getOldValue();
            if (os != null)
                os.removeChangeListener(this);
            final BoundedRangeModel ns = (BoundedRangeModel) evt.getNewValue();
            if (ns != null)
                ns.addChangeListener(this);
            syncSpeedM2V(ns);/*w ww .  j av a  2 s.  c om*/
        } else
            log.info(evt.getPropertyName() + " " + evt.getSource());
    } else
        log.warn("Unconsumed event from " + evt.getSource());
}

From source file:com.mightypocket.ashot.Mediator.java

private void installListeners() {
    demon.addTaskListener(new Adapter<Void, ImageEx>() {
        @Override//from  w w  w.ja va  2 s  . c  o m
        public void process(TaskEvent<List<ImageEx>> event) {
            List<ImageEx> value = event.getValue();

            if (!value.isEmpty()) {
                final ImageEx img = value.get(0);
                updateImageProcessor(img);

                final Image imgp = imageProcessor.process(img.getValue());

                showImage(imgp);

                if (isRecording() && !(p.getBoolean(PREF_SAVE_SKIP_DUPLICATES, true) && img.isDuplicate())) {
                    imageSaver.saveImage((saveOriginal) ? img.getValue() : imgp);
                }

                lastImage = img;
            } else {
                showImage(generateDummyImage());
            }
        }

    });

    addPropertyChangeListener(PROP_CONNECTED_DEVICE, new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            final JRadioButtonMenuItem disconnected = devices.get((String) evt.getOldValue());
            final JRadioButtonMenuItem connected = devices.get((String) evt.getNewValue());

            if (disconnected != null) {
                disconnected.setSelected(false);
            }

            if (connected != null) {
                connected.setSelected(true);
            } else {
                devicesGroup.clearSelection();
            }
        }
    });

    addPropertyChangeListener(PROP_FULL_SCREEN, new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            logger.debug("Full screen: {}", evt.getNewValue());
            boolean fs = (Boolean) evt.getNewValue();
            presenter = fs ? fullScreenFrame.getPresenter() : mainPanel.getPresenter();
        }
    });

}