当前位置: 首页>>代码示例>>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;未经允许,请勿转载。