当前位置: 首页>>代码示例>>Java>>正文


Java HierarchyEvent.PARENT_CHANGED属性代码示例

本文整理汇总了Java中java.awt.event.HierarchyEvent.PARENT_CHANGED属性的典型用法代码示例。如果您正苦于以下问题:Java HierarchyEvent.PARENT_CHANGED属性的具体用法?Java HierarchyEvent.PARENT_CHANGED怎么用?Java HierarchyEvent.PARENT_CHANGED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.awt.event.HierarchyEvent的用法示例。


在下文中一共展示了HierarchyEvent.PARENT_CHANGED属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: eventDispatched

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,代码行数:18,代码来源:RemoteAWTHierarchyListener.java

示例2: hierarchyChanged

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,代码行数:15,代码来源:BufferedCanvasComponent.java

示例3: createHierarchyListener

private final HierarchyListener createHierarchyListener()
{
	return new HierarchyListener()
	{

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

	};
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:16,代码来源:CTable.java

示例4: hierarchyChanged

@Override
public void hierarchyChanged(HierarchyEvent e) {
    if ((e.getChangeFlags() & HierarchyEvent.PARENT_CHANGED) == 0) {
        return;
    }
    // the component may be reparented, usually in the same execution sequence
    // within an event. Let's update (suspend or resume) the changes depending on
    // the stabilized state in a next AWT event:
    if (updating) {
        return;
    }
    updating = true;
    SwingUtilities.invokeLater(this);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:FoldHierarchyExecution.java

示例5: hierarchyChanged

@Override
public void hierarchyChanged(final HierarchyEvent event) {
  if ((event.getChangeFlags() & HierarchyEvent.PARENT_CHANGED) != 0 && event.getChangedParent() == null) {
    this.splitPane.removeHierarchyListener(this);
    this.splitPane.removePropertyChangeListener(this);
  }
}
 
开发者ID:AndreasWBartels,项目名称:libraries,代码行数:7,代码来源:SplitPanePreferenceUpdaterListener.java

示例6: hierarchyChanged

@Override
public void hierarchyChanged(final HierarchyEvent e) {
	if ((e.getChangeFlags() & HierarchyEvent.PARENT_CHANGED) == HierarchyEvent.PARENT_CHANGED) {
		if (jViewport != null) {
			jViewport.removeComponentListener(this);
		}
		jViewport = getParentViewport();
		if (jViewport != null) {
			jViewport.addComponentListener(this);
		}
	}
}
 
开发者ID:GoldenGnu,项目名称:jwarframe,代码行数:12,代码来源:JAutoColumnTable.java

示例7: hierarchyChanged

/**
 * Called when the hierarchy has been changed. To discern the actual
 * type of change, call <code>HierarchyEvent.getChangeFlags()</code>.
 * @see java.awt.event.HierarchyEvent#getChangeFlags()
 */
public void hierarchyChanged(HierarchyEvent e) {
	if ((e.getChangeFlags() & HierarchyEvent.PARENT_CHANGED) != 0) {
		createPopupWindow();
		Container frame = textComponent.getTopLevelAncestor();
		if (frame != null){
			frame.addComponentListener(componentListener);
		}
	}
}
 
开发者ID:Kaljurand,项目名称:aceview,代码行数:14,代码来源:SnippetAutocompleter.java

示例8: hierarchyChanged

/**
 *
 * @param e
 */
public void hierarchyChanged(HierarchyEvent e) {
    if ((e.getChangeFlags() & HierarchyEvent.PARENT_CHANGED) != 0) {
        attach();
    }
}
 
开发者ID:hohonuuli,项目名称:mbarix4j,代码行数:9,代码来源:AbstractComponentDecorator.java

示例9: isParentChange

private boolean isParentChange(HierarchyEvent evt) {
    if(evt.getID()!=HierarchyEvent.HIERARCHY_CHANGED || evt.getChangeFlags()!=HierarchyEvent.PARENT_CHANGED)
        return false;
    return true;
}
 
开发者ID:humphrej,项目名称:flexdock,代码行数:5,代码来源:DockingPortTracker.java


注:本文中的java.awt.event.HierarchyEvent.PARENT_CHANGED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。