Package java.awt.peer

Examples of java.awt.peer.ListPeer


     * Removes the peer for this list.  The peer allows us to modify the
     * list's appearance without changing its functionality.
     */
    public void removeNotify() {
      synchronized (getTreeLock()) {
      ListPeer peer = (ListPeer)this.peer;
      if (peer != null) {
    selected = peer.getSelectedIndexes();
      }
      super.removeNotify();
  }
    }
View Full Code Here


      items.addElement(item);
  } else {
      items.insertElementAt(item, index);
  }

  ListPeer peer = (ListPeer)this.peer;
  if (peer != null) {
      peer.addItem(item, index);
  }
    }
View Full Code Here

     * @deprecated As of JDK version 1.1,
     * replaced by <code>removeAll()</code>.
     */
    @Deprecated
    public synchronized void clear() {
  ListPeer peer = (ListPeer)this.peer;
  if (peer != null) {
      peer.clear();
  }
  items = new Vector();
  selected = new int[0];
    }
View Full Code Here

     * @see           #select
     * @see           #deselect
     * @see           #isIndexSelected
     */
    public synchronized int[] getSelectedIndexes() {
  ListPeer peer = (ListPeer)this.peer;
  if (peer != null) {
      selected = ((ListPeer)peer).getSelectedIndexes();
  }
  return (int[])selected.clone();
    }
View Full Code Here

        // because it is called from the Window Thread.  It is sufficient to
        // synchronize the code that manipulates 'selected' except for the
        // case where the peer changes.  To handle this case, we simply
        // repeat the selection process.
        
        ListPeer peer;
        do {
            peer = (ListPeer)this.peer;
            if (peer != null) {
                peer.select(index);
                return;
            }
            
            synchronized(this)
            {
View Full Code Here

     * @see          #select
     * @see          #getSelectedItem
     * @see          #isIndexSelected
     */
    public synchronized void deselect(int index) {
  ListPeer peer = (ListPeer)this.peer;
  if (peer != null) {
      peer.deselect(index);
  }

  for (int i = 0 ; i < selected.length ; i++) {
      if (selected[i] == index) {
    int newsel[] = new int[selected.length - 1];
View Full Code Here

     */
    @Deprecated
    public synchronized void setMultipleSelections(boolean b) {
  if (b != multipleMode) {
      multipleMode = b;
      ListPeer peer = (ListPeer)this.peer;
      if (peer != null) {
    peer.setMultipleSelections(b);
      }
  }
    }
View Full Code Here

     * @param       index    the position of the item
     * @see         #getVisibleIndex
     */
    public synchronized void makeVisible(int index) {
  visibleIndex = index;
  ListPeer peer = (ListPeer)this.peer;
  if (peer != null) {
      peer.makeVisible(index);
  }
    }
View Full Code Here

     * replaced by <code>getPreferredSize(int)</code>.
     */
    @Deprecated
    public Dimension preferredSize(int rows) {
        synchronized (getTreeLock()) {
      ListPeer peer = (ListPeer)this.peer;
      return (peer != null) ?
           peer.preferredSize(rows) :
           super.preferredSize();
        }
    }
View Full Code Here

     * replaced by <code>getMinimumSize(int)</code>.
     */
    @Deprecated
    public Dimension minimumSize(int rows) {
        synchronized (getTreeLock()) {
      ListPeer peer = (ListPeer)this.peer;
      return (peer != null) ?
           peer.minimumSize(rows) :
           super.minimumSize();
        }
    }
View Full Code Here

TOP

Related Classes of java.awt.peer.ListPeer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.