本文整理汇总了Java中java.awt.event.HierarchyEvent.getChangedParent方法的典型用法代码示例。如果您正苦于以下问题:Java HierarchyEvent.getChangedParent方法的具体用法?Java HierarchyEvent.getChangedParent怎么用?Java HierarchyEvent.getChangedParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.event.HierarchyEvent
的用法示例。
在下文中一共展示了HierarchyEvent.getChangedParent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hierarchyChanged
import java.awt.event.HierarchyEvent; //导入方法依赖的package包/类
@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);
}
}
示例2: formAncestorResized
import java.awt.event.HierarchyEvent; //导入方法依赖的package包/类
private void formAncestorResized(HierarchyEvent evt) {//GEN-FIRST:event_formAncestorResized
Component parent = evt.getChangedParent();
// TODO: small hack that prevent the application from throwing exceptions
if (parent == null) {
return;
}
int newHeight = getSize().height;
int newWidth = parent.getSize().width - 40;
setSize(newWidth, newHeight);
setPreferredSize(getSize());
revalidate();
}
示例3: formAncestorResized
import java.awt.event.HierarchyEvent; //导入方法依赖的package包/类
private void formAncestorResized(HierarchyEvent evt) {//GEN-FIRST:event_formAncestorResized
Component parent = evt.getChangedParent();
int newHeight = getSize().height;
int newWidth = parent.getSize().width - 40;
setSize(newWidth, newHeight);
setPreferredSize(getSize());
revalidate();
}
示例4: hierarchyChanged
import java.awt.event.HierarchyEvent; //导入方法依赖的package包/类
public void hierarchyChanged(HierarchyEvent evt) {
// only work with DockingPorts
if(!(evt.getSource() instanceof DockingPort))
return;
// we don't want to work with sub-ports
DockingPort port = (DockingPort)evt.getSource();
if(!port.isRoot())
return;
// only work with parent-change events
if(!isParentChange(evt))
return;
// root-ports are tracked by window. if we can't find a parent window, then we
// can track the dockingport.
Container changedParent = evt.getChangedParent();
RootWindow window = RootWindow.getRootContainer(changedParent);
if(window==null)
return;
boolean removal = isRemoval(evt);
if(removal)
dockingPortRemoved(window, port);
else
dockingPortAdded(window, port);
}