当前位置: 首页>>代码示例>>Java>>正文


Java ListPeer.deselect方法代码示例

本文整理汇总了Java中java.awt.peer.ListPeer.deselect方法的典型用法代码示例。如果您正苦于以下问题:Java ListPeer.deselect方法的具体用法?Java ListPeer.deselect怎么用?Java ListPeer.deselect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.peer.ListPeer的用法示例。


在下文中一共展示了ListPeer.deselect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deselect

import java.awt.peer.ListPeer; //导入方法依赖的package包/类
/**
 * Deselects the item at the specified index.
 * <p>
 * Note that passing out of range parameters is invalid,
 * and will result in unspecified behavior.
 * <p>
 * If the item at the specified index is not selected,
 * then the operation is ignored.
 * @param        index the position of the item to deselect
 * @see          #select
 * @see          #getSelectedItem
 * @see          #isIndexSelected
 */
public synchronized void deselect(int index) {
    ListPeer peer = (ListPeer)this.peer;
    if (peer != null) {
        if (isMultipleMode() || (getSelectedIndex() == index)) {
            peer.deselect(index);
        }
    }

    for (int i = 0 ; i < selected.length ; i++) {
        if (selected[i] == index) {
            int newsel[] = new int[selected.length - 1];
            System.arraycopy(selected, 0, newsel, 0, i);
            System.arraycopy(selected, i+1, newsel, i, selected.length - (i+1));
            selected = newsel;
            return;
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:List.java

示例2: deselect

import java.awt.peer.ListPeer; //导入方法依赖的package包/类
/**
 * Makes the item at the specified index not selected.
 *
 * @param index The index of the item to unselect.
 */
public synchronized void deselect(int index)
{
  if (isSelected(index))
    {
      ListPeer lp = (ListPeer)getPeer();
      if (lp != null)
        lp.deselect(index);

      int[] temp = new int[selected.length - 1];
      for (int i = 0; i < temp.length; i++)
        {
          if (selected[i] != index)
            temp[i] = selected[i];
          else
            {
              System.arraycopy(selected, i + 1, temp, i,
                               selected.length - i - 1);
              break;
            }
        }
      selected = temp;
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:29,代码来源:List.java

示例3: deselect

import java.awt.peer.ListPeer; //导入方法依赖的package包/类
/**
 * Makes the item at the specified index not selected.
 *
 * @param index The index of the item to unselect.
 */
public synchronized void deselect(int index)
{
  if (isSelected(index))
    {
      ListPeer lp = (ListPeer)getPeer();
      if (lp != null)
        lp.deselect(index);

      int[] temp = new int[selected.length - 1];
      for (int i = 0; i < temp.length; i++)
        {
          if (selected[i] != index)
            temp[i] = selected[i];
          else
            {
              System.arraycopy(selected, i + 1, temp, i, 
                               selected.length - i - 1);
              break;
            }
        }
      selected = temp;
    }
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:29,代码来源:List.java

示例4: deselect

import java.awt.peer.ListPeer; //导入方法依赖的package包/类
/**
    * Deselects the item at the specified index.
    * <p>
    * Note that passing out of range parameters is invalid, 
    * and will result in unspecified behavior.  
    * <p>
    * If the item at the specified index is not selected,
    * then the operation is ignored.
    * @param        index the position of the item to deselect
    * @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];
	System.arraycopy(selected, 0, newsel, 0, i);
	System.arraycopy(selected, i+1, newsel, i, selected.length - (i+1));
	selected = newsel;
	return;
    }
}
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:30,代码来源:List.java


注:本文中的java.awt.peer.ListPeer.deselect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。