Java Code Examples for java.util.Vector#removeElement()

The following examples show how to use java.util.Vector#removeElement() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 * Removes a <code>LookAndFeel</code> from the list of auxiliary look and feels.
 * The auxiliary look and feels tell the multiplexing look and feel what
 * other <code>LookAndFeel</code> classes for a component instance are to be used
 * in addition to the default <code>LookAndFeel</code> class when creating a
 * multiplexing UI.  The change will only take effect when a new
 * UI class is created or when the default look and feel is changed
 * on a component instance.
 * <p>Note these are not the same as the installed look and feels.
 * @return true if the <code>LookAndFeel</code> was removed from the list
 * @see #removeAuxiliaryLookAndFeel
 * @see #getAuxiliaryLookAndFeels
 * @see #setLookAndFeel
 * @see #getInstalledLookAndFeels
 */
static public boolean removeAuxiliaryLookAndFeel(LookAndFeel laf) {
    maybeInitialize();

    boolean result;

    Vector<LookAndFeel> v = getLAFState().auxLookAndFeels;
    if ((v == null) || (v.size() == 0)) {
        return false;
    }

    result = v.removeElement(laf);
    if (result) {
        if (v.size() == 0) {
            getLAFState().auxLookAndFeels = null;
            getLAFState().multiLookAndFeel = null;
        } else {
            getLAFState().auxLookAndFeels = v;
        }
    }
    laf.uninitialize();

    return result;
}
 
Example 2
/**
 * Removes a <code>LookAndFeel</code> from the list of auxiliary look and feels.
 * The auxiliary look and feels tell the multiplexing look and feel what
 * other <code>LookAndFeel</code> classes for a component instance are to be used
 * in addition to the default <code>LookAndFeel</code> class when creating a
 * multiplexing UI.  The change will only take effect when a new
 * UI class is created or when the default look and feel is changed
 * on a component instance.
 * <p>Note these are not the same as the installed look and feels.
 * @return true if the <code>LookAndFeel</code> was removed from the list
 * @see #removeAuxiliaryLookAndFeel
 * @see #getAuxiliaryLookAndFeels
 * @see #setLookAndFeel
 * @see #getInstalledLookAndFeels
 */
static public boolean removeAuxiliaryLookAndFeel(LookAndFeel laf) {
    maybeInitialize();

    boolean result;

    Vector<LookAndFeel> v = getLAFState().auxLookAndFeels;
    if ((v == null) || (v.size() == 0)) {
        return false;
    }

    result = v.removeElement(laf);
    if (result) {
        if (v.size() == 0) {
            getLAFState().auxLookAndFeels = null;
            getLAFState().multiLookAndFeel = null;
        } else {
            getLAFState().auxLookAndFeels = v;
        }
    }
    laf.uninitialize();

    return result;
}
 
Example 3
/**
 * Removes a <code>LookAndFeel</code> from the list of auxiliary look and feels.
 * The auxiliary look and feels tell the multiplexing look and feel what
 * other <code>LookAndFeel</code> classes for a component instance are to be used
 * in addition to the default <code>LookAndFeel</code> class when creating a
 * multiplexing UI.  The change will only take effect when a new
 * UI class is created or when the default look and feel is changed
 * on a component instance.
 * <p>Note these are not the same as the installed look and feels.
 * @return true if the <code>LookAndFeel</code> was removed from the list
 * @see #removeAuxiliaryLookAndFeel
 * @see #getAuxiliaryLookAndFeels
 * @see #setLookAndFeel
 * @see #getInstalledLookAndFeels
 */
static public boolean removeAuxiliaryLookAndFeel(LookAndFeel laf) {
    maybeInitialize();

    boolean result;

    Vector<LookAndFeel> v = getLAFState().auxLookAndFeels;
    if ((v == null) || (v.size() == 0)) {
        return false;
    }

    result = v.removeElement(laf);
    if (result) {
        if (v.size() == 0) {
            getLAFState().auxLookAndFeels = null;
            getLAFState().multiLookAndFeel = null;
        } else {
            getLAFState().auxLookAndFeels = v;
        }
    }
    laf.uninitialize();

    return result;
}
 
Example 4
Source Project: jdk8u60   File: UIManager.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Removes a <code>LookAndFeel</code> from the list of auxiliary look and feels.
 * The auxiliary look and feels tell the multiplexing look and feel what
 * other <code>LookAndFeel</code> classes for a component instance are to be used
 * in addition to the default <code>LookAndFeel</code> class when creating a
 * multiplexing UI.  The change will only take effect when a new
 * UI class is created or when the default look and feel is changed
 * on a component instance.
 * <p>Note these are not the same as the installed look and feels.
 * @return true if the <code>LookAndFeel</code> was removed from the list
 * @see #removeAuxiliaryLookAndFeel
 * @see #getAuxiliaryLookAndFeels
 * @see #setLookAndFeel
 * @see #getInstalledLookAndFeels
 */
