Example usage for javax.swing.event ChangeEvent ChangeEvent

List of usage examples for javax.swing.event ChangeEvent ChangeEvent

Introduction

In this page you can find the example usage for javax.swing.event ChangeEvent ChangeEvent.

Prototype

public ChangeEvent(Object source) 

Source Link

Document

Constructs a ChangeEvent object.

Usage

From source file:blue.components.lines.LinePoint.java

public void setLocation(float x, float y) {
    this.x = x;/*from www.  ja  v a2s  .  c  om*/
    this.y = y;

    if (changeEvent == null) {
        changeEvent = new ChangeEvent(this);
    }

    fireChangeEvent(changeEvent);
}

From source file:blue.soundObject.jmask.TablePoint.java

public void setLocation(double time, double value) {
    this.time = time;
    this.value = value;

    if (changeEvent == null) {
        changeEvent = new ChangeEvent(this);
    }// w ww . ja v  a2s  . c  o m

    fireChangeEvent(changeEvent);
}

From source file:com.github.alexfalappa.nbspringboot.projects.initializr.InitializrProjectWizardPanel1.java

protected final void fireChangeEvent() {
    Set<ChangeListener> ls;
    synchronized (listeners) {
        ls = new HashSet<>(listeners);
    }/*from  w  ww  . j a  v  a2s . c o  m*/
    ChangeEvent ev = new ChangeEvent(this);
    for (ChangeListener l : ls) {
        l.stateChanged(ev);
    }
}

From source file:DualListener.java

protected void fireBChanged() {
    Object[] listeners = events.getListenerList();
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
        if (listeners[i] == ChangeListener.class) {
            if (changeEvent == null) {
                changeEvent = new ChangeEvent(this);
            }//from  www  .  j av  a 2s .com
            ((ChangeListener) listeners[i + 1]).stateChanged(changeEvent);
        }
    }
}

From source file:it.unibas.spicygui.vista.wizard.NewMappingTaskWizardPanel1.java

protected final void fireChangeEvent() {
    Iterator<ChangeListener> it;
    synchronized (listeners) {
        it = new HashSet<ChangeListener>(listeners).iterator();
    }/*from w  w  w  .ja  va  2 s  . co  m*/
    ChangeEvent ev = new ChangeEvent(this);
    while (it.hasNext()) {
        it.next().stateChanged(ev);
    }
}

From source file:com.anrisoftware.prefdialog.miscswing.lists.CheckListItem.java

/**
 * Sets the selected state of the item.//w w  w  . j  a va2s.c om
 *
 * @param selected
 *            {@code true} if the item is selected.
 */
public void setSelected(boolean selected) {
    boolean oldValue = this.selected;
    this.selected = selected;
    if (oldValue != selected) {
        changeSupport.fire().stateChanged(new ChangeEvent(this));
    }
}

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

/**
 * Sends notification on GUI thread/*from www.j a v  a2s.c om*/
 * @param listener
 * @param imgIcon
 */
private ImageIcon notifyListener(final ChangeListener listener, final ImageIcon imgIcon) {
    if (listener != null) {
        SwingWorker<Boolean, Boolean> worker = new SwingWorker<Boolean, Boolean>() {
            @Override
            protected Boolean doInBackground() throws Exception {
                try {
                    Thread.sleep(100);
                } catch (Exception ex) {
                }
                return null;
            }

            @Override
            protected void done() {
                listener.stateChanged(new ChangeEvent(imgIcon));
            }

        };
        worker.execute();
    }
    return imgIcon;
}

From source file:com.hp.alm.ali.idea.ui.MultiValueSelectorLabel.java

private void fireChangeEvent(Object source) {
    synchronized (listeners) {
        for (ChangeListener listener : listeners) {
            listener.stateChanged(new ChangeEvent(source));
        }/*from w ww. ja  va  2 s  .com*/
    }
}

From source file:com.anrisoftware.prefdialog.miscswing.docks.dockingframes.dock.AbstractViewDockWindow.java

/**
 * Fire state changed.
 */
protected void fireStateChanged() {
    changeSupport.fire().stateChanged(new ChangeEvent(this));
}

From source file:com.anrisoftware.prefdialog.miscswing.docks.dockingframes.dock.AbstractEditorDockWindow.java

private void updateVisible(boolean visible) {
    boolean oldValue = this.visible;
    this.visible = visible;
    if (oldValue != visible) {
        changeSupport.fire().stateChanged(new ChangeEvent(this));
    }//from  w w w  .ja va2s . co m
}