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


Java HierarchyEvent.SHOWING_CHANGED屬性代碼示例

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


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

示例1: hierarchyChanged

public void hierarchyChanged(HierarchyEvent e) {
    if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {
        boolean showing = container.isShowing();
        if (showing != bug4924561knownShowing) {
            if (container.isShowing()) {
                initDisplayer();
                attachModelAndSelectionListeners();
                ensureSelectedComponentIsShowing();
                if (container.getType() == TabbedContainer.TYPE_SLIDING) {
                    updateOrientation();
                }
            } else {
                detachModelAndSelectionListeners();
                if (container.getType() == TabbedContainer.TYPE_SLIDING) {
                    updateOrientation();
                }
            }
        }
        bug4924561knownShowing = showing;
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:21,代碼來源:DefaultTabbedContainerUI.java

示例2: hierarchyChanged

public void hierarchyChanged(HierarchyEvent e) {
    if ((e.getChangeFlags() & HierarchyEvent.PARENT_CHANGED) != 0) {
        Window parentWindow = SwingUtilities.getWindowAncestor(BufferedCanvasComponent.this);
        if (lastParentWindow != parentWindow) {
            if (lastParentWindow != null) lastParentWindow.removeWindowListener(VisibilityHandler.this);
            if (parentWindow != null) parentWindow.addWindowListener(VisibilityHandler.this);
            lastParentWindow = parentWindow;
        }
    }
    
    if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {
        if (isShowing()) BufferedCanvasComponent.this.shown();
        else BufferedCanvasComponent.this.hidden();
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:15,代碼來源:BufferedCanvasComponent.java

示例3: hierarchyChanged

public void hierarchyChanged(HierarchyEvent event) {
    if ((event.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) > 0) {
        JComponent component = (JComponent)event.getComponent();
        final Demo demo = (Demo)component.getClientProperty("swingset3.demo");
        if (!component.isShowing()) {
            demo.stop();
        } else {
            demoContainer.revalidate();
            EventQueue.invokeLater(new Runnable() {
                public void run() {
                    demo.start();
                }
            });
        }
    }            
}
 
開發者ID:freeseawind,項目名稱:littleluck,代碼行數:16,代碼來源:SwingSet3.java

示例4: hierarchyChanged

public void hierarchyChanged(@NotNull HierarchyEvent e) {
  if (isDisposed()) return;

  if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) > 0) {
    final Runnable runnable = new DumbAwareRunnable() {
      public void run() {
        final Component c = myComponent.get();
        if (isDisposed() || c == null) return;

        if (c.isShowing()) {
          showNotify();
        }
        else {
          hideNotify();
        }
      }
    };
    final Application app = ApplicationManager.getApplication();
    if (app != null && app.isDispatchThread()) {
      app.invokeLater(runnable, ModalityState.current());
    } else {
      //noinspection SSBasedInspection
      SwingUtilities.invokeLater(runnable);
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:26,代碼來源:UiNotifyConnector.java

示例5: hierarchyChanged

@Override
public void hierarchyChanged(HierarchyEvent hierarchyEvent) {
  if ((hierarchyEvent.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {
    // We only want to listen to VFS_CHANGES events when the tool window is opened.
    if (myTree.isShowing()) {
      if (myConnection == null) {
        myConnection = myProject.getMessageBus().connect(myProject);
        myConnection.subscribe(VirtualFileManager.VFS_CHANGES, this);
      }
    }
    else {
      if (myConnection != null) {
        myConnection.disconnect();
        myConnection = null;
      }
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:CapturesToolWindow.java

示例6: hierarchyChanged

public void hierarchyChanged(HierarchyEvent event) {
    if ((event.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) > 0) {
        JComponent component = (JComponent)event.getComponent();
        final Demo demo = (Demo)component.getClientProperty("swingset3.demo");
        if (!component.isShowing()) {
            demo.stop();
        } else {
            getComponentByConstraint("demo").revalidate();
            EventQueue.invokeLater(new Runnable() {
                public void run() {
                    demo.start();
                }
            });
        }
    }            
}
 
開發者ID:RockManJoe64,項目名稱:swingx,代碼行數:16,代碼來源:SwingXSet.java

示例7: 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

示例8: hierarchyChanged

public void hierarchyChanged(HierarchyEvent e) {
  if (isDisposed()) return;

  if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) > 0) {
    final Runnable runnable = new DumbAwareRunnable() {
      public void run() {
        final Component c = myComponent.get();
        if (isDisposed() || c == null) return;

        if (c.isShowing()) {
          showNotify();
        }
        else {
          hideNotify();
        }
      }
    };
    final Application app = ApplicationManager.getApplication();
    if (app != null && app.isDispatchThread()) {
      app.invokeLater(runnable, ModalityState.current());
    } else {
      //noinspection SSBasedInspection
      SwingUtilities.invokeLater(runnable);
    }
  }
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:26,代碼來源:UiNotifyConnector.java

示例9: hierarchyChanged

public void hierarchyChanged(HierarchyEvent e) {
    if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {
        Window window = SwingUtilities.getWindowAncestor(this);

        if (window instanceof Dialog && !((Dialog) window).isModal()) {
            showFromEditor();
        } else {
            hideFromEditor();
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:LocationCustomizer.java

示例10: createListener

private HierarchyListener createListener() {
    return new HierarchyListener() {
        public void hierarchyChanged(HierarchyEvent e) {
            if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {
                boolean visible = component.isShowing();
                if (wasVisible == visible) return;

                wasVisible = visible;

                if (visible) shown();
                else hidden();
            }
        }
    };
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:15,代碼來源:VisibilityHandler.java

示例11: hierarchyChanged

public void hierarchyChanged(HierarchyEvent e) {
    JPanel fieldsBrowserPanel = instancesController.getFieldsBrowserController().getPanel();
    JPanel referencesBrowserPanel = instancesController.getReferencesBrowserController().getPanel();

    if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {
        legendPanel.setGCRootVisible(referencesBrowserPanel.isShowing());
        legendPanel.setVisible(fieldsBrowserPanel.isShowing() || referencesBrowserPanel.isShowing());
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:9,代碼來源:InstancesControllerUI.java

示例12: hierarchyChanged

@Override
public void hierarchyChanged(HierarchyEvent e) {
	// update whenever the component visibility changes, the view is dirty (prior updates
	// have been ignored), and not more than one update is scheduled
	synchronized (updateLock) {
		if ((HierarchyEvent.SHOWING_CHANGED & e.getChangeFlags()) != 0 && isDirty && scheduledUpdates <= 1) {
			scheduledUpdates++;
			SwingUtilities.invokeLater(updateEntries);
		}
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:11,代碼來源:IOObjectCacheViewer.java

示例13: hierarchyChanged

@Override
public void hierarchyChanged(HierarchyEvent e) {
	if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {
		if (!list.isShowing()) {
			lastLocation = null;
			setHoverIndex(-1);
		}
		// else: nothing to be done as mouse location is not known (only 1.5)
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:10,代碼來源:ListHoverHelper.java

示例14: 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

示例15: 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


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