Example usage for com.google.gwt.user.client.ui ScrollPanel setSize

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

Introduction

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

Prototype

@Override
public void setSize(String width, String height) 

Source Link

Document

Sets the object's size.

Usage

From source file:asquare.gwt.debug.client.DebugConsole.java

License:Apache License

/**
 * Creates the console, installs the enabler key listener. 
 * The console is not yet attached to the DOM. 
 *//*  ww w.jav a 2s .c  o  m*/
protected DebugConsole() {
    super(false, false);
    setStyleName("tk-DebugConsole");
    DOM.setStyleAttribute(getElement(), "border", "solid black 1px");
    DOM.setStyleAttribute(getElement(), "background", "white");

    setHTML("<div style='margin: 2px; padding: 3px; background-color: rgb(195, 217, 255); font-weight: bold; font-size: smaller; cursor: default;'>Debug Console</div>");

    m_content.setWordWrap(false);
    DOM.setStyleAttribute(m_content.getElement(), "margin", "2px");
    DOM.setStyleAttribute(m_content.getElement(), "padding", "3px");

    VerticalPanel outer = new VerticalPanel();

    ScrollPanel scrollPanel = new ScrollPanel(m_content);
    scrollPanel.setAlwaysShowScrollBars(true);
    scrollPanel.setSize("40em", "20em");
    outer.add(scrollPanel);

    HorizontalPanel controls = new HorizontalPanel();
    DOM.setStyleAttribute(controls.getElement(), "margin", "2px");
    controls.setWidth("100%");
    outer.add(controls);

    HorizontalPanel controlsLeft = new HorizontalPanel();
    controls.add(controlsLeft);
    controls.setCellHorizontalAlignment(controlsLeft, HorizontalPanel.ALIGN_LEFT);

    HorizontalPanel controlsRight = new HorizontalPanel();
    controls.add(controlsRight);
    controls.setCellHorizontalAlignment(controlsRight, HorizontalPanel.ALIGN_RIGHT);

    final Button toggleDebugButton = new Button("Toggle&nbsp;Debug");
    DOM.setElementProperty(toggleDebugButton.getElement(), "title", "Toggles output of debug statements");
    controlsLeft.add(toggleDebugButton);

    updateDisableButtonText();
    DOM.setElementProperty(m_disableButton.getElement(), "title",
            "Prevents this console from appearing when debug statements are printed");
    controlsLeft.add(m_disableButton);

    final Button clearButton = new Button("Clear");
    DOM.setElementProperty(clearButton.getElement(), "title", "Clears all messages in the console");
    controlsRight.add(clearButton);

    final Button hideButton = new Button("Hide");
    DOM.setStyleAttribute(hideButton.getElement(), "textAlign", "right");
    controlsRight.add(hideButton);

    setWidget(outer);
    m_left = Window.getClientWidth() / 2 - 640 / 2;
    m_top = Window.getClientHeight() / 2;

    m_enabler.install();

    ClickHandler handler = new ClickHandler() {
        public void onClick(ClickEvent event) {
            Widget sender = (Widget) event.getSource();
            if (sender == clearButton) {
                clearMessages();
            } else if (sender == hideButton) {
                hide();
            } else if (sender == m_disableButton) {
                disable();
            } else if (sender == toggleDebugButton) {
                if (Debug.isEnabled()) {
                    Debug.disable();
                } else {
                    Debug.enable();
                }
            } else {
                assert false;
            }
        }
    };
    toggleDebugButton.addClickHandler(handler);
    m_disableButton.addClickHandler(handler);
    clearButton.addClickHandler(handler);
    hideButton.addClickHandler(handler);

    sinkEvents(Event.ONMOUSEDOWN);
    preventSelectionInIE(getElement());
}

From source file:asquare.gwt.tk.demo.client.DebugPanel.java

License:Apache License

private Widget createWidgetPanel() {
    BasicPanel widgets = new BasicPanel();
    DOM.setAttribute(widgets.getElement(), "id", "debug-widgets");
    TextArea textArea = new TextArea();
    textArea.setText("Enable event tracing then type in here");
    widgets.add(textArea);//from  w ww  .ja  v  a2 s  .co  m

    ListBox listBox = new ListBox();
    listBox.addItem("List Box");
    listBox.addItem("foo");
    listBox.addItem("bar");
    listBox.addItem("baz");
    widgets.add(listBox);

    TreeItem treeRoot = new TreeItem("Tree");
    TreeItem treeItem = new TreeItem("foo");
    treeRoot.addItem(treeItem);
    treeRoot.addItem("bar");
    treeRoot.addItem("baz");
    Tree tree = new Tree();
    tree.addItem(treeRoot);
    tree.setSelectedItem(treeItem);
    tree.ensureSelectedItemVisible();
    widgets.add(tree);

    Image image = new Image("icecube.jpg");
    ScrollPanel scrollPanel = new ScrollPanel(image);
    scrollPanel.setSize("200px", "200px");
    widgets.add(scrollPanel);

    return widgets;
}

