Example usage for com.google.gwt.user.client.ui DockPanel DockPanel

List of usage examples for com.google.gwt.user.client.ui DockPanel DockPanel

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui DockPanel DockPanel.

Prototype

public DockPanel() 

Source Link

Document

Creates an empty dock panel.

Usage

From source file:com.sun.labs.aura.dbbrowser.client.query.TabbedQueryUI.java

License:Open Source License

public void showError(String msg) {
    final DialogBox err = new DialogBox();
    err.setText("Alert!");
    DockPanel contents = new DockPanel();
    contents.add(new Label(msg), DockPanel.CENTER);
    Button ok = new Button("OK");
    ok.addClickListener(new ClickListener() {
        public void onClick(Widget arg0) {
            err.hide();//  w  w  w.  ja  v a2 s  .  c o  m
        }
    });
    contents.add(ok, DockPanel.SOUTH);
    err.setWidget(contents);
    err.show();
}

From source file:com.sun.labs.aura.dbbrowser.client.shell.ScriptDialog.java

License:Open Source License

public ScriptDialog() {
    scriptArea = new TextArea();
    scriptArea.setCharacterWidth(80);//from   w  w  w  .  j a v a  2 s  .c om
    scriptArea.setVisibleLines(20);
    scriptArea.setStylePrimaryName("shell-margin");

    Button closeBtn = new Button("Close");
    closeBtn.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
            hide();
        }
    });

    DockPanel mainPanel = new DockPanel();
    mainPanel.add(new Label("Script code will be written at /tmp/script.js:"), DockPanel.NORTH);
    mainPanel.add(scriptArea, DockPanel.CENTER);
    mainPanel.add(closeBtn, DockPanel.SOUTH);

    setText("Enter Script");
    setWidget(mainPanel);
    setPopupPosition(30, 30);
}

From source file:com.sun.labs.aura.music.wsitm.client.Main.java

License:Open Source License

Widget getMainPanel() {
    DockPanel mainPanel = new DockPanel();
    mainPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
    mainPanel.setWidth("95%");

    ArrayList<MenuItem> menuItems = new ArrayList<MenuItem>();

    contentPanel = new FlowPanel();

    Swidget serverInfo = new ServerInfoSwidget(cdm);
    registerTokenHeaders(serverInfo);//from  w  w  w  .  j  av  a  2  s.  c  o  m
    cdm.registerSwidget(serverInfo);

    Swidget userPref = new ProfileSwidget(cdm);
    registerTokenHeaders(userPref);
    cdm.registerSwidget(userPref);

    Swidget dashboard = new DashboardSwidget(cdm);
    registerTokenHeaders(dashboard);
    cdm.registerSwidget(dashboard);
    menuItems.add(dashboard.getMenuItem());

    Swidget steeringRec = new SteeringSwidget(cdm);
    registerTokenHeaders(steeringRec);
    cdm.registerSwidget(steeringRec);
    menuItems.add(steeringRec.getMenuItem());

    Swidget artistSearch = new SimpleSearchSwidget(cdm);
    registerTokenHeaders(artistSearch);
    menuItems.add(artistSearch.getMenuItem());

    PageHeaderWidget uP = new PageHeaderWidget(cdm);
    cdm.registerSwidget(uP);
    cdm.setWidgets(uP);

    Swidget homePage = new HomeSwidget(cdm);
    registerTokenHeaders(homePage);

    mainPanel.add(uP, DockPanel.NORTH);
    mainPanel.add(contentPanel, DockPanel.CENTER);

    uP.setMenuItems(menuItems);

    VerticalPanel footer = new VerticalPanel();
    footer.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);

    String disclaimers = "<a href=\"http://www.sun.com/privacy/\">Privacy</a> | "
            + "<a href=\"http://www.sun.com/termsofuse.html\">Terms of Use</a> | "
            + "<a href=\"http://www.sun.com/suntrademarks/\"> Trademarks</a> | "
            + "<a href=\"http://www.tastekeeper.com\"> More Info</a> | "
            + "<a href=\"mailto:explaura@sun.com\">Contact Us</a>";

    footer.add(new HTML(
            "<br/><hr/><center><div class=\"bottomUrl\">Powered by <a href=\"http://www.sun.com\">Sun Microsystems</a>, "
                    + "<a href=\"http://www.last.fm\">Last.fm</a>, <a href=\"http://www.spotify.com\">Spotify</a>, "
                    + "<a href=\"http://www.wikipedia.org\">Wikipedia</a>, <a href=\"http://www.flickr.com\">Flickr</a>, "
                    + "<a href=\"http://www.youtube.com\">Youtube</a>, <a href=\"http://www.yahoo.com\">Yahoo</a>, "
                    + "<a href=\"http://musicbrainz.org\">Musicbrainz</a>, <a href=\"http://upcoming.yahoo.com\">Upcoming</a>, "
                    + "<a href=\"http://the.echonest.com\">The Echo Nest</a> and <a href=\"http://www.amazon.com\">Amazon</a><br/>"
                    + disclaimers + "<br/>" + "</div></center>"));

    // if performance monitoring is enabled, add a button to the footer
    // that will show us the stats
    if (PerformanceTimer.isEnabled()) {

        HorizontalPanel hP = new HorizontalPanel();
        hP.setSpacing(5);

        // Add the server info link
        SpannedLabel perfmon = new SpannedLabel("PerfMon");
        perfmon.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent ce) {
                PerformanceTimer.showPopup();
            }
        });
        hP.add(perfmon);

        // Add the server info link
        SpannedLabel sI = new SpannedLabel("ServerInfo");
        sI.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent ce) {
                History.newItem("serverinfo:");
            }
        });
        hP.add(sI);

        footer.add(hP);

    }
    //
    // Hack to allow opening the spotify link while preventing losing the GWT state
    footer.add(new HTML("<iframe name=\"spotifyFrame\" height=\"0px\" frameborder=\"0\" />"));
    footer.setStyleName("footer");

    mainPanel.add(footer, DockPanel.SOUTH);
    mainPanel.setStyleName("main");
    return mainPanel;
}

