本文整理匯總了Java中java.awt.event.HierarchyEvent.getSource方法的典型用法代碼示例。如果您正苦於以下問題:Java HierarchyEvent.getSource方法的具體用法?Java HierarchyEvent.getSource怎麽用?Java HierarchyEvent.getSource使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.awt.event.HierarchyEvent
的用法示例。
在下文中一共展示了HierarchyEvent.getSource方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: hierarchyChanged
import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
public void hierarchyChanged(HierarchyEvent e) {
JComponent jc = (JComponent)e.getSource();
JRootPane realRootPane = jc.getRootPane();
Object recordedRootPane = rootPanes.get(jc);
if(recordedRootPane==NULL_VALUE) recordedRootPane = null;
if(realRootPane!=recordedRootPane) {
Object value = realRootPane;
if(value==null) value = NULL_VALUE;
rootPanes.put(jc, value);
rootPaneChanged(jc, realRootPane);
}
}
示例2: hierarchyChanged
import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
public void hierarchyChanged(HierarchyEvent e) {
JComponent c = (JComponent) e.getSource();
if ((e.getChangeFlags() & HierarchyEvent.DISPLAYABILITY_CHANGED) != 0
&& !c.isDisplayable() && autoScroll) {
scroller.stop();
}
}
示例3: hierarchyChanged
import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
public void hierarchyChanged(HierarchyEvent e)
/* 217: */ {
/* 218:400 */ if (((e.getChangeFlags() & 0x4) != 0L) &&
/* 219:401 */ ((e.getSource() instanceof Window)))
/* 220: */ {
/* 221:402 */ Window secondaryWindow = (Window)e.getSource();
/* 222:403 */ if (!secondaryWindow.isShowing()) {
/* 223:404 */ SingleFrameApplication.this.saveSession(secondaryWindow);
/* 224: */ }
/* 225: */ }
/* 226: */ }
示例4: hierarchyChanged
import java.awt.event.HierarchyEvent; //導入方法依賴的package包/類
/**
* <p>Keeps track of the current card</p>
*
* @param e The event
*/
@Override
public void hierarchyChanged(HierarchyEvent e) {
JComponent component = (JComponent) e.getSource();
if ((HierarchyEvent.SHOWING_CHANGED & e.getChangeFlags()) != 0
&& component.isShowing()) {
currentCard = component;
}
}
示例5: 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);
}