微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

java.awt.event.HierarchyEvent的实例源码

项目:incubator-netbeans    文件FileNameController.java   
@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();
    }
}
项目:incubator-netbeans    文件RemoteAWTHierarchyListener.java   
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);
        }
    }
}
项目:incubator-netbeans    文件DefaultTabbedContainerUI.java   
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;
    }
}
项目:incubator-netbeans    文件BufferedCanvasComponent.java   
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();
    }
}
项目:incubator-netbeans    文件OQLControllerUI.java   
public QueryUI(OQLController.QueryController queryController,OQLEngine engine) {
    super(Bundle.OQLControllerUI_QueryEditorCaption(),ICON,true);

    this.queryController = queryController;

    initComponents(engine);

    addHierarchyListener(new HierarchyListener() {
        public void hierarchyChanged(HierarchyEvent e) {
            if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {
                if (isShowing()) {
                    updateUIState();
                    QueryUI.this.removeHierarchyListener(this);
                }
            }
        }
    });
}
项目:incubator-netbeans    文件InstancesListControllerUI.java   
InstanceScrollPane(Heap heap) {
    this.heap = heap;

    setBorder(BorderFactory.createEmptyBorder());
    setViewportBorder(BorderFactory.createLineBorder(
            UIManager.getLookAndFeel().getID().equals("Metal") ? // NOI18N
            UIManager.getColor("Button.darkShadow") : // NOI18N
            UIManager.getColor("Button.shadow"))); // NOI18N

    addHierarchyListener(new HierarchyListener() {
        public void hierarchyChanged(HierarchyEvent e) {
            if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {
                if (instancePending && isShowing()) showInstanceImpl();
            }
        }
    });
}
项目:incubator-netbeans    文件JTreeTablePanel.java   
/** Creates a new instance of JTreeTablePanel */
public JTreeTablePanel(JTreeTable treeTable) {
    super(new BorderLayout());
    this.treeTable = treeTable;

    initComponents();
    hookHeaderColumnResize();
    hookScrollBarValueChange();
    hookTreeCollapsedExpanded();

    addHierarchyListener(new HierarchyListener() {
        public void hierarchyChanged(HierarchyEvent e) {
            if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {
                if (isShowing()) {
                    updateScrollBar(true);
                }
            }
        }
    });
}
项目:incubator-netbeans    文件RepositoryComboSupport.java   
@Override
public void hierarchyChanged(HierarchyEvent e) {
    if ((e.getChangeFlags() & disPLAYABILITY_CHANGED) == 0) {
        return;
    }

    assert e.getChanged() == triggerComponent;

    if (triggerComponent.isdisplayable()) {
        LOG.finer("trigger component became displayable");      //NOI18N
        RepositoryComboSupport.this.start();
    } else {
        LOG.finer("trigger component became non-displayable");  //NOI18N
        RepositoryComboSupport.this.shutdown();
    }
}
项目:VASSAL-src    文件SpecialDiceButton.java   
/**
 * Expects to be added to a SymbolDice. Adds the button to the control window's toolbar and registers itself as a
 * {@link KeystrokeListener}
 */
public void addTo(Buildable parent) {
  resultsIcon.setResults(new int[dice.size()]);
  launch.addHierarchyListener(new HierarchyListener() {
    public void hierarchyChanged(HierarchyEvent e) {
      if (launch.isShowing()) {
        dialog.setLocationRelativeto(launch);
        launch.removeHierarchyListener(this);
      }
    }
  });
  final GameModule mod = GameModule.getGameModule();
  ran = mod.getRNG();
  mod.getToolBar().add(launch);
  idMgr.add(this);
  mod.addCommandEncoder(this);
  property.addTo((MutablePropertiesContainer)parent);
}
项目:JavaGraph    文件GraPHPreviewDialog.java   
/** Returns the main panel shown on this dialog. */
public GraPHPreviewPanel getContent() {
    if (this.contentPanel == null) {
        this.contentPanel = new GraPHPreviewPanel(getJGraph());
        this.contentPanel.initialise();
        this.contentPanel.setEnabled(true);
        // make any dialog in which this panel is embedded resizable
        // taken from https://blogs.oracle.com/scblog/entry/tip_making_joptionpane_dialog_resizable
        this.contentPanel.addHierarchyListener(new HierarchyListener() {
            @Override
            public void hierarchyChanged(HierarchyEvent e) {
                Window window =
                    SwingUtilities.getwindowAncestor(GraPHPreviewDialog.this.contentPanel);
                if (window instanceof Dialog) {
                    Dialog dialog = (Dialog) window;
                    if (!dialog.isResizable()) {
                        dialog.setResizable(true);
                    }
                }
            }
        });
    }
    return this.contentPanel;
}
项目:Openjsharp    文件WindowsMenuBarUI.java   
@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();
}
项目:jdk8u-jdk    文件WindowsMenuBarUI.java   
@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();
}
项目:openjdk-jdk10    文件WindowsMenuBarUI.java   
@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();
}
项目:openjdk9    文件WindowsMenuBarUI.java   
@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();
}
项目:PhET    文件PCanvas.java   
/**
 * Construct a canvas with the basic scene graph consisting of a root,* camera,and layer. Zooming and panning are automatically installed.
 */
