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


Java HierarchyEvent.DISPLAYABILITY_CHANGED属性代码示例

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


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

示例1: installListeners

@Override
protected void installListeners() {
    if (WindowsLookAndFeel.isOnVista()) {
        installWindowListener();
        hierarchyListener =
            new HierarchyListener() {
                public void hierarchyChanged(HierarchyEvent e) {
                    if ((e.getChangeFlags()
                            & HierarchyEvent.DISPLAYABILITY_CHANGED) != 0) {
                        if (menuBar.isDisplayable()) {
                            installWindowListener();
                        } else {
                            uninstallWindowListener();
                        }
                    }
                }
        };
        menuBar.addHierarchyListener(hierarchyListener);
    }
    super.installListeners();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:WindowsMenuBarUI.java

示例2: finishHierarchyChange

void finishHierarchyChange(Component changed, Container changedParent, int ancestorFlags) {
    if (--hierarchyChangingCounter == 0) {
        int changeFlags = ancestorFlags;
        if (wasShowing != isShowing()) {
            changeFlags |= HierarchyEvent.SHOWING_CHANGED;
        }
        if (wasDisplayable != isDisplayable()) {
            changeFlags |= HierarchyEvent.DISPLAYABILITY_CHANGED;
        }
        if (changeFlags > 0) {
            postEvent(new HierarchyEvent(this, HierarchyEvent.HIERARCHY_CHANGED, changed,
                    changedParent, changeFlags));
        }
        finishChildrenHierarchyChange(changed, changedParent, ancestorFlags);
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:16,代码来源:Component.java

示例3: hierarchyChanged

@Override
    public void hierarchyChanged(HierarchyEvent event) {
        if ((event.getChangeFlags() & HierarchyEvent.DISPLAYABILITY_CHANGED) != 0) {
            if (isDisplayable()) {
//                for (Tile tile: dimension.getTiles()) {
//                    threeDeeRenderManager.renderTile(tile);
//                }
                timer = new Timer(250, this);
                timer.start();
            } else {
                timer.stop();
                timer = null;
                threeDeeRenderManager.stop();
                for (Tile tile : dimension.getTiles()) {
                    tile.removeListener(this);
                }
                dimension.removeDimensionListener(this);
            }
        }
    }
 
开发者ID:Captain-Chaos,项目名称:WorldPainter,代码行数:20,代码来源:ThreeDeeView.java

示例4: hierarchyChanged

@Override
public void hierarchyChanged(HierarchyEvent e) {
	if((e.getChangeFlags() & HierarchyEvent.DISPLAYABILITY_CHANGED) != 0 && isDisplayable()) {
		createBufferStrategy(2);
		requestFocus();
	}
}
 
开发者ID:sylvain121,项目名称:Xpra-client-android,代码行数:7,代码来源:XpraCanvas.java

示例5: addNotify

/**
 * Called when the parent of this Component is made visible or when
 * the Component is added to an already visible Container and needs
 * to be shown.  A native peer - if any - is created at this
 * time. This method is called automatically by the AWT system and
 * should not be called by user level code.
 *
 * @see #isDisplayable()
 * @see #removeNotify()
 */
public void addNotify()
{
  // We need to lock the tree here to avoid races and inconsistencies.
  synchronized (getTreeLock())
    {
      if (peer == null)
        peer = getToolkit().createComponent(this);
      else if (parent != null && parent.isLightweight())
        new HeavyweightInLightweightListener(parent);
      // Now that all the children has gotten their peers, we should
      // have the event mask needed for this component and its
      //lightweight subcomponents.
      peer.setEventMask(eventMask);

      // We used to leave the invalidate() to the peer. However, I put it
      // back here for 2 reasons: 1) The RI does call invalidate() from
      // addNotify(); 2) The peer shouldn't be bother with validation too
      // much.
      invalidate();

      if (dropTarget != null)
        dropTarget.addNotify(peer);

      // Fetch the peerFont for later installation in validate().
      peerFont = getFont();

      // Notify hierarchy listeners.
      long flags = HierarchyEvent.DISPLAYABILITY_CHANGED;
      if (isHierarchyVisible())
        flags |= HierarchyEvent.SHOWING_CHANGED;
      fireHierarchyEvent(HierarchyEvent.HIERARCHY_CHANGED, this, parent,
                         flags);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:44,代码来源:Component.java

示例6: removeNotify

/**
 * Called to inform this component is has been removed from its
 * container. Its native peer - if any - is destroyed at this time.
 * This method is called automatically by the AWT system and should
 * not be called by user level code.
 *
 * @see #isDisplayable()
 * @see #addNotify()
 */
public void removeNotify()
{
  // We need to lock the tree here to avoid races and inconsistencies.
  synchronized (getTreeLock())
    {
      // We null our peer field before disposing of it, such that if we're
      // not the event dispatch thread and the dispatch thread is awoken by
      // the dispose call, there will be no race checking the peer's null
      // status.

      ComponentPeer tmp = peer;
      peer = null;
      peerFont = null;
      if (tmp != null)
        {
          tmp.hide();
          tmp.dispose();
        }

      // Notify hierarchy listeners.
      long flags = HierarchyEvent.DISPLAYABILITY_CHANGED;
      if (isHierarchyVisible())
        flags |= HierarchyEvent.SHOWING_CHANGED;
      fireHierarchyEvent(HierarchyEvent.HIERARCHY_CHANGED, this, parent,
                         flags);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:36,代码来源:Component.java

示例7: hierarchyChanged

public void hierarchyChanged(HierarchyEvent e) {
    JComponent c = (JComponent) e.getSource();
    if ((e.getChangeFlags() & HierarchyEvent.DISPLAYABILITY_CHANGED) != 0
            && !c.isDisplayable() && autoScroll) {
        scroller.stop();
    }
}
 
开发者ID:Emd4600,项目名称:SporeModder,代码行数:7,代码来源:UIImagePanel.java

示例8: addNotify

/**
 * Called when the parent of this Component is made visible or when
 * the Component is added to an already visible Container and needs
 * to be shown.  A native peer - if any - is created at this
 * time. This method is called automatically by the AWT system and
 * should not be called by user level code.
 *
 * @see #isDisplayable()
 * @see #removeNotify()
 */
public void addNotify()
{
  // We need to lock the tree here to avoid races and inconsistencies.
  synchronized (getTreeLock())
    {
      if (peer == null)
        peer = getToolkit().createComponent(this);
      else if (parent != null && parent.isLightweight())
        new HeavyweightInLightweightListener(parent);
      // Now that all the children has gotten their peers, we should
      // have the event mask needed for this component and its
      //lightweight subcomponents.
      peer.setEventMask(eventMask);

      // We used to leave the invalidate() to the peer. However, I put it
      // back here for 2 reasons: 1) The RI does call invalidate() from
      // addNotify(); 2) The peer shouldn't be bother with validation too
      // much.
      invalidate();

      if (dropTarget != null) 
        dropTarget.addNotify(peer);

      // Fetch the peerFont for later installation in validate().
      peerFont = getFont();

      // Notify hierarchy listeners.
      long flags = HierarchyEvent.DISPLAYABILITY_CHANGED;
      if (isHierarchyVisible())
        flags |= HierarchyEvent.SHOWING_CHANGED;
      fireHierarchyEvent(HierarchyEvent.HIERARCHY_CHANGED, this, parent,
                         flags);
    }
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:44,代码来源:Component.java

示例9: hierarchyChanged

public void hierarchyChanged(HierarchyEvent e) {
    if((e.getChangeFlags()&HierarchyEvent.DISPLAYABILITY_CHANGED)>0){
        if(this.isDisplayable())                         
            ensureUpdates();
        else
            stopUpdates();
    }
}
 
开发者ID:Glank,项目名称:PACGameDev,代码行数:8,代码来源:GameComponent.java

示例10: hierarchyChanged

public void hierarchyChanged(HierarchyEvent event) {
    if ((event.getChangeFlags() & HierarchyEvent.DISPLAYABILITY_CHANGED) != 0) {
        synchronized (renderLock) {
            if (this.isDisplayable()) {
                r = createAndSetRenderer();
            } else {
                env.removeRenderer(r);
                r = null;
            }
        }
    }
}
 
开发者ID:jplot2d,项目名称:jplot2d,代码行数:12,代码来源:JPlot2DComponent.java


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