use of java.awt.Container in project jgnash by ccavanaugh.
the class DynamicJasperReportPanel method emptyContainer.
private void emptyContainer(final Container container) {
Component[] components = container.getComponents();
if (components != null) {
for (Component component1 : components) {
if (component1 instanceof Container) {
emptyContainer((Container) component1);
}
}
}
container.removeAll();
}
use of java.awt.Container in project jdk8u_jdk by JetBrains.
the class XDataViewer method registerForMouseEvent.
public static void registerForMouseEvent(Component comp, MouseListener mouseListener) {
if (comp instanceof JScrollPane) {
JScrollPane pane = (JScrollPane) comp;
comp = pane.getViewport().getView();
}
if (comp instanceof Container) {
Container container = (Container) comp;
Component[] components = container.getComponents();
for (int i = 0; i < components.length; i++) {
registerForMouseEvent(components[i], mouseListener);
}
}
//No registration for JButton that are themselves clickable.
if (comp != null && (!(comp instanceof XOpenTypeViewer.XOpenTypeData) && !(comp instanceof JButton)))
comp.addMouseListener(mouseListener);
}
use of java.awt.Container in project jdk8u_jdk by JetBrains.
the class XComponentPeer method getParentTopLevel.
XWindowPeer getParentTopLevel() {
AWTAccessor.ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor();
Container parent = (target instanceof Container) ? ((Container) target) : (compAccessor.getParent(target));
// Search for parent window
while (parent != null && !(parent instanceof Window)) {
parent = compAccessor.getParent(parent);
}
if (parent != null) {
return (XWindowPeer) compAccessor.getPeer(parent);
} else {
return null;
}
}
use of java.awt.Container in project jdk8u_jdk by JetBrains.
the class XComponentPeer method addTree.
private void addTree(Collection order, Set set, Container cont) {
for (int i = 0; i < cont.getComponentCount(); i++) {
Component comp = cont.getComponent(i);
ComponentPeer peer = comp.getPeer();
if (peer instanceof XComponentPeer) {
Long window = Long.valueOf(((XComponentPeer) peer).getWindow());
if (!set.contains(window)) {
set.add(window);
order.add(window);
}
} else if (comp instanceof Container) {
// It is lightweight container, it might contain heavyweight components attached to this
// peer
addTree(order, set, (Container) comp);
}
}
}
use of java.awt.Container in project jdk8u_jdk by JetBrains.
the class XComponentPeer method isObscured.
public boolean isObscured() {
Container container = (target instanceof Container) ? (Container) target : target.getParent();
if (container == null) {
return true;
}
Container parent;
while ((parent = container.getParent()) != null) {
container = parent;
}
if (container instanceof Window) {
XWindowPeer wpeer = (XWindowPeer) (container.getPeer());
if (wpeer != null) {
return (wpeer.winAttr.visibilityState != wpeer.winAttr.AWT_UNOBSCURED);
}
}
return true;
}
Aggregations