public PCanvas() {
    CURRENT_ZCANVAS = this;
    cursorStack = new PStack();
    setCamera(createDefaultCamera());
    setDefaultRenderQuality(PPaintContext.HIGH_QUALITY_RENDERING);
    setAnimatingRenderQuality(PPaintContext.LOW_QUALITY_RENDERING);
    setInteractingRenderQuality(PPaintContext.LOW_QUALITY_RENDERING);
    setPanEventHandler(new PPanEventHandler());
    setZoomEventHandler(new PZoomEventHandler());
    setBackground(Color.WHITE);
    setopaque(true);

    addHierarchyListener(new HierarchyListener() {
        public void hierarchyChanged(final HierarchyEvent e) {
            if (e.getComponent() == PCanvas.this) {
                if (getParent() == null) {
                    removeInputSources();
                }
                else if (isEnabled()) {
                    installInputSources();
                }
            }
        }
    });
}
项目:jdk8u_jdk    文件WindowsMenuBarUI.java   
@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();
}
项目:littleluck    文件BezierAnimationPanel.java   
/**
 * BezierAnimationPanel Constructor
 */
public BezierAnimationPanel() {
    setopaque(true);

    colors.put(BACKGROUND,new Color(0,153));
    colors.put(OUTER,new Color(255,255,255));
    colors.put(GRADIENT_A,101));
    colors.put(GRADIENT_B,0));

    addHierarchyListener(new HierarchyListener() {
        public void hierarchyChanged(HierarchyEvent e) {
            if (isShowing()) {
                start();
            } else {
                stop();
            }
        }
    }
    );
}
项目:littleluck    文件SwingSet3.java   
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();
                }
            });
        }
    }            
}
项目:lookaside_java-1.8.0-openjdk    文件WindowsMenuBarUI.java   
@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();
}
项目:cuba    文件DetachedFrame.java   
private void initUI() {
    setDefaultCloSEOperation(JFrame.DO_nothing_ON_CLOSE);
    glasspane = new disabledGlasspane();
    JRootPane rootPane = SwingUtilities.getRootPane(this);
    rootPane.setGlasspane(glasspane);

    final java.awt.Component topLevelGlasspane = DesktopComponentsHelper.getTopLevelFrame(parentContainer).getGlasspane();
    topLevelGlasspane.addHierarchyListener(new HierarchyListener() {
        @Override
        public void hierarchyChanged(HierarchyEvent e) {
            if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) == HierarchyEvent.SHOWING_CHANGED) {
                if (topLevelGlasspane.isVisible()) {
                    glasspane.activate(null);
                } else {
                    glasspane.deactivate();
                }
            }
        }
    });
}
项目:intellij-ce-playground    文件UiNotifyConnector.java   
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);
    }
  }
}
项目:intellij-ce-playground    文件CapturesToolWindow.java   
@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;
      }
    }
  }
}
项目:triplea    文件PbemSetupPanel.java   
private void createComponents() {
  final JScrollPane scrollPane = new JScrollPane(localPlayerPanel);
  localPlayerPanel.addHierarchyListener(new HierarchyListener() {
    @Override
    public void hierarchyChanged(final HierarchyEvent e) {
      final Window window = SwingUtilities.getwindowAncestor(localPlayerPanel);
      if (window instanceof Dialog) {
        final Dialog dialog = (Dialog) window;
        if (!dialog.isResizable()) {
          dialog.setResizable(true);
          dialog.setMinimumSize(new Dimension(700,700));
        }
      }
    }
  });
  localPlayerSelection.addActionListener(
      e -> JOptionPane.showMessageDialog(PbemSetupPanel.this,scrollPane,"Select Local Players and AI's",JOptionPane.PLAIN_MESSAGE));
}
项目:beautyeye    文件BezierAnimationPanel.java   
/**
 * BezierAnimationPanel Constructor
 */