From source file:com.sun.labs.aura.music.wsitm.client.ui.Popup.java

License:Open Source License

public static void showPopup(Widget w, String title, final DialogBox popup) {

    DockPanel docPanel = new DockPanel();

    Label closeButton = new Label("Close");
    closeButton.setStyleName("clickableLabel");
    closeButton.addStyleName("whiteTxt");
    closeButton.addClickHandler(new ClickHandler() {
        @Override//from ww  w  . j  a  va 2s. c om
        public void onClick(ClickEvent ce) {
            popup.hide();
        }
    });

    FlowPanel container = new FlowPanel();
    container.setStyleName("outerpopup");
    container.add(w);

    docPanel.add(container, DockPanel.CENTER);
    docPanel.add(closeButton, DockPanel.SOUTH);
    docPanel.setCellHorizontalAlignment(closeButton, DockPanel.ALIGN_RIGHT);
    popup.add(docPanel);
    popup.setText(title);
    popup.setAnimationEnabled(true);
    popup.center();
}

From source file:com.sun.labs.aura.music.wsitm.client.ui.swidget.SimpleSearchSwidget.java

License:Open Source License

/** Creates a new instance of SimpleSearchWidget */
@Override//from   w w w .ja v  a 2  s . c om
public Widget getWidget() {

    //searchBoxContainerPanel = new FlowPanel();

    //search = new SearchWidget(musicServer, cdm, searchBoxContainerPanel);
    //search.updateSuggestBox(Oracles.ARTIST);

    mainPanel = new DockPanel();
    mainPanel.setWidth("100%");
    mainPanel.setHorizontalAlignment(DockPanel.ALIGN_CENTER);
    mainPanel.add(new Label(), DockPanel.NORTH);

    return mainPanel;
}

From source file:com.sun.labs.aura.music.wsitm.client.ui.swidget.SimpleSearchSwidget.java

License:Open Source License

