當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。