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

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

Introduction

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

Prototype

protected Label(Element element) 

Source Link

Document

This constructor may be used by subclasses to explicitly use an existing element.

Usage

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   w ww.j  ava  2s.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.SituationalPanel.java

License:Open Source License

public SituationalPanel() {

    CaptionPanel captionPanel = new CaptionPanel("Situational");
    initWidget(captionPanel);/*from w  w w . j  a v  a  2 s .  com*/

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

    int row = 0;

    Label lblGreaterRiftLevel = new Label("Greater Rift Level:");
    lblGreaterRiftLevel.setWordWrap(false);
    flexTable.setWidget(row, 0, lblGreaterRiftLevel);

    riftLevel = new NumberSpinner();
    riftLevel.setVisibleLength(4);
    riftLevel.setTitle("Greater Rift Level");
    riftLevel.setText("1");
    riftLevel.setMin(1);
    riftLevel.setMax(100);
    flexTable.setWidget(row++, 1, riftLevel);

    Label lblNumberOfPlayers = new Label("Number of Players:");
    lblNumberOfPlayers.setWordWrap(false);
    flexTable.setWidget(row, 0, lblNumberOfPlayers);

    numPlayers = new NumberSpinner();
    numPlayers.setVisibleLength(4);
    numPlayers.setTitle("# of players in rift (used to calculate monster health)");
    numPlayers.setText("1");
    numPlayers.setMin(1);
    numPlayers.setMax(4);
    flexTable.setWidget(row++, 1, numPlayers);

    Label lblPrimaryTargetType = new Label("Primary Target Type:");
    lblPrimaryTargetType.setWordWrap(false);
    flexTable.setWidget(row, 0, lblPrimaryTargetType);

    primaryTargetType = new ListBox();
    flexTable.setWidget(row++, 1, primaryTargetType);
    primaryTargetType.setWidth("100%");

    Label lblPrimaryTargetHealth = new Label("Primary Target Health:");
    lblPrimaryTargetHealth.setWordWrap(false);
    flexTable.setWidget(row, 0, lblPrimaryTargetHealth);

    primaryTargetHealth = new LongSpinner();
    primaryTargetHealth.setVisibleLength(20);
    primaryTargetHealth.setTitle("Number of additional targets to account for.");
    primaryTargetHealth.setText("0");
    flexTable.setWidget(row++, 1, primaryTargetHealth);

    Label lblAdditionalTargetsType = new Label("Additional Targets Type:");
    lblAdditionalTargetsType.setWordWrap(false);
    flexTable.setWidget(row, 0, lblAdditionalTargetsType);

    additionalTargetType = new ListBox();
    flexTable.setWidget(row++, 1, additionalTargetType);
    additionalTargetType.setWidth("100%");

    Label lblOfadditional = new Label("# of Additional targets:");
    lblOfadditional.setWordWrap(false);
    flexTable.setWidget(row, 0, lblOfadditional);

    additional = new NumberSpinner();
    additional.setVisibleLength(4);
    additional.setTitle("Number of additional targets to account for.");
    additional.setText("0");
    flexTable.setWidget(row++, 1, additional);
    this.additional.setMax(10);

    Label lblAdditionalTargetsHealth = new Label("Additional Targets Health:");
    lblAdditionalTargetsHealth.setWordWrap(false);
    flexTable.setWidget(row, 0, lblAdditionalTargetsHealth);

    additionalTargetsHealth = new LongSpinner();
    additionalTargetsHealth.setVisibleLength(20);
    additionalTargetsHealth.setTitle("Number of additional targets to account for.");
    additionalTargetsHealth.setText("0");
    flexTable.setWidget(row++, 1, additionalTargetsHealth);

    Label lblPercentOfTargets = new Label("Percent of targets slowed/chilled?");
    lblPercentOfTargets.setWordWrap(false);
    flexTable.setWidget(row, 0, lblPercentOfTargets);

    percentSlowedChilled = new NumberSpinner();
    percentSlowedChilled.setVisibleLength(4);
    percentSlowedChilled.setTitle("Percent of targets slowed or chilled (apply Cull the Weak).");
    percentSlowedChilled.setText("0");
    flexTable.setWidget(row++, 1, percentSlowedChilled);

    Label lblPercentOfTargets_1 = new Label("Percent of targets control impaired?");
    lblPercentOfTargets_1.setWordWrap(false);
    flexTable.setWidget(row, 0, lblPercentOfTargets_1);

    percentControlled = new NumberSpinner();
    percentControlled.setVisibleLength(4);
    percentControlled.setTitle("Percent of targets control impaired (apply Bane of the Trapped).");
    percentControlled.setText("0");
    flexTable.setWidget(row++, 1, percentControlled);

    Label lblPercentOfTargets_2 = new Label("Percent of targets at least 10 yards away?");
    lblPercentOfTargets_2.setWordWrap(false);
    flexTable.setWidget(row, 0, lblPercentOfTargets_2);

    percentAtLeast10Yards = new NumberSpinner();
    percentAtLeast10Yards.setVisibleLength(4);
    percentAtLeast10Yards.setTitle("Percent of targets at least 10 yards away (apply Steady Aim/UE4).");
    percentAtLeast10Yards.setText("0");
    flexTable.setWidget(row++, 1, percentAtLeast10Yards);

    Label label_8 = new Label("Distance to target(s) (yards)");
    label_8.setWordWrap(false);
    flexTable.setWidget(row, 0, label_8);

    distance = new NumberSpinner();
    distance.setVisibleLength(4);
    distance.setTitle("Average distance (in yards) to target(s) (for Zei's Stone of Vengeance).");
    distance.setText("0");
    flexTable.setWidget(row++, 1, distance);

    Label lblSpacingBetweenTargets = new Label("Spacing between targets (yards):");
    lblSpacingBetweenTargets.setWordWrap(false);
    flexTable.setWidget(row, 0, lblSpacingBetweenTargets);

    targetSpacing = new NumberSpinner();
    targetSpacing.setVisibleLength(4);
    targetSpacing.setTitle(
            "Average distance (in yards) between target(s) (for Grenades, certain Marked for Death runes and Single Out).");
    targetSpacing.setText("0");
    flexTable.setWidget(row++, 1, targetSpacing);

    Label moving = new Label("% of time Moving:");
    moving.setWordWrap(false);
    flexTable.setWidget(row, 0, moving);

    percentMoving = new NumberSpinner();
    percentMoving.setVisibleLength(4);
    percentMoving.setTitle("Percent of the time that the player is moving (vs standing still)");
    percentMoving.setMin(0);
    percentMoving.setMax(100);
    percentMoving.setText("50");
    flexTable.setWidget(row++, 1, percentMoving);

    Label lblTargetSizefor = new Label("Target Size (for Ball Lightning):");
    lblTargetSizefor.setWordWrap(false);
    flexTable.setWidget(row, 0, lblTargetSizefor);

    targetSize = new ListBox();
    targetSize.setTitle("Target Size");
    flexTable.setWidget(row++, 1, targetSize);
    targetSize.setWidth("100%");

    Label label = new Label("# Health Globes:");
    flexTable.setWidget(row, 0, label);

    numHealthGlobes = new NumberSpinner();
    numHealthGlobes.setVisibleLength(4);
    numHealthGlobes.setTitle("# of Health Globes picked up during fight");
    flexTable.setWidget(row++, 1, numHealthGlobes);

    Label label_1 = new Label("Average Firing Delay (ms):");
    label_1.setWordWrap(false);
    flexTable.setWidget(row, 0, label_1);

    firingDelay = new NumberSpinner();
    firingDelay.setVisibleLength(4);
    firingDelay.setTitle("Average delay (in milliseconds) of player actions.");
    flexTable.setWidget(row++, 1, firingDelay);

    this.distance.setMax(100);
    this.targetSpacing.setMax(100);
    this.percentAtLeast10Yards.setMax(100);
    this.percentControlled.setMax(100);
    this.percentSlowedChilled.setMax(100);
    this.numHealthGlobes.setMin(0);
    this.firingDelay.setMin(0);
    this.firingDelay.setMax(1000);

    for (TargetSize t : TargetSize.values()) {
        targetSize.addItem(t.getDisplayName(), t.name());
    }

    ChangeHandler primaryHandler = new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {

            if (!disableListeners)
                updatePrimaryMonsterHealth();
        }
    };

    ChangeHandler additionalHandler = new ChangeHandler() {

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

    for (MonsterType m : MonsterType.values()) {
        this.primaryTargetType.addItem(m.toString(), m.name());
        this.additionalTargetType.addItem(m.toString(), m.name());
    }

    this.primaryTargetType.setSelectedIndex(0);
    this.additionalTargetType.setSelectedIndex(0);

    this.riftLevel.addChangeHandler(primaryHandler);
    this.riftLevel.addChangeHandler(additionalHandler);
    this.primaryTargetType.addChangeHandler(primaryHandler);
    this.additionalTargetType.addChangeHandler(additionalHandler);
    this.numPlayers.addChangeHandler(primaryHandler);
    this.numPlayers.addChangeHandler(additionalHandler);
}

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

License:Open Source License

public SkillData() {

    data.setDefaults();//from ww  w. jav a 2s .c  o  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.dawg6.web.dhcalc.client.SkillsPanel.java

License:Open Source License

public SkillsPanel() {

    CaptionPanel captionPanel = new CaptionPanel("Active Skills");
    initWidget(captionPanel);/*from  w w w . j  av  a  2s.  c o  m*/

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

    int row = 0;

    List<ActiveSkill> skills = new Vector<ActiveSkill>();

    for (ActiveSkill s : ActiveSkill.values()) {
        if (s.getSkillType() != SkillType.NA)
            skills.add(s);
    }
    Collections.sort(skills, new Comparator<ActiveSkill>() {

        @Override
        public int compare(ActiveSkill o1, ActiveSkill o2) {
            return o1.getLongName().toLowerCase().compareTo(o2.getLongName().toLowerCase());
        }
    });

    for (int i = 0; i < NUM_SKILLS; i++) {
        final Anchor anchor = new Anchor("Skill " + (i + 1) + ":");
        anchor.setHref("javascript:void(0)");
        anchor.setTarget("_blank");
        anchor.setWordWrap(false);
        skillAnchors.add(anchor);
        flexTable.setWidget(row, 0, anchor);

        final ListBox list = new ListBox();

        list.addItem("None", "");

        for (ActiveSkill s : skills) {
            list.addItem(s.getLongName(), s.name());
        }

        list.setSelectedIndex(0);
        skillBoxes.add(list);
        list.setWidth("100%");
        flexTable.setWidget(row, 1, list);

        final Anchor anchor2 = new Anchor("Rune:");
        anchor2.setHref("javascript:void(0)");
        anchor2.setTarget("_blank");
        anchor2.setWordWrap(false);
        runeAnchors.add(anchor2);
        flexTable.setWidget(row, 2, anchor2);

        final ListBox list2 = new ListBox();

        list2.addItem("None", Rune.None.name());
        list2.setSelectedIndex(0);
        list2.setWidth("100%");
        flexTable.setWidget(row, 3, list2);
        runeBoxes.add(list2);

        list.addChangeHandler(new ChangeHandler() {

            @Override
            public void onChange(ChangeEvent event) {

                if (!disableListeners) {
                    skillChanged(anchor, list, anchor2, list2);
                }
            }
        });

        list2.addChangeHandler(new ChangeHandler() {

            @Override
            public void onChange(ChangeEvent event) {

                if (!disableListeners) {
                    runeChanged(list, anchor2, list2);
                }
            }
        });

        row++;
    }

    Label label = new Label("Caltrops Uptime:");
    label.setWordWrap(false);
    flexTable.setWidget(row, 0, label);
    flexTable.getFlexCellFormatter().setColSpan(row, 0, 2);
    flexTable.getFlexCellFormatter().setHorizontalAlignment(row, 0, HasHorizontalAlignment.ALIGN_RIGHT);

    caltropsUptime = new NumberSpinner();
    caltropsUptime.setVisibleLength(3);
    caltropsUptime.setTitle("Percent of the time primary target will have active Caltrops applied.");
    flexTable.setWidget(row, 1, caltropsUptime);
    flexTable.getFlexCellFormatter().setColSpan(row, 1, 2);
    caltropsUptime.setMax(100);

    row++;

    Label lblUptime = new Label("Primary Target MfD Uptime:");
    lblUptime.setWordWrap(false);
    flexTable.setWidget(row, 0, lblUptime);
    flexTable.getFlexCellFormatter().setColSpan(row, 0, 2);
    flexTable.getFlexCellFormatter().setHorizontalAlignment(row, 0, HasHorizontalAlignment.ALIGN_RIGHT);

    mfdUptime = new NumberSpinner();
    mfdUptime.setTitle("Percent of the time primary target will have active MfD applied.");
    mfdUptime.setVisibleLength(3);
    flexTable.setWidget(row, 1, mfdUptime);
    flexTable.getFlexCellFormatter().setColSpan(row, 1, 2);

    row++;

    Label lblAdditionalTargetsUptime = new Label("Additional Targets MfD Uptime:");
    lblAdditionalTargetsUptime.setWordWrap(false);
    flexTable.setWidget(row, 0, lblAdditionalTargetsUptime);
    flexTable.getFlexCellFormatter().setColSpan(row, 0, 2);
    flexTable.getFlexCellFormatter().setHorizontalAlignment(row, 0, HasHorizontalAlignment.ALIGN_RIGHT);

    mfdAddUptime = new NumberSpinner();
    mfdAddUptime.setVisibleLength(3);
    mfdAddUptime.setTitle("Percent of the time additional targets will have active MfD applied.");
    flexTable.setWidget(row, 1, mfdAddUptime);
    flexTable.getFlexCellFormatter().setColSpan(row, 1, 2);

    row++;

    Label lblNoteThisStacks = new Label("Note: This stacks with Calamity's MfD");
    lblNoteThisStacks.setWordWrap(false);
    lblNoteThisStacks.setStyleName("boldText");
    flexTable.setWidget(row, 0, lblNoteThisStacks);
    flexTable.getFlexCellFormatter().setColSpan(row, 0, 4);

    row++;

    mfdUptime.setMax(100);
    mfdAddUptime.setMax(100);
    caltropsUptime.setMax(100);

}

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

License:Open Source License

public StatsPanel() {

    CaptionPanel cptnpnlNewPanel = new CaptionPanel("Statistics");
    initWidget(cptnpnlNewPanel);/* ww w .  j ava  2s. 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.dawg6.web.dhcalc.client.StatsPanel.java

License:Open Source License

protected void showStats(DBStatistics stats) {

    this.statList = new Vector<StatHolder>(stats.builds.size());

    for (Map.Entry<Build, Statistics> e : stats.builds.entrySet()) {
        StatHolder h = new StatHolder();
        h.build = e.getKey();//w w w  .j a v  a 2 s .  c om
        h.stats = e.getValue();
        statList.add(h);
    }

    totalLabel.setText(Util.format(stats.stats.total));

    int row = 1;
    for (StatCategory c : StatCategory.values()) {
        final DpsTableEntry entry = stats.stats.max.get(c);
        Double average = stats.stats.average.get(c);
        double max = c.getValue(entry);

        Label label1 = new Label(Util.format(Math.round(average)));
        label1.addStyleName("right");
        Label label2 = new Label(Util.format(Math.round(max)));
        label2.addStyleName("right");
        mainTable.setWidget(row, 1, label1);
        mainTable.setWidget(row, 2, label2);
        Anchor anchor = new Anchor(entry.getRealm().name() + "/" + entry.getProfile() + "-" + entry.getTag());
        anchor.setTarget("_blank");
        anchor.setTitle("View this profile on battle.net");
        anchor.setHref(ClientUtils.getProfileUrl(entry));
        mainTable.setWidget(row, 3, anchor);

        Anchor imp = new Anchor("import");
        imp.setTitle("Import this profile");
        imp.setHref("javascript:void(0);");
        imp.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
                importEntry(entry);

            }
        });
        mainTable.setWidget(row, 4, imp);

        row++;
    }

    sortStats(StatSorter.COUNT);
}

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

License:Open Source License

public WeaponPanel(String title, boolean offHand) {
    this.offHand = offHand;
    captionPanel = new CaptionPanel(title);
    initWidget(captionPanel);//from   w w  w .  j  a v  a2  s .  c om

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

    Label label = new Label("Weapon Type:");
    label.setWordWrap(false);
    flexTable.setWidget(0, 0, label);

    weaponType = new ListBox();
    weaponType.setSelectedIndex(0);
    flexTable.setWidget(0, 1, weaponType);

    Label label_1 = new Label("Base (Physical) Damage:");
    label_1.setWordWrap(false);
    flexTable.setWidget(1, 0, label_1);

    baseMin = new DoubleSpinner();
    baseMin.box.setTitle("This number is not displayed in-game. It is imported from hero import.");
    baseMin.setVisibleLength(8);
    baseMin.setText("0");
    flexTable.setWidget(1, 1, baseMin);

    Label label_2 = new Label(" to ");
    label_2.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    flexTable.setWidget(1, 2, label_2);

    baseMax = new DoubleSpinner();
    baseMax.box.setTitle("This number is not displayed in-game. It is imported from hero import.");
    baseMax.setVisibleLength(8);
    baseMax.setText("0");
    flexTable.setWidget(1, 3, baseMax);

    Label label_3 = new Label("Tooltip Damage:");
    label_3.setWordWrap(false);
    label_3.setStyleName("boldText");
    flexTable.setWidget(1, 4, label_3);

    tooltipMin = new Label();
    tooltipMin.setTitle("Shown as \"white\" damage on weapon tooltip.");
    tooltipMin.setText("0");
    tooltipMin.setStyleName("boldText");
    flexTable.setWidget(1, 5, tooltipMin);

    Label label_5 = new Label(" to ");
    label_5.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    flexTable.setWidget(1, 6, label_5);

    tooltipMax = new Label();
    tooltipMax.setTitle("Shown as \"white\" damage on weapon tooltip.");
    tooltipMax.setText("0");
    tooltipMax.setStyleName("boldText");
    flexTable.setWidget(1, 7, tooltipMax);

    Label label_7 = new Label("Added (Elemental) Damage:");
    label_7.setWordWrap(false);
    flexTable.setWidget(2, 0, label_7);

    addMin = new DoubleSpinner();
    addMin.box.setTitle("Shown as primary stat on weapon.");
    addMin.setVisibleLength(8);
    addMin.setText("0");
    flexTable.setWidget(2, 1, addMin);

    Label label_8 = new Label(" to ");
    label_8.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    flexTable.setWidget(2, 2, label_8);

    addMax = new DoubleSpinner();
    addMax.box.setTitle("Shown as primary stat on weapon.");
    addMax.setVisibleLength(8);
    addMax.setText("0");
    flexTable.setWidget(2, 3, addMax);

    Label label_9 = new Label("Average Weapon Damage:");
    label_9.setWordWrap(false);
    label_9.setStyleName("boldText");
    flexTable.setWidget(2, 4, label_9);

    averageWeaponDamage = new Label("0.0");
    averageWeaponDamage.setTitle("Average weapon damage used for Skill calculations");
    averageWeaponDamage.setStyleName("boldText");
    flexTable.setWidget(2, 5, averageWeaponDamage);
    flexTable.getFlexCellFormatter().setColSpan(2, 5, 3);

    Label label_11 = new Label("Weapon IAS (%):");
    label_11.setWordWrap(false);
    flexTable.setWidget(3, 0, label_11);

    weaponIAS = new NumberSpinner();
    weaponIAS.box.setTitle("Increased attack speed as a primary attribute on the weapon.");
    weaponIAS.setVisibleLength(6);
    flexTable.setWidget(3, 1, weaponIAS);

    Label label_12 = new Label("Weapon DPS:");
    label_12.setWordWrap(false);
    label_12.setStyleName("boldText");
    flexTable.setWidget(3, 4, label_12);

    weaponDpsLabel = new Label("0.0");
    weaponDpsLabel.setTitle("Shown as dps on weapon tooltip.");
    weaponDpsLabel.setStyleName("boldText");
    flexTable.setWidget(3, 5, weaponDpsLabel);
    flexTable.getFlexCellFormatter().setColSpan(3, 5, 3);

    Label label_14 = new Label("Weapon Increased Damage (%):");
    label_14.setWordWrap(false);
    flexTable.setWidget(4, 0, label_14);

    weaponDamage = new NumberSpinner();
    weaponDamage.box.setTitle("Increased damage as a primary attribute on the weapon.");
    weaponDamage.setVisibleLength(6);
    flexTable.setWidget(4, 1, weaponDamage);

    Label label_15 = new Label("Weapon APS:");
    label_15.setWordWrap(false);
    label_15.setStyleName("boldText");
    flexTable.setWidget(4, 4, label_15);

    weaponApsLabel = new Label("0.0");
    weaponApsLabel.setTitle("As shown on weapon tooltip");
    weaponApsLabel.setStyleName("boldText");
    flexTable.setWidget(4, 5, weaponApsLabel);
    flexTable.getFlexCellFormatter().setColSpan(4, 5, 3);

    this.weaponIAS.setMax(7);
    this.weaponDamage.setMax(10);

    weaponType.addItem("None", "");

    for (WeaponType wt : WeaponType.values()) {

        if (!offHand || (wt == WeaponType.HandCrossbow))
            weaponType.addItem(wt.getName(), wt.name());
    }

    weaponType.setSelectedIndex(0);

    ChangeHandler handler = new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {

            if (!disableUpdates) {
                calculate();
            }
        }
    };

    weaponType.addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {

            disableUpdates = true;

            WeaponType type = getWeaponTypeEnum();

            if (type == null) {
                baseMin.setValue(0.0);
                baseMax.setMax(0.0);
            } else {
                baseMin.setValue((double) type.getMin());
                baseMax.setValue((double) type.getMax());
            }

            disableUpdates = false;

            calculate();
        }
    });

    baseMin.addChangeHandler(handler);
    baseMax.addChangeHandler(handler);
    addMin.addChangeHandler(handler);
    addMax.addChangeHandler(handler);
    weaponIAS.addChangeHandler(handler);
    weaponDamage.addChangeHandler(handler);
}

From source file:com.df3n5.gwtproc.client.util.MatrixWidget.java

License:Apache License

/**
 * Constructs a new instance of the MatrixWidget to view a FloatMatrix of
 * the given size./*from w  ww .  j  a  va2  s .  co m*/
 * 
 * @param width
 *            column count of matrix
 * @param height
 *            row count of matrix
 * @param title
 *            the title of the matrix
 */
public MatrixWidget(int width, int height, String title) {
    this.width = width;
    this.height = height;
    flextable = new FlexTable();
    flextable.setWidget(0, 0, new Label(title));
    flextable.getFlexCellFormatter().setColSpan(0, 0, width);
    for (int x = 0; x < width; x++) {
        for (int y = 0; y < height; y++) {
            flextable.setText(y + 1, x, "[" + String.valueOf(x) + "_" + String.valueOf(y) + "]");
        }
    }

    initWidget(flextable);

    setStyleName("matrixWidget");
}

From source file:com.dimdim.conference.ui.common.client.layout.MultipleListsControlDialog.java

License:Open Source License

protected Label createLabel(String labelText, String styleName) {
    Label html = new Label(labelText);
    html.setStyleName("common-table-header");
    if (styleName != null) {
        html.addStyleName(styleName);//ww  w  .j  a v  a  2  s .c  o m
    }
    return html;
}

From source file:com.dimdim.conference.ui.common.client.layout.MultipleListsControlDialog.java

License:Open Source License

protected Label createTextHTML(String text, String styleName) {
    Label html = new Label(text);
    html.setStyleName("common-table-text");
    if (styleName != null) {
        html.addStyleName(styleName);/*from  w w  w  . j  ava  2s .co m*/
    }
    return html;
}