private Widget createArtistPanel(ArtistDetails artistDetails) {

    ArtistCompact aC = artistDetails.toArtistCompact();
    updateWindowTitleLocal(aC.getName());

    VerticalPanel main = new VerticalPanel();
    main.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
    main.add(getBioWidget(artistDetails));
    if (artistDetails.getVideos().length > 0) {
        main.add(new DualRoundedPanel("Videos", new VideoScrollWidget(artistDetails.getVideos())));
    }/*w  w  w  .j a v  a2s  .  co m*/
    if (artistDetails.getPhotos().length > 0) {
        main.add(new DualRoundedPanel("Photos", new ImageScrollWidget(artistDetails.getPhotos())));
    }
    if (artistDetails.getAlbums().length > 0) {
        main.add(new DualRoundedPanel("Albums", new AlbumScrollWidget(artistDetails.getAlbums())));
    }
    main.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
    if (artistDetails.getEvents().length > 0) {
        main.add(getEventsWidget(artistDetails));
    }
    main.setStyleName("center");

    VerticalPanel left = new VerticalPanel();
    left.setSpacing(4);
    left.setWidth("300px");

    // Add similar artists
    ArtistCompact[] aCArray;
    aCArray = artistDetails.getSimilarArtistsAsArray();
    addCompactArtistToOracle(aCArray);

    if (leftSimList != null) {
        leftSimList.doRemoveListeners();
    }
    leftSimList = new ArtistCloudArtistListWidget(musicServer, cdm, artistDetails.getSimilarArtists(), aC);

    HorizontalPanel hP = new HorizontalPanel();
    hP.add(new Label("Similar artists"));
    hP.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);
    popSelect = new PopularitySelectAD(artistDetails);
    hP.add(popSelect);
    hP.setWidth("300px");
    hP.setStyleName("h2");

    left.add(new Updatable<ArtistDetails>(hP, leftSimList, cdm, artistDetails) {

        public void update(ArrayList<ScoredC<ArtistCompact>> aCList) {
            addCompactArtistToOracle(aCList);
            leftSimList.doRemoveListeners();
            leftSimList = new ArtistCloudArtistListWidget(musicServer, cdm, aCList, data.toArtistCompact());
            setNewContent(leftSimList);
        }
    });

    // Add recommended artists
    if (artistDetails.getRecommendedArtists().length > 0) {
        aCArray = artistDetails.getRecommendedArtists();
        addCompactArtistToOracle(aCArray);

        if (leftRecList != null) {
            leftRecList.doRemoveListeners();
        }
        leftRecList = new ArtistCloudArtistListWidget(musicServer, cdm, aCArray, aC);
        left.add(WebLib.createSection("Recommendations", leftRecList));
    }

    // Add related artists
    if (artistDetails.getCollaborations().length > 0) {
        aCArray = artistDetails.getCollaborations();
        addCompactArtistToOracle(aCArray);

        if (leftRelList != null) {
            leftRelList.doRemoveListeners();
        }
        leftRelList = new ArtistCloudArtistListWidget(musicServer, cdm, aCArray, aC);
        left.add(WebLib.createSection("Related", leftRelList));
    }
    left.add(getMoreInfoWidget(artistDetails));
    left.setStyleName("left");

    DockPanel artistPanel = new DockPanel();
    artistPanel.add(main, DockPanel.CENTER);
    artistPanel.add(left, DockPanel.WEST);
    artistPanel.setWidth("100%");
    artistPanel.setStyleName("resultpanel");
    return artistPanel;
}

From source file:com.sun.labs.aura.music.wsitm.client.ui.swidget.SimpleSearchSwidget.java

License:Open Source License

private Widget createTagPanel(TagDetails tagDetails) {

    updateWindowTitleLocal(tagDetails.getName() + " tag");

    VerticalPanel main = new VerticalPanel();
    main.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
    main.add(getTagHeaderWidget(tagDetails));
    main.add(new DualRoundedPanel("Videos", new VideoScrollWidget(tagDetails.getVideos())));
    main.add(new DualRoundedPanel("Photos", new ImageScrollWidget(tagDetails.getPhotos())));
    main.setStyleName("center");

    VerticalPanel left = new VerticalPanel();
    left.setSpacing(4);//from   w w  w.j  a  va2 s  .com
    left.setWidth("300px");

    // Add similar artists
    ArtistCompact[] aCArray;
    aCArray = tagDetails.getRepresentativeArtists();
    addCompactArtistToOracle(aCArray);

    if (leftSimList != null) {
        leftSimList.doRemoveListeners();
    }
    leftSimList = new TagCloudArtistListWidget(musicServer, cdm, aCArray);

    HorizontalPanel hP = new HorizontalPanel();
    hP.add(new Label("Representative artists"));
    hP.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);
    hP.setWidth("300px");
    hP.setStyleName("h2");

    left.add(hP);
    left.add(leftSimList);

    DockPanel artistPanel = new DockPanel();
    artistPanel.add(main, DockPanel.CENTER);
    artistPanel.add(left, DockPanel.WEST);
    artistPanel.setWidth("100%");
    artistPanel.setStyleName("resultpanel");
    return artistPanel;
}

From source file:com.sun.labs.aura.music.wsitm.client.ui.swidget.SimpleSearchSwidget.java

License:Open Source License

private Widget createMainSection(String title, Widget widget, Widget adornment, ItemInfo[] tagCloud,
        StarRatingWidget starWidget, boolean addTagInputWidget) {
    Panel panel = new VerticalPanel();
    DockPanel h = new DockPanel();
    h.add(new Label(title), DockPanel.WEST);
    if (adornment != null) {
        h.add(adornment, DockPanel.EAST);
        h.setCellHorizontalAlignment(adornment, HorizontalPanel.ALIGN_RIGHT);
    }// w  w  w.  j av  a 2  s  .com
    if (starWidget != null) {
        h.add(starWidget, DockPanel.NORTH);
    }

    h.setWidth("100%");
    h.setStyleName("h1");
    panel.add(h);
    if (tagCloud != null) {
        if (tagInputWidget != null) {
            tagInputWidget.onDelete();
        }
        if (addTagInputWidget) {
            tagInputWidget = new TagInputWidget(musicServer, cdm, "artist", cdm.getCurrArtistID());
            cdm.getLoginListenerManager().addListener(tagInputWidget);
            //panel.add(tagInputWidget);
        }

        Panel p = TagDisplayLib.getTagsInPanel(tagCloud, TagDisplayLib.ORDER.SHUFFLE, cdm, TagColorType.TAG);
        // If there are not tags, this will be null
        if (p != null) {
            p.addStyleName("tagCloudMargin");
            panel.add(p);
        } else {
            panel.add(new HTML("<br /<br />"));
        }
    }
    panel.add(widget);
    return panel;
}

From source file:com.unilorraine.projetdevie.client.ui.viewmodules.preparationmodule.PreparationModuleViewImpl.java

License:Open Source License

public PreparationModuleViewImpl() {

    DockPanel dockPanel = new DockPanel();
    add(dockPanel);/* w  w  w . ja va 2 s  .  c o m*/
    dockPanel.setSize("566px", "484px");

    VerticalPanel titlePanel = new VerticalPanel();
    dockPanel.add(titlePanel, DockPanel.NORTH);

    Label title = new Label("Pr\u00E9paration du projet de vie");
    title.setStyleName("title");
    titlePanel.add(title);
    title.setHeight("61px");

    VerticalPanel verticalPanelProject = new VerticalPanel();
    dockPanel.add(verticalPanelProject, DockPanel.WEST);

    HorizontalPanel horizontalPanel = new HorizontalPanel();
    verticalPanelProject.add(horizontalPanel);
    //categoryChoice = new DetailViewerField("choice");

    Label preparationLabel = new Label("Editez la cat\u00E9gorie : ");
    horizontalPanel.add(preparationLabel);
    preparationLabel.setWidth("177px");
    preparationLabel.setStyleName("subtitle");

    categoryLabel = new Label("");
    categoryLabel.setStyleName("subtitle");
    horizontalPanel.add(categoryLabel);

    categoryPicture = new DetailViewerField("picture");
    categoryPicture.setType("image");
    categoryPicture.setImageWidth(50);
    categoryPicture.setImageHeight(50);

    categoryName = new DetailViewerField("name");

    DecoratedStackPanel decoratedStackPanel = new DecoratedStackPanel();
    verticalPanelProject.add(decoratedStackPanel);
    decoratedStackPanel.setSize("303px", "381px");

    tileGridActivities = new TileGrid();
    tileGridActivities.setSize("292px", "432px");

    tileGridActivities.setEdgeSize(0);
    tileGridActivities.setShowEdges(false);

    tileGridActivities.setTileWidth(80);
    tileGridActivities.setTileHeight(80);

    tileGridActivities.setCanAcceptDrop(true);
    tileGridActivities.setCanDrag(true);

    tileGridActivities.setFields(categoryPicture, categoryName);
    tileGridActivities.setData(new ActivityRecord[10]);

    decoratedStackPanel.add(tileGridActivities, "Activit\u00E9s du Projet de Vie", false);

    ScrollPanel scrollPanel = new ScrollPanel();
    decoratedStackPanel.add(scrollPanel, "Unit\u00E9s de Choix", false);
    scrollPanel.setSize("300px", "443px");

    unitPanel = new VerticalPanel();
    scrollPanel.setWidget(unitPanel);
    unitPanel.setSize("292px", "443px");

    VerticalPanel verticalPanel = new VerticalPanel();
    dockPanel.add(verticalPanel, DockPanel.WEST);

    Label schemaLabel = new Label("Activit\u00E9s restantes");
    schemaLabel.setStyleName("subtitle");
    verticalPanel.add(schemaLabel);

    listGrid = new ListGrid();
    listGrid.setSize("240px", "504px");
    listGrid.setCanDragRecordsOut(true);
    listGrid.setCanAcceptDroppedRecords(true);
    listGrid.setCanReorderRecords(true);

    ListGridField nameField = new ListGridField("name");
    ListGridField descriptionField = new ListGridField("description");
    //lifeSpanField.setWidth(50);    
    listGrid.setFields(nameField, descriptionField);
    verticalPanel.add(listGrid);

    listGrid.setData(new ActivityRecord[10]);

    Button btnSauverLeProjet = new Button("Sauver le projet");
    btnSauverLeProjet.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            listener.saveProject();
        }
    });
    verticalPanel.add(btnSauverLeProjet);

    savedWindow = new Window();

    savedWindow.setAutoCenter(true);
    savedWindow.setShowModalMask(true);
    savedWindow.setSize("200px", "150px");
    savedWindow.setShowTitle(true);
    savedWindow.setShowMinimizeButton(false);
    savedWindow.setTitle("Projet sauvegard\u00E9");
    Label label = new Label("Le projet a \u00E9t\u00E9 sauv\u00E9");

    label.setStyleName("bigText");
    savedWindow.addItem(label);

}

From source file:com.xpn.xwiki.cbdf.client.CBDF.java

License:Open Source License

/**
* Method that initializes all the variables and creates the html required for the color picker and so on.
*//*from  w w  w .j  a  va  2s . c  o  m*/
private void InitComponents() {
    apanel = new AbsolutePanel();
    FocusPanel focus = new FocusPanel();
    DockPanel panel = new DockPanel();

    lastPosition[0] = 0;
    lastPosition[1] = 0;

    isMovable = false;
    isTransformable = false;

    transformPoints = new VirtualGroup();
    transformPointers = new GraphicObject[9];

    currRotation = 0.0;

    this.currentFontFamily = new ListBox();
    this.currentFontFamily.setMultipleSelect(false);
    this.currentFontFamily.insertItem("Arial", 0);
    this.currentFontFamily.insertItem("Courier", 1);
    this.currentFontFamily.insertItem("Times New Roman", 2);
    this.currentFontFamily.insertItem("Verdana", 3);
    this.currentFontFamily.insertItem("Georgia", 4);
    this.currentFontFamily.setSelectedIndex(0);
    this.currentFontFamily.addChangeListener(this);

    this.currentFontSize = new ListBox();
    this.currentFontSize.setMultipleSelect(false);
    this.currentFontSize.insertItem("8", 0);
    this.currentFontSize.insertItem("10", 1);
    this.currentFontSize.insertItem("12", 2);
    this.currentFontSize.insertItem("14", 3);
    this.currentFontSize.insertItem("16", 4);
    this.currentFontSize.insertItem("18", 5);
    this.currentFontSize.insertItem("20", 6);
    this.currentFontSize.insertItem("24", 7);
    this.currentFontSize.insertItem("28", 8);
    this.currentFontSize.insertItem("36", 9);
    this.currentFontSize.insertItem("48", 10);
    this.currentFontSize.insertItem("72", 11);
    this.currentFontSize.setSelectedIndex(2);
    this.currentFontSize.addChangeListener(this);

    this.currentFontStyle = new ListBox();
    this.currentFontStyle.setMultipleSelect(false);
    this.currentFontStyle.insertItem("normal", 0);
    this.currentFontStyle.insertItem("italic", 1);
    this.currentFontStyle.setSelectedIndex(0);
    this.currentFontStyle.addChangeListener(this);

    this.currentFontWeight = new ListBox();
    this.currentFontWeight.setMultipleSelect(false);
    this.currentFontWeight.insertItem("normal", 0);
    this.currentFontWeight.insertItem("bold", 1);
    this.currentFontWeight.setSelectedIndex(0);
    this.currentFontWeight.addChangeListener(this);

    this.updateFont();

    canvas = new GraphicCanvas();
    canvas.setStyleName("drawboard");
    canvas.setPixelSize(width, height);
    canvas.addGraphicObjectListener(this);

    saver = new SVGFormatter("1.1", "http://www.w3.org/2000/svg", "demo", width, height);

    buttonPanel = new VerticalPanel();
    buttonPanel.setSpacing(0);

    Grid gridShape = new Grid(4, 2);
    gridShape.setCellSpacing(2);
    gridShape.setCellPadding(2);

    Grid gridTransform = new Grid(3, 2);
    gridTransform.setCellPadding(2);
    gridTransform.setCellSpacing(2);

    fill = new HTML(" ");
    DOM.setStyleAttribute(fill.getElement(), "backgroundColor", this.currentFillColor.toHex());
    DOM.setStyleAttribute(fill.getElement(), "border", "solid");
    DOM.setStyleAttribute(fill.getElement(), "borderWidth", "thin");
    DOM.setStyleAttribute(fill.getElement(), "borderColor", "#000000");
    fill.setSize("30px", "30px");
    fill.addClickListener(this);

    stroke = new HTML(" ");
    DOM.setStyleAttribute(stroke.getElement(), "backgroundColor", this.currentStrokeColor.toHex());
    DOM.setStyleAttribute(stroke.getElement(), "border", "solid");
    DOM.setStyleAttribute(stroke.getElement(), "borderWidth", "thin");
    DOM.setStyleAttribute(stroke.getElement(), "borderColor", "#000000");
    stroke.setSize("30px", "30px");
    stroke.addClickListener(this);

    HTML fake = new HTML("&nbsp;&nbsp;&nbsp;");
    DOM.setStyleAttribute(fake.getElement(), "backgroundColor", "#FFFFFF");
    fake.setSize("30px", "30px");

    HTML fake2 = new HTML("&nbsp;&nbsp;&nbsp;");
    DOM.setStyleAttribute(fake2.getElement(), "backgroundColor", "#FFFFFF");
    fake2.setSize("30px", "30px");

    buttonPanel.add(gridShape);
    buttonPanel.add(fake);
    buttonPanel.add(fake2);

    this.strokeButton = new Image("gfx/color.gif");
    this.strokeButton.setTitle("Choose the stroke");
    this.strokeButton.setSize("34px", "34px");
    this.strokeButton.addClickListener(this);

    buttonPanel.add(this.strokeButton);
    buttonPanel.setCellHorizontalAlignment(this.strokeButton, VerticalPanel.ALIGN_CENTER);

    buttonPanel.add(gridTransform);

    fillOpacity = new Slider(Slider.HORIZONTAL, 0, 255, 255, true);
    fillOpacity.addChangeListener(this);

    strokeOpacity = new Slider(Slider.HORIZONTAL, 0, 255, 255, true);
    strokeOpacity.addChangeListener(this);

    currentStrokeSize = new Slider(Slider.HORIZONTAL, 0, 50, 1, true);
    currentStrokeSize.addChangeListener(this);

    /** This adds the buttons to the two grids */
    selectButton = addToGrid(gridShape, 0, 0, "Select object", "gfx/select.gif");
    pencilButton = addToGrid(gridShape, 0, 1, "Draw with Pencil", "gfx/pencil.gif");
    lineButton = addToGrid(gridShape, 1, 0, "Draw a Line", "gfx/line.gif");
    rectButton = addToGrid(gridShape, 1, 1, "Draw a Rect", "gfx/rect.gif");
    circleButton = addToGrid(gridShape, 2, 0, "Draw a Circle", "gfx/circle.gif");
    ellipseButton = addToGrid(gridShape, 2, 1, "Draw a Ellipse", "gfx/ellipse.gif");
    polylineButton = addToGrid(gridShape, 3, 0, "Draw a Path", "gfx/polyline.gif");
    textButton = addToGrid(gridShape, 3, 1, "Write Text", "gfx/text.gif");

    deleteButton = addToGrid(gridTransform, 0, 0, "Delete object", "gfx/delete.gif");
    saveButton = addToGrid(gridTransform, 0, 1, "Save SVG to page", "gfx/save.gif");
    backButton = addToGrid(gridTransform, 1, 0, "Send object Back", "gfx/back.gif");
    frontButton = addToGrid(gridTransform, 1, 1, "Send object Front", "gfx/front.gif");

    apanel.add(focus);

    focus.add(panel);
    panel.add(this.canvas, DockPanel.CENTER);
    panel.add(this.buttonPanel, DockPanel.WEST);
    panel.add(this.currentFontFamily, DockPanel.SOUTH);
    panel.add(this.currentFontSize, DockPanel.SOUTH);
    panel.add(this.currentFontStyle, DockPanel.SOUTH);
    panel.add(this.currentFontWeight, DockPanel.SOUTH);
    this.apanel.setSize("100%", "100%");
    focus.addKeyboardListener(this);
    focus.setSize("100%", "100%");
}