Package org.onemind.swingweb.util

Source Code of org.onemind.swingweb.util.ContainerLayoutHelperTest

/*
* Copyright (C) 2004 TiongHiang Lee
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not,  write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*
* Email: thlee@onemindsoft.org
*/

package org.onemind.swingweb.util;

import java.awt.*;
import java.util.Iterator;
import org.onemind.swingweb.templaterender.layout.DefaultComponentGridLayout;
import junit.framework.TestCase;
/**
* Unit test for layout helper
* @author TiongHiang Lee (thlee@onemindsoft.org)
*
*/
public class ContainerLayoutHelperTest extends TestCase
{

    /**
     * Test the layout function
     * @throws Exception if there's problem
     */
    public void testLayout() throws Exception
    {
        Frame f = new Frame();
        f.setLayout(new GridLayout(3, 2));
        f.add(new TextField("test1"));
        f.add(new TextField("test2"));
        f.add(new TextField("test3"));
        f.add(new TextField("test4"));
        f.add(new TextField("test5"));
        f.add(new TextField("test6"));
        f.pack();
        f.show();
        DefaultComponentGridLayout h = new DefaultComponentGridLayout(f);
        h.doLayout();
        Iterator it = h.getCells().iterator();
        while (it.hasNext())
        {
            System.out.println(it.next());
        }
    }
}
TOP

Related Classes of org.onemind.swingweb.util.ContainerLayoutHelperTest

TOP
Copyright © 2018 www.massapi.com. 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.