static public boolean removeAuxiliaryLookAndFeel(LookAndFeel laf) {
    maybeInitialize();

    boolean result;

    Vector<LookAndFeel> v = getLAFState().auxLookAndFeels;
    if ((v == null) || (v.size() == 0)) {
        return false;
    }

    result = v.removeElement(laf);
    if (result) {
        if (v.size() == 0) {
            getLAFState().auxLookAndFeels = null;
            getLAFState().multiLookAndFeel = null;
        } else {
            getLAFState().auxLookAndFeels = v;
        }
    }
    laf.uninitialize();

    return result;
}
 
Example 5
/**
 * Removes a <code>LookAndFeel</code> from the list of auxiliary look and feels.
 * The auxiliary look and feels tell the multiplexing look and feel what
 * other <code>LookAndFeel</code> classes for a component instance are to be used
 * in addition to the default <code>LookAndFeel</code> class when creating a
 * multiplexing UI.  The change will only take effect when a new
 * UI class is created or when the default look and feel is changed
 * on a component instance.
 * <p>Note these are not the same as the installed look and feels.
 * @return true if the <code>LookAndFeel</code> was removed from the list
 * @see #removeAuxiliaryLookAndFeel
 * @see #getAuxiliaryLookAndFeels
 * @see #setLookAndFeel
 * @see #getInstalledLookAndFeels
 */
static public boolean removeAuxiliaryLookAndFeel(LookAndFeel laf) {
    maybeInitialize();

    boolean result;

    Vector<LookAndFeel> v = getLAFState().auxLookAndFeels;
    if ((v == null) || (v.size() == 0)) {
        return false;
    }

    result = v.removeElement(laf);
    if (result) {
        if (v.size() == 0) {
            getLAFState().auxLookAndFeels = null;
            getLAFState().multiLookAndFeel = null;
        } else {
            getLAFState().auxLookAndFeels = v;
        }
    }
    laf.uninitialize();

    return result;
}
 
Example 6
/**
 * Removes a <code>LookAndFeel</code> from the list of auxiliary look and feels.
 * The auxiliary look and feels tell the multiplexing look and feel what
 * other <code>LookAndFeel</code> classes for a component instance are to be used
 * in addition to the default <code>LookAndFeel</code> class when creating a
 * multiplexing UI.  The change will only take effect when a new
 * UI class is created or when the default look and feel is changed
 * on a component instance.
 * <p>Note these are not the same as the installed look and feels.
 * @return true if the <code>LookAndFeel</code> was removed from the list
 * @see #removeAuxiliaryLookAndFeel
 * @see #getAuxiliaryLookAndFeels
 * @see #setLookAndFeel
 * @see #getInstalledLookAndFeels
 */
static public boolean removeAuxiliaryLookAndFeel(LookAndFeel laf) {
    maybeInitialize();

    boolean result;

    Vector<LookAndFeel> v = getLAFState().auxLookAndFeels;
    if ((v == null) || (v.size() == 0)) {
        return false;
    }

    result = v.removeElement(laf);
    if (result) {
        if (v.size() == 0) {
            getLAFState().auxLookAndFeels = null;
            getLAFState().multiLookAndFeel = null;
        } else {
            getLAFState().auxLookAndFeels = v;
        }
    }
    laf.uninitialize();

    return result;
}
 
Example 7
/**
 * Removes a <code>LookAndFeel</code> from the list of auxiliary look and feels.
 * The auxiliary look and feels tell the multiplexing look and feel what
 * other <code>LookAndFeel</code> classes for a component instance are to be used
 * in addition to the default <code>LookAndFeel</code> class when creating a
 * multiplexing UI.  The change will only take effect when a new
 * UI class is created or when the default look and feel is changed
 * on a component instance.
 * <p>Note these are not the same as the installed look and feels.
 * @return true if the <code>LookAndFeel</code> was removed from the list
 * @see #removeAuxiliaryLookAndFeel
 * @see #getAuxiliaryLookAndFeels
 * @see #setLookAndFeel
 * @see #getInstalledLookAndFeels
 */
static public boolean removeAuxiliaryLookAndFeel(LookAndFeel laf) {
    maybeInitialize();

    boolean result;

    Vector<LookAndFeel> v = getLAFState().auxLookAndFeels;
    if ((v == null) || (v.size() == 0)) {
        return false;
    }

    result = v.removeElement(laf);
    if (result) {
        if (v.size() == 0) {
            getLAFState().auxLookAndFeels = null;
            getLAFState().multiLookAndFeel = null;
        } else {
            getLAFState().auxLookAndFeels = v;
        }
    }
    laf.uninitialize();

    return result;
}
 
Example 8
public synchronized void removeRelationSetListener(RelationSetListener l) {
  if(listeners != null && listeners.contains(l)) {
    @SuppressWarnings("unchecked")
    Vector<RelationSetListener> v =
            (Vector<RelationSetListener>)listeners.clone();
    v.removeElement(l);
    listeners = v;
  }
}
 
