本文整理匯總了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);
}