public BezierAnimationPanel() {
    setopaque(true);

    colors.put(BACKGROUND,0));

    addHierarchyListener(new HierarchyListener() {
        public void hierarchyChanged(HierarchyEvent e) {
            if (isShowing()) {
                start();
            } else {
                stop();
            }
        }
    }
    );
}
项目:beautyeye    文件SwingSet3.java   
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();
                }
            });
        }
    }            
}
项目:swingx    文件JXLabel.java   
/**
 * Helper method for initializing multi line support.
 */
private void initLineWrapSupport() {
    addPropertychangelistener(new MultiLinesupport());
    // FYI: no more listening for componentResized. Those events are delivered out
    // of order and without old values are meaningless and forcing us to react when
    // not necessary. Instead overriding reshape() ensures we have control over old AND new size.
    addHierarchyBoundsListener(new HierarchyBoundsAdapter() {
        @Override
        public void ancestorResized(HierarchyEvent e) {
            // if one of the parents is viewport,resized events will not be propagated down unless viewport is changing visibility of scrollbars.
            // To make sure Label is able to re-wrap text when viewport size changes,initiate re-wrapping here by changing size of view
            if (e.getChanged() instanceof JViewport) {
                Rectangle viewportBounds = e.getChanged().getBounds();
                if (viewportBounds.getWidth() < getWidth()) {
                    View view = getWrappingView();
                    if (view != null) {
                        view.setSize(viewportBounds.width,viewportBounds.height);
                    }
                }
            }
        }});
}
项目:swingx    文件SwingXSet.java   
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();
                }
            });
        }
    }            
}
项目:netbeans-mmd-plugin    文件UiUtils.java   
public static void makeOwningDialogResizable(@Nonnull final Component component,@Nonnull @MustNotContainNull final Runnable... extraActions) {
  final HierarchyListener listener = new HierarchyListener() {
    @Override
    public void hierarchyChanged(@Nonnull final HierarchyEvent e) {
      final Window window = SwingUtilities.getwindowAncestor(component);
      if (window instanceof Dialog) {
        final Dialog dialog = (Dialog) window;
        if (!dialog.isResizable()) {
          dialog.setResizable(true);
          component.removeHierarchyListener(this);

          for (final Runnable r : extraActions) {
            r.run();
          }
        }
      }
    }
  };
  component.addHierarchyListener(listener);
}
项目:Metasfresh    文件CTable.java   
private final HierarchyListener createHierarchyListener()
{
    return new HierarchyListener()
    {

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

    };
}
项目:CommandGenerator    文件Tag.java   
/** displays the Tag panel. Returns true if the user canceled. */
protected boolean showPanel()
{
    isEmpty = true;

    panel.addHierarchyListener(new HierarchyListener() {
        @Override
        public void hierarchyChanged(HierarchyEvent e)
        {
            Window window = SwingUtilities.getwindowAncestor(panel);
            if (window instanceof Dialog)
            {
                Dialog dialog = (Dialog) window;
                if (!dialog.isResizable())
                {
                    dialog.setResizable(true);
                }
            }
        }
    });
    boolean cancel = JOptionPane.showConfirmDialog(null,panel,Generator.translate("GUI:tag.add") + " : " + getName(),JOptionPane.OK_CANCEL_OPTION) != JOptionPane.OK_OPTION;
    if (!cancel) isEmpty = false;
    return cancel;
}
项目:piccolo2d.java    文件PCanvas.java   
/**
 * Construct a canvas with the basic scene graph consisting of a root,and layer. Zooming and panning are automatically installed.
 */
