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


Java HierarchyEvent.getChangeFlags方法代碼示例

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


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

示例1: hierarchyChanged

import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
@Override
public void hierarchyChanged(HierarchyEvent e) {
    if ((e.getComponent() != txtComp)
            || ((e.getChangeFlags() & DISPLAYABILITY_CHANGED) == 0)
            || !txtComp.isDisplayable()) {
        return;
    }

    watcherLogger.finer("componentShown()");                    //NOI18N
    if (foregroundColor == null) {
        foregroundColor = txtComp.getForeground();
    }
    if ((doc.getLength() == 0) && !txtComp.isFocusOwner()) {
        displayInfo();
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:17,代碼來源:FileNameController.java

示例2: eventDispatched

import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
public void eventDispatched(AWTEvent event) {
    HierarchyEvent e = (HierarchyEvent) event;
    if ((e.getChangeFlags() & HierarchyEvent.PARENT_CHANGED) != 0) {
        Component c = e.getChanged();
        Container p = c.getParent();
        if (p == null) {
            // Component was removed from the hierarchy
            components.remove(c);
        } else {
            Throwable t = new RuntimeException();
            StringWriter sw = new StringWriter();
            t.printStackTrace(new PrintWriter(sw));
            String stackTrace = sw.toString();
            String stackLine = getComponentAddStackLine(stackTrace);
            components.put(c, stackLine);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:19,代碼來源:RemoteAWTHierarchyListener.java

示例3: hierarchyChanged

import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
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,代碼行數:22,代碼來源:DefaultTabbedContainerUI.java

示例4: hierarchyChanged

import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
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,代碼行數:16,代碼來源:BufferedCanvasComponent.java

示例5: installListeners

import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
@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,代碼行數:22,代碼來源:WindowsMenuBarUI.java

示例6: hierarchyChanged

import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
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,代碼行數:17,代碼來源:SwingSet3.java

示例7: hierarchyChanged

import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
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,代碼行數:27,代碼來源:UiNotifyConnector.java

示例8: hierarchyChanged

import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
@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,代碼行數:19,代碼來源:CapturesToolWindow.java

示例9: hierarchyChanged

import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
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,代碼行數:17,代碼來源:SwingXSet.java

示例10: createHierarchyListener

import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
private final HierarchyListener createHierarchyListener()
{
	return new HierarchyListener()
	{

		@Override
		public void hierarchyChanged(HierarchyEvent e)
		{
			if (e.getChangeFlags() == HierarchyEvent.PARENT_CHANGED)
			{
				configureColumnControl();
			}
		}

	};
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:17,代碼來源:CTable.java

示例11: hierarchyChanged

import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
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,代碼行數:27,代碼來源:UiNotifyConnector.java

示例12: hierarchyChanged

import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
@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,代碼行數:21,代碼來源:ThreeDeeView.java

示例13: hierarchyChanged

import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
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,代碼行數:12,代碼來源:LocationCustomizer.java

示例14: createListener

import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
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,代碼行數:16,代碼來源:VisibilityHandler.java

示例15: hierarchyChanged

import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
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,代碼行數:10,代碼來源:InstancesControllerUI.java


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