view flys-client/src/main/java/de/intevation/flys/client/client/ui/FLYSWorkspace.java @ 273:905daf30221a

ISSUE 34: Move every new project window 20 px down and right. flys-client/trunk@1899 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 11 May 2011 11:44:23 +0000
parents 95b30a5d6350
children e763d8efd42f
line wrap: on
line source
package de.intevation.flys.client.client.ui;

import com.smartgwt.client.widgets.Canvas;

import java.util.ArrayList;
import java.util.List;


/**
 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
 */
public class FLYSWorkspace extends Canvas {

    /** A map that contains the open CollectionViews. */
    protected List<CollectionView> views;


    /**
     * The default constructor creates an empty FLYSWorkspace with no
     * CollectionViews opened.
     */
    public FLYSWorkspace() {
        views = new ArrayList<CollectionView>();
    }


    /**
     * This method adds a new CollectionView to this workspace and stores a
     * reference in {@link views}.
     *
     * @param collectionView A new CollectionView.
     */
    public void addView(CollectionView collectionView) {
        if (views.size() > 0) {
          collectionView.moveTo(
              views.size() * 20,
              views.size() * 20);
        }
        views.add(collectionView);
        addChild(collectionView);
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org