public PCanvas() {
    cursorStack = new PStack();
    setCamera(createDefaultCamera());
    setDefaultRenderQuality(PPaintContext.HIGH_QUALITY_RENDERING);
    setAnimatingRenderQuality(PPaintContext.LOW_QUALITY_RENDERING);
    setInteractingRenderQuality(PPaintContext.LOW_QUALITY_RENDERING);
    setPanEventHandler(new PPanEventHandler());
    setZoomEventHandler(new PZoomEventHandler());
    setBackground(Color.WHITE);
    setopaque(true);

    addHierarchyListener(new HierarchyListener() {
        public void hierarchyChanged(final HierarchyEvent e) {
            if (e.getComponent() == PCanvas.this) {
                if (getParent() == null) {
                    removeInputSources();
                }
                else if (isEnabled()) {
                    installInputSources();
                }
            }
        }
    });
}
项目:infobip-open-jdk-8    文件WindowsMenuBarUI.java   
@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();
}
项目:jdk8u-dev-jdk    文件WindowsMenuBarUI.java   
@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();
}
项目:vassal    文件SpecialDiceButton.java   
/**
 * Expects to be added to a SymbolDice. Adds the button to the control window's toolbar and registers itself as a
 * {@link KeystrokeListener}
 */
public void addTo(Buildable parent) {
  resultsIcon.setResults(new int[dice.size()]);
  launch.addHierarchyListener(new HierarchyListener() {
    public void hierarchyChanged(HierarchyEvent e) {
      if (launch.isShowing()) {
        dialog.setLocationRelativeto(launch);
        launch.removeHierarchyListener(this);
      }
    }
  });
  final GameModule mod = GameModule.getGameModule();
  ran = mod.getRNG();
  mod.getToolBar().add(launch);
  idMgr.add(this);
  mod.addCommandEncoder(this);
  property.addTo((MutablePropertiesContainer)parent);
}
项目:aibench-project    文件JXLabel.java   
/**
 * Helper method for initializing multi line support.
 */
private void initLineWrapSupport() {
    addPropertychangelistener(new MultiLinesupport());
    // FYI: no more listening for componentResized. Those events are delivered out
    // of order and without old values are meaningless and forcing us to react when
    // not necessary. Instead overriding reshape() ensures we have control over old AND new size.
    addHierarchyBoundsListener(new HierarchyBoundsAdapter() {
        public void ancestorResized(HierarchyEvent e) {
            // if one of the parents is viewport,viewportBounds.height);
                    }
                }
            }
        }});
}
项目:jo-widgets    文件SwingdispoSEObservable.java   
public SwingdispoSEObservable(final Component component) {
    Assert.paramNotNull(component,"component");

    this.wasdisplayable = component.isdisplayable();
    component.addHierarchyListener(new HierarchyListener() {
        @Override
        public void hierarchyChanged(final HierarchyEvent e) {
            if ((e.getChangeFlags() & HierarchyEvent.disPLAYABILITY_CHANGED) != 0) {
                if (wasdisplayable && !component.isdisplayable()) {
                    fireAfterdispose();
                }
                else if (!wasdisplayable && component.isdisplayable()) {
                    wasdisplayable = true;
                }
            }
        }
    });
}
项目:jdk7-jdk    文件WindowsMenuBarUI.java   
@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();
}
项目:openjdk-source-code-learn    文件WindowsMenuBarUI.java   
@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();
}
项目:OLD-OpenJDK8    文件WindowsMenuBarUI.java   
@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();
}
项目:cn1    文件Component.java   
/**
 * Update the component bounds and post the appropriate events
 */
void setBounds(int x,int y,int w,int h,int bMask,boolean updateBehavior) {
    int oldX = this.x;
    int oldY = this.y;
    int oldW = this.w;
    int oldH = this.h;
    setBoundsFields(x,y,w,h,bMask);
    // Moved
    if ((oldX != this.x) || (oldY != this.y)) {
        invalidateRealParent();
        postEvent(new ComponentEvent(this,ComponentEvent.COMPONENT_MOVED));
        spreadHierarchyBoundsEvents(this,HierarchyEvent.ANCESTOR_MOVED);
    }
    // Resized
    if ((oldW != this.w) || (oldH != this.h)) {
        invalidate();
        postEvent(new ComponentEvent(this,ComponentEvent.COMPONENT_RESIZED));
        spreadHierarchyBoundsEvents(this,HierarchyEvent.ANCESTOR_RESIZED);
    }
    if (updateBehavior) {
        behavIoUr.setBounds(this.x,this.y,this.w,this.h,bMask);
    }
    notifyInputMethod(new Rectangle(x,h));
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。