當前位置: 首頁>>代碼示例>>Java>>正文


Java JComponent.removeMouseMotionListener方法代碼示例

本文整理匯總了Java中javax.swing.JComponent.removeMouseMotionListener方法的典型用法代碼示例。如果您正苦於以下問題:Java JComponent.removeMouseMotionListener方法的具體用法?Java JComponent.removeMouseMotionListener怎麽用?Java JComponent.removeMouseMotionListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JComponent的用法示例。


在下文中一共展示了JComponent.removeMouseMotionListener方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: registerComponent

import javax.swing.JComponent; //導入方法依賴的package包/類
/**
    * Registers a component for tooltip management.
    * <p>
    * This will register key bindings to show and hide the tooltip text
    * only if <code>component</code> has focus bindings. This is done
    * so that components that are not normally focus traversable, such
    * as <code>JLabel</code>, are not made focus traversable as a result
    * of invoking this method.
    *
    * @param component  a <code>JComponent</code> object to add
    * @see JComponent#isFocusTraversable
    */
   protected void registerComponent(JComponent component) {
       component.removeMouseListener(this);
       component.addMouseListener(this);
       component.removeMouseMotionListener(moveBeforeEnterListener);
component.addMouseMotionListener(moveBeforeEnterListener);

if (shouldRegisterBindings(component)) {
    // register our accessibility keybindings for this component
    // this will apply globally across L&F
    // Post Tip: Ctrl+F1
    // Unpost Tip: Esc and Ctrl+F1
    InputMap inputMap = component.getInputMap(JComponent.WHEN_FOCUSED);
    ActionMap actionMap = component.getActionMap();

    if (inputMap != null && actionMap != null) {
               //XXX remove
    }
}
   }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:32,代碼來源:ToolTipManagerEx.java

示例2: unregisterComponent

import javax.swing.JComponent; //導入方法依賴的package包/類
/**
    * Removes a component from tooltip control.
    *
    * @param component  a <code>JComponent</code> object to remove
    */
   protected void unregisterComponent(JComponent component) {
       component.removeMouseListener(this);
component.removeMouseMotionListener(moveBeforeEnterListener);

if (shouldRegisterBindings(component)) {
    InputMap inputMap = component.getInputMap(JComponent.WHEN_FOCUSED);
    ActionMap actionMap = component.getActionMap();

    if (inputMap != null && actionMap != null) {
               //XXX remove
    }
}
   }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:19,代碼來源:ToolTipManagerEx.java

示例3: initiateToolTip

import javax.swing.JComponent; //導入方法依賴的package包/類
private void initiateToolTip(MouseEvent event) {
       if (event.getSource() == window) {
           return;
       }
       JComponent component = (JComponent)event.getSource();
component.removeMouseMotionListener(moveBeforeEnterListener);

       exitTimer.stop();

Point location = event.getPoint();
// ensure tooltip shows only in proper place
if (location.x < 0 || 
    location.x >=component.getWidth() ||
    location.y < 0 ||
    location.y >= component.getHeight()) {
    return;
}

       if (insideComponent != null) {
           enterTimer.stop();
       }
// A component in an unactive internal frame is sent two
// mouseEntered events, make sure we don't end up adding
// ourselves an extra time.
       component.removeMouseMotionListener(this);
       component.addMouseMotionListener(this);

       boolean sameComponent = (insideComponent == component);

       insideComponent = component;
if (tipWindow != null){
           mouseEvent = event;
           if (showImmediately) {
               Rectangle rect = provider.getToolTipSourceBounds( event.getPoint() );
               if( null != rect ) {
                   String newToolTipText = startToolTipCalculation( rect, event.getPoint() );

                   if (!sameComponent || !toolTipText.equals(newToolTipText) /*|| 
                            !sameLoc*/) {
                       toolTipText = newToolTipText;
                       showTipWindow();
                   }
               }
           } else {
               enterTimer.start();
           }
       }
   }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:49,代碼來源:ToolTipManagerEx.java


注:本文中的javax.swing.JComponent.removeMouseMotionListener方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。