本文整理汇总了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();
}
}
示例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);
}
}
}
示例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;
}
}
示例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();
}
}
示例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();
}
示例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();
}
});
}
}
}
示例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);
}
}
}
示例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;
}
}
}
}
示例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();
}
});
}
}
}
示例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();
}
}
};
}
示例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);
}
}
}
示例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);
}
}
}
示例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();
}
}
}
示例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();
}
}
};
}
示例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());
}
}