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


Java HierarchyEvent.ANCESTOR_MOVED屬性代碼示例

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


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

示例1: processHierarchyBoundsEvent

/**
 * Called when a hierarchy bounds event is dispatched and component events
 * are enabled. This method passes the event along to any listeners that are
 * attached.
 *
 * @param e the <code>HierarchyEvent</code> to process
 * @throws NullPointerException if e is null
 * @see HierarchyBoundsListener
 * @see #addHierarchyBoundsListener(HierarchyBoundsListener)
 * @see #enableEvents(long)
 * @since 1.3
 */
protected void processHierarchyBoundsEvent(HierarchyEvent e)
{
  if (hierarchyBoundsListener == null)
    return;
  switch (e.id)
    {
      case HierarchyEvent.ANCESTOR_MOVED:
        hierarchyBoundsListener.ancestorMoved(e);
      break;
      case HierarchyEvent.ANCESTOR_RESIZED:
        hierarchyBoundsListener.ancestorResized(e);
      break;
    }
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:26,代碼來源:Component.java

示例2: fireHierarchyEvent

/**
 * Fires hierarchy events to the children of this container and this
 * container itself. This overrides {@link Component#fireHierarchyEvent}
 * in order to forward this event to all children.
 */
void fireHierarchyEvent(int id, Component changed, Container parent,
                        long flags)
{
  // Only propagate event if there is actually a listener waiting for it.
  if ((id == HierarchyEvent.HIERARCHY_CHANGED && numHierarchyListeners > 0)
      || ((id == HierarchyEvent.ANCESTOR_MOVED
           || id == HierarchyEvent.ANCESTOR_RESIZED)
          && numHierarchyBoundsListeners > 0))
    {
      for (int i = 0; i < ncomponents; i++)
        component[i].fireHierarchyEvent(id, changed, parent, flags);
      super.fireHierarchyEvent(id, changed, parent, flags);
    }
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:19,代碼來源:Container.java

示例3: processHierarchyBoundsEvent

protected void processHierarchyBoundsEvent(HierarchyEvent e) {
    for (HierarchyBoundsListener listener : hierarchyBoundsListeners.getUserListeners()) {
        switch (e.getID()) {
            case HierarchyEvent.ANCESTOR_MOVED:
                listener.ancestorMoved(e);
                break;
            case HierarchyEvent.ANCESTOR_RESIZED:
                listener.ancestorResized(e);
                break;
        }
    }
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:12,代碼來源:Component.java

示例4: eventTypeEnabled

/**
 * Tells whether or not an event type is enabled.
 */
boolean eventTypeEnabled (int type)
{
  if (type > AWTEvent.RESERVED_ID_MAX)
    return true;

  switch (type)
    {
    case HierarchyEvent.HIERARCHY_CHANGED:
      return (hierarchyListener != null
          || (eventMask & AWTEvent.HIERARCHY_EVENT_MASK) != 0);

    case HierarchyEvent.ANCESTOR_MOVED:
    case HierarchyEvent.ANCESTOR_RESIZED:
      return (hierarchyBoundsListener != null
          || (eventMask & AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK) != 0);

    case ComponentEvent.COMPONENT_HIDDEN:
    case ComponentEvent.COMPONENT_MOVED:
    case ComponentEvent.COMPONENT_RESIZED:
    case ComponentEvent.COMPONENT_SHOWN:
      return (componentListener != null
              || (eventMask & AWTEvent.COMPONENT_EVENT_MASK) != 0);

    case KeyEvent.KEY_PRESSED:
    case KeyEvent.KEY_RELEASED:
    case KeyEvent.KEY_TYPED:
      return (keyListener != null
              || (eventMask & AWTEvent.KEY_EVENT_MASK) != 0);

    case MouseEvent.MOUSE_CLICKED:
    case MouseEvent.MOUSE_ENTERED:
    case MouseEvent.MOUSE_EXITED:
    case MouseEvent.MOUSE_PRESSED:
    case MouseEvent.MOUSE_RELEASED:
      return (mouseListener != null
              || (eventMask & AWTEvent.MOUSE_EVENT_MASK) != 0);
    case MouseEvent.MOUSE_MOVED:
    case MouseEvent.MOUSE_DRAGGED:
      return (mouseMotionListener != null
              || (eventMask & AWTEvent.MOUSE_MOTION_EVENT_MASK) != 0);
    case MouseEvent.MOUSE_WHEEL:
      return (mouseWheelListener != null
              || (eventMask & AWTEvent.MOUSE_WHEEL_EVENT_MASK) != 0);

    case FocusEvent.FOCUS_GAINED:
    case FocusEvent.FOCUS_LOST:
      return (focusListener != null
              || (eventMask & AWTEvent.FOCUS_EVENT_MASK) != 0);

    case InputMethodEvent.INPUT_METHOD_TEXT_CHANGED:
    case InputMethodEvent.CARET_POSITION_CHANGED:
      return (inputMethodListener != null
              || (eventMask & AWTEvent.INPUT_METHOD_EVENT_MASK) != 0);

    case PaintEvent.PAINT:
    case PaintEvent.UPDATE:
      return (eventMask & AWTEvent.PAINT_EVENT_MASK) != 0;

    default:
      return false;
    }
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:65,代碼來源:Component.java

示例5: eventTypeEnabled

/**
 * Tells whether or not an event type is enabled.
 */
boolean eventTypeEnabled (int type)
{
  if (type > AWTEvent.RESERVED_ID_MAX)
    return true;

  switch (type)
    {
    case HierarchyEvent.HIERARCHY_CHANGED:
      return (hierarchyListener != null 
          || (eventMask & AWTEvent.HIERARCHY_EVENT_MASK) != 0);
      
    case HierarchyEvent.ANCESTOR_MOVED:
    case HierarchyEvent.ANCESTOR_RESIZED:
      return (hierarchyBoundsListener != null 
          || (eventMask & AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK) != 0);
      
    case ComponentEvent.COMPONENT_HIDDEN:
    case ComponentEvent.COMPONENT_MOVED:
    case ComponentEvent.COMPONENT_RESIZED:
    case ComponentEvent.COMPONENT_SHOWN:
      return (componentListener != null
              || (eventMask & AWTEvent.COMPONENT_EVENT_MASK) != 0);

    case KeyEvent.KEY_PRESSED:
    case KeyEvent.KEY_RELEASED:
    case KeyEvent.KEY_TYPED:
      return (keyListener != null
              || (eventMask & AWTEvent.KEY_EVENT_MASK) != 0);

    case MouseEvent.MOUSE_CLICKED:
    case MouseEvent.MOUSE_ENTERED:
    case MouseEvent.MOUSE_EXITED:
    case MouseEvent.MOUSE_PRESSED:
    case MouseEvent.MOUSE_RELEASED:
      return (mouseListener != null
              || (eventMask & AWTEvent.MOUSE_EVENT_MASK) != 0);
    case MouseEvent.MOUSE_MOVED:
    case MouseEvent.MOUSE_DRAGGED:
      return (mouseMotionListener != null
              || (eventMask & AWTEvent.MOUSE_MOTION_EVENT_MASK) != 0);
    case MouseEvent.MOUSE_WHEEL:
      return (mouseWheelListener != null
              || (eventMask & AWTEvent.MOUSE_WHEEL_EVENT_MASK) != 0);
      
    case FocusEvent.FOCUS_GAINED:
    case FocusEvent.FOCUS_LOST:
      return (focusListener != null
              || (eventMask & AWTEvent.FOCUS_EVENT_MASK) != 0);

    case InputMethodEvent.INPUT_METHOD_TEXT_CHANGED:
    case InputMethodEvent.CARET_POSITION_CHANGED:
      return (inputMethodListener != null
              || (eventMask & AWTEvent.INPUT_METHOD_EVENT_MASK) != 0);
      
    case PaintEvent.PAINT:
    case PaintEvent.UPDATE:
      return (eventMask & AWTEvent.PAINT_EVENT_MASK) != 0;
      
    default:
      return false;
    }
}
 
開發者ID:nmldiegues,項目名稱:jvm-stm,代碼行數:65,代碼來源:Component.java


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