本文整理汇总了Java中java.awt.event.HierarchyEvent类的典型用法代码示例。如果您正苦于以下问题:Java HierarchyEvent类的具体用法?Java HierarchyEvent怎么用?Java HierarchyEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HierarchyEvent类属于java.awt.event包,在下文中一共展示了HierarchyEvent类的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: QueryUI
import java.awt.event.HierarchyEvent; //导入依赖的package包/类
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);
}
}
}
});
}
示例6: InstanceScrollPane
import java.awt.event.HierarchyEvent; //导入依赖的package包/类
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();
}
}
});
}
示例7: JTreeTablePanel
import java.awt.event.HierarchyEvent; //导入依赖的package包/类
/** 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);
}
}
}
});
}
示例8: hierarchyChanged
import java.awt.event.HierarchyEvent; //导入依赖的package包/类
@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();
}
}
示例9: addTo
import java.awt.event.HierarchyEvent; //导入依赖的package包/类
/**
* 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);
}
示例10: getContent
import java.awt.event.HierarchyEvent; //导入依赖的package包/类
/** 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;
}
示例11: 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();
}
示例12: PCanvas
import java.awt.event.HierarchyEvent; //导入依赖的package包/类
/**
* 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();
}
}
}
});
}
示例13: BezierAnimationPanel
import java.awt.event.HierarchyEvent; //导入依赖的package包/类
/**
* BezierAnimationPanel Constructor
*/
public BezierAnimationPanel() {
setOpaque(true);
colors.put(BACKGROUND, new Color(0, 0, 153));
colors.put(OUTER, new Color(255, 255, 255));
colors.put(GRADIENT_A, new Color(255, 0, 101));
colors.put(GRADIENT_B, new Color(255, 255, 0));
addHierarchyListener(new HierarchyListener() {
public void hierarchyChanged(HierarchyEvent e) {
if (isShowing()) {
start();
} else {
stop();
}
}
}
);
}
示例14: 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();
}
});
}
}
}
示例15: initUI
import java.awt.event.HierarchyEvent; //导入依赖的package包/类
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();
}
}
}
});
}