From source file:asquare.gwt.tkdemo.client.demos.DebugPanel.java

License:Apache License

private Widget createWidgetPanel() {
    BasicPanel widgets = new BasicPanel();
    TextArea textArea = new TextArea();
    textArea.setText("Enable event tracing then type in here");
    widgets.add(textArea);//from  www .  j  av  a2  s .  c  om

    ListBox listBox = new ListBox();
    listBox.addItem("List Box");
    listBox.addItem("foo");
    listBox.addItem("bar");
    listBox.addItem("baz");
    widgets.add(listBox);

    TreeItem treeRoot = new TreeItem("Tree");
    final TreeItem treeItem = new TreeItem("foo");
    treeRoot.addItem(treeItem);
    treeRoot.addItem("bar");
    treeRoot.addItem("baz");
    final Tree tree = new Tree();
    tree.addItem(treeRoot);
    /*
       * This crashes the hosted shell
       * http://code.google.com/p/google-web-toolkit/issues/detail?id=1785
     */
    //        /*
    //         * Defer selection so that Tree does not break Opera
    //         * http://code.google.com/p/google-web-toolkit/issues/detail?id=1784
    //       */
    //        DeferredCommand.addCommand(new Command()
    //        {
    //            public void execute()
    //            {
    //                tree.setSelectedItem(treeItem);
    //                tree.ensureSelectedItemVisible();
    //            }
    //        });
    widgets.add(tree);

    Image image = new Image("icecube.jpg");
    ScrollPanel scrollPanel = new ScrollPanel(image);
    scrollPanel.setSize("200px", "200px");
    widgets.add(scrollPanel);

    return widgets;
}

From source file:com.binomed.cineshowtime.client.ui.dialog.AboutDialog.java

License:Open Source License

public AboutDialog() {
    setText("CineShowTime " + CineshowtimeDbCst.APP_VERSION);
    setAnimationEnabled(true);/*from  www  .j  av  a 2s . c om*/
    setGlassEnabled(true);
    setSize(WIDTH, HEIGHT);
    setAutoHideEnabled(true);
    ScrollPanel scrollPanel = new ScrollPanel();
    scrollPanel.setSize(WIDTH, HEIGHT);
    String strContent = I18N.instance.msgDevelopped() + " " + "<A HREF='http://blog.binomed.fr'>Binomed</A><br>"//
            + I18N.instance.msgTraductorName() + "<br>" //
            + " 2010 - Binomed <br>"//
            + "GNU General Public License v2<br>"//
            + "Use of Google Analytics Service";
    HTMLPanel content = new HTMLPanel(strContent);
    scrollPanel.add(content);
    setWidget(scrollPanel);
    // setWidget(content);

}

From source file:com.dawg6.web.dhcalc.client.StatsPanel.java

License:Open Source License

public StatsPanel() {

    CaptionPanel cptnpnlNewPanel = new CaptionPanel("Statistics");
    initWidget(cptnpnlNewPanel);//from w w w  .  jav  a  2  s.  c o m
    cptnpnlNewPanel.setSize("1005px", "619px");

    FlexTable flexTable = new FlexTable();
    SimplePanel panel = new SimplePanel();

    panel.setWidget(flexTable);
    flexTable.setHeight("554px");
    cptnpnlNewPanel.setContentWidget(panel);
    panel.setSize("100%", "100%");

    Label lblNewLabel = new Label("Total # of Profiles Analyzed:");
    lblNewLabel.setStyleName("boldText");
    lblNewLabel.setWordWrap(false);
    flexTable.setWidget(0, 0, lblNewLabel);

    totalLabel = new Label("Loading...");
    flexTable.setWidget(0, 1, totalLabel);

    CaptionPanel cptnpnlNewPanel_1 = new CaptionPanel("Global Statistics");
    flexTable.setWidget(1, 0, cptnpnlNewPanel_1);

    mainTable = new FlexTable();
    mainTable.setStyleName("statsTable");

    SimplePanel panel2 = new SimplePanel();
    panel2.setWidget(mainTable);
    cptnpnlNewPanel_1.setContentWidget(panel2);

    Label lblStatistic = new Label("Statistic");
    lblStatistic.setStyleName("boldText");
    lblStatistic.setWordWrap(false);
    mainTable.setWidget(0, 0, lblStatistic);

    Label lblAverage = new Label("Average DPS");
    lblAverage.setWordWrap(false);
    lblAverage.setStyleName("boldText");
    mainTable.setWidget(0, 1, lblAverage);

    Label lblNewLabel_1 = new Label("Max DPS");
    lblNewLabel_1.setStyleName("boldText");
    lblNewLabel_1.setWordWrap(false);
    mainTable.setWidget(0, 2, lblNewLabel_1);

    Label lblProfile = new Label("Link to Profile");
    lblProfile.setWordWrap(false);
    lblProfile.setStyleName("boldText");
    mainTable.setWidget(0, 3, lblProfile);
    mainTable.getCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_RIGHT);
    mainTable.getCellFormatter().setHorizontalAlignment(0, 2, HasHorizontalAlignment.ALIGN_RIGHT);
    mainTable.getCellFormatter().setHorizontalAlignment(0, 3, HasHorizontalAlignment.ALIGN_RIGHT);

    Label lblImport = new Label("Import");
    lblImport.setWordWrap(false);
    lblImport.setStyleName("boldText");
    mainTable.setWidget(0, 4, lblImport);
    mainTable.getCellFormatter().setHorizontalAlignment(0, 4, HasHorizontalAlignment.ALIGN_CENTER);

    flexTable.getFlexCellFormatter().setColSpan(1, 0, 2);

    CaptionPanel cptnpnlNewPanel_2 = new CaptionPanel("Build Statistics");
    flexTable.setWidget(2, 0, cptnpnlNewPanel_2);
    cptnpnlNewPanel_2.setHeight("367px");

    VerticalPanel verticalPanel = new VerticalPanel();
    cptnpnlNewPanel_2.setContentWidget(verticalPanel);

    filterTable = new FlexTable();

    SimplePanel panel3 = new SimplePanel();
    panel3.setWidget(filterTable);
    verticalPanel.add(panel3);
    panel3.setHeight("80px");

    Label sentryLabel = new Label("Sentry:");
    sentryLabel.setWordWrap(false);
    sentryLabel.setStyleName("boldText");
    filterTable.setWidget(0, 0, sentryLabel);

    sentry = new SimpleCheckBox();
    filterTable.setWidget(0, 1, sentry);

    Label lblNewLabel_2 = new Label("Rune:");
    lblNewLabel_2.setWordWrap(false);
    lblNewLabel_2.setStyleName("boldText");
    filterTable.setWidget(0, 2, lblNewLabel_2);

    sentryRune = new ListBox();
    filterTable.setWidget(0, 3, sentryRune);

    Label lblSkill = new Label("Skill 1:");
    lblSkill.setWordWrap(false);
    lblSkill.setStyleName("boldText");
    filterTable.setWidget(0, 2, lblSkill);

    skill1 = new ListBox();
    filterTable.setWidget(0, 3, skill1);

    Label lblSkill_1 = new Label("Skill 2:");
    lblSkill_1.setWordWrap(false);
    lblSkill_1.setStyleName("boldText");
    filterTable.setWidget(0, 4, lblSkill_1);

    skill2 = new ListBox();
    filterTable.setWidget(0, 5, skill2);

    //      Label lblSkill_2 = new Label("Skill 3:");
    //      lblSkill_2.setWordWrap(false);
    //      lblSkill_2.setStyleName("boldText");
    //      filterTable.setWidget(0, 6, lblSkill_2);
    //
    //      skill3 = new ListBox();
    //      filterTable.setWidget(0, 7, skill3);
    //
    Button button = new Button("Copy My Build");
    filterTable.setWidget(0, 6, button);

    button.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            copyBuild();
        }
    });

    Button btnNewButton = new Button("Update");
    btnNewButton.setText("Filter/Refresh");
    filterTable.setWidget(1, 0, btnNewButton);
    btnNewButton.setWidth("100%");

    btnNewButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            updateStats();
        }
    });

    Label lblRune = new Label("Rune 1:");
    lblRune.setWordWrap(false);
    lblRune.setStyleName("boldText");
    filterTable.setWidget(1, 2, lblRune);

    rune1 = new ListBox();
    filterTable.setWidget(1, 3, rune1);

    Label lblRune_1 = new Label("Rune 2:");
    lblRune_1.setWordWrap(false);
    lblRune_1.setStyleName("boldText");
    filterTable.setWidget(1, 4, lblRune_1);

    rune2 = new ListBox();
    filterTable.setWidget(1, 5, rune2);

    //      Label lblRune_2 = new Label("Rune 3:");
    //      lblRune_2.setWordWrap(false);
    //      lblRune_2.setStyleName("boldText");
    //      filterTable.setWidget(1, 6, lblRune_2);
    //
    //      rune3 = new ListBox();
    //      filterTable.setWidget(1, 7, rune3);
    //      filterTable.getFlexCellFormatter().setColSpan(1, 0, 2);

    buildTable = new FlexTable();
    buildTable.setStyleName("statsTable");

    ScrollPanel scroll = new ScrollPanel();
    scroll.setWidget(buildTable);
    verticalPanel.add(scroll);
    scroll.setSize("975px", "269px");

    Anchor lblSentryRune = new Anchor("Sentry Rune");
    lblSentryRune.setWordWrap(false);
    lblSentryRune.setStyleName("boldText");
    lblSentryRune.setHref("javascript:void(0);");
    buildTable.setWidget(0, 0, lblSentryRune);

    lblSentryRune.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            //            sortStats(StatSorter.SENTRY_RUNE);
        }
    });

    Anchor lblSkill_3 = new Anchor("Skills/Runes");
    lblSkill_3.setHref("javascript:void(0);");
    lblSkill_3.setWordWrap(false);
    lblSkill_3.setStyleName("boldText");
    buildTable.setWidget(0, 1, lblSkill_3);

    lblSkill_3.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            //            sortStats(StatSorter.SKILLS);
        }
    });
    buildTable.getCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_CENTER);

    Anchor lblCount = new Anchor("Count");
    lblCount.setHref("javascript:void(0);");
    lblCount.setWordWrap(false);
    lblCount.setStyleName("boldText");
    buildTable.setWidget(0, 2, lblCount);

    lblCount.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            sortStats(StatSorter.COUNT);
        }
    });

    flexTable.getFlexCellFormatter().setColSpan(2, 0, 2);
    flexTable.getCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT);
    flexTable.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE);

    disableListeners = true;

    int row = 1;
    int col = 3;

    for (StatCategory c : StatCategory.values()) {
        Label label = new Label(c.getDescription());
        label.setWordWrap(false);

        if ((row % 2) == 0)
            mainTable.getRowFormatter().addStyleName(row, "even");
        else
            mainTable.getRowFormatter().addStyleName(row, "odd");

        for (int i = 0; i < 4; i++) {
            Label label3 = new Label("Loading...");
            label3.addStyleName("right");
            mainTable.setWidget(row, i + 1, label3);
        }

        mainTable.setWidget(row++, 0, label);

        FlexTable table = new FlexTable();
        buildTable.setWidget(0, col, table);

        Anchor avg = new Anchor("Avg");
        avg.setWordWrap(false);
        avg.setHref("javascript:void(0);");
        avg.setStyleName("boldText");

        Anchor max = new Anchor("Max");
        max.setWordWrap(false);
        max.setHref("javascript:void(0);");
        max.setStyleName("boldText");

        Label split = new Label("/");
        split.setWordWrap(false);
        split.setStyleName("boldText");

        table.setWidget(0, 0, avg);
        table.setWidget(0, 1, split);
        table.setWidget(0, 2, max);
        table.getFlexCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER);
        table.getFlexCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_CENTER);
        table.getFlexCellFormatter().setHorizontalAlignment(0, 2, HasHorizontalAlignment.ALIGN_CENTER);

        Label label2 = new Label(c.getDescription());
        label2.setWordWrap(true);
        label2.setStyleName("boldText");

        table.setWidget(1, 0, label2);
        table.getFlexCellFormatter().setColSpan(1, 0, 3);
        table.getFlexCellFormatter().setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_CENTER);

        buildTable.getFlexCellFormatter().setHorizontalAlignment(0, col, HasHorizontalAlignment.ALIGN_CENTER);

        final StatCategory cat = c;

        avg.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
                sortStats(new StatSorter.AverageCategorySorter(cat));
            }
        });

        max.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
                sortStats(new StatSorter.MaxCategorySorter(cat));
            }
        });

        col++;
    }

    skills = new ListBox[] { skill1, skill2 }; //, skill3 };
    runes = new ListBox[] { rune1, rune2 }; //, rune3 };

    for (int i = 0; i < skills.length; i++) {
        populateSkillsAndRunes(i);
        final int j = i;

        skills[i].addChangeHandler(new ChangeHandler() {

            @Override
            public void onChange(ChangeEvent event) {
                if (!disableListeners) {
                    skillChanged(j);
                }

            }
        });

    }

    disableListeners = false;
}

From source file:com.dimdim.conference.ui.layout.client.widget.MeetingAssistentDialog.java

License:Open Source License

protected Widget getContent() {
    VerticalPanel basePanel = new VerticalPanel();
    //      VerticalPanel   basePanel2 = new VerticalPanel();
    basePanel.setStyleName("meeting-assistent-panel");

    headerPanel1 = new DockPanel();
    headerPanel1.setStyleName("meeting-assistent-header-1");
    closeButton = new PNGImage("images/assistent/close.png", 16, 16);
    closeButton.addStyleName("anchor-cursor");
    headerPanel1.add(closeButton, DockPanel.EAST);
    headerPanel1.setCellHorizontalAlignment(closeButton, HorizontalPanel.ALIGN_RIGHT);
    headerPanel1.setCellVerticalAlignment(closeButton, VerticalPanel.ALIGN_TOP);
    closeButton.addClickListener(this);

    Label filler1 = new Label(" ");
    HorizontalPanel filler1Panel = new HorizontalPanel();
    filler1Panel.add(filler1);/*  w w w  .  j a va  2  s.  c o  m*/
    headerPanel1.add(filler1Panel, DockPanel.CENTER);
    headerPanel1.setCellWidth(filler1Panel, "100%");

    basePanel.add(headerPanel1);
    basePanel.setCellHorizontalAlignment(headerPanel1, HorizontalPanel.ALIGN_RIGHT);
    basePanel.setCellVerticalAlignment(headerPanel1, VerticalPanel.ALIGN_TOP);
    basePanel.setCellWidth(headerPanel1, "100%");

    //      headerPanel2 = new DockPanel();
    Label label = new Label(ConferenceGlobals.getDisplayString("meeting.assistant.title",
            "What would you like to do with Web Meeting today?"));
    label.setStyleName("meeting-assistent-header-2");
    //      headerPanel2.setStyleName("meeting-assistent-header-2");
    //      headerPanel2.add(label,DockPanel.CENTER);
    //      headerPanel2.setCellHorizontalAlignment(label,HorizontalPanel.ALIGN_CENTER);
    //      headerPanel2.setCellVerticalAlignment(label,VerticalPanel.ALIGN_TOP);
    //      headerPanel2.setCellWidth(label,"100%");

    HorizontalPanel labelPanel = new HorizontalPanel();
    labelPanel.add(label);
    labelPanel.setCellHorizontalAlignment(label, HorizontalPanel.ALIGN_CENTER);
    basePanel.add(labelPanel);
    basePanel.setCellHorizontalAlignment(labelPanel, HorizontalPanel.ALIGN_CENTER);
    basePanel.setCellVerticalAlignment(labelPanel, VerticalPanel.ALIGN_TOP);
    basePanel.setCellWidth(labelPanel, "100%");

    //      basePanel.add(basePanel2);
    //      basePanel.setCellHorizontalAlignment(basePanel2,HorizontalPanel.ALIGN_CENTER);
    //      basePanel.setCellVerticalAlignment(basePanel2,VerticalPanel.ALIGN_TOP);
    //      basePanel.setCellWidth(basePanel2,"100%");

    //      ImageButtonPanel desktopButton = new ImageButtonPanel("Share Desktop Screen",null,
    //            "label-base","red-label-normal","red-label-mouseover");
    String desktopButtonColor = "gray";
    if (ConferenceGlobals.publisherEnabled) {
        desktopButtonColor = "red";
    }
    desktopButton = new ImageButtonPanel2(
            ConferenceGlobals.getDisplayString("meeting.assistant.desktop", "Share Desktop Screen"), null,
            desktopButtonColor);
    basePanel.add(desktopButton);
    basePanel.setCellHorizontalAlignment(desktopButton, HorizontalPanel.ALIGN_RIGHT);
    basePanel.setCellVerticalAlignment(desktopButton, VerticalPanel.ALIGN_MIDDLE);
    desktopButton.addClickListener(this);

    String whiteboardButtonColor = "gray";
    if (ConferenceGlobals.whiteboardEnabled) {
        whiteboardButtonColor = "green";
    }
    whiteboardButton = new ImageButtonPanel2(
            ConferenceGlobals.getDisplayString("meeting.assistant.whiteboard", "Share Whiteboard"), null,
            whiteboardButtonColor);
    basePanel.add(whiteboardButton);
    basePanel.setCellHorizontalAlignment(whiteboardButton, HorizontalPanel.ALIGN_RIGHT);
    basePanel.setCellVerticalAlignment(whiteboardButton, VerticalPanel.ALIGN_MIDDLE);
    whiteboardButton.addClickListener(this);

    ImageButtonPanel2 pptButton = new ImageButtonPanel2(
            ConferenceGlobals.getDisplayString("meeting.assistant.presentation", "Share a Presentation"), null,
            "blue");
    basePanel.add(pptButton);
    basePanel.setCellHorizontalAlignment(pptButton, HorizontalPanel.ALIGN_RIGHT);
    basePanel.setCellVerticalAlignment(pptButton, VerticalPanel.ALIGN_MIDDLE);
    //Window.alert("click lietener = "+middlePanel.getShareButtonListener());
    pptButton.addClickListener(this);
    pptButton.addClickListener(middlePanel.getShareButtonListener());

    Label label2 = new Label(" ");
    basePanel.add(label2);
    basePanel.setCellHorizontalAlignment(label2, HorizontalPanel.ALIGN_RIGHT);
    basePanel.setCellVerticalAlignment(label2, VerticalPanel.ALIGN_MIDDLE);

    ScrollPanel sPanel = new ScrollPanel();
    sPanel.setSize("550px", "390px");
    sPanel.add(basePanel);

    return sPanel;
}

From source file:com.dimdim.conference.ui.layout2.client.MeetingAssistentDialog.java

License:Open Source License

protected Widget getContent() {
    VerticalPanel basePanel = new VerticalPanel();
    basePanel.setStyleName("meeting-assistent-panel");

    headerPanel1 = new DockPanel();
    headerPanel1.setStyleName("meeting-assistent-header-1");
    closeButton = new PNGImage("images/assistent/close.png", 16, 16);
    closeButton.addStyleName("anchor-cursor");
    headerPanel1.add(closeButton, DockPanel.EAST);
    headerPanel1.setCellHorizontalAlignment(closeButton, HorizontalPanel.ALIGN_RIGHT);
    headerPanel1.setCellVerticalAlignment(closeButton, VerticalPanel.ALIGN_TOP);
    closeButton.addClickListener(this);

    Label filler1 = new Label(" ");
    HorizontalPanel filler1Panel = new HorizontalPanel();
    filler1Panel.add(filler1);/*w w w.  j  ava  2s  . co  m*/
    headerPanel1.add(filler1Panel, DockPanel.CENTER);
    headerPanel1.setCellWidth(filler1Panel, "100%");

    basePanel.add(headerPanel1);
    basePanel.setCellHorizontalAlignment(headerPanel1, HorizontalPanel.ALIGN_RIGHT);
    basePanel.setCellVerticalAlignment(headerPanel1, VerticalPanel.ALIGN_TOP);
    basePanel.setCellWidth(headerPanel1, "100%");

    Label label = new Label(ConferenceGlobals.getDisplayString("meeting.assistant.title",
            "What would you like to do with Web Meeting today?"));
    label.setStyleName("meeting-assistent-header-2");
    HorizontalPanel labelPanel = new HorizontalPanel();
    labelPanel.add(label);
    labelPanel.setCellHorizontalAlignment(label, HorizontalPanel.ALIGN_CENTER);
    basePanel.add(labelPanel);
    basePanel.setCellHorizontalAlignment(labelPanel, HorizontalPanel.ALIGN_CENTER);
    basePanel.setCellVerticalAlignment(labelPanel, VerticalPanel.ALIGN_TOP);
    basePanel.setCellWidth(labelPanel, "100%");

    String desktopButtonColor = "gray";
    if (ConferenceGlobals.publisherEnabled) {
        desktopButtonColor = "red";
    }
    desktopButton = new ImageButtonPanel2(
            ConferenceGlobals.getDisplayString("meeting.assistant.desktop", "Share Desktop Screen"), null,
            desktopButtonColor);
    basePanel.add(desktopButton);
    basePanel.setCellHorizontalAlignment(desktopButton, HorizontalPanel.ALIGN_RIGHT);
    basePanel.setCellVerticalAlignment(desktopButton, VerticalPanel.ALIGN_MIDDLE);
    desktopButton.addClickListener(this);

    String whiteboardButtonColor = "gray";
    if (ConferenceGlobals.whiteboardEnabled) {
        whiteboardButtonColor = "green";
    }
    whiteboardButton = new ImageButtonPanel2(
            ConferenceGlobals.getDisplayString("meeting.assistant.whiteboard", "Share Whiteboard"), null,
            whiteboardButtonColor);
    basePanel.add(whiteboardButton);
    basePanel.setCellHorizontalAlignment(whiteboardButton, HorizontalPanel.ALIGN_RIGHT);
    basePanel.setCellVerticalAlignment(whiteboardButton, VerticalPanel.ALIGN_MIDDLE);
    whiteboardButton.addClickListener(this);

    String pptButtonColor = "gray";
    if (ConferenceGlobals.docEnabled) {
        pptButtonColor = "blue";
    }
    ImageButtonPanel2 pptButton = new ImageButtonPanel2(
            ConferenceGlobals.getDisplayString("meeting.assistant.presentation", "Share a Presentation"), null,
            pptButtonColor);
    basePanel.add(pptButton);
    basePanel.setCellHorizontalAlignment(pptButton, HorizontalPanel.ALIGN_RIGHT);
    basePanel.setCellVerticalAlignment(pptButton, VerticalPanel.ALIGN_MIDDLE);
    //      pptButton.addClickListener(middlePanel.getShareButtonListener());
    if (ConferenceGlobals.docEnabled) {
        pptButton.addClickListener(this);
        pptButton.addClickListener(this.shareClickListener);
    }

    Label label2 = new Label(" ");
    basePanel.add(label2);
    basePanel.setCellHorizontalAlignment(label2, HorizontalPanel.ALIGN_RIGHT);
    basePanel.setCellVerticalAlignment(label2, VerticalPanel.ALIGN_MIDDLE);

    ScrollPanel sPanel = new ScrollPanel();
    sPanel.setSize("550px", "390px");
    sPanel.add(basePanel);

    return sPanel;
}

From source file:com.dimdim.conference.ui.resources.client.ResourceTypeListEntryPopupPanel.java

License:Open Source License

private void writeListPanel(DockPanel outer) {
    Vector vec = new Vector();
    UIResourceObject currentActiveResource = ConferenceGlobals.getCurrentSharedResource();
    numberOfItems = 0;/*from w  ww .ja  v  a 2s  .c o m*/

    int size = this.resourceList.getListSize();
    for (int i = 0; i < size; i++) {
        UIResourceObject res = ((ResourceListEntry) this.resourceList.getListEntryAt(i)).getResource();
        if (res.getResourceType().equals(this.typeName)) {
            Label resLabel = new FixedLengthLabel(res.getResourceName(), 26);
            //            resLabel.setStyleName("tool-entry");
            resLabel.setStyleName("resource-entry");
            resLabel.addStyleName("anchor-cursor");
            resLabel.addClickListener(this);
            resLabel.addClickListener(this.rtpcp.getNameLabelClickListener(res));

            HorizontalPanel h1 = new HorizontalPanel();
            Widget img = new HorizontalPanel();

            if (currentActiveResource != null
                    && currentActiveResource.getResourceId().equals(res.getResourceId())) {
                img = this.getSharingInProgressImageUrl();
                //               h2.add(img);
                //               h2.setCellVerticalAlignment(img, VerticalPanel.ALIGN_MIDDLE);
                //               h2.setCellHorizontalAlignment(img, HorizontalPanel.ALIGN_CENTER);
            } else {
                img = new Label(" ");
                img.setWidth("18px");
                //               h2.add(filler);
            }
            //            h2.setWidth("18px");
            h1.add(img);
            //            h1.setCellWidth(img, "100%");
            h1.setCellHeight(img, "100%");
            h1.setCellHorizontalAlignment(img, HorizontalPanel.ALIGN_LEFT);
            h1.setCellVerticalAlignment(img, VerticalPanel.ALIGN_MIDDLE);
            h1.add(resLabel);
            h1.setCellWidth(resLabel, "100%");
            h1.setCellHeight(resLabel, "100%");
            h1.setCellVerticalAlignment(resLabel, VerticalPanel.ALIGN_MIDDLE);
            h1.setStyleName("resource-entry-panel");
            if (numberOfItems == 0) {
                h1.addStyleName("first-resource-entry-panel");
            }
            resLabel.addMouseListener(new ResourceHoverStyler(h1));
            vec.add(h1);
            //            panel.add(h1);
            //            panel.setCellWidth(h1, "100%");
            //            panel.setCellHorizontalAlignment(h1, HorizontalPanel.ALIGN_LEFT);
            //            panel.setCellVerticalAlignment(h1, VerticalPanel.ALIGN_MIDDLE);
            numberOfItems++;
        }
    }

    if (numberOfItems != 0) {
        int scrollLimit = UIParams.getUIParams().getBrowserParamIntValue("resource_popup_scroll_limit", 5);
        if (numberOfItems > scrollLimit) {
            ScrollPanel sp = new ScrollPanel();
            int width = UIParams.getUIParams().getBrowserParamIntValue("resource_popup_scroll_width", 250);
            int barWidth = UIParams.getUIParams().getBrowserParamIntValue("resource_popup_scroll_bar_width",
                    250);
            int height = UIParams.getUIParams().getBrowserParamIntValue("resource_popup_scroll_height", 150);
            sp.setSize(width + "px", height + "px");
            VerticalPanel panel = new VerticalPanel();
            panel.setSize((width - barWidth) + "px", height + "px");
            sp.add(panel);
            outer.add(sp, DockPanel.NORTH);
            outer.setCellHorizontalAlignment(sp, HorizontalPanel.ALIGN_LEFT);
            outer.setCellVerticalAlignment(sp, VerticalPanel.ALIGN_MIDDLE);
            int size2 = vec.size();
            for (int i = 0; i < size2; i++) {
                HorizontalPanel h = (HorizontalPanel) vec.elementAt(i);
                panel.add(h);
                panel.setCellWidth(h, "100%");
                panel.setCellHorizontalAlignment(h, HorizontalPanel.ALIGN_LEFT);
                panel.setCellVerticalAlignment(h, VerticalPanel.ALIGN_MIDDLE);
            }
        } else {
            int size2 = vec.size();
            for (int i = 0; i < size2; i++) {
                HorizontalPanel h = (HorizontalPanel) vec.elementAt(i);
                outer.add(h, DockPanel.NORTH);
                outer.setCellWidth(h, "100%");
                outer.setCellHorizontalAlignment(h, HorizontalPanel.ALIGN_LEFT);
                outer.setCellVerticalAlignment(h, VerticalPanel.ALIGN_MIDDLE);
            }
        }
    } else {
    }
}

