Java 8 SwingPropertyChangeSupport - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 SwingPropertyChangeSupport class.

This code example shows how to use the following methods:firePropertyChange
	 
	private String author;
	private String title;
	private Double price = 0d;
 
	private SwingPropertyChangeSupport pcs = new SwingPropertyChangeSupport(this, true);
	 
	public Book() { 
		super(); 
	} 
	 
	public Book(String author, String title) {
		this(author,title,0d);
	} 
 
	public Book(String author, String title, Double price) {
		super(); 
		this.setAuthor(author);
		this.setTitle(title);
		this.setPrice(price);

6
CodeRank
This code example shows how to use the following methods:firePropertyChange
	 
	private String author;
	private String title;
	private Double price = 0d;
 
	private SwingPropertyChangeSupport pcs = new SwingPropertyChangeSupport(this, true);
	 
	public Book() { 
		super(); 
	} 
	 
	public Book(String author, String title) {
		this(author,title,0d);
	} 
 
	public Book(String author, String title, Double price) {
		super(); 
		this.setAuthor(author);
		this.setTitle(title);
		this.setPrice(price);

6
CodeRank
This code example shows how to use the following methods:addPropertyChangeListener
     * @see prefuse.data.tuple.TupleSet#addPropertyChangeListener(java.beans.PropertyChangeListener) 
     */ 
    public void addPropertyChangeListener(PropertyChangeListener lstnr) {
        if ( lstnr == null ) return;
        if ( m_propSupport == null )
            m_propSupport = new SwingPropertyChangeSupport(this);
        m_propSupport.addPropertyChangeListener(lstnr);
    } 
     
    /** 
     * @see prefuse.data.tuple.TupleSet#addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) 
     */ 
    public void addPropertyChangeListener(String key, 
                                          PropertyChangeListener lstnr)
    { 
        if ( lstnr == null ) return;
        if ( m_propSupport == null )
            m_propSupport = new SwingPropertyChangeSupport(this);
        m_propSupport.addPropertyChangeListener(key, lstnr);
    } 
6
CodeRank
This code example shows how to use the following methods:addPropertyChangeListener
		this.progress = progress;
	} 
 
	public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
        if (changeSupport == null) {
	    changeSupport = new SwingPropertyChangeSupport(this);
        } 
        changeSupport.addPropertyChangeListener(listener);
    } 
	 
	public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
        if (changeSupport == null || 
	    (oldValue != null && newValue != null && oldValue.equals(newValue))) { 
            return; 
        } 
        changeSupport.firePropertyChange(propertyName, oldValue, newValue);
    } 
 
	public synchronized void cancel(boolean interrupt) {
		this.canceled = true;
5
CodeRank
This code example shows how to use the following methods:removePropertyChangeListener
        public void addPropertyChangeListener(PropertyChangeListener listener) {
            changeSupport.addPropertyChangeListener(listener);
        } 
 
        public void removePropertyChangeListener(PropertyChangeListener listener) {
            changeSupport.removePropertyChangeListener(listener);
        } 
 
        public void actionPerformed(ActionEvent e) {
            if(delegate != null) 
                delegate.actionPerformed(e);
        } 
    } 
} 
4
CodeRank
This code example shows how to use the following methods:removePropertyChangeListener
        firePropertyChangeEvent(UndoManager.UndoName, undoable, canUndo());
 
    } 
 
    public void removePropertyChangeListener(PropertyChangeListener pcl) {
        propChangeSupport.removePropertyChangeListener(pcl);
    } 
 
    public void reset() { 
        boolean changed = modificationMarker != editToBeUndone();
        if (changed) {
            modificationMarker = editToBeUndone();
        } 
    } 
 
    protected void trimEdits(int from, int to) {
        boolean undoable = canUndo();
        boolean redoable = canRedo();
 
        boolean changed = hasChanged();
4
CodeRank
This code example shows how to use the following methods:removePropertyChangeListener
	public void addPropertyChangeListener(PropertyChangeListener listener) {
		support.addPropertyChangeListener(listener);
	} 
 
	public void removePropertyChangeListener(PropertyChangeListener listener) {
		support.removePropertyChangeListener(listener);
	} 
 
	 
	/** 
	 * @return the authors List 
	 */ 
	public List<Author> getAuthors() {
		return authorsList;
	} 
 
 
	/** 
	 * @return the author 
	 */ 
4
CodeRank
This code example shows how to use the following methods:removePropertyChangeListener
This code example shows how to use the following methods:removePropertyChangeListener
    public void addPropertyChangeListener(PropertyChangeListener listener) {
        propertyChangeSupport.addPropertyChangeListener(listener);
    } 
 
    public void removePropertyChangeListener(PropertyChangeListener listener) {
        propertyChangeSupport.removePropertyChangeListener(listener);
    } 
 
    public void fireEvent(Object oldValue, Object newValue) { 
        if (!isEnabled()) { 
          //  System.out.println("Setting pending event fire - " + name); 
            pending = true;
        } else { 
            pending = false;
           // System.out.println("Actually Firing event - " + name); 
            propertyChangeSupport.firePropertyChange(new PropertyChangeEvent(sourceObject, name, oldValue, newValue));
        } 
    } 
 
    public void fireEvent() { 
3
CodeRank
This code example shows how to use the following methods:
		return propertyChangeSupport;
	} 
 
	private PropertyChangeSupport getOrCreatePropertyChangeSupport() {
		if (propertyChangeSupport == null) {
			propertyChangeSupport = new SwingPropertyChangeSupport(this);
		} 
		return propertyChangeSupport;
	} 
 
	protected void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) {
		if (propertyChangeSupport != null) {
			propertyChangeSupport.firePropertyChange(propertyName, oldValue, newValue);
		} 
	} 
 
	protected void firePropertyChange(String propertyName, int oldValue, int newValue) {
		if (propertyChangeSupport != null) {
			propertyChangeSupport.firePropertyChange(propertyName, oldValue, newValue);
		} 
4
CodeRank
See Code Examples for Java 8 SwingPropertyChangeSupport Methods: