Search in sources :

Example 56 with Container

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();
}
Also used : Container(java.awt.Container) Component(java.awt.Component)

Example 57 with Container

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);
}
Also used : JScrollPane(javax.swing.JScrollPane) Container(java.awt.Container) JButton(javax.swing.JButton) Component(java.awt.Component)

Example 58 with Container

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;
    }
}
Also used : Window(java.awt.Window) Container(java.awt.Container)

Example 59 with Container

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);
        }
    }
}
Also used : Container(java.awt.Container) Component(java.awt.Component) ComponentPeer(java.awt.peer.ComponentPeer)

Example 60 with Container

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;
}
Also used : Window(java.awt.Window) Container(java.awt.Container)

Aggregations

Container (java.awt.Container)250 JPanel (javax.swing.JPanel)70 JLabel (javax.swing.JLabel)65 JButton (javax.swing.JButton)56 JScrollPane (javax.swing.JScrollPane)55 BoxLayout (javax.swing.BoxLayout)50 FlowLayout (java.awt.FlowLayout)49 Component (java.awt.Component)46 BorderLayout (java.awt.BorderLayout)44 Dimension (java.awt.Dimension)39 ActionEvent (java.awt.event.ActionEvent)38 ActionListener (java.awt.event.ActionListener)26 JComponent (javax.swing.JComponent)22 JFrame (javax.swing.JFrame)22 JmriJFrame (jmri.util.JmriJFrame)20 Border (javax.swing.border.Border)18 JTable (javax.swing.JTable)17 JTextArea (javax.swing.JTextArea)17 Frame (java.awt.Frame)16 JTextField (javax.swing.JTextField)16