From source file:com.dimdim.conference.ui.user.client.ActivePresenterAVWindow.java

License:Open Source License

/**
 * Same chat panel is used for global as well as personal chats. Global
 * chat is simply identified by using 'other' argument as null.
 *//*from   www .j  av a 2s .co  m*/
public ActivePresenterAVWindow(UIRosterEntry me, String captionText, String movieUrl, int movieWidth,
        int movieHeight, String suffix, String sizeFactor, ClickListener presenterSizeControl) {
    super(false);
    //      Window.alert("ActivePresenterAVWindow::ActivePresenterAVWindow");

    this.me = me;
    this.movieUrl = movieUrl;
    this.movieWidth = movieWidth;
    this.movieHeight = movieHeight;
    this.suffix = suffix;
    this.sizeFactor = sizeFactor;
    //   Add header.

    caption.setStyleName("common-float-panel-header");
    caption.addStyleName("common-text");

    this.caption.setText(captionText);

    ScrollPanel s1 = new ScrollPanel();
    headerPanel.setSize(movieWidth + "px", "14px");
    s1.setSize(movieWidth + "px", "14px");
    s1.add(headerPanel);

    if (presenterSizeControl != null) {
        //   This is a broadcaster on presenter console. Add the size
        //   change image in the header.
        header.add(caption);
        header.setCellWidth(caption, "100%");
        header.setCellHorizontalAlignment(caption, HorizontalPanel.ALIGN_LEFT);

        Image image = this.getHeaderImageUrl();
        header.add(image);
        image.addStyleName("anchor-cursor");
        header.setCellHorizontalAlignment(image, HorizontalPanel.ALIGN_RIGHT);
        image.addClickListener(presenterSizeControl);
        headerPanel.add(header);

        header.setWidth(movieWidth + "px");
        //         outer.setCellWidth(header, "100%");
    } else {
        //         caption.setWidth(movieWidth+"px");
        headerPanel.add(caption);
        header.setCellWidth(caption, "100%");
    }
    outer.add(s1);

    avWindow = new AVWindow("AVPlayer" + suffix, "AV" + suffix, movieUrl, movieWidth, movieHeight);
    this.panelHeight = movieHeight + 24;
    this.setHeight((movieHeight + 24) + "px");
    this.panelWidth = movieWidth + 8;
    this.setWidth((movieWidth + 8) + "px");

    this.scrollPanel = new ScrollPanel();
    this.scrollPanel.setSize(movieWidth + "px", movieHeight + "px");
    this.scrollPanel.add(avWindow);
    outer.setStyleName("common-float-panel-content");
    outer.add(scrollPanel);
    outer.setCellHorizontalAlignment(avWindow, HorizontalPanel.ALIGN_CENTER);
    outer.setCellVerticalAlignment(avWindow, VerticalPanel.ALIGN_MIDDLE);
    this.avRoundedPanel = new RoundedPanel(this.outer);
    add(this.avRoundedPanel);

    //      Window.addWindowResizeListener(this);
    DimdimPopupsLayoutManager.getManager(me).dimdimPopupOpened(this);

    addPopupListener(this);
}

