当前位置: 首页>>代码示例>>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;未经允许,请勿转载。