Example 9
Source Project: netbeans   File: DebuggerManager.java    License: Apache License 2.0 5 votes vote down vote up
/** 
 * Remove a debuggerManager listener to changes of watches and breakpoints.
 *
 * @param propertyName a name of property to listen on
 * @param l the debuggerManager listener to remove
 */
public void removeDebuggerListener (
    String propertyName, 
    DebuggerManagerListener l
) {
    synchronized (listenersMap) {
        Vector listeners = (Vector) listenersMap.get (propertyName);
        if (listeners == null) return;
        listeners.removeElement (l);
        if (listeners.size () == 0)
            listenersMap.remove (propertyName);
    }
}
 
Example 10
public synchronized void removeCreoleListener(CreoleListener l) {
  if(creoleListeners != null && creoleListeners.contains(l)) {
    @SuppressWarnings("unchecked")
    Vector<CreoleListener> v =
            (Vector<CreoleListener>)creoleListeners.clone();
    v.removeElement(l);
    creoleListeners = v;
  }// if
}
 
Example 11
/**
 *
 * Removes an annotation listener
 */
@Override
public synchronized void removeAnnotationListener(AnnotationListener l) {
  if (annotationListeners != null && annotationListeners.contains(l)) {
    @SuppressWarnings("unchecked")
    Vector<AnnotationListener> v = (Vector<AnnotationListener>) annotationListeners.clone();
    v.removeElement(l);
    annotationListeners = v;
  }
}
 
Example 12
@Override
public synchronized void removeAnnotationSetListener(AnnotationSetListener l) {
  if(annotationSetListeners != null && annotationSetListeners.contains(l)) {
    @SuppressWarnings("unchecked")
    Vector<AnnotationSetListener> v = (Vector<AnnotationSetListener>)annotationSetListeners.clone();
    v.removeElement(l);
    annotationSetListeners = v;
  }
}
 
Example 13
@Override
public synchronized void removeGateListener(GateListener l) {
  if(gateListeners != null && gateListeners.contains(l)) {
    @SuppressWarnings("unchecked")
    Vector<GateListener> v = (Vector<GateListener>)gateListeners.clone();
    v.removeElement(l);
    gateListeners = v;
  }
}
 
Example 14
private static void cacheRemove(String host, int port, Https http) {
    Vector v = (Vector) cache.get(cacheKey(host, port));
    if (v != null) {
        v.removeElement(http);
        if (v.isEmpty()) {
            cache.remove(cacheKey(host, port));
        }
    }
}
 
Example 15
Source Project: gemfirexd-oss   File: CoordGmsImpl.java    License: Apache License 2.0 5 votes vote down vote up
/** Removed rejected merge requests from merge_rsps and coords */
protected/*GemStoneAddition*/ void removeRejectedMergeRequests(Vector coords) {
    MergeData data;
    for(Iterator it=merge_rsps.iterator(); it.hasNext();) {
        data=(MergeData)it.next();
        if(data.merge_rejected) {
            if(data.getSender() != null && coords != null)
                coords.removeElement(data.getSender());
            it.remove();
            if(log.isDebugEnabled()) log.debug("removed element " + data);
        }
    }
}
 
Example 16
@Override
public synchronized void removeDocumentListener(DocumentListener l) {
  if(documentListeners != null && documentListeners.contains(l)) {
    @SuppressWarnings("unchecked")
    Vector<DocumentListener> v = (Vector<DocumentListener>)documentListeners.clone();
    v.removeElement(l);
    documentListeners = v;
  }
}
 
Example 17
public synchronized void removeStatusListener(StatusListener l) {
  if (statusListeners != null && statusListeners.contains(l)) {
    @SuppressWarnings("unchecked")
    Vector<StatusListener> v = (Vector<StatusListener>) statusListeners.clone();
    v.removeElement(l);
    statusListeners = v;
  }
}
 
Example 18
@SuppressWarnings("unchecked")
public synchronized void removeProgressListener(ProgressListener l) {
  if(progressListeners != null && progressListeners.contains(l)) {
    Vector<ProgressListener> v = (Vector<ProgressListener>)progressListeners
            .clone();
    v.removeElement(l);
    progressListeners = v;
  }
}
 
Example 19
/**
 * Removes a {@link gate.event.ProgressListener} from the list of listeners
 * for this processing resource.
 */
public synchronized void removeProgressListener(ProgressListener l) {
  if (progressListeners != null && progressListeners.contains(l)) {
    @SuppressWarnings("unchecked")
    Vector<ProgressListener> v = (Vector<ProgressListener>)progressListeners.clone();
    v.removeElement(l);
    progressListeners = v;
  }
}
 
Example 20
Source Project: jmg   File: Score.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
 * Deletes the last Part added to the Score
 */
 public void removeLastPart() {
    Vector vct = (Vector)this.partList;
    vct.removeElement(vct.lastElement());
}