Java 8 EventListenerList - 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 EventListenerList class.

This code example shows how to use the following methods:
package org.drools.examples.sudoku.swing; 
 
import javax.swing.event.EventListenerList;
 
public abstract class AbstractSudokuGridModel { 
   private EventListenerList listenerList = new EventListenerList();
 
   public void addSudokuGridListener(SudokuGridListener l){
      listenerList.add(SudokuGridListener.class, l);
   } 
    
   public void removeSudokuGridListener(SudokuGridListener l){
      listenerList.remove(SudokuGridListener.class, l);
   } 
 
   private void forwardEvent(SudokuGridEvent ev){
       // Guaranteed to return a non-null array 
       Object[] listeners = listenerList.getListenerList();
       // Process the listeners last to first, notifying 
       // those that are interested in this event 
6
CodeRank
This code example shows how to use the following methods:
    } 
 
    /** 
     * The list of event listeners for this component. 
     */ 
    protected EventListenerList listenerList = new EventListenerList();
 
    public PaneMenu() { 
        Dimension d = new Dimension(103, 21);
        setMinimumSize(d);
        setMaximumSize(d);
        setPreferredSize(d);
        setEnabled(true); 
    } 
 
    @Override 
    public void setEnabled(boolean enabled) {
        super.setEnabled(enabled);
        if (enabled) {
            addMouseListener(this);
6
CodeRank
This code example shows how to use the following methods:
   * Initializes the <code>CloseableTabbedPane</code> 
   * @param horizontalTextPosition the horizontal position of the text (e.g. 
   * SwingUtilities.TRAILING or SwingUtilities.LEFT) 
   */ 
  private void init(int horizontalTextPosition) {
    listenerList = new EventListenerList();
    addMouseListener(this);
    addMouseMotionListener(this);
  
    //setUI(new AquaCloseableTabbedPaneUI(horizontalTextPosition)); 
    if (getUI() instanceof MetalTabbedPaneUI)
      setUI(new CloseableMetalTabbedPaneUI(horizontalTextPosition));
    /* 
    else 
      setUI(new CloseableTabbedPaneUI(horizontalTextPosition)); 
   */ 
  } 
  
  /** 
   * Allows setting own closeicons. 
6
CodeRank
This code example shows how to use the following methods:add
     */ 
    @Override 
    public void addFigureChangeListener(FigureChangeListener listener) {
        if (listener != null) {
            if (_listenerList == null) {
                _listenerList = new EventListenerList();
            } 
            _listenerList.add(FigureChangeListener.class, listener);
        } 
    } 
 
    /** 
     * Removes a listener for this figure. 
     * 
     * @param listener the listener to be removed 
     */ 
    @Override 
    public void removeFigureChangeListener(FigureChangeListener listener) {
        if (listener != null && _listenerList != null) {
            _listenerList.remove(FigureChangeListener.class, listener);
5
CodeRank
This code example shows how to use the following methods:
 
    /** 
     * Default constructor. 
     */ 
    public AbstractOverlay() { 
        this.changeListeners = new EventListenerList();
    } 
 
    /** 
     * Registers an object for notification of changes to the overlay. 
     * 
     * @param listener  the listener (<code>null</code> not permitted). 
     * 
     * @see #removeChangeListener(OverlayChangeListener) 
     */ 
    public void addChangeListener(OverlayChangeListener listener) {
        if (listener == null) {
            throw new IllegalArgumentException("Null 'listener' argument.");
        } 
        this.changeListeners.add(OverlayChangeListener.class, listener);
6
CodeRank
This code example shows how to use the following methods:
    /** 
     * Creates a new instance. 
     */ 
    protected AbstractDialLayer() { 
        this.visible = true;
        this.listenerList = new EventListenerList();
    } 
 
    /** 
     * Returns <code>true</code> if this layer is visible (should be displayed), 
     * and <code>false</code> otherwise. 
     * 
     * @return A boolean. 
     * 
     * @see #setVisible(boolean) 
     */ 
    public boolean isVisible() { 
        return this.visible;
    } 
 
5
CodeRank
This code example shows how to use the following methods:
     * Constructs a dataset. By default, the dataset is assigned to its own 
     * group. 
     */ 
    protected AbstractDataset() { 
        this.group = new DatasetGroup();
        this.listenerList = new EventListenerList();
    } 
 
    /** 
     * Returns the dataset group for the dataset. 
     * 
     * @return The group (never <code>null</code>). 
     * 
     * @see #setGroup(DatasetGroup) 
     */ 
    public DatasetGroup getGroup() { 
        return this.group;
    } 
 
    /** 
5
CodeRank
This code example shows how to use the following methods:
 * 
 * @author  rogan 
 */ 
public abstract class AbstractUrlModel implements UrlModel { 
     
    private EventListenerList _listenerList = new EventListenerList();
     
    private Logger _logger = Logger.getLogger(getClass().getName());
     
    /** Creates a new instance of AbstractUrlModel */ 
    public AbstractUrlModel() { 
    } 
     
    public abstract int getChildCount(HttpUrl parent);
     
    public abstract int getIndexOf(HttpUrl url);
     
    public abstract HttpUrl getChildAt(HttpUrl parent, int index);
     
    public abstract Sync readLock(); 
5
CodeRank
This code example shows how to use the following methods:
        if (key == null) {
            throw new IllegalArgumentException("Null 'key' argument.");
        } 
        this.key = key;
        this.description = description;
        this.listeners = new EventListenerList();
        this.propertyChangeSupport = new PropertyChangeSupport(this);
        this.notify = true;
    } 
 
    /** 
     * Returns the key for the series. 
     * 
     * @return The series key (never <code>null</code>). 
     * 
     * @see #setKey(Comparable) 
     */ 
    public Comparable getKey() {
        return this.key;
    } 
5
CodeRank
This code example shows how to use the following methods:
public abstract class ColumnDataModel<T> { 
     
    /** 
     * Maintains the list of listeners 
     */ 
    protected EventListenerList _listenerList = new EventListenerList();
     
    private String name = null;
    private Class<?> clazz = Object.class;
     
    /** 
     * Creates a new ColumnDataModel 
     */ 
    protected ColumnDataModel(String name, Class<?> clazz) {
    	this.name = name;
    	this.clazz = clazz;
    } 
    /** 
     * Used by the "composing" table model to determine what the class of the 
     * column objects is. 
5
CodeRank
This code example shows how to use the following methods:
public abstract class AbstractTreeModel implements TreeModel {
     
    protected EventListenerList listeners;
     
    protected AbstractTreeModel() { 
        listeners = new EventListenerList();
    } 
     
    public int getIndexOfChild(Object parent, Object child) { 
        for (int count = getChildCount(parent), i = 0; i < count; i++)
            if (getChild(parent, i).equals(child))
                return i;
         
        return -1; 
    } 
     
    /** Call when there is a new root, which may be null, i.e. not existent. */ 
    protected void fireNewRoot() { 
        Object[] pairs = listeners.getListenerList();
         
5
CodeRank
This code example shows how to use the following methods:
 */ 
public abstract class AbstractConversationModel implements ConversationModel { 
     
    private FrameworkModel _model;
     
    private EventListenerList _listenerList = new EventListenerList();
     
    private Logger _logger = Logger.getLogger(getClass().getName());
     
    /** Creates a new instance of AbstractConversationModel */ 
    public AbstractConversationModel(FrameworkModel model) {
        _model = model;
    } 
     
    public abstract int getConversationCount(); 
     
    public abstract ConversationID getConversationAt(int index);
     
    public abstract int getIndexOfConversation(ConversationID id);
     
5
CodeRank
This code example shows how to use the following methods:
 * @version $Revision: 1.1.2.1 $ 
 **/ 
 
public abstract class AbstractTreeModel implements TreeModel {
 
    private EventListenerList listenerList = new EventListenerList();
 
    /** 
     * Adds a listener for the TreeModelEvent posted after the tree changes. 
     * 
     * @see     #removeTreeModelListener 
     * @param   l       the listener to add 
     */ 
    public void addTreeModelListener(TreeModelListener l) {
        listenerList.add(TreeModelListener.class, l);
    } 
 
    /** 
     * Removes a listener previously added with <B>addTreeModelListener()</B>. 
     * 
5
CodeRank
This code example shows how to use the following methods:
public abstract class AbstractTreeTableModel extends DefaultTableModel implements TreeTableModel {
 
    private static final long serialVersionUID = 240L;
 
    protected final TreeNode rootNode;
    protected final EventListenerList listener = new EventListenerList();
 
    protected transient final List<Object> objects = new ArrayList<Object>();
 
    protected transient final List<String> headers = new ArrayList<String>();
 
    protected transient final List<Class<?>> classes = new ArrayList<Class<?>>();
 
    protected transient final List<Functor> readFunctors;
 
    protected transient final List<Functor> writeFunctors;
 
    public AbstractTreeTableModel(TreeNode root) {
        this.rootNode = root;
        readFunctors = new ArrayList<Functor>();
5
CodeRank
This code example shows how to use the following methods:
 
    /** a generated serial id */ 
    private static final long serialVersionUID = 4206903652292146757L;
 
    /** Storage for registered listeners. */ 
    private transient EventListenerList listenerList = new EventListenerList();
 
    /** notify flag {@link #isNotify()} */ 
    private boolean notify;
     
    /**  
     * dirty flag true if changes occurred is used to trigger a queued change  
     * event if notify is reset to true. 
     */ 
    private boolean dirty;
     
    /** reference to the extended dataset */ 
    private final DATASET dataset;
     
    /** 
5
CodeRank
This code example shows how to use the following methods:
        this.visible = true;
        this.position = position;
        this.horizontalAlignment = horizontalAlignment;
        this.verticalAlignment = verticalAlignment;
        setPadding(padding);
        this.listenerList = new EventListenerList();
        this.notify = true;
 
    } 
 
    /** 
     * Returns a flag that controls whether or not the title should be 
     * drawn.  The default value is <code>true</code>. 
     * 
     * @return A boolean. 
     * 
     * @see #setVisible(boolean) 
     * 
     * @since 1.0.11 
     */ 
5
CodeRank
This code example shows how to use the following methods:
 
    /** 
     * Constructs an annotation. 
     */ 
    protected AbstractAnnotation() { 
        this.listenerList = new EventListenerList();
    } 
 
    /** 
     * Registers an object to receive notification of changes to the 
     * annotation. 
     * 
     * @param listener  the object to register. 
     * 
     * @see #removeChangeListener(AnnotationChangeListener) 
     */ 
    @Override 
    public void addChangeListener(AnnotationChangeListener listener) {
        this.listenerList.add(AnnotationChangeListener.class, listener);
    } 
5
CodeRank
This code example shows how to use the following methods:
 
    private ViewModelInfo dotInfo;
 
    private ViewModelInfo markInfo;
 
    protected EventListenerList listenerList = new EventListenerList();
 
    protected transient ChangeEvent changeEvent = null;
 
    private DocumentRange docRange;
 
    // private List lastModified = new ArrayList(); 
 
    private Range lastSelectionRange = null;
 
    private DocumentTraversal docTraversal;
 
    private Map elementBoxMap;
 
    private Map textInlineMap;
5
CodeRank
This code example shows how to use the following methods:
    private boolean renameTopId;
    private boolean renameAssertionId;
    private boolean renameLastAssertionId;
    private boolean removeAssertionSignature;
     
    private EventListenerList _listenerList = new EventListenerList();
    private SamlModel samlModel;
 
    @Override 
    public String getPluginName() {
        return "SAML Proxy"; 
    } 
 
    @Override 
    public HTTPClient getProxyPlugin(HTTPClient in) {
        return new SamlHTTPClient(in, this);
    } 
 
    public void setCorruptSignature(boolean corruptSignature) {
        this.corruptSignature = corruptSignature;
5
CodeRank
This code example shows how to use the following methods:
 *  
 * @author Tom Nelson 
 */ 
public abstract class AbstractPickedState<T> implements PickedState<T> { 
     
    protected EventListenerList listenerList = new EventListenerList();
 
    public void addItemListener(ItemListener l) {
        listenerList.add(ItemListener.class, l);
         
    } 
 
    public void removeItemListener(ItemListener l) {
        listenerList.remove(ItemListener.class, l);
    } 
     
    protected void fireItemStateChanged(ItemEvent e) {
        Object[] listeners = listenerList.getListenerList();
        for ( int i = listeners.length-2; i>=0; i-=2 ) {
            if ( listeners[i]==ItemListener.class ) {
5
CodeRank
This code example shows how to use the following methods:
     
    Object eventSource; 
    /** 
     * holds the registered listeners 
     */ 
    protected EventListenerList listenerList = new EventListenerList();
 
    /** 
     * Only one <code>ChangeEvent</code> is needed 
     * instance since the 
     * event's only state is the source property.  The source of events 
     * generated is always "this". 
     */ 
    protected transient ChangeEvent changeEvent;
     
    public DefaultChangeEventSupport(Object eventSource) { 
        this.eventSource = eventSource;
    } 
 
    public void addChangeListener(ChangeListener l) {
5
CodeRank
This code example shows how to use the following methods:
        this.paint = SerialUtilities.readPaint(stream);
        this.stroke = SerialUtilities.readStroke(stream);
        this.outlinePaint = SerialUtilities.readPaint(stream);
        this.outlineStroke = SerialUtilities.readStroke(stream);
        this.labelPaint = SerialUtilities.readPaint(stream);
        this.listenerList = new EventListenerList();
    } 
 
} 
5
CodeRank
This code example shows how to use the following methods:
  private EventListenerList listenerList;
 
  protected HorizontalPositionsModel() 
  { 
    this.backend = new HorizontalPositionsList();
    this.listenerList = new EventListenerList();
  } 
 
  public void addChangeListener(final ChangeListener changeListener)
  { 
    this.listenerList.add(ChangeListener.class, changeListener);
  } 
 
  public void removeChangeListener(final ChangeListener changeListener)
  { 
    this.listenerList.remove(ChangeListener.class, changeListener);
  } 
 
  public int size() 
  { 
5
CodeRank
This code example shows how to use the following methods:
	} 
 
	/*-------------------------------------------------[ Listeners ]---------------------------------------------------*/ 
 
	/** {@link EventListenerList} instance. */ 
	protected EventListenerList listenerList = new EventListenerList();
 
	/** {@inheritDoc} */ 
	@Override 
	public void addTreeModelListener(TreeModelListener listener) {
		listenerList.add(TreeModelListener.class, listener);
	} 
 
	/** {@inheritDoc} */ 
	@Override 
	public void removeTreeModelListener(TreeModelListener listener) {
		listenerList.remove(TreeModelListener.class, listener);
	} 
 
	/*-------------------------------------------------[ Firing Changes ]---------------------------------------------------*/ 
5
CodeRank
This code example shows how to use the following methods:
  private EventListenerList listeners;
  private QueryDialogModel<T> dialogModel;
 
  public QueryDialogComboBoxModel(QueryDialogModel<T> dialogModel)
  { 
    this.listeners = new EventListenerList();
    this.dialogModel = dialogModel;
    this.dialogModel.addQueryDialogModelListener(new UpdateHandler());
  } 
 
  public Object getSelectedItem() 
  { 
    return dialogModel.getSelectedQuery();
  } 
 
  @SuppressWarnings("unchecked") 
  public void setSelectedItem(final Object anItem) 
  { 
    dialogModel.setSelectedQuery((Query<T>) anItem);
  } 
5
CodeRank
This code example shows how to use the following methods:
     
    private FrameworkModel _model = null;
     
    private Logger _logger = Logger.getLogger(getClass().getName());
     
    private EventListenerList _listenerList = new EventListenerList();
    private ReentrantReaderPreferenceReadWriteLock _rwl = new ReentrantReaderPreferenceReadWriteLock();
     
    private FuzzConversationModel _conversationModel;
     
    private String _fuzzMethod = "GET";
    private String _fuzzUrl = "http://localhost:8080/test";
    private String _fuzzVersion = "HTTP/1.0";
     
    private List<NamedValue> _fuzzHeaders = new ArrayList<NamedValue>();
    private List<Parameter> _fuzzParameters = new ArrayList<Parameter>();
    private List<FuzzSource> _fuzzSources = new ArrayList<FuzzSource>();
    private List<Integer> _parameterPriorities = new ArrayList<Integer>();
     
    private int _maxPriority = 0;
5
CodeRank
This code example shows how to use the following methods:
  private EventListenerList listenerList;
  private Throwable[] throwables;
 
  public ExceptionsListModel() 
  { 
    this.listenerList = new EventListenerList();
    this.throwables = UncaughtExceptionsModel.getInstance().getThrowables();
  } 
 
  /** 
   * Returns the length of the list. 
   * 
   * @return the length of the list 
   */ 
  public int getSize() 
  { 
    return throwables.length;
  } 
 
  /** 
5
CodeRank
This code example shows how to use the following methods:
 
public class ProfileModeModel { 
    private static final Preferences preferences = Preferences.userNodeForPackage(ProfileModeModel.class);
    private static final String PROFILE_MODE_PREFERENCE = "profileMode";
 
    private EventListenerList listenerList = new EventListenerList();
 
    public ProfileMode getProfileMode() { 
        try { 
            return ProfileMode.valueOf(preferences.get(PROFILE_MODE_PREFERENCE, Elevation.toString()));
        } catch (IllegalArgumentException e) {
            return Elevation; 
        } 
    } 
 
    public void setProfileMode(ProfileMode profileMode) {
        preferences.put(PROFILE_MODE_PREFERENCE, profileMode.toString());
        fireChanged(); 
    } 
 
5
CodeRank
This code example shows how to use the following methods:
 */ 
 
public class UndoManager { 
    private static final Preferences preferences = Preferences.userNodeForPackage(UndoManager.class);
    private final javax.swing.undo.UndoManager delegate = new javax.swing.undo.UndoManager();
    private final EventListenerList listenerList = new EventListenerList();
 
    public UndoManager() { 
        delegate.setLimit(preferences.getInt("undoLimit", -1));
    } 
 
    public boolean canUndo() { 
        return delegate.canUndo();
    } 
 
    public boolean canRedo() { 
        return delegate.canRedo();
    } 
 
    public String getUndoPresentationName() {
5
CodeRank
This code example shows how to use the following methods:
public class UnitSystemModel { 
    private static final Preferences preferences = Preferences.userNodeForPackage(UnitSystemModel.class);
    private static final String UNIT_SYSTEM_PREFERENCE = "unitSystem";
    private static final String DEGREE_FORMAT_PREFERENCE = "degreeFormat";
 
    private EventListenerList listenerList = new EventListenerList();
 
    public UnitSystem getUnitSystem() { 
        try { 
            return UnitSystem.valueOf(preferences.get(UNIT_SYSTEM_PREFERENCE, Metric.toString()));
        } catch (IllegalArgumentException e) {
            return Metric; 
        } 
    } 
 
    public void setUnitSystem(UnitSystem unitSystem) {
        preferences.put(UNIT_SYSTEM_PREFERENCE, unitSystem.toString());
        fireChanged(); 
    } 
 
5
CodeRank
See Code Examples for Java 8 EventListenerList Methods: