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

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

Introduction

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

Prototype

public HorizontalPanel() 

Source Link

Document

Creates an empty horizontal panel.

Usage

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

License:Open Source License

public ParagonPanel() {

    CaptionPanel captionPanel = new CaptionPanel("Paragon");
    initWidget(captionPanel);// w w  w .  j  a  v  a  2 s .c  o  m

    FlexTable flexTable = new FlexTable();
    flexTable.setCellPadding(2);
    captionPanel.setContentWidget(flexTable);

    lblNewLabel = new Label(
            "Note: Paragon points other than Dexterity must be entered manually (they are not available via the battle.net API)");
    lblNewLabel.setWordWrap(true);
    lblNewLabel.addStyleName("boldText");
    flexTable.setWidget(0, 0, lblNewLabel);
    lblNewLabel.setWidth("300px");

    lblParagonDexteritypoints = new Label("Paragon Dexterity (points):");
    lblParagonDexteritypoints.setWordWrap(false);
    flexTable.setWidget(1, 0, lblParagonDexteritypoints);

    paragonDexterity = new NumberSpinner();
    paragonDexterity.setVisibleLength(6);
    paragonDexterity.setTitle("Each paragon Dexterity point adds 5 Dexterity");
    flexTable.setWidget(1, 1, paragonDexterity);
    paragonDexterity.setMax(10000);

    paragonDexterity.addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {
            updateDexterityLabel();
        }
    });

    dexLabel = new Label("(0)");
    dexLabel.setStyleName("boldText");
    flexTable.setWidget(1, 2, dexLabel);

    lblParagonHatredpoints = new Label("Paragon Hatred (points):");
    lblParagonHatredpoints.setWordWrap(false);
    flexTable.setWidget(2, 0, lblParagonHatredpoints);

    paragonHatred = new NumberSpinner();
    paragonHatred.setVisibleLength(6);
    paragonHatred.setTitle("Each paragon Hatred point adds 0.5 Max Hatred");
    paragonHatred.setText("0");
    flexTable.setWidget(2, 1, paragonHatred);
    paragonHatred.setMax(50);

    paragonHatred.addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {
            updateHatredLabel();
        }
    });

    hatredLabel = new Label("(0)");
    hatredLabel.setStyleName("boldText");
    flexTable.setWidget(2, 2, hatredLabel);

    lblParagonRcrpoints = new Label("Paragon RCR (points):");
    lblParagonRcrpoints.setWordWrap(false);
    flexTable.setWidget(3, 0, lblParagonRcrpoints);

    paragonRCR = new NumberSpinner();
    paragonRCR.setVisibleLength(6);
    paragonRCR.setTitle("Each paragon RCR point adds 0.1% Resource Cost Reduction");
    paragonRCR.setText("0");
    flexTable.setWidget(3, 1, paragonRCR);
    paragonRCR.setMax(50);

    paragonRCR.addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {
            updateRCRLabel();
        }
    });

    rcrLabel = new Label("(0%)");
    rcrLabel.setStyleName("boldText");
    flexTable.setWidget(3, 2, rcrLabel);

    label_4 = new Label("Paragon Area Damage (points):");
    label_4.setWordWrap(false);
    flexTable.setWidget(4, 0, label_4);

    paragonAD = new NumberSpinner();
    paragonAD.setVisibleLength(6);
    paragonAD.setTitle("Each paragon AD point adds 1% Area Damage");
    paragonAD.setText("0");
    flexTable.setWidget(4, 1, paragonAD);

    paragonAD.addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {
            updateADLabel();
        }
    });

    adLabel = new Label("(0%)");
    adLabel.setStyleName("boldText");
    flexTable.setWidget(4, 2, adLabel);

    lblOffensePoints = new Label("Offense Points:");
    lblOffensePoints.setWordWrap(false);
    lblOffensePoints.addStyleName("boldText");
    flexTable.setWidget(5, 0, lblOffensePoints);

    Label label = new Label("Paragon IAS (points):");
    label.setWordWrap(false);
    flexTable.setWidget(6, 0, label);

    paragonIAS = new NumberSpinner();
    paragonIAS.setTitle("Each paragon IAS point adds .2% IAS");
    paragonIAS.setVisibleLength(6);
    flexTable.setWidget(6, 1, paragonIAS);

    paragonIAS.addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {
            updateIASLabel();
            updateTotal();
        }
    });

    iasLabel = new Label("(0%)");
    iasLabel.setStyleName("boldText");
    flexTable.setWidget(6, 2, iasLabel);

    Label paragonCDRlabel = new Label("Paragon CDR (points):");
    paragonCDRlabel.setWordWrap(false);
    flexTable.setWidget(7, 0, paragonCDRlabel);

    paragonCDR = new NumberSpinner();
    paragonCDR.setTitle("Each paragon CDR point adds .2% Cooldown Reduction");
    paragonCDR.setVisibleLength(6);
    flexTable.setWidget(7, 1, paragonCDR);

    paragonCDR.addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {
            updateCDRLabel();
            updateTotal();
        }
    });

    cdrLabel = new Label("(0%)");
    cdrLabel.setStyleName("boldText");
    flexTable.setWidget(7, 2, cdrLabel);

    Label label_1 = new Label("Paragon CC  (points):");
    label_1.setWordWrap(false);
    flexTable.setWidget(8, 0, label_1);

    paragonCC = new NumberSpinner();
    paragonCC.setTitle("Each paragon CC point adds .1 % Crit Chance");
    paragonCC.setVisibleLength(6);
    paragonCC.setText("0");
    flexTable.setWidget(8, 1, paragonCC);

    paragonCC.addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {
            updateCCLabel();
            updateTotal();
        }
    });

    ccLabel = new Label("(0%)");
    ccLabel.setStyleName("boldText");
    flexTable.setWidget(8, 2, ccLabel);

    Label label_2 = new Label("Paragon CHD (points):");
    label_2.setWordWrap(false);
    flexTable.setWidget(9, 0, label_2);

    paragonCHD = new NumberSpinner();
    paragonCHD.setTitle("Each paragon CHD point add 1% Crit Hit Damage");
    paragonCHD.setVisibleLength(6);
    paragonCHD.setText("0");
    flexTable.setWidget(9, 1, paragonCHD);

    paragonCHD.addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {
            updateCHDLabel();
            updateTotal();
        }
    });

    chdLabel = new Label("(0%)");
    chdLabel.setStyleName("boldText");
    flexTable.setWidget(9, 2, chdLabel);

    horizontalPanel = new HorizontalPanel();
    horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    horizontalPanel.setSpacing(2);
    flexTable.setWidget(10, 0, horizontalPanel);

    lblTotal = new Label("Total Offense Points:");
    horizontalPanel.add(lblTotal);
    lblTotal.setWordWrap(false);

    total = new Label("0");
    horizontalPanel.add(total);
    total.setStyleName("boldText");

    lblRequiredParagonLevel = new Label(" (Requires paragon level");
    horizontalPanel.add(lblRequiredParagonLevel);
    lblRequiredParagonLevel.setWordWrap(false);

    level = new Label("0");
    horizontalPanel.add(level);
    level.setStyleName("boldText");

    label_3 = new Label(")");
    label_3.setWordWrap(false);
    horizontalPanel.add(label_3);
    flexTable.getCellFormatter().setHorizontalAlignment(10, 0, HasHorizontalAlignment.ALIGN_RIGHT);
    flexTable.getFlexCellFormatter().setColSpan(10, 0, 3);
    flexTable.getFlexCellFormatter().setColSpan(0, 0, 3);
    flexTable.getFlexCellFormatter().setColSpan(5, 0, 3);

    paragonIAS.setMax(50);
    paragonCC.setMax(50);
    paragonCHD.setMax(50);
    paragonCDR.setMax(50);
    paragonAD.setMax(50);
}

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

License:Open Source License

public RCRPanel() {

    CaptionPanel cptnpnlResourceReduction = new CaptionPanel("Resource Cost Reduction");
    initWidget(cptnpnlResourceReduction);

    FlexTable flexTable = new FlexTable();
    flexTable.setCellPadding(2);//from  www.j  ava2  s .c  om
    cptnpnlResourceReduction.setContentWidget(flexTable);

    HorizontalPanel horizontalPanel_1 = new HorizontalPanel();
    horizontalPanel_1.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    horizontalPanel_1.setSpacing(5);
    flexTable.setWidget(0, 0, horizontalPanel_1);

    Label lblShoulders = new Label("Shoulders (%):");
    lblShoulders.setWordWrap(false);
    lblShoulders.setStyleName("boldText");
    flexTable.setWidget(1, 0, lblShoulders);

    shoulders = new NumberSpinner();
    shoulders.setVisibleLength(4);
    flexTable.setWidget(1, 1, shoulders);

    Label lblGloves = new Label("Gloves (%):");
    lblGloves.setWordWrap(false);
    lblGloves.setStyleName("boldText");
    flexTable.setWidget(2, 0, lblGloves);

    gloves = new NumberSpinner();
    gloves.setVisibleLength(4);
    flexTable.setWidget(2, 1, gloves);

    Label lblAmulet = new Label("Amulet (%):");
    lblAmulet.setWordWrap(false);
    lblAmulet.setStyleName("boldText");
    flexTable.setWidget(3, 0, lblAmulet);

    amulet = new NumberSpinner();
    amulet.setVisibleLength(4);
    flexTable.setWidget(3, 1, amulet);

    Label lblRing = new Label("Ring 1 (%):");
    lblRing.setWordWrap(false);
    lblRing.setStyleName("boldText");
    flexTable.setWidget(4, 0, lblRing);

    ring1 = new NumberSpinner();
    ring1.setVisibleLength(4);
    flexTable.setWidget(4, 1, ring1);

    Label lblRing_1 = new Label("Ring 2 (%):");
    lblRing_1.setWordWrap(false);
    lblRing_1.setStyleName("boldText");
    flexTable.setWidget(5, 0, lblRing_1);

    ring2 = new NumberSpinner();
    ring2.setVisibleLength(4);
    flexTable.setWidget(5, 1, ring2);

    Label lblBelt = new Label("Belt (%):");
    lblBelt.setWordWrap(false);
    lblBelt.setStyleName("boldText");
    flexTable.setWidget(6, 0, lblBelt);

    belt = new NumberSpinner();
    belt.setVisibleLength(4);
    flexTable.setWidget(6, 1, belt);

    Label lblWeapon = new Label("Main Hand (%):");
    lblWeapon.setWordWrap(false);
    lblWeapon.setStyleName("boldText");
    flexTable.setWidget(7, 0, lblWeapon);

    weapon = new NumberSpinner();
    weapon.setVisibleLength(4);
    flexTable.setWidget(7, 1, weapon);

    Label lblQuiver = new Label("Off Hand(%):");
    lblQuiver.setWordWrap(false);
    lblQuiver.setStyleName("boldText");
    flexTable.setWidget(8, 0, lblQuiver);

    quiver = new NumberSpinner();
    quiver.setVisibleLength(4);
    flexTable.setWidget(8, 1, quiver);

    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    horizontalPanel.setSpacing(5);
    flexTable.setWidget(9, 0, horizontalPanel);

    this.shoulders.setMax(10);
    this.gloves.setMax(10);
    this.ring1.setMax(10);
    this.ring2.setMax(10);
    this.belt.setMax(10);
    this.weapon.setMax(60); // yang's 50% + 10%
    this.quiver.setMax(10);
    this.amulet.setMax(10);

    Label l10 = new Label("Effective RCR:");
    l10.addStyleName("boldText");
    l10.setWordWrap(false);
    flexTable.setWidget(10, 0, l10);
    this.effRCR = new Label("0.0%");
    this.effRCR.addStyleName("boldText");
    flexTable.setWidget(10, 1, effRCR);

    this.skillTable = new FlexTable();
}

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

License:Open Source License

public SavePanel() {

    CaptionPanel captionPanel = new CaptionPanel("Save/Load");
    initWidget(captionPanel);//w  w  w  .j  a  v a 2  s.  com

    FlexTable flexTable_3 = new FlexTable();
    flexTable_3.setCellPadding(2);
    captionPanel.setContentWidget(flexTable_3);

    tabPanel = new TabPanel();
    flexTable_3.setWidget(0, 0, tabPanel);

    browserPanel = new FlexTable();
    browserPanel.setCellPadding(2);

    if (Storage.isLocalStorageSupported()) {
        tabPanel.add(browserPanel, "Browser Storage", false);
    }

    storageList = new ListBox();
    browserPanel.setWidget(0, 0, storageList);
    storageList.setWidth("100%");
    storageList.setVisibleItemCount(5);

    nameField = new TextBox();
    nameField.setVisibleLength(30);
    nameField.setText("Enter a Name");
    browserPanel.setWidget(1, 0, nameField);

    Button btnNewButton = new Button("New button");
    browserPanel.setWidget(1, 1, btnNewButton);
    btnNewButton.setText("Add");

    btnNewButton.addClickHandler(new ClickHandler() {

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

    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.setSpacing(5);
    horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    browserPanel.setWidget(2, 0, horizontalPanel);

    Button button_6 = new Button("New button");
    button_6.setText("Save");
    horizontalPanel.add(button_6);

    button_6.addClickHandler(new ClickHandler() {

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

    Button button_5 = new Button("New button");
    horizontalPanel.add(button_5);
    button_5.setText("Restore");

    button_5.addClickHandler(new ClickHandler() {

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

    Button button_2 = new Button("New button");
    horizontalPanel.add(button_2);
    button_2.setText("Delete");

    button_2.addClickHandler(new ClickHandler() {

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

    Button btnNewButton_1 = new Button("New button");
    horizontalPanel.add(btnNewButton_1);
    btnNewButton_1.setText("Rename");

    btnNewButton_1.addClickHandler(new ClickHandler() {

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

    browserPanel.getFlexCellFormatter().setColSpan(0, 0, 1);
    browserPanel.getFlexCellFormatter().setColSpan(2, 0, 1);
    browserPanel.getFlexCellFormatter().setColSpan(0, 0, 2);
    browserPanel.getFlexCellFormatter().setColSpan(2, 0, 2);
    browserPanel.getCellFormatter().setHorizontalAlignment(2, 0, HasHorizontalAlignment.ALIGN_CENTER);

    filePanel = new FlexTable();
    filePanel.setCellPadding(2);
    tabPanel.add(filePanel, "Local File", false);

    HorizontalPanel horizontalPanel_1 = new HorizontalPanel();
    filePanel.setWidget(0, 0, horizontalPanel_1);

    loadPanel = new FormPanel();
    loadPanel.setMethod(FormPanel.METHOD_POST);
    loadPanel.setEncoding(FormPanel.ENCODING_MULTIPART);
    loadPanel.setAction("loadData");
    horizontalPanel_1.add(loadPanel);

    HorizontalPanel horizontalPanel_2 = new HorizontalPanel();
    loadPanel.setWidget(horizontalPanel_2);
    horizontalPanel_2.setSize("100%", "100%");

    fileUpload = new FileUpload();
    fileUpload.setName("file");
    horizontalPanel_2.add(fileUpload);

    clientKey = new Hidden("client");
    horizontalPanel_2.add(clientKey);
    filePanel.getFlexCellFormatter().setColSpan(0, 0, 1);

    Button button = new Button("Save Data...");
    filePanel.setWidget(1, 0, button);
    button.setText("Save File");

    Button button_1 = new Button("Load Data...");
    filePanel.setWidget(1, 1, button_1);
    button_1.setText("Load File");
    filePanel.getFlexCellFormatter().setColSpan(0, 0, 2);
    filePanel.getCellFormatter().setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_CENTER);
    filePanel.getCellFormatter().setHorizontalAlignment(1, 1, HasHorizontalAlignment.ALIGN_CENTER);

    button_1.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            loadFile();

        }
    });

    button.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            saveFile();

        }
    });

    textPanel = new FlexTable();
    textPanel.setCellPadding(2);
    tabPanel.add(textPanel, "Copy/Paste", false);

    textArea = new TextArea();
    textArea.setText(
            "Paste previously saved form data here and click \"Restore.\" Or press \"Current\" to paste current Form data.");
    textArea.setVisibleLines(5);
    textPanel.setWidget(0, 0, textArea);
    textArea.setSize("100%", "");

    Button button_3 = new Button("Save Data...");
    button_3.setText("Current");
    textPanel.setWidget(1, 0, button_3);

    textArea.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            textArea.selectAll();
        }
    });

    nameField.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            nameField.selectAll();
        }
    });

    button_3.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {

            if (listener != null) {

                FormData data = listener.getFormData();

                JSONObject obj = JsonUtil.toJSONObject(data);
                textArea.setText(JsonUtil.formatJsonText(obj.toString()));
                textArea.selectAll();
            }

        }
    });

    Button button_4 = new Button("Load Data...");
    button_4.setText("Restore");

    button_4.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            if (listener != null) {
                String text = textArea.getText();

                FormData data = JsonUtil.parseFormData(text);

                listener.setFormData(data);
                textArea.setText("");
            }

        }
    });

    textPanel.setWidget(1, 1, button_4);
    textPanel.getFlexCellFormatter().setColSpan(0, 0, 2);
    textPanel.getCellFormatter().setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_CENTER);
    textPanel.getCellFormatter().setHorizontalAlignment(1, 1, HasHorizontalAlignment.ALIGN_CENTER);

    flexTable_3.getFlexCellFormatter().setColSpan(0, 0, 1);

    storageList.addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {
            int i = storageList.getSelectedIndex();

            if (i >= 0) {
                String name = storageList.getItemText(i);

                if (name != null)
                    nameField.setText(name);
            }

        }
    });
}

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

License:Open Source License

public SkillData() {

    data.setDefaults();/*from  w w w .  j  a v  a  2  s  .co m*/

    VerticalPanel panel = new VerticalPanel();
    initWidget(panel);

    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    horizontalPanel.setSpacing(5);
    panel.add(horizontalPanel);

    Label lblNewLabel = new Label("Skill:");
    lblNewLabel.setStyleName("boldText");
    horizontalPanel.add(lblNewLabel);

    skills = new ListBox();
    horizontalPanel.add(skills);

    CaptionPanel cptnpnlNewPanel = new CaptionPanel("Skill Damage");
    panel.add(cptnpnlNewPanel);

    table = new FlexTable();
    cptnpnlNewPanel.setContentWidget(table);
    table.setSize("5cm", "3cm");
    table.setStyleName("breakpointTable");
    table.setCellPadding(5);
    table.setBorderWidth(1);

    table.getRowFormatter().addStyleName(0, "headerRow");

    int col = 0;

    Label lblSkill = new Label("Skill");
    lblSkill.setWordWrap(false);
    table.setWidget(0, col++, lblSkill);

    Label lblRune = new Label("Rune");
    lblRune.setWordWrap(false);
    table.setWidget(0, col++, lblRune);

    Label lblType = new Label("Damage Type");
    lblType.setWordWrap(false);
    table.setWidget(0, col++, lblType);

    Label lblMultiplier = new Label("Multiplier");
    lblMultiplier.setWordWrap(false);
    table.setWidget(0, col++, lblMultiplier);

    Label frames = new Label("Frames");
    frames.setWordWrap(false);
    table.setWidget(0, col++, frames);

    Label lblPrimary = new Label("Primary");
    lblPrimary.setWordWrap(false);
    table.setWidget(0, col++, lblPrimary);

    Label lblAdditional = new Label("# Additional");
    lblAdditional.setWordWrap(false);
    table.setWidget(0, col++, lblAdditional);

    Label lblProjectiles = new Label("# Projectiles");
    lblProjectiles.setWordWrap(false);
    table.setWidget(0, col++, lblProjectiles);

    Label lblAoeRadius = new Label("AoE Radius");
    lblAoeRadius.setWordWrap(false);
    table.setWidget(0, col++, lblAoeRadius);

    Label lblGrenades = new Label("Grenades");
    lblGrenades.setWordWrap(false);
    table.setWidget(0, col++, lblGrenades);

    Label lblRockets = new Label("Rockets");
    lblRockets.setWordWrap(false);
    table.setWidget(0, col++, lblRockets);

    Label lblDot = new Label(" DoT ");
    lblDot.setWordWrap(false);
    table.setWidget(0, col++, lblDot);

    Label lblNotes = new Label("Notes");
    lblNotes.setWordWrap(false);
    lblNotes.addStyleName("notes");
    table.setWidget(0, col++, lblNotes);

    List<Pair<String, String>> list = new Vector<Pair<String, String>>();

    for (ActiveSkill s : ActiveSkill.values()) {

        if (DamageFunction.hasDamage(s))
            list.add(new Pair<String, String>(s.getLongName(), s.name()));
    }

    for (GemSkill g : GemSkill.values()) {

        if (DamageFunction.hasDamage(g))
            list.add(new Pair<String, String>(g.getDisplayName(), g.name()));
    }

    for (DamageProc p : DamageProc.values()) {
        list.add(new Pair<String, String>(p.getLongName(), p.name()));
    }

    Collections.sort(list, new Comparator<Pair<String, String>>() {

        @Override
        public int compare(Pair<String, String> o1, Pair<String, String> o2) {
            return o1.getA().toLowerCase().compareTo(o2.getA().toLowerCase());
        }
    });

    for (Pair<String, String> p : list) {
        skills.addItem(p.getA(), p.getB());
    }

    skills.addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {
            skillChanged();
        }
    });

    skills.setSelectedIndex(0);

    skillChanged();
}

From source file:com.dimdim.conference.ui.common.client.tab.CommonTab.java

License:Open Source License

public CommonTab(CommonTabGroup tabGroup, String name, String tooltip, String labelText,
        CommonTabContentProvider tabContentProvider, CommonTabContentPanel tabContentPanel, Widget hideControl,
        ClickListener openControlListener) {
    if (hideControl != null) {
        label.setWordWrap(false);//from w w  w  . j ava2  s . co m
        label.addClickListener(openControlListener);

        HorizontalPanel hp = new HorizontalPanel();
        hp.add(hideControl);
        hp.add(label);
        hp.setStyleName("dm-tab-label-image-pair");
        actualPanel = hp;
        initWidget(hp);
    } else {
        initWidget(label);
    }
    this.hideControl = hideControl;
    this.tabGroup = tabGroup;
    this.name = name;
    this.labelText = labelText;
    this.tabContentPanel = tabContentPanel;
    this.tabContentProvider = tabContentProvider;

    this.label.setText(labelText);
    this.label.setTitle(tooltip);

    this.label.addClickListener(this);
    this.setStyleName("dm-tab");
    //      this.addStyleName("common-anchor");
    this.addStyleName("anchor-cursor");
    this.addStyleName("dm-tab-unselected");
    DOM.setAttribute(this.label.getElement(), "id", this.name);

    this.subTabs = new Vector();
}

From source file:com.dimdim.conference.ui.common.client.tab.CommonTab.java

License:Open Source License

public HorizontalPanel getShareControlPanel() {
    if (shareControlPanel == null) {
        shareControlPanel = new HorizontalPanel();
    }/*w  ww  .  ja va 2  s  .  co m*/
    return shareControlPanel;
}

From source file:com.dimdim.conference.ui.common.client.tab.CommonTab.java

License:Open Source License

public Widget getSubtabsPanel() {
    if (this.subTabsPanel == null) {
        this.subTabsPanel = new HorizontalPanel();
        int size = this.subTabs.size();
        for (int i = 0; i < size; i++) {
            CommonSubTab subTab = (CommonSubTab) this.subTabs.elementAt(i);
            if (subTab.isTypeComment()) {
                subTab.addStyleName("common-text");
            } else {
                subTab.addStyleName("console-sub-tab-link");
            }// w w w  . j a  v  a  2s .c  o  m
            if (i > 0) {
                HTML seperator = new HTML("|");
                seperator.setStyleName("console-sub-tab-seperator");
                this.subTabsPanel.add(seperator);
            }

            this.subTabsPanel.add(subTab);
            if (subTab.getImage() != null) {
                this.subTabsPanel.add(subTab.getImage());
                this.subTabsPanel.setCellHorizontalAlignment(subTab, HorizontalPanel.ALIGN_RIGHT);
                this.subTabsPanel.setCellHorizontalAlignment(subTab.getImage(), HorizontalPanel.ALIGN_RIGHT);
            }
        }
        if (this.comment != null) {
            Label label = new Label(comment);
            label.setStyleName("common-text");
            this.subTabsPanel.add(label);
        }
        if (this.shareControlPanel != null) {
            this.subTabsPanel.add(this.shareControlPanel);
            this.subTabsPanel.setCellHorizontalAlignment(shareControlPanel, HorizontalPanel.ALIGN_RIGHT);
        }
    }
    return this.subTabsPanel;
}

From source file:com.dimdim.conference.ui.common.client.tab.CommonTabbedPage.java

License:Open Source License

protected void createPanels() {
    this.tabsPanel = new DockPanel();
    this.tabsPanel.setStyleName("dm-tab-bar");
    this.subTabsPanel = new DockPanel();
    this.subTabsPanel.setStyleName("dm-sub-tab-bar");
    this.contentPanel = new DockPanel();

    leftGroupTabs = new HorizontalPanel();
    tabsPanel.add(leftGroupTabs, DockPanel.WEST);
    tabsPanel.setCellVerticalAlignment(leftGroupTabs, VerticalPanel.ALIGN_BOTTOM);
    tabsPanel.setCellHorizontalAlignment(leftGroupTabs, HorizontalPanel.ALIGN_LEFT);

    leftGroupSubTabs = new HorizontalPanel();
    subTabsPanel.add(leftGroupSubTabs, DockPanel.WEST);
    subTabsPanel.setCellHorizontalAlignment(leftGroupSubTabs, HorizontalPanel.ALIGN_LEFT);
    subTabsPanel.setCellVerticalAlignment(leftGroupSubTabs, VerticalPanel.ALIGN_MIDDLE);

    leftGroupContentPanel = new VerticalPanel();
    leftGroupContentPanel.setStyleName("left-group-content-panel");
    contentPanel.add(leftGroupContentPanel, DockPanel.WEST);
    contentPanel.setCellHorizontalAlignment(leftGroupContentPanel, HorizontalPanel.ALIGN_CENTER);
    contentPanel.setCellVerticalAlignment(leftGroupContentPanel, VerticalPanel.ALIGN_TOP);

    poppedOutWorkspaceContent = new HorizontalPanel();
    poppedOutWorkspaceContent.add(new Label("."));

    leftTabGroup = new CommonTabGroup(this, name, CommonTabGroup.LEFT, leftGroupTabs, leftGroupSubTabs,
            leftGroupContentPanel, this.leftGroupContentWidth, this.leftGroupContentHeight);

    if (this.rightGroupName != null && this.rightGroupWidth != null) {
        this.rightGroupContentVisible = true;
        rightGroupTabs = new HorizontalPanel();
        rightGroupTabs.setWidth(rightGroupWidth);

        tabsPanel.add(rightGroupTabs, DockPanel.EAST);
        tabsPanel.setCellVerticalAlignment(rightGroupTabs, VerticalPanel.ALIGN_BOTTOM);
        tabsPanel.setCellHorizontalAlignment(rightGroupTabs, HorizontalPanel.ALIGN_RIGHT);

        rightGroupTabs.add(meetingClock);
        rightGroupTabs.setCellVerticalAlignment(meetingClock, VerticalPanel.ALIGN_BOTTOM);
        rightGroupTabs.setCellHorizontalAlignment(meetingClock, HorizontalPanel.ALIGN_RIGHT);

        rightGroupSubTabs = new HorizontalPanel();
        rightGroupSubTabs.setWidth(rightGroupWidth);
        subTabsPanel.add(rightGroupSubTabs, DockPanel.EAST);
        subTabsPanel.setCellHorizontalAlignment(rightGroupSubTabs, HorizontalPanel.ALIGN_RIGHT);
        subTabsPanel.setCellVerticalAlignment(rightGroupSubTabs, VerticalPanel.ALIGN_MIDDLE);

        rightGroupContentPanel = new VerticalPanel();
        rightGroupContentPanel.setWidth(rightGroupWidth);
        contentPanel.add(rightGroupContentPanel, DockPanel.EAST);
        contentPanel.setCellHorizontalAlignment(rightGroupContentPanel, HorizontalPanel.ALIGN_LEFT);
        contentPanel.setCellVerticalAlignment(rightGroupContentPanel, VerticalPanel.ALIGN_TOP);

        rightTabGroup = new CommonTabGroup(this, name, CommonTabGroup.RIGHT, rightGroupTabs, rightGroupSubTabs,
                rightGroupContentPanel, this.rightGroupContentWidth, this.rightGroupContentHeight);

        this.rightGroupHideControl = new Image("images/opentriangle.gif");//,15,15);
        this.rightGroupHideControl.addClickListener(this);
        this.rightGroupHideControl.setStyleName("hide-discuss-panel-button");
        rightTabGroup.setHideControl(this.rightGroupHideControl);
        rightTabGroup.setOpenControlListener(this);
    } else {//from w w  w.  ja  v  a2 s  .  c  om
        //   Just to make sure that the subtabs panel expands horizontally.
        rightGroupSubTabs = new HorizontalPanel();
        rightGroupSubTabs.add(new HTML("&nbsp;"));
        subTabsPanel.add(rightGroupSubTabs, DockPanel.EAST);
        subTabsPanel.setCellHorizontalAlignment(rightGroupSubTabs, HorizontalPanel.ALIGN_RIGHT);
        subTabsPanel.setCellVerticalAlignment(rightGroupSubTabs, VerticalPanel.ALIGN_MIDDLE);
    }
    subTabsAndContentPanel = new DockPanel();
    subTabsAndContentPanel.setStyleName("dm-tab-content");
    subTabsAndContentPanel.add(subTabsPanel, DockPanel.NORTH);
    subTabsAndContentPanel.add(poppedOutWorkspaceContent, DockPanel.NORTH);
    this.poppedOutWorkspaceContent.setVisible(false);
    subTabsAndContentPanel.add(contentPanel, DockPanel.CENTER);
    roundedPanel = new RoundedPanel(subTabsAndContentPanel);

    tabbedPage.add(tabsPanel);
    tabbedPage.add(roundedPanel);
}

From source file:com.dimdim.conference.ui.common.client.user.NewChatPanel.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  w  w  w .  j a va 2 s .  c om
public NewChatPanel(UIRosterEntry me, UIRosterEntry other) {
    this.me = me;
    this.other = other;
    if (other != null) {
        this.toId = other.getUserId();
    }
    this.lastActivityTime = System.currentTimeMillis();
    if (ConferenceGlobals.isBrowserIE()) {
        spaceSequence = "DIMDIM_LTwbr>";
    }

    //   Add the central scroll panel that will hold the messages.

    scrollPanel = new ScrollPanel();
    scrollPanel.add(this.chatMessages);
    scrollPanel.setStyleName("dm-chat-message-area");

    //   A small and short instructions / message area.

    instructionPanel = new HorizontalPanel();
    instructionPanel.setStyleName("chat-instruction-panel");
    instructionPanel.setWidth("248px");

    //in public chat add powered by dimdim logo else have the help text
    if (null == toId) {
        HorizontalPanel hp = new HorizontalPanel();

        HorizontalPanel tempSpacer = new HorizontalPanel();
        tempSpacer.setWidth("10px");
        tempSpacer.add(new Label("  "));
        hp.add(tempSpacer);
        hp.setCellHorizontalAlignment(tempSpacer, HorizontalPanel.ALIGN_LEFT);
        hp.setCellVerticalAlignment(tempSpacer, VerticalPanel.ALIGN_MIDDLE);

        PNGImage image = new PNGImage("images/logo_powered.png", 8, 14);
        hp.add(image);
        //instructionPanel.setCellWidth(image,"100%");
        hp.setCellHorizontalAlignment(image, HorizontalPanel.ALIGN_LEFT);
        hp.setCellVerticalAlignment(image, VerticalPanel.ALIGN_MIDDLE);

        //hp.setBorderWidth(1);
        HTML instruction = new HTML("Powered By <a href='#'><u> Dimdim </u></a>");
        instruction.addClickListener(new ClickListener() {
            public void onClick(Widget sender) {
                openDimdimWebSite();
            }
        });
        instruction.setStyleName("poweredby-text");
        hp.add(instruction);
        //instructionPanel.setCellWidth(instruction,"100%");
        hp.setCellHorizontalAlignment(instruction, HorizontalPanel.ALIGN_LEFT);
        hp.setCellVerticalAlignment(instruction, VerticalPanel.ALIGN_MIDDLE);

        instructionPanel.add(hp);
        //instructionPanel.setCellWidth(instruction,"100%");
        instructionPanel.setCellHorizontalAlignment(hp, HorizontalPanel.ALIGN_LEFT);
        instructionPanel.setCellVerticalAlignment(hp, VerticalPanel.ALIGN_MIDDLE);

    } else {
        Label instruction = new Label(UIStrings.getChatPanelInstruction());
        instruction.setStyleName("chat-instruction");
        instructionPanel.add(instruction);
        //instructionPanel.setCellWidth(instruction,"100%");
        instructionPanel.setCellHorizontalAlignment(instruction, HorizontalPanel.ALIGN_LEFT);
        instructionPanel.setCellVerticalAlignment(instruction, VerticalPanel.ALIGN_MIDDLE);
    }

    Label emoticon = new Label(UIStrings.getChatPanelEmoticonInstruction());
    emoticon.setStyleName("chat-emoticon-lable");
    instructionPanel.add(emoticon);
    //instructionPanel.setCellWidth(emoticon,"30%");
    instructionPanel.setCellHorizontalAlignment(emoticon, HorizontalPanel.ALIGN_RIGHT);
    instructionPanel.setCellVerticalAlignment(emoticon, VerticalPanel.ALIGN_MIDDLE);

    //   Add the text area that the users will type their messages in.

    sendText = new TextArea();
    sendText.setText("");
    if (null == toId) {
        sendText.setText(UIStrings.getChatPanelInstruction());
        sendText.setStyleName("chat-instruction");
    }
    //if (ConferenceGlobals.isBrowserIE())
    //{
    sendText.setVisibleLines(2);
    //}
    //else
    //{
    //   sendText.setVisibleLines(1);
    //}
    sendText.setStyleName("chat-text-area");

    keyboardListener = new KeyboardListenerAdapter() {
        public void onKeyDown(Widget sender, char keyCode, int modifiers) {
        }

        public void onKeyUp(Widget sender, char keyCode, int modifiers) {
            if (keyCode == KeyboardListener.KEY_ENTER) {
                sendChatMessage();
            }
        }
    };
    sendText.addKeyboardListener(keyboardListener);
    sendText.addFocusListener(this);

    //   Assemble the overall chat panel.

    initWidget(pane);
    pane.setWidth("100%");
    pane.add(outer);
    outer.setWidth("100%");

    outer.add(scrollPanel);
    scrollPanel.addStyleName("dm-chat-message-area-pane");

    outer.add(this.instructionPanel);
    outer.setCellWidth(this.instructionPanel, "100%");
    outer.setCellHorizontalAlignment(this.instructionPanel, HorizontalPanel.ALIGN_LEFT);

    outer.add(this.sendText);
    outer.setCellWidth(this.sendText, "100%");
    outer.setCellHorizontalAlignment(this.sendText, HorizontalPanel.ALIGN_CENTER);
    this.sendText.setStyleName("dm-chat-text-area");

    this.rosterModel = ClientModel.getClientModel().getRosterModel();

    //      Window.alert("created popup..");
    //setting up emoticons popup panel
    ePopUP = new EmoticonsPopup(sendText);
    emoticon.addMouseListener(new MouseListenerAdapter() {
        public void onMouseEnter(Widget sender) {
            int left = sender.getAbsoluteLeft() - 5;
            int top = sender.getAbsoluteTop() - 75;
            ePopUP.setPopupPosition(left, top);
            ePopUP.showHoverPopup();
            ePopUP.popupVisible();
        }
    });

    if (emoticonsMap == null) {
        emoticonsMap = new HashMap();
        prepareEmoticonsList();
        //         this is to handle :) and :( also         
    }
}

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

License:Open Source License

private void addText(Widget lbl, boolean host) {
    HorizontalPanel hp = new HorizontalPanel();
    hp.add(lbl);/* www .  j a  v  a2s.  c o  m*/
    if (chatMessages.getWidgetCount() > maxMessages) {
        for (int i = trimMessages; i >= 0; i--) {
            chatMessages.remove(i);
        }
    }
    this.chatMessages.add(hp);
    this.chatMessages.setCellWidth(hp, "100%");
    if (host) {
        hp.addStyleName("host-chat-message");
    } else {
        hp.addStyleName("remote-chat-message");
    }

    if (!this.textBoxHasFocus) {
        if (this.unreadMessaeListener != null) {
            this.unreadMessaeListener.hasNewUnreadMessage();
        }
    } else {
        if (this.unreadMessaeListener != null) {
            this.unreadMessaeListener.seenUnreadMessage();
        }
    }

    int scrollPosition = scrollPanel.getScrollPosition();
    DebugPanel.getDebugPanel().addDebugMessage("Chat Panel scroll position:" + scrollPosition);
    if (scrollPosition < 0) {
        scrollPosition = 0;
    }
    /*if(scrollPosition < scrollMax)
    {
       scrollMax += scrollPosition;
    }*/
    //      Window.alert("Scroll position " + scrollPosition );
    //      Window.alert("Scroll Max " + scrollMax);
    scrollMax += scrollPosition;
    scrollPanel.setScrollPosition(scrollMax);
}