Package java.awt

Examples of java.awt.LayoutManager


    /*
     * Class under test for LayoutManager createLayoutManager()
     */
    public void testCreateLayoutManager() {
        LayoutManager layout = ui.createLayoutManager();
        assertTrue("not null", layout != null);
        if (isHarmony()) {
            assertTrue("instanceof InternalFrameLayout",
                    layout instanceof BasicInternalFrameUI.InternalFrameLayout);
        }
View Full Code Here


    /*
     * Class under test for void setLayout(LayoutManager)
     */
    public void testSetLayout() {
        TestFrame frame = new TestFrame();
        LayoutManager contentLayout = frame.getContentPane().getLayout();
        LayoutManager frameLayout = frame.getLayout();
        // rootPaneCheckingEnabled is true, no exception since 1.5
        frame.setRootPaneCheckingEnabled(true);
        boolean ok = false;
        try {
            frame.setLayout(new FlowLayout());
View Full Code Here

     * Test method for 'javax.swing.plaf.basic.BasicPopupMenuUI.installDefaults()'
     */
    public void testInstallUninstallUI() {
        JPopupMenu menu = new JPopupMenu();
        menu.setUI(basicPopupUI);
        LayoutManager oldManager = menu.getLayout();
        basicPopupUI.uninstallUI(menu);
        basicPopupUI.installUI(menu);
        assertNotNull(menu.getLayout());
        assertNotSame(oldManager, menu.getLayout());
        basicPopupUI.uninstallUI(menu);
View Full Code Here

                    listener instanceof BasicInternalFrameTitlePane.PropertyChangeHandler);
        }
    }

    public void testCreateLayout() {
        LayoutManager layout = pane.createLayout();
        assertTrue("!= null", layout != null);
        if (isHarmony()) {
            assertTrue("instanceof TitlePaneLayout",
                    layout instanceof BasicInternalFrameTitlePane.TitlePaneLayout);
        }
View Full Code Here

    public void testMoveAction() {
        // cannot test
    }

    public void testTitlePaneLayout() {
        LayoutManager layout = pane.new TitlePaneLayout();
        pane.setSize(200, 31);
        final Rectangle menuBarBounds = new Rectangle(2, 7, 16, 16);
        final Rectangle zeroBounds = new Rectangle();
        final Rectangle closeButtonBounds = new Rectangle(182, 7, 16, 16);
        final Rectangle iconButtonBounds = new Rectangle(146, 7, 16, 16);
        final Rectangle maximizeButtonBounds = new Rectangle(164, 7, 16, 16);
        // non-iconifiable, non-maximizable, non-closable
        layout.layoutContainer(null);
        assertEquals("menuBar", menuBarBounds, pane.menuBar.getBounds());
        assertEquals("iconButton", zeroBounds, pane.iconButton.getBounds());
        assertEquals("maximizeButton", zeroBounds, pane.maxButton.getBounds());
        assertEquals("closeButton", zeroBounds, pane.closeButton.getBounds());
        if (!isHarmony()) {
            return;
        }
        // iconifiable, non-maximizable, non-closable
        frame.setIconifiable(true);
        layout.layoutContainer(null);
        assertEquals("menuBar", menuBarBounds, pane.menuBar.getBounds());
        assertEquals("iconButton", closeButtonBounds, pane.iconButton.getBounds());
        assertEquals("maximizeButton", zeroBounds, pane.maxButton.getBounds());
        assertEquals("closeButton", zeroBounds, pane.closeButton.getBounds());
        // iconifiable, maximizable, closable
        frame.setMaximizable(true);
        frame.setClosable(true);
        layout.layoutContainer(null);
        assertEquals("menuBar", menuBarBounds, pane.menuBar.getBounds());
        assertEquals("iconButton", iconButtonBounds, pane.iconButton.getBounds());
        assertEquals("maximizeButton", maximizeButtonBounds, pane.maxButton.getBounds());
        assertEquals("closeButton", closeButtonBounds, pane.closeButton.getBounds());
        // minimumLayoutSize(), preferredLayoutSize() implementations
        assertTrue("", layout.minimumLayoutSize(pane) != null);
        assertTrue("", layout.preferredLayoutSize(pane) != null);
    }
View Full Code Here

     * Class under test for void installUI(JComponent)
     */
    public void testInstallUI() {
        // test install with windowDecorationStyle = JRootPane.NONE
        Border saveBorder = rootPane.getBorder();
        LayoutManager saveLayout = rootPane.getLayout();
        int saveComponentCount = rootPane.getLayeredPane().getComponentCount();
        ui.installUI(rootPane);
        assertTrue("didn't install border", rootPane.getBorder() == saveBorder);
        assertTrue("didn't install layout", rootPane.getLayout() == saveLayout);
        assertTrue("didn't install titlePane",
View Full Code Here

     */
    public void testUninstallUI() {
        // test uninstall with windowDecorationStyle = JRootPane.NONE
        ui.installUI(rootPane);
        Border saveBorder = rootPane.getBorder();
        LayoutManager saveLayout = rootPane.getLayout();
        int saveComponentCount = rootPane.getLayeredPane().getComponentCount();
        ui.uninstallUI(rootPane);
        assertTrue("didn't uninstall border", rootPane.getBorder() == saveBorder);
        assertTrue("didn't uninstall layout", rootPane.getLayout() == saveLayout);
        assertTrue("didn't uninstall titlePane",
View Full Code Here

     * Class under test for void propertyChange(PropertyChangeEvent)
     */
    public void testPropertyChange() {
        rootPane.setUI(ui);
        Border saveBorder = rootPane.getBorder();
        LayoutManager saveLayout = rootPane.getLayout();
        int saveComponentCount = rootPane.getLayeredPane().getComponentCount();
        // test windowDecorationStyle = JRootPane.FRAME
        rootPane.setWindowDecorationStyle(JRootPane.FRAME);
        assertTrue("border != null", rootPane.getBorder() != null);
        assertTrue("installed border", rootPane.getBorder() != saveBorder);
View Full Code Here

    /*
     * Class under test for void setLayout(LayoutManager)
     */
    public void testSetLayout() {
        TestApplet applet = new TestApplet();
        LayoutManager contentLayout = applet.getContentPane().getLayout();
        LayoutManager appletLayout = applet.getLayout();

        // rootPaneCheckingEnabled is true, no exception since 1.5
        applet.setRootPaneCheckingEnabled(true);
        boolean ok = false;
        try {
View Full Code Here

        assertEquals(pane, layout.getSyncScrollPane());
        pane.setLayout(null);
        testExceptionalCase(new ExceptionalCase() {
            @Override
            public void exceptionalAction() throws Exception {
                pane.setLayout(new LayoutManager() {
                    public void addLayoutComponent(final String name, final Component comp) {
                    }

                    public void layoutContainer(final Container parent) {
                    }
View Full Code Here

TOP

Related Classes of java.awt.LayoutManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.