當前位置: 首頁>>代碼示例>>Java>>正文


Java HierarchyEvent.getComponent方法代碼示例

本文整理匯總了Java中java.awt.event.HierarchyEvent.getComponent方法的典型用法代碼示例。如果您正苦於以下問題:Java HierarchyEvent.getComponent方法的具體用法?Java HierarchyEvent.getComponent怎麽用?Java HierarchyEvent.getComponent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.awt.event.HierarchyEvent的用法示例。


在下文中一共展示了HierarchyEvent.getComponent方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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();
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:17,代碼來源:FileNameController.java

示例2: 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();
                }
            });
        }
    }            
}
 
開發者ID:freeseawind,項目名稱:littleluck,代碼行數:17,代碼來源:SwingSet3.java

示例3: 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();
                }
            });
        }
    }            
}
 
開發者ID:RockManJoe64,項目名稱:swingx,代碼行數:17,代碼來源:SwingXSet.java

示例4: hierarchyChanged

import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
@Override
public void hierarchyChanged(HierarchyEvent e) {
	Component c = e.getComponent();
	if(c instanceof AudioPlayerComponent) {
		AudioPlayerComponent jc = (AudioPlayerComponent)c;
		if(jc.getUI() instanceof BasicAudioPlayerUI) {
			((BasicAudioPlayerUI)jc.getUI()).updateComponents( (AudioPlayerComponent)jc );
		}
	}
}
 
開發者ID:mickleness,項目名稱:pumpernickel,代碼行數:11,代碼來源:BasicAudioPlayerUI.java

示例5: installListeners

import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
protected void installListeners(final JXHeader header) {
    propListener = new PropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            onPropertyChange(header, evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
        }
    };
    boundsListener = new HierarchyBoundsAdapter() {
        @Override
        public void ancestorResized(HierarchyEvent e) {
            if (header == e.getComponent()) {
                View v = (View) descriptionPane.getClientProperty(BasicHTML.propertyKey);
                // view might get lost on LAF change ...
                if (v == null) {
                    descriptionPane.putClientProperty(BasicHTML.propertyKey, 
                            MultiLineSupport.createView(descriptionPane));
                    v = (View) descriptionPane.getClientProperty(BasicHTML.propertyKey);
                }
                if (v != null) {
                    Container tla = header.getTopLevelAncestor();
                    if (tla == null) {
                        tla = header.getParent();
                        while (tla.getParent() != null) {
                            tla = tla.getParent();
                        }
                    }
                    int h = Math.max(descriptionPane.getHeight(), tla.getHeight());
                    int w = Math.min(tla.getWidth(), header.getParent().getWidth());
                    // 35 = description pane insets, TODO: obtain dynamically
                    w -= 35 + header.getInsets().left + header.getInsets().right + descriptionPane.getInsets().left + descriptionPane.getInsets().right + imagePanel.getInsets().left + imagePanel.getInsets().right + imagePanel.getWidth() + descriptionPane.getBounds().x;
                    v.setSize(w, h);
                    descriptionPane.setSize(w, (int) Math.ceil(v.getPreferredSpan(View.Y_AXIS)));
                }
            }
        }};
    header.addPropertyChangeListener(propListener);
    header.addHierarchyBoundsListener(boundsListener);
}
 
開發者ID:RockManJoe64,項目名稱:swingx,代碼行數:39,代碼來源:BasicHeaderUI.java

示例6: installListeners

import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
protected void installListeners(final JXHeader header) {
    propListener = new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
            onPropertyChange(header, evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
        }
    };
    boundsListener = new HierarchyBoundsAdapter() {
        @Override
        public void ancestorResized(HierarchyEvent e) {
            if (header == e.getComponent()) {
                View v = (View) descriptionPane.getClientProperty(BasicHTML.propertyKey);
                // view might get lost on LAF change ...
                if (v == null) {
                    descriptionPane.putClientProperty(BasicHTML.propertyKey, 
                            descriptionPane.getMultiLineSupport().createView(descriptionPane));
                    v = (View) descriptionPane.getClientProperty(BasicHTML.propertyKey);
                }
                if (v != null) {
                    Container tla = header.getTopLevelAncestor();
                    if (tla == null) {
                        tla = header.getParent();
                        while (tla.getParent() != null) {
                            tla = tla.getParent();
                        }
                    }
                    int h = Math.max(descriptionPane.getHeight(), tla.getHeight());
                    int w = Math.min(tla.getWidth(), header.getParent().getWidth());
                    // 35 = description pane insets, TODO: obtain dynamically
                    w -= 35 + header.getInsets().left + header.getInsets().right + descriptionPane.getInsets().left + descriptionPane.getInsets().right + imagePanel.getInsets().left + imagePanel.getInsets().right + imagePanel.getWidth() + descriptionPane.getBounds().x;
                    v.setSize(w, h);
                    descriptionPane.setSize(w, (int) Math.ceil(v.getPreferredSpan(View.Y_AXIS)));
                }
            }
        }};
    header.addPropertyChangeListener(propListener);
    header.addHierarchyBoundsListener(boundsListener);
}
 
開發者ID:sing-group,項目名稱:aibench-project,代碼行數:38,代碼來源:BasicHeaderUI.java

示例7: hierarchyChanged

import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
@Override
public void hierarchyChanged(HierarchyEvent hierarchyEvent) {
	Component component = hierarchyEvent.getComponent();
	privateRegisterComponentListenerToParentWindowOf(component, component);
}
 
開發者ID:jsettlers,項目名稱:settlers-remake,代碼行數:6,代碼來源:GOSwingEventConverter.java


注:本文中的java.awt.event.HierarchyEvent.getComponent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。