當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。