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


Java HierarchyEvent.ANCESTOR_RESIZED属性代码示例

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


在下文中一共展示了HierarchyEvent.ANCESTOR_RESIZED属性的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_RESIZED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。