From source file:com.dimdim.conference.ui.user.client.AttendeeAudioBroadcasterFloat.java

License:Open Source License

/**
 * Same chat panel is used for global as well as personal chats. Global
 * chat is simply identified by using 'other' argument as null.
 *//* w w w.  j ava 2s .co m*/
public AttendeeAudioBroadcasterFloat(UIRosterEntry me, SWFCallableWidget movie, int movieWidth, int movieHeight,
        String sizeFactor, String captionKey, String movieUrl) {
    super(false);

    this.me = me;
    this.movie = movie;
    this.movieUrl = movieUrl;
    this.movieWidth = movieWidth;
    this.movieHeight = movieHeight;
    this.sizeFactor = sizeFactor;

    //   Add header.

    caption.setStyleName("common-float-panel-header");
    caption.addStyleName("common-text");

    String name = this.me.getDisplayName();
    //      String captionKey = "audio_broadcaster_caption";
    String captionSuffix = ConferenceGlobals.uiStringsDictionary.getStringValue(captionKey);
    if (captionSuffix == null || captionSuffix.equals(captionKey)) {
        captionSuffix = "";
    }
    String s = name;
    if (s.length() > 10) {
        s = s.substring(0, 10) + "...";
    }
    this.caption.setText(s + " " + captionSuffix);

    ScrollPanel s1 = new ScrollPanel();
    headerPanel.setSize(movieWidth + "px", "14px");
    s1.setSize(movieWidth + "px", "14px");
    s1.add(headerPanel);

    //      caption.setWidth(movieWidth+"px");
    headerPanel.add(caption);
    headerPanel.setCellWidth(caption, "100%");
    outer.add(s1);

    this.panelHeight = movieHeight + 24;
    this.setHeight((movieHeight + 24) + "px");
    this.panelWidth = movieWidth + 8;
    this.setWidth((movieWidth + 8) + "px");

    this.scrollPanel = new ScrollPanel();
    this.scrollPanel.setSize(movieWidth + "px", movieHeight + "px");
    this.scrollPanel.add(movie);

    outer.setStyleName("common-float-panel-content");
    outer.add(scrollPanel);
    outer.setCellHorizontalAlignment(movie, HorizontalPanel.ALIGN_CENTER);
    outer.setCellVerticalAlignment(movie, VerticalPanel.ALIGN_MIDDLE);

    this.avRoundedPanel = new RoundedPanel(this.outer);
    add(this.avRoundedPanel);

    //      Window.addWindowResizeListener(this);
    DimdimPopupsLayoutManager.getManager(me).dimdimPopupOpened(this);

    addPopupListener(this);
}