java.awt.Container.removeMouseListener()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(156)

本文整理了Java中java.awt.Container.removeMouseListener()方法的一些代码示例,展示了Container.removeMouseListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Container.removeMouseListener()方法的具体详情如下:
包路径:java.awt.Container
类名称:Container
方法名:removeMouseListener

Container.removeMouseListener介绍

暂无

代码示例

代码示例来源:origin: edu.ucar/grib

/**
 * Removes the specified mouse listener so that it no longer receives
 * mouse events from this component.
 *
 * @param l the mouse listener
 * */
public synchronized void removeMouseListener(MouseListener l) {
  super.removeMouseListener(l);
  imgDisplay.removeMouseListener(l);
}

代码示例来源:origin: edu.ucar/jj2000

/**
 * Removes the specified mouse listener so that it no longer receives
 * mouse events from this component.
 *
 * @param l the mouse listener
 * */
public synchronized void removeMouseListener(MouseListener l) {
  super.removeMouseListener(l);
  imgDisplay.removeMouseListener(l);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide-loaders

public void removeNotify() {
  try {
    getParent().removeMouseListener(listener);
  } finally {
    super.removeNotify();
  }
}

代码示例来源:origin: net.sf.cuf/cuf-swing

/**
 * Process add/remove of the table to/from a parent.
 * We have to install mouse listeners in order to get the context menu working properly
 * for tables that are embedded into a {@link javax.swing.JScrollPane}.
 */
private void checkTableParent()
{
  if ( (mMode & CONTEXT_MENU_IN_VIEWPORT) != 0 )  // only install mouse listener in corresponding mode
  {
    Container currentParent = mTable.getParent();
    if ( currentParent != mTableParent)
    {
      // remove contect menu mouse listener from previous parent
      if ( mTableParent != null )
      {
        mTableParent.removeMouseListener(this);
        mTableParent = null;
      }
      // add context menu mouse listener to new parent
      if ( currentParent instanceof JViewport )
      {
        mTableParent = currentParent;
        mTableParent.addMouseListener(this);
      }
    }
  }
}

代码示例来源:origin: net.sf.cuf/cuf-swing

/**
 * Set the mode as a bitflag consisting of
 * {@link #CONTEXT_MENU_IN_TABLE}, {@link #CONTEXT_MENU_IN_HEADER} and {@link #CONTEXT_MENU_IN_VIEWPORT}.
 * @param  pMode  new mode
 */
public void setMode(final int pMode)
{
  // remove old listeners
  if ( (this.mMode & CONTEXT_MENU_IN_HEADER) != 0 )
    mTable.getTableHeader().removeMouseListener(this);
  if ( (this.mMode & CONTEXT_MENU_IN_TABLE) != 0 )
    mTable.removeMouseListener(this);
  if ( mTableParent != null )  // tableParent is only set when there is a listener installed in it
  {
    mTableParent.removeMouseListener(this);
    mTableParent = null;
  }
  // add new listeners
  this.mMode = pMode;
  if ( (pMode & CONTEXT_MENU_IN_HEADER) != 0 )
    mTable.getTableHeader().addMouseListener(this);
  if ( (pMode & CONTEXT_MENU_IN_TABLE) != 0 )
    mTable.addMouseListener(this);
  checkTableParent();
}

相关文章

微信公众号

最新文章

更多

Container类方法