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.DPSCalculator.java

License:Open Source License

public DPSCalculator(MainPanel main) {

    this.main = main;

    ChangeHandler handler = new ChangeHandler() {

        @Override//from   w  w  w .  j a v  a2s .  c o  m
        public void onChange(ChangeEvent event) {
            if (!disableListeners)
                calculate();
        }

    };

    ClickHandler clickHandler = new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            Service.getInstance().checkNews(null);
            calculate();
        }
    };

    FlexTable grid = new FlexTable();
    grid.setBorderWidth(0);
    grid.setCellPadding(5);
    initWidget(grid);

    mainHand = new WeaponPanel("Main Hand", false);
    grid.setWidget(0, 0, mainHand);
    grid.getFlexCellFormatter().setColSpan(0, 0, 2);

    offHand = new WeaponPanel("Off Hand", true);
    grid.setWidget(1, 0, offHand);
    grid.getFlexCellFormatter().setColSpan(1, 0, 2);

    CaptionPanel cptnpnlNewPanel_2 = new CaptionPanel("Equipment");
    grid.setWidget(2, 0, cptnpnlNewPanel_2);

    FlexTable flexTable_2 = new FlexTable();
    flexTable_2.setCellPadding(2);
    cptnpnlNewPanel_2.setContentWidget(flexTable_2);

    Label lblJewelryDamage = new Label("Jewelry Damage:");
    flexTable_2.setWidget(0, 0, lblJewelryDamage);
    lblJewelryDamage.setWordWrap(false);

    minJewelDamage = new NumberSpinner();
    minJewelDamage.box.setTitle("Total of all jewelry damage");
    flexTable_2.setWidget(0, 1, minJewelDamage);
    minJewelDamage.setVisibleLength(6);
    minJewelDamage.addChangeHandler(handler);

    Label label_1 = new Label(" to ");
    flexTable_2.setWidget(0, 2, label_1);
    label_1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

    maxJewelDamage = new NumberSpinner();
    maxJewelDamage.box.setTitle("Total of all jewelry damage");
    flexTable_2.setWidget(0, 3, maxJewelDamage);
    maxJewelDamage.setVisibleLength(6);
    maxJewelDamage.addChangeHandler(handler);

    Label lblNewLabel_2b = new Label("Equipment IAS (%):");
    flexTable_2.setWidget(1, 0, lblNewLabel_2b);
    lblNewLabel_2b.setWordWrap(false);

    equipIAS = new NumberSpinner();
    equipIAS.box.setTitle("Increased attack speed from equipment, except Weapon");
    flexTable_2.setWidget(1, 1, equipIAS);
    equipIAS.setVisibleLength(6);
    equipIAS.addChangeHandler(handler);

    Label lblNewLabel_4 = new Label("Crit Chance (%):");
    flexTable_2.setWidget(3, 0, lblNewLabel_4);
    lblNewLabel_4.setWordWrap(false);

    critChance = new DoubleSpinner();
    critChance.box.setTitle("Increased Crit Chance from equipment and set bonuses");
    flexTable_2.setWidget(3, 1, critChance);
    critChance.setVisibleLength(6);
    critChance.addChangeHandler(handler);
    critChance.setMax(95.0);

    Label lblNewLabel_5 = new Label("Crit Hit Damage (%):");
    flexTable_2.setWidget(4, 0, lblNewLabel_5);
    lblNewLabel_5.setWordWrap(false);

    critDamage = new NumberSpinner();
    critDamage.box.setTitle("Increased Crit Hit Damage from equipment and set bonuses");
    flexTable_2.setWidget(4, 1, critDamage);
    critDamage.setVisibleLength(6);
    critDamage.addChangeHandler(handler);

    FlexTable flexTable_7 = new FlexTable();
    grid.setWidget(2, 1, flexTable_7);

    flexTable_7.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);
    flexTable_7.getCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT);

    CaptionPanel cptnpnlNewPanel_4 = new CaptionPanel("Hero");
    grid.setWidget(2, 1, cptnpnlNewPanel_4);
    grid.getCellFormatter().setVerticalAlignment(2, 1, HasVerticalAlignment.ALIGN_TOP);

    FlexTable flexTable_4 = new FlexTable();
    flexTable_4.setCellPadding(2);
    cptnpnlNewPanel_4.setContentWidget(flexTable_4);

    Label lblHeroLevel = new Label("Hero Level:");
    lblHeroLevel.setWordWrap(false);
    flexTable_4.setWidget(0, 0, lblHeroLevel);

    heroLevel = new NumberSpinner();
    heroLevel.box.setTitle("Hero's level");
    heroLevel.setVisibleLength(6);
    heroLevel.setMin(1);
    heroLevel.setMax(70);
    flexTable_4.setWidget(0, 1, heroLevel);

    heroLevel.addChangeHandler(handler);

    Label lblNewLabel_3 = new Label("Dexterity from Items:");
    flexTable_4.setWidget(1, 0, lblNewLabel_3);
    lblNewLabel_3.setWordWrap(false);

    dexterity = new NumberSpinner();
    dexterity.box.setTitle("Total of all dexterity from items and set bonuses only");
    flexTable_4.setWidget(1, 1, dexterity);
    dexterity.setVisibleLength(6);

    dexterity.addChangeHandler(handler);

    CaptionPanel cptnpnlNewPanel_6 = new CaptionPanel("Breakpoint Calculator");
    grid.setWidget(3, 0, cptnpnlNewPanel_6);
    grid.getFlexCellFormatter().setColSpan(3, 0, 2);

    FlexTable flexTable_6 = new FlexTable();
    flexTable_6.setCellPadding(5);
    cptnpnlNewPanel_6.setContentWidget(flexTable_6);

    Label lblNewLabel_7 = new Label("Sheet DPS:");
    flexTable_6.setWidget(0, 0, lblNewLabel_7);
    lblNewLabel_7.setWordWrap(false);
    lblNewLabel_7.setStyleName("boldText");

    dps = new Label("0");
    dps.setTitle("This is the shet dps shown on charcter screen as \"Damage\"");
    flexTable_6.setWidget(0, 1, dps);
    dps.setStyleName("boldText");

    Label label_11 = new Label("Skill APS:");
    flexTable_6.setWidget(1, 2, label_11);
    label_11.setWordWrap(false);
    label_11.setStyleName("boldText");

    skillApsLabel = new Label("0");
    skillApsLabel.setTitle("APS for selected skill");
    flexTable_6.setWidget(1, 3, skillApsLabel);
    skillApsLabel.setStyleName("boldText");

    Label lblBreakPoint = new Label("Break Point #:");
    flexTable_6.setWidget(2, 2, lblBreakPoint);
    lblBreakPoint.setWordWrap(false);
    lblBreakPoint.setStyleName("boldText");

    breakpoint = new Label("0");
    breakpoint.setTitle("Break Point # for selected skill");
    flexTable_6.setWidget(2, 3, breakpoint);
    breakpoint.setStyleName("boldText");

    CaptionPanel cptnpnlNewPanel = new CaptionPanel("Next/Previous Breakpoint");
    flexTable_6.setWidget(0, 4, cptnpnlNewPanel);
    cptnpnlNewPanel.setStyleName("boldText");

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

    Label skill = new Label("Skill:");
    skill.setWordWrap(false);
    flexTable.setWidget(0, 0, skill);

    skillBox = new ListBox();
    skillBox.setWidth("100%");
    flexTable.setWidget(0, 1, skillBox);

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

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

        if (DamageFunction.hasDamage(s) && (s.getFrames() != 0))
            list.add(new Pair<String, String>(s.getLongName(), s.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) {
        skillBox.addItem(p.getA(), p.getB());
    }

    skillBox.setSelectedIndex(0);

    skillBox.addChangeHandler(new ChangeHandler() {

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

    Label lblWithRepectTo = new Label("With Repect To:");
    lblWithRepectTo.setWordWrap(false);
    flexTable.setWidget(1, 0, lblWithRepectTo);

    iasType = new ListBox();
    flexTable.setWidget(1, 1, iasType);
    iasType.setWidth("100%");
    iasType.setSelectedIndex(0);

    Label lblApsForNext = new Label("IAS for next BP:");
    flexTable.setWidget(2, 0, lblApsForNext);
    lblApsForNext.setWordWrap(false);
    lblApsForNext.setStyleName("boldText");

    nextBP = new Label("0");
    nextBP.setTitle("IAS needed for next BP");
    flexTable.setWidget(2, 1, nextBP);
    nextBP.setWordWrap(false);
    nextBP.setStyleName("boldText");

    Label lblextraIas = new Label("\"Extra\" IAS:");
    flexTable.setWidget(3, 0, lblextraIas);
    lblextraIas.setWordWrap(false);
    lblextraIas.setStyleName("boldText");

    prevBP = new Label("0");
    prevBP.setTitle("Extra IAS that can be removed without lowering BP");
    flexTable.setWidget(3, 1, prevBP);
    prevBP.setWordWrap(false);
    prevBP.setStyleName("boldText");

    iasType.addChangeHandler(new ChangeHandler() {

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

    Label lblNewLabel_7b = new Label("Player APS:");
    flexTable_6.setWidget(1, 0, lblNewLabel_7b);
    lblNewLabel_7b.setWordWrap(false);
    lblNewLabel_7b.setStyleName("boldText");

    aps = new Label("0.0");
    aps.setTitle("This is the APS for the character, as shown on the details screen under offense");
    flexTable_6.setWidget(1, 1, aps);
    aps.setStyleName("boldText");

    Label lblPetAps = new Label("Pet APS:");
    flexTable_6.setWidget(0, 2, lblPetAps);
    lblPetAps.setWordWrap(false);
    lblPetAps.setStyleName("boldText");

    petAps = new Label("0.0");
    petAps.setTitle("Calculated Pet/Sentry APS");
    flexTable_6.setWidget(0, 3, petAps);
    petAps.setStyleName("boldText");

    Label lblTotal = new Label("Total Crit Chance:");
    flexTable_6.setWidget(2, 0, lblTotal);
    lblTotal.setStyleName("boldText");

    actualCC = new Label("0.0%");
    actualCC.setTitle("Total CC as shown on character details screen under offense");
    flexTable_6.setWidget(2, 1, actualCC);
    actualCC.setStyleName("boldText");

    Label lblAttacksPer = new Label("FPA");
    lblAttacksPer.setWordWrap(false);
    lblAttacksPer.setStyleName("boldText");
    flexTable_6.setWidget(3, 2, lblAttacksPer);

    fpaLabel = new Label("0");
    fpaLabel.setTitle("Frames per Attack");
    fpaLabel.setStyleName("boldText");
    flexTable_6.setWidget(3, 3, fpaLabel);

    Label lblTotalCritDamage = new Label("Total Crit Hit Damage:");
    flexTable_6.setWidget(3, 0, lblTotalCritDamage);
    lblTotalCritDamage.setStyleName("boldText");

    actualCD = new Label("0.0%");
    actualCD.setTitle("Total CHD as shown on character details screen under offense");
    flexTable_6.setWidget(3, 1, actualCD);
    actualCD.setStyleName("boldText");

    Label lblBpAps = new Label("Actual APS:");
    flexTable_6.setWidget(4, 2, lblBpAps);
    lblBpAps.setWordWrap(false);
    lblBpAps.setStyleName("boldText");

    actualAps = new Label("0");
    actualAps.setTitle("Actual APS (based on Breakpoint)");
    flexTable_6.setWidget(4, 3, actualAps);
    actualAps.setStyleName("boldText");

    Label lblTotalDexterity = new Label("Total Dexterity:");
    lblTotalDexterity.setStyleName("boldText");
    flexTable_6.setWidget(4, 0, lblTotalDexterity);

    dexterityLabel = new Label("0");
    dexterityLabel.setTitle("This is the total of all Dexterity from items, levels and paragon points");
    dexterityLabel.setStyleName("boldText");
    flexTable_6.setWidget(4, 1, dexterityLabel);

    flexTable_6.getFlexCellFormatter().setRowSpan(0, 4, 5);
    flexTable_6.getCellFormatter().setVerticalAlignment(0, 4, HasVerticalAlignment.ALIGN_TOP);
    flexTable_6.getCellFormatter().setHorizontalAlignment(0, 4, HasHorizontalAlignment.ALIGN_LEFT);
    grid.getCellFormatter().setHorizontalAlignment(2, 1, HasHorizontalAlignment.ALIGN_LEFT);
    grid.getCellFormatter().setVerticalAlignment(2, 1, HasVerticalAlignment.ALIGN_TOP);
    grid.getCellFormatter().setHorizontalAlignment(2, 0, HasHorizontalAlignment.ALIGN_LEFT);
    grid.getCellFormatter().setVerticalAlignment(2, 0, HasVerticalAlignment.ALIGN_TOP);

    for (IasType t : IasType.values()) {
        iasType.addItem(t.getDescription(), t.name());
    }
    grid.getFlexCellFormatter().setColSpan(3, 0, 2);
    grid.getFlexCellFormatter().setColSpan(0, 0, 2);
    grid.getFlexCellFormatter().setColSpan(1, 0, 2);

    mainHand.getWeaponType().addChangeHandler(handler);
    mainHand.getBaseMin().addChangeHandler(handler);
    mainHand.getBaseMax().addChangeHandler(handler);
    mainHand.getAddMin().addChangeHandler(handler);
    mainHand.getAddMax().addChangeHandler(handler);
    mainHand.getWeaponIAS().addChangeHandler(handler);
    mainHand.getWeaponDamage().addChangeHandler(handler);

    offHand.getWeaponType().addChangeHandler(handler);
    offHand.getBaseMin().addChangeHandler(handler);
    offHand.getBaseMax().addChangeHandler(handler);
    offHand.getAddMin().addChangeHandler(handler);
    offHand.getAddMax().addChangeHandler(handler);
    offHand.getWeaponIAS().addChangeHandler(handler);
    offHand.getWeaponDamage().addChangeHandler(handler);

}

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

License:Open Source License

@SuppressWarnings("unchecked")
public GearPanel() {

    HorizontalPanel panel = new HorizontalPanel();
    initWidget(panel);/*w  ww  .  j  a va  2  s.com*/

    VerticalPanel verticalPanel_1 = new VerticalPanel();
    panel.add(verticalPanel_1);

    CaptionPanel captionPanel = new CaptionPanel("Current Items");
    verticalPanel_1.add(captionPanel);

    FlexTable table = new FlexTable();
    captionPanel.add(table);

    CaptionPanel cptnpnlNewPanel = new CaptionPanel("Saved Items");
    panel.add(cptnpnlNewPanel);

    VerticalPanel verticalPanel = new VerticalPanel();
    cptnpnlNewPanel.setContentWidget(verticalPanel);
    verticalPanel.setSize("5cm", "3cm");

    savedItems = new ListBox();
    verticalPanel.add(savedItems);
    savedItems.setVisibleItemCount(20);
    savedItems.setWidth("100%");

    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.setSpacing(5);
    verticalPanel.add(horizontalPanel);

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

    btnNewButton.addClickHandler(new ClickHandler() {

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

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

    btnNewButton_1.addClickHandler(new ClickHandler() {

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

    int row = 0;

    for (Slot slot : Slot.values())
        if (!slot.isCube()) {
            final Slot thisSlot = slot;

            Label label = new Label(slot.name());
            label.addStyleName("boldText");
            table.setWidget(row, 0, label);

            Anchor status = new Anchor("unloaded");
            status.setTarget("_blank");
            status.setHref("javascript:void(0);");
            table.setWidget(row, 1, status);
            labels.put(slot, status);
            status.addClickHandler(new ClickHandler() {

                @Override
                public void onClick(ClickEvent event) {
                    event.preventDefault();
                    clickItem(thisSlot);

                }
            });

            Button saveButton = new Button("save");
            table.setWidget(row, 2, saveButton);
            saveButton.addClickHandler(new ClickHandler() {

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

            Button replaceButton = new Button("replace");
            table.setWidget(row, 3, replaceButton);
            replaceButton.addClickHandler(new ClickHandler() {

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

            Button clearButton = new Button("clear");
            table.setWidget(row, 4, clearButton);
            clearButton.addClickHandler(new ClickHandler() {

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

            row++;
        }

    Storage storage = getStorage();

    if (storage != null) {
        String data = storage.getItem(SAVED_ITEMS);
        JsoArray<Entry> list = null;

        if (data != null) {
            list = JsonUtils.safeEval(data);
        } else {
            list = (JsoArray<Entry>) JavaScriptObject.createArray();
        }

        for (int i = 0; i < list.length(); i++) {
            Entry e = list.get(i);
            savedItems.addItem(e.getName(), e.getItem());
        }

    }

    setVisible(false);
}

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

License:Open Source License

public HatredPanel() {

    CaptionPanel captionPanel = new CaptionPanel("Hatred/Discipline");
    initWidget(captionPanel);/* www  .  j  a  v a2s . c o  m*/

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

    Label lblHatredPerSecond = new Label("+ Hatred per Second:");
    flexTable.setWidget(0, 0, lblHatredPerSecond);

    hatredPerSecond = new DoubleSpinner();
    hatredPerSecond.setVisibleLength(5);

    flexTable.setWidget(0, 1, hatredPerSecond);

    Label label = new Label("+ Maximum Discipline:");
    flexTable.setWidget(1, 0, label);

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

    Label lblNewLabel_1 = new Label(
            "Only include increased Hatred per Second and Max Discipline from items. Do not include gains from skills (e.g. Archery) or buffs (e.g. Inspire).");
    lblNewLabel_1.setWordWrap(true);
    lblNewLabel_1.addStyleName("boldText");
    flexTable.setWidget(2, 0, lblNewLabel_1);
    flexTable.getFlexCellFormatter().setColSpan(2, 0, 2);
    lblNewLabel_1.setWidth("400px");
}

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

License:Open Source License

public Legend() {

    SimplePanel panel = new SimplePanel();
    initWidget(panel);//from   w w  w. ja v a2 s. c  o m

    flexTable = new FlexTable();
    flexTable.setStyleName("outputTable");
    flexTable.setBorderWidth(1);
    flexTable.setCellPadding(5);
    flexTable.getRowFormatter().addStyleName(0, "headerRow");

    ScrollPanel scroll = new ScrollPanel();
    scroll.setWidth("800px");
    scroll.setHeight("400px");
    scroll.add(flexTable);
    panel.add(scroll);

    Label lblNewLabel = new Label("Key");
    lblNewLabel.setWordWrap(false);
    flexTable.setWidget(0, 0, lblNewLabel);

    Label lblAccumulator = new Label("How Calculated");
    lblAccumulator.setWordWrap(false);
    flexTable.setWidget(0, 1, lblAccumulator);

    Label lblDescription = new Label("Description");
    lblDescription.setWordWrap(false);
    flexTable.setWidget(0, 2, lblDescription);

    int row = 1;

    List<DamageMultiplier> sortedList = new Vector<DamageMultiplier>();

    for (DamageMultiplier d : DamageMultiplier.values()) {
        sortedList.add(d);
    }

    Collections.sort(sortedList, new Comparator<DamageMultiplier>() {

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

    for (DamageMultiplier d : sortedList) {
        if ((row % 2) == 0)
            flexTable.getRowFormatter().addStyleName(row, "evenRow");
        else
            flexTable.getRowFormatter().addStyleName(row, "oddRow");

        addLabel(row, 0, d.getAbbreviation());
        addLabel(row, 1, d.getAccumulator().getDescription());
        addLabel(row, 2, d.getDescription());
        row++;
    }

}

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

License:Open Source License

private void addLabel(int row, int column, String text) {
    Label label = new Label(text);
    label.setWordWrap(false);/*from   w ww. j  av a2s . c  o m*/

    flexTable.setWidget(row, column, label);
}

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

License:Open Source License

public MainPanel() {
    VerticalPanel panel = new VerticalPanel();
    initWidget(panel);/*from  www .ja  v a2  s . co  m*/
    panel.setWidth("");

    newsPanel = new HorizontalPanel();
    panel.add(newsPanel);

    HorizontalPanel horizontalPanel_4 = new HorizontalPanel();
    panel.add(horizontalPanel_4);

    VerticalPanel verticalPanel_2 = new VerticalPanel();
    horizontalPanel_4.add(verticalPanel_2);

    CaptionPanel cptnpnlNewPanel_7 = new CaptionPanel("Battle.Net Import");
    verticalPanel_2.add(cptnpnlNewPanel_7);

    VerticalPanel verticalPanel_6 = new VerticalPanel();
    verticalPanel_6.setSpacing(5);
    verticalPanel_6.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    cptnpnlNewPanel_7.setContentWidget(verticalPanel_6);

    HorizontalPanel horizontalPanel_5 = new HorizontalPanel();
    horizontalPanel_5.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    horizontalPanel_5.setSpacing(5);
    verticalPanel_6.add(horizontalPanel_5);

    Label lblNewLabel_18 = new Label("Realm:");
    horizontalPanel_5.add(lblNewLabel_18);

    realms = new ListBox();
    horizontalPanel_5.add(realms);

    Button ldrButton = new Button("Leaderboards...");
    horizontalPanel_5.add(ldrButton);

    ldrButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            Service.getInstance().checkVersion(null);
            showLeaderboards();
        }
    });

    Button helpButton = new Button("Help...");
    horizontalPanel_5.add(helpButton);

    helpButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            Service.getInstance().checkVersion(null);
            showHelp();
        }
    });

    HorizontalPanel horizontalPanel_7 = new HorizontalPanel();
    horizontalPanel_7.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    horizontalPanel_7.setSpacing(5);
    verticalPanel_6.add(horizontalPanel_7);

    Label lblNewLabel_19 = new Label("Battle Tag:");
    lblNewLabel_19.setWordWrap(false);
    horizontalPanel_7.add(lblNewLabel_19);

    battleTag = new TextBox();
    battleTag.setText("BnetName");
    battleTag.setVisibleLength(15);
    horizontalPanel_7.add(battleTag);

    Label lblNewLabel_20 = new Label("#");
    horizontalPanel_7.add(lblNewLabel_20);

    tagNumber = new TextBox();
    tagNumber.setText("1234");
    tagNumber.setVisibleLength(8);
    horizontalPanel_7.add(tagNumber);

    Button fetchButton = new Button("Get Hero List");
    fetchButton.setWidth("100px");
    horizontalPanel_7.add(fetchButton);
    fetchButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {

            fetchHeros(null);

        }
    });

    HorizontalPanel horizontalPanel_8 = new HorizontalPanel();
    horizontalPanel_8.setSpacing(5);
    horizontalPanel_8.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    verticalPanel_6.add(horizontalPanel_8);

    Label lblNewLabel_21 = new Label("Hero:");
    horizontalPanel_8.add(lblNewLabel_21);

    heroList = new ListBox();
    horizontalPanel_8.add(heroList);
    heroList.addItem("Enter BattleTag and Fetch", "");
    heroList.setSelectedIndex(0);

    Button importButton = new Button("New button");
    importButton.setText("Import");
    horizontalPanel_8.add(importButton);

    profileLinks = new HorizontalPanel();
    profileLinks.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    profileLinks.setSpacing(5);
    verticalPanel_6.add(profileLinks);

    profileLink = new Anchor("battle.net profile");
    profileLinks.add(profileLink);
    profileLink.setText("battle.net profile");
    profileLink.setHref("javascript:void(0)");
    profileLink.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            Service.getInstance().checkVersion(null);
            showProfile();
        }
    });

    Anchor anchor = new Anchor("paperdoll");
    anchor.setText("paperdoll");
    anchor.setHref("javascript:void(0)");
    profileLinks.add(anchor);

    anchor.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            Service.getInstance().checkVersion(null);
            showPaperdoll();
        }
    });

    Button itemsButton = new Button("Items...");
    profileLinks.add(itemsButton);

    itemsButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            Service.getInstance().checkVersion(null);
            showGearPanel();
        }
    });

    paragonPanel = new ParagonPanel();
    verticalPanel_2.add(paragonPanel);

    this.paragonPanel.getParagonIAS().addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {

            if (!disableListeners)
                updateDps();
        }
    });

    this.paragonPanel.getParagonDexterity().addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {

            if (!disableListeners)
                updateDps();
        }
    });

    this.paragonPanel.getParagonCDR().addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {

            if (!disableListeners)
                updateDps();
        }
    });

    this.paragonPanel.getParagonRCR().addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {

            if (!disableListeners)
                updateDps();
        }
    });

    savePanel = new SavePanel();
    verticalPanel_2.add(savePanel);

    savePanel.setFormListener(new FormListener() {

        @Override
        public FormData getFormData() {
            return MainPanel.this.getFormData();
        }

        @Override
        public void setFormData(FormData data) {
            MainPanel.this.restoreData(data);
        }
    });

    CaptionPanel cptnpnlNewPanel_4 = new CaptionPanel("Character Data");
    verticalPanel_2.add(cptnpnlNewPanel_4);

    FlexTable grid_1 = new FlexTable();
    grid_1.setCellPadding(5);
    cptnpnlNewPanel_4.setContentWidget(grid_1);
    Label label = new Label("Sheet DPS: ");
    label.setWordWrap(false);
    grid_1.setWidget(0, 0, label);
    label.setWidth("");

    sheetDps = new Label("0.0", false);
    sheetDps.addStyleName("boldText");
    grid_1.setWidget(0, 1, sheetDps);

    Label lblWeaponDamage = new Label("Weapon Damage:");
    lblWeaponDamage.setWordWrap(false);
    grid_1.setWidget(0, 2, lblWeaponDamage);
    lblWeaponDamage.setWidth("");

    avgWeaponDamage = new Label("0.0", false);
    avgWeaponDamage.setStyleName("boldText");
    grid_1.setWidget(0, 3, avgWeaponDamage);

    Label lblNewLabel = new Label("Attacks Per Second:");
    lblNewLabel.setWordWrap(false);
    grid_1.setWidget(1, 0, lblNewLabel);

    aps = new Label("0.0", false);
    aps.addStyleName("boldText");
    grid_1.setWidget(1, 1, aps);

    Label lblCritChance = new Label("Crit Chance:");
    lblCritChance.setWordWrap(false);
    grid_1.setWidget(1, 2, lblCritChance);

    critChance = new Label("0.0", false);
    critChance.setStyleName("boldText");
    grid_1.setWidget(1, 3, critChance);

    Label lblDexterity = new Label("Dexterity:");
    lblDexterity.setWordWrap(false);
    grid_1.setWidget(2, 0, lblDexterity);

    dexterity = new Label("0.0", false);
    dexterity.setStyleName("boldText");
    grid_1.setWidget(2, 1, dexterity);

    Label lblCritHitDamage = new Label("Crit Hit Damage:");
    lblCritHitDamage.setWordWrap(false);
    grid_1.setWidget(2, 2, lblCritHitDamage);

    critDamage = new Label("0.0", false);
    critDamage.setStyleName("boldText");
    grid_1.setWidget(2, 3, critDamage);

    Button calcDps = new Button("DPS/Break Point Calculator...");
    grid_1.setWidget(3, 2, calcDps);
    grid_1.getFlexCellFormatter().setColSpan(3, 2, 2);
    grid_1.getCellFormatter().setHorizontalAlignment(3, 2, HasHorizontalAlignment.ALIGN_RIGHT);
    grid_1.getCellFormatter().setVerticalAlignment(3, 2, HasVerticalAlignment.ALIGN_MIDDLE);

    CaptionPanel captionPanel = new CaptionPanel("Compare Builds");
    verticalPanel_2.add(captionPanel);

    buffPanel = new BuffPanel();
    verticalPanel_2.add(buffPanel);

    CaptionPanel cptnpnlNewPanel2 = new CaptionPanel("Simulate");
    verticalPanel_2.add(cptnpnlNewPanel2);

    FlexTable simTable = new FlexTable();
    cptnpnlNewPanel2.add(simTable);

    Label l1 = new Label("Simulation Time Limit (seconds):", false);
    simTable.setWidget(0, 0, l1);

    timeLimit = new NumberSpinner();
    timeLimit.setMin(1);
    timeLimit.setMax(FiringData.MAX_DURATION);
    timeLimit.setVisibleLength(5);
    timeLimit.setTitle("Maximum time (in simulation seconds) to let the simulation run");
    simTable.setWidget(0, 1, timeLimit);

    Button calcButton = new Button("Simulate");
    calcButton.setTitle("Press to run damage simulation");
    simTable.setWidget(0, 2, calcButton);
    calcButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            Service.getInstance().checkVersion(null);
            calculate();
        }
    });

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

    Button button_6 = new Button("Compare...");
    compareTable.setWidget(0, 0, button_6);
    button_6.setTitle("Click to see differences between each build");
    compareTable.getFlexCellFormatter().setRowSpan(0, 0, 2);

    button_6.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            Service.getInstance().checkVersion(null);
            compareBuilds();
        }
    });

    Label label_11 = new Label("APS:");
    label_11.setWordWrap(false);
    label_11.setStyleName("boldText");
    compareTable.setWidget(2, 0, label_11);

    Label label_8 = new Label("Weapon Damage:");
    label_8.setWordWrap(false);
    label_8.setStyleName("boldText");
    compareTable.setWidget(3, 0, label_8);

    Label label_14a = new Label("Time:");
    label_14a.setWordWrap(false);
    label_14a.setStyleName("boldText");
    compareTable.setWidget(5, 0, label_14a);

    Label label_14 = new Label("DPS:");
    label_14.setWordWrap(false);
    label_14.setStyleName("boldText");
    compareTable.setWidget(7, 0, label_14);

    for (int j = 0; j < 3; j++) {
        final int which = j;
        int col = (j * 2) + 1;

        Anchor button_3 = new Anchor("Set");
        button_3.setHref("javascript:void(0)");
        button_3.setTitle("Click to store the current build for comparison");
        compareTable.setWidget(0, col, button_3);
        compareTable.getFlexCellFormatter().setHorizontalAlignment(0, col, HasHorizontalAlignment.ALIGN_CENTER);

        button_3.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
                Service.getInstance().checkVersion(null);
                storeBuild(which);
            }
        });

        Anchor button_4 = new Anchor("Restore");
        button_4.setHref("javascript:void(0)");
        button_4.setTitle("Click to retrieve this build");
        compareTable.setWidget(1, col - 1, button_4);
        compareTable.getFlexCellFormatter().setHorizontalAlignment(1, col - 1,
                HasHorizontalAlignment.ALIGN_CENTER);

        button_4.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
                Service.getInstance().checkVersion(null);
                loadBuild(which);
            }
        });

        Anchor label_1 = new Anchor("Clear");
        label_1.setHref("javascript:void(0)");
        label_1.setTitle("Click to clear this build");
        compareTable.setWidget(9, col, label_1);
        compareTable.getFlexCellFormatter().setWidth(9, col + 1, "5px");
        compareTable.getFlexCellFormatter().setHorizontalAlignment(9, col, HasHorizontalAlignment.ALIGN_CENTER);

        label_1.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
                Service.getInstance().checkVersion(null);
                clearBuild(which);
            }
        });

        for (int i = 0; i < 4; i++) {
            int row = 2 + ((i > 0) ? 1 + ((i - 1) * 2) : 0);

            Label l = new Label("No Data");
            l.setWordWrap(false);
            compareTable.setWidget(row, col, l);
            compareTable.getFlexCellFormatter().setHorizontalAlignment(row, col,
                    HasHorizontalAlignment.ALIGN_CENTER);

            if (j > 0) {
                Label pct = new Label("No Data");
                pct.setWordWrap(false);
                compareTable.setWidget(row + 1, col, pct);
                compareTable.getFlexCellFormatter().setHorizontalAlignment(row + 1, col,
                        HasHorizontalAlignment.ALIGN_CENTER);
            }
        }
    }

    calcDps.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            Service.getInstance().checkVersion(null);
            showDpsCalculator();
        }
    });

    importButton.addClickHandler(new ClickHandler() {

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

    this.paragonPanel.getParagonCC().addChangeHandler(new ChangeHandler() {

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

    this.paragonPanel.getParagonCHD().addChangeHandler(new ChangeHandler() {

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

    VerticalPanel verticalPanel_1 = new VerticalPanel();
    horizontalPanel_4.add(verticalPanel_1);

    skills = new SkillsPanel();
    verticalPanel_1.add(skills);

    passives = new PassivesPanel();
    verticalPanel_1.add(passives);

    situational = new SituationalPanel();
    verticalPanel_1.add(situational);

    gemPanel = new GemsPanel();
    verticalPanel_1.add(gemPanel);

    VerticalPanel verticalPanel_3 = new VerticalPanel();
    horizontalPanel_4.add(verticalPanel_3);

    skillDamage = new SkillDamagePanel();
    verticalPanel_3.add(skillDamage);

    typeDamage = new DamageTypePanel();
    verticalPanel_3.add(typeDamage);

    itemPanel = new ItemPanel();
    verticalPanel_3.add(itemPanel);

    hatredPanel = new HatredPanel();
    verticalPanel_3.add(hatredPanel);

    playerBuffPanel = new PlayerBuffPanel();
    verticalPanel_1.add(playerBuffPanel);

    playerBuffPanel.getCalcWolfButton().addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            Service.getInstance().checkVersion(null);
            calculateWolfUptime();
        }
    });

    VerticalPanel vpanel = new VerticalPanel();
    horizontalPanel_4.add(vpanel);

    cdrPanel = new CDRPanel();
    vpanel.add(cdrPanel);

    rcrPanel = new RCRPanel();
    vpanel.add(rcrPanel);

    ClickHandler clickHandler3 = new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            if (!disableListeners) {
                Service.getInstance().checkVersion(null);
                calculator.calculate();
                updateDpsLabels();
            }
        }
    };

    ChangeHandler changeHandler = new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {
            if (!disableListeners) {
                disableListeners = true;
                calculator.calculate();
                updateDpsLabels();
                disableListeners = false;
            }
        }
    };

    itemPanel.addChangeHandler(changeHandler);

    playerBuffPanel.getBbv().addClickHandler(clickHandler3);
    playerBuffPanel.getBbvUptime().addChangeHandler(changeHandler);
    playerBuffPanel.getStretchTime().addClickHandler(clickHandler3);
    playerBuffPanel.getStretchTimeUptime().addChangeHandler(changeHandler);
    playerBuffPanel.getValor().addClickHandler(clickHandler3);
    playerBuffPanel.getValorActiveUptime().addChangeHandler(changeHandler);
    playerBuffPanel.getValorPassiveUptime().addChangeHandler(changeHandler);
    playerBuffPanel.getRetribution().addClickHandler(clickHandler3);
    playerBuffPanel.getRetributionUptime().addChangeHandler(changeHandler);

    buffPanel.getAnatomy().addClickHandler(clickHandler3);
    buffPanel.getFocusedMind().addClickHandler(clickHandler3);
    buffPanel.getHysteria().addClickHandler(clickHandler3);

    gemPanel.addChangeHandler(changeHandler);

    CaptionPanel cptnpnlNewPanel = new CaptionPanel("Simulation Output");
    panel.add(cptnpnlNewPanel);
    cptnpnlNewPanel.setWidth("");

    VerticalPanel verticalPanel_5 = new VerticalPanel();
    cptnpnlNewPanel.setContentWidget(verticalPanel_5);
    verticalPanel_5.setSize("100%", "3cm");

    HorizontalPanel horizontalPanel_19 = new HorizontalPanel();
    verticalPanel_5.add(horizontalPanel_19);
    horizontalPanel_19.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    horizontalPanel_19.setSpacing(5);

    Button legendButton = new Button("New button");
    legendButton.setText("Legend...");
    horizontalPanel_19.add(legendButton);

    outputHeader = new FlexTable();
    outputHeader.setCellPadding(2);
    verticalPanel_5.add(outputHeader);

    Label lblNewLabel_27 = new Label("Average Weapon Damage (Main Hand):");
    outputHeader.setWidget(0, 0, lblNewLabel_27);
    lblNewLabel_27.setWordWrap(false);

    weaponDamage = new Label("00000");
    outputHeader.setWidget(0, 1, weaponDamage);
    weaponDamage.setStyleName("boldText");

    Label lblNewLabel_27a = new Label("(Off Hand):");
    outputHeader.setWidget(0, 2, lblNewLabel_27a);
    lblNewLabel_27a.setWordWrap(false);

    offHand_weaponDamage = new Label("00000");
    outputHeader.setWidget(0, 3, offHand_weaponDamage);
    offHand_weaponDamage.setStyleName("boldText");

    Label lblNewLabel_27b = new Label("(Dual Wield):");
    outputHeader.setWidget(0, 4, lblNewLabel_27b);
    lblNewLabel_27b.setWordWrap(false);

    dw_weaponDamage = new Label("00000");
    outputHeader.setWidget(0, 5, dw_weaponDamage);
    dw_weaponDamage.setStyleName("boldText");

    Label lblNewLabel_6 = new Label("Total Damage:");
    outputHeader.setWidget(2, 0, lblNewLabel_6);
    lblNewLabel_6.setWordWrap(false);

    Label lblNewLabel_6a = new Label("Time Elapsed:");
    outputHeader.setWidget(3, 0, lblNewLabel_6a);
    lblNewLabel_6a.setWordWrap(false);

    totalDamage = new Label("00000");
    outputHeader.setWidget(2, 1, totalDamage);
    totalDamage.setStyleName("boldText");

    timeElapsed = new Label("00000");
    outputHeader.setWidget(3, 1, timeElapsed);
    timeElapsed.setStyleName("boldText");

    Label lblNewLabel_7 = new Label("DPS:");
    outputHeader.setWidget(2, 2, lblNewLabel_7);
    lblNewLabel_7.setWordWrap(false);

    dps = new Label("00000");
    outputHeader.setWidget(2, 3, dps);
    dps.setStyleName("boldText");

    Label lblNewLabel_29a = new Label("Max Sentries:");
    outputHeader.setWidget(2, 4, lblNewLabel_29a);

    Label lblNewLabel_7b = new Label("+% Elite Damage:");
    outputHeader.setWidget(3, 4, lblNewLabel_7b);
    lblNewLabel_7b.setWordWrap(false);

    eliteDamage = new Label("00000");
    outputHeader.setWidget(3, 5, eliteDamage);
    eliteDamage.setStyleName("boldText");

    Button bpButton = new Button("New button");
    bpButton.setText("Break Points...");
    horizontalPanel_19.add(bpButton);

    bpButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {

            Service.getInstance().checkVersion(null);

            if (bpData == null)
                bpData = new BPData();

            ApplicationPanel.showDialogBox("Break Points", bpData, ApplicationPanel.OK, null);
        }
    });

    Button skillButton = new Button("New button");
    skillButton.setText("Skills...");
    horizontalPanel_19.add(skillButton);

    skillButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {

            Service.getInstance().checkVersion(null);

            if (skillData == null)
                skillData = new SkillData();

            ApplicationPanel.showDialogBox("Skills", skillData, ApplicationPanel.OK, null);
        }
    });

    outputPanel = new VerticalPanel();
    verticalPanel_5.add(outputPanel);

    HorizontalPanel horizontalPanel_9 = new HorizontalPanel();
    outputPanel.add(horizontalPanel_9);

    statTableCaption = new CaptionPanel("Stat Calculator");
    horizontalPanel_9.add(statTableCaption);

    VerticalPanel panel_1 = new VerticalPanel();
    horizontalPanel_9.add(panel_1);

    captionPanelTypeSummary = new CaptionPanel("Damage Type Summary");
    panel_1.add(captionPanelTypeSummary);

    summary = new FlexTable();
    summary.setCellPadding(5);
    summary.setBorderWidth(1);
    summary.setStyleName("outputTable");
    summary.setWidth("100%");
    captionPanelTypeSummary.setContentWidget(summary);

    Label lblNewLabel_17 = new Label("Type");
    lblNewLabel_17.setWordWrap(false);
    summary.setWidget(0, 0, lblNewLabel_17);

    Label label_1 = new Label("# Attacks");
    label_1.setWordWrap(false);
    label_1.setStyleName("dpsHeader");
    summary.setWidget(0, 1, label_1);

    Label label_2 = new Label("Per Attack");
    label_2.setWordWrap(false);
    label_2.setStyleName("dpsHeader");
    summary.setWidget(0, 2, label_2);

    Label lblTotalDamage = new Label("Total");
    lblTotalDamage.setStyleName("dpsHeader");
    lblTotalDamage.setWordWrap(false);
    summary.setWidget(0, 3, lblTotalDamage);
    summary.getColumnFormatter().addStyleName(1, "dpsCol");

    Label lblDps_1 = new Label("DPS");
    lblDps_1.setStyleName("dpsHeader");
    lblDps_1.setWordWrap(false);
    summary.setWidget(0, 4, lblDps_1);
    summary.getColumnFormatter().addStyleName(2, "dpsCol");

    Label lblOfTotal = new Label("% of Total");
    lblOfTotal.setStyleName("dpsHeader");
    lblOfTotal.setWordWrap(false);
    summary.setWidget(0, 5, lblOfTotal);

    captionPanelSkillSummary = new CaptionPanel("Skill Damage Summary");
    panel_1.add(captionPanelSkillSummary);

    skillSummary = new FlexTable();
    skillSummary.setStyleName("outputTable");
    skillSummary.setCellPadding(5);
    skillSummary.setBorderWidth(1);
    skillSummary.setWidth("100%");

    captionPanelSkillSummary.setContentWidget(skillSummary);

    Label lblSkill_2 = new Label("Skill");
    lblSkill_2.setWordWrap(false);
    skillSummary.setWidget(0, 0, lblSkill_2);

    Label lblAttacks = new Label("# Attacks");
    lblAttacks.setWordWrap(false);
    lblAttacks.setStyleName("dpsHeader");
    skillSummary.setWidget(0, 1, lblAttacks);

    Label lblPerAttack = new Label("Per Attack");
    lblPerAttack.setWordWrap(false);
    lblPerAttack.setStyleName("dpsHeader");
    skillSummary.setWidget(0, 2, lblPerAttack);

    Label lblTotal = new Label("Total");
    lblTotal.setStyleName("dpsHeader");
    lblTotal.setWordWrap(false);
    skillSummary.setWidget(0, 3, lblTotal);
    skillSummary.getColumnFormatter().addStyleName(1, "dpsCol");

    Label label_5 = new Label("DPS");
    label_5.setStyleName("dpsHeader");
    label_5.setWordWrap(false);
    skillSummary.setWidget(0, 4, label_5);
    skillSummary.getColumnFormatter().addStyleName(2, "dpsCol");

    Label label_6 = new Label("% of Total");
    label_6.setStyleName("dpsHeader");
    label_6.setWordWrap(false);
    skillSummary.setWidget(0, 5, label_6);

    captionPanelShooterSummary = new CaptionPanel("Shooter Summary");
    panel_1.add(captionPanelShooterSummary);

    shooterSummary = new FlexTable();
    captionPanelShooterSummary.setContentWidget(shooterSummary);
    shooterSummary.setStyleName("outputTable");
    shooterSummary.setCellPadding(5);
    shooterSummary.setBorderWidth(1);
    shooterSummary.setWidth("100%");

    Label lblSkill_2a = new Label("Shooter");
    lblSkill_2a.setWordWrap(false);
    shooterSummary.setWidget(0, 0, lblSkill_2a);

    Label lblAttacksa = new Label("# Attacks");
    lblAttacksa.setWordWrap(false);
    lblAttacksa.setStyleName("dpsHeader");
    shooterSummary.setWidget(0, 1, lblAttacksa);

    Label lblPerAttacka = new Label("Per Attack");
    lblPerAttacka.setWordWrap(false);
    lblPerAttacka.setStyleName("dpsHeader");
    shooterSummary.setWidget(0, 2, lblPerAttacka);

    Label lblTotala = new Label("Total");
    lblTotala.setStyleName("dpsHeader");
    lblTotala.setWordWrap(false);
    shooterSummary.setWidget(0, 3, lblTotala);
    shooterSummary.getColumnFormatter().addStyleName(1, "dpsCol");

    Label label_5a = new Label("DPS");
    label_5a.setStyleName("dpsHeader");
    label_5a.setWordWrap(false);
    shooterSummary.setWidget(0, 4, label_5a);
    shooterSummary.getColumnFormatter().addStyleName(2, "dpsCol");

    Label label_6b = new Label("% of Total");
    label_6b.setStyleName("dpsHeader");
    label_6b.setWordWrap(false);
    shooterSummary.setWidget(0, 5, label_6b);

    skillSummary.getColumnFormatter().addStyleName(3, "dpsCol");
    skillSummary.getRowFormatter().addStyleName(0, "headerRow");
    summary.getColumnFormatter().addStyleName(3, "dpsCol");
    summary.getRowFormatter().addStyleName(0, "headerRow");
    shooterSummary.getColumnFormatter().addStyleName(3, "dpsCol");
    shooterSummary.getRowFormatter().addStyleName(0, "headerRow");

    HorizontalPanel horizontalPanel_2 = new HorizontalPanel();
    outputPanel.add(horizontalPanel_2);

    captionPanelDamageLog = new CaptionPanel("Damage Log");
    horizontalPanel_2.add(captionPanelDamageLog);

    damageLog = new FlexTable();
    damageLog.setCellPadding(5);
    damageLog.setBorderWidth(1);
    captionPanelDamageLog.setContentWidget(damageLog);

    int col = 0;

    Label lblNewLabel_11 = new Label("Time", false);
    lblNewLabel_11.setWordWrap(false);
    lblNewLabel_11.setStyleName("dpsHeader");
    damageLog.setWidget(0, col, lblNewLabel_11);
    damageLog.getColumnFormatter().addStyleName(col, "dpsCol");
    col++;

    Label lblNewLabel_8a = new Label("Shooter", false);
    lblNewLabel_8a.setWordWrap(false);
    damageLog.setWidget(0, col, lblNewLabel_8a);
    col++;

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

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

    Label lblNewLabel_10 = new Label("Type", false);
    lblNewLabel_10.setWordWrap(false);
    damageLog.setWidget(0, col, lblNewLabel_10);
    col++;

    Label lblNewLabel_12a = new Label("+/- Hatred", false);
    lblNewLabel_12a.setWordWrap(false);
    damageLog.setWidget(0, col, lblNewLabel_12a);
    damageLog.getColumnFormatter().addStyleName(col, "dpsCol");
    col++;

    Label lblNewLabel_12b = new Label("Hatred", false);
    lblNewLabel_12b.setWordWrap(false);
    damageLog.setWidget(0, col, lblNewLabel_12b);
    damageLog.getColumnFormatter().addStyleName(col, "dpsCol");
    col++;

    Label lblNewLabel_12c = new Label("+/- Disc", false);
    damageLog.setWidget(0, col, lblNewLabel_12c);
    damageLog.getColumnFormatter().addStyleName(col, "dpsCol");
    col++;

    Label lblNewLabel_12d = new Label("Disc", false);
    damageLog.setWidget(0, col, lblNewLabel_12d);
    damageLog.getColumnFormatter().addStyleName(col, "dpsCol");
    col++;

    Label lblNewLabel_13 = new Label("Damage", false);
    lblNewLabel_13.setStyleName("dpsHeader");
    lblNewLabel_13.setWordWrap(false);
    damageLog.setWidget(0, col, lblNewLabel_13);
    damageLog.getColumnFormatter().addStyleName(col, "dpsCol");
    col++;

    Label lblNewLabel_14 = new Label("Target HP", false);
    lblNewLabel_14.setStyleName("dpsHeader");
    lblNewLabel_14.setWordWrap(false);
    damageLog.setWidget(0, col, lblNewLabel_14);
    damageLog.getColumnFormatter().addStyleName(col, "dpsCol");
    col++;

    Label lblNewLabel_15 = new Label("% HP", false);
    lblNewLabel_15.setStyleName("dpsHeader");
    lblNewLabel_15.setWordWrap(false);
    damageLog.setWidget(0, col, lblNewLabel_15);
    damageLog.getColumnFormatter().addStyleName(col, "dpsCol");
    col++;

    Label lblNewLabel_15b = new Label("Target", false);
    lblNewLabel_15b.setWordWrap(false);
    damageLog.setWidget(0, col, lblNewLabel_15b);
    col++;

    Label lblNewLabel_16 = new Label("Notes", false);
    lblNewLabel_16.setWordWrap(false);
    damageLog.setWidget(0, col, lblNewLabel_16);
    col++;

    Label lblNewLabel_28 = new Label("Calculations", false);
    lblNewLabel_28.setWordWrap(false);
    damageLog.setWidget(0, col, lblNewLabel_28);
    col++;

    damageLog.addStyleName("outputTable");
    damageLog.getRowFormatter().addStyleName(0, "headerRow");

    calculator = new DPSCalculator(this);

    passives.addChangeHandler(changeHandler);

    ChangeHandler handler = new ChangeHandler() {

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

    ChangeHandler handler2 = new ChangeHandler() {

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

    ClickHandler clickHandler = new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            Service.getInstance().checkVersion(null);
            updateCDRLabels();
        }

    };

    ClickHandler clickHandler2 = new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            Service.getInstance().checkVersion(null);
            updateRCRLabels();
        }

    };

    statTable = new FlexTable();
    statTableCaption.setContentWidget(statTable);
    statTable.setCellPadding(5);
    statTable.setBorderWidth(1);
    statTable.setStyleName("outputTable");
    statTable.getRowFormatter().addStyleName(0, "headerRow");

    col = 0;

    Label l1a = new Label("Stat");
    l1a.setStyleName("dpsHeader");
    l1a.setWordWrap(false);
    statTable.setWidget(0, col++, l1a);

    Label l2b = new Label("Time");
    l2b.setStyleName("dpsHeader");
    l2b.setWordWrap(false);
    statTable.setWidget(0, col++, l2b);

    Label l2c = new Label("%");
    l2c.setStyleName("dpsHeader");
    l2c.setWordWrap(false);
    statTable.setWidget(0, col++, l2c);

    Label l4 = new Label("Damage");
    l4.setStyleName("dpsHeader");
    l4.setWordWrap(false);
    statTable.setWidget(0, col++, l4);

    Label l2 = new Label("DPS");
    l2.setStyleName("dpsHeader");
    l2.setWordWrap(false);
    statTable.setWidget(0, col++, l2);

    Label l2a = new Label("%");
    l2a.setStyleName("dpsHeader");
    l2a.setWordWrap(false);
    statTable.setWidget(0, col++, l2a);

    captionPanelDamageLog.setContentWidget(damageLog);

    paragonPanel.getParagonCDR().addChangeHandler(handler);
    gemPanel.addChangeHandler(handler);
    cdrPanel.getDiamond().addChangeHandler(handler);
    cdrPanel.getShoulders().addChangeHandler(handler);
    cdrPanel.getAmulet().addChangeHandler(handler);
    cdrPanel.getGloves().addChangeHandler(handler);
    cdrPanel.getRing1().addChangeHandler(handler);
    cdrPanel.getRing2().addChangeHandler(handler);
    cdrPanel.getBelt().addChangeHandler(handler);
    cdrPanel.getWeapon().addChangeHandler(handler);
    cdrPanel.getQuiver().addChangeHandler(handler);
    itemPanel.addChangeHandler(handler);

    paragonPanel.getParagonRCR().addChangeHandler(handler2);
    rcrPanel.getShoulders().addChangeHandler(handler2);
    rcrPanel.getAmulet().addChangeHandler(handler2);
    rcrPanel.getGloves().addChangeHandler(handler2);
    rcrPanel.getRing1().addChangeHandler(handler2);
    rcrPanel.getRing2().addChangeHandler(handler2);
    rcrPanel.getBelt().addChangeHandler(handler2);
    rcrPanel.getWeapon().addChangeHandler(handler2);
    rcrPanel.getQuiver().addChangeHandler(handler2);
    itemPanel.addChangeHandler(handler2);

    Button exportButton = new Button("New button");
    exportButton.setText("Export to Excel...");
    horizontalPanel_19.add(exportButton);

    exportButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            Service.getInstance().checkVersion(null);
            exportExcel();
        }

    });

    Button statsButton = new Button("Statistics...");

    firstTimeStats = true;

    statsButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {

            Service.getInstance().checkVersion(null);

            if (stats == null) {
                stats = new StatsPanel();

                stats.setActionListener(new StatsPanel.ActionListener() {

                    @Override
                    public void importEntry(DpsTableEntry entry) {
                        MainPanel.this.importEntry(entry);
                    }

                    @Override
                    public void closePanel() {
                        if (statsDialog != null) {
                            statsDialog.hide();
                            statsDialog = null;
                        }
                    }

                    @Override
                    public Build getBuild() {
                        return MainPanel.this.getBuild();
                    }

                    @Override
                    public void setBuild(Build build) {
                        MainPanel.this.setBuild(build);

                    }
                });

            }

            statsDialog = ApplicationPanel.showDialogBox("Statistics", stats, ApplicationPanel.OK, null);

            if (firstTimeStats) {
                firstTimeStats = false;
                stats.updateStats();
            }
        }
    });

    Button aboutButton = new Button("New button");
    aboutButton.setText("About...");
    horizontalPanel_19.add(aboutButton);

    aboutButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {

            Service.getInstance().checkVersion(null);

            if (about == null)
                about = new AboutDialog();

            ApplicationPanel.showDialogBox("About", about, ApplicationPanel.OK, null);
        }
    });

    legendButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {

            Service.getInstance().checkVersion(null);

            if (legend == null)
                legend = new Legend();

            ApplicationPanel.showDialogBox("Legend", legend, ApplicationPanel.OK, null);
        }
    });

    for (Realm r : Realm.values()) {
        realms.addItem(r.getDisplayName(), r.name());
    }

    Service.getInstance().addNewsHandler(new NewsHandler() {

        @Override
        public void newsChanged(List<NewsItem> news) {
            setNews(news);
        }
    });

    skills.addSkillsChangedListener(new SkillsChangedListener() {

        @Override
        public void skillsChanged(Map<ActiveSkill, Rune> skills) {
            cdrPanel.setSkills(skills, itemPanel.getItems(), itemPanel.getSetCounts());
        }
    });

    itemPanel.addItemsChangedListener(new ItemsChangedListener() {

        @Override
        public void itemsChanged(Map<Slot, ItemHolder> items) {
            cdrPanel.setSkills(skills.getSkills(), items, itemPanel.getSetCounts());
        }

        @Override
        public void setCountsChanged(Map<String, Integer> sets) {
            cdrPanel.setSkills(skills.getSkills(), itemPanel.getItems(), sets);
        }
    });
}

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

License:Open Source License

protected void compareBuilds() {
    int count = 0;
    List<CompareData> list = new Vector<CompareData>();

    for (int i = 0; i < compareData.length; i++) {
        CompareData data = compareData[i];

        if (data != null) {
            count++;/*from w w  w .  j  a v  a 2  s .co  m*/
            list.add(data);
        }
    }

    if (count == 0) {
        ApplicationPanel.showErrorDialog("Please select at least 2 builds to compare");
        return;
    }

    int numDiff = 0;

    FlexTable table = new FlexTable();
    table.setCellPadding(2);
    table.setBorderWidth(1);
    table.addStyleName("breakpointTable");
    ScrollPanel panel = new ScrollPanel();
    panel.setWidget(table);

    for (int i = 0; i < count; i++) {
        Label label = new Label("Build #" + (i + 1));
        label.setWordWrap(false);
        table.setWidget(0, i + 1, label);
        table.getFlexCellFormatter().setHorizontalAlignment(0, i + 1, HasHorizontalAlignment.ALIGN_CENTER);
    }

    Label l1 = new Label("Input Field");
    l1.setWordWrap(false);
    table.setWidget(0, 0, l1);
    table.getFlexCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT);

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

    int row = 1;

    List<Map<String, String>> formData = new Vector<Map<String, String>>();

    for (int i = 0; i < count; i++) {
        Map<String, String> map = new TreeMap<String, String>();
        map.putAll(list.get(i).formData.main);

        Util.putAll(map, "passives.", list.get(i).formData.passives);
        Util.putAll(map, "gems.", list.get(i).formData.gems);
        Util.putAll(map, "specialItems.", list.get(i).formData.specialItems);
        Util.putAll(map, "skills.", list.get(i).formData.skills);
        Util.putAll(map, "elementalDamages.", list.get(i).formData.elementalDamage);
        Util.putAll(map, "skillDamages.", list.get(i).formData.skillDamage);

        for (Map.Entry<String, String> e : list.get(i).formData.calculator.entrySet()) {
            String key = e.getKey();
            String value = e.getValue();

            if (key.startsWith("calc.")) {
                String k = key.substring(5);
                String old = map.get(k);

                if (old == null) {
                    map.put(k, value);
                } else if (!old.equals(value)) {
                    map.put(key, value);
                }
            } else {
                map.put(key, value);
            }
        }

        formData.add(map);
    }

    Set<String> keys = new TreeSet<String>();

    for (Map<String, String> map : formData) {
        keys.addAll(map.keySet());
    }

    for (String key : keys) {
        List<String> values = new Vector<String>();
        String first = formData.get(0).get(key);
        values.add(first);
        boolean diff = false;

        for (int i = 1; i < count; i++) {
            String value = formData.get(i).get(key);
            values.add(value);
            if (!diff && ((value == null) || !value.equals(first)))
                diff = true;
        }

        if (diff) {
            numDiff++;

            if ((row % 2) == 0) {
                table.getRowFormatter().addStyleName(row, "evenRow");
            } else {
                table.getRowFormatter().addStyleName(row, "oddRow");
            }

            Label keyLabel = new Label(key);
            keyLabel.setWordWrap(false);
            keyLabel.addStyleName("boldText");
            table.setWidget(row, 0, keyLabel);
            table.getFlexCellFormatter().setHorizontalAlignment(row, 0, HasHorizontalAlignment.ALIGN_LEFT);

            for (int i = 0; i < count; i++) {
                String value = values.get(i);

                if (value == null)
                    value = "N/A";

                Label label = new Label(value);
                label.setWordWrap(false);
                table.setWidget(row, i + 1, label);
                table.getFlexCellFormatter().setHorizontalAlignment(row, i + 1,
                        HasHorizontalAlignment.ALIGN_CENTER);
            }

            row++;
        }
    }

    if (numDiff == 0) {
        ApplicationPanel.showErrorDialog("There were no differences in the builds");
        return;
    } else {
        ApplicationPanel.showDialogBox("Compare Builds", panel, ApplicationPanel.OK, null);
    }
}

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

License:Open Source License

private void updateOutput() {

    Label ns = new Label("" + data.getNumSentries());
    ns.addStyleName("boldText");
    outputHeader.setWidget(2, 5, ns);// w w w.ja v a2  s  .c om

    while (damageLog.getRowCount() > 1) {
        damageLog.removeRow(1);
    }

    for (int i = damageLog.getRowCount(); i > 1; --i) {
        damageLog.removeRow(i - 1);
    }

    for (int i = statTable.getRowCount(); i > 1; --i) {
        statTable.removeRow(i - 1);
    }

    for (int i = shooterSummary.getRowCount(); i > 1; --i) {
        shooterSummary.removeRow(i - 1);
    }

    this.captionPanelDamageLog.setCaptionHTML("Damage Log (" + damage.duration + " seconds)");

    for (int row = 0; row < damage.damages.length; row++) {
        if ((row % 2) == 0)
            damageLog.getRowFormatter().addStyleName(row + 1, "oddRow");
        else
            damageLog.getRowFormatter().addStyleName(row + 1, "evenRow");

        Damage d = damage.damages[row];

        int col = 0;

        Label timeLabel = new Label(Util.format(Math.round(d.time * 100.0) / 100.0), false);
        timeLabel.addStyleName("dpsCol");
        damageLog.setWidget(row + 1, col++, timeLabel);

        Label sLabel = new Label(d.shooter);
        sLabel.setWordWrap(false);
        damageLog.setWidget(row + 1, col++, sLabel);

        if (d.source != null) {
            ActiveSkill skill = d.source.skill;
            Anchor a = new Anchor(d.source.getName());
            a.setTarget("_blank");
            a.setWordWrap(false);
            String url = d.source.getUrl();
            a.setHref(url);

            damageLog.setWidget(row + 1, col++, a);

            if (skill != null) {
                Anchor b = new Anchor(d.source.rune.getLongName());
                b.setTarget("_blank");
                b.setWordWrap(false);

                if (d.source.skill == ActiveSkill.CR)
                    url = ActiveSkill.RoV.getUrl();

                if (d.source.rune != Rune.None)
                    url += ("#" + d.source.rune.getSlug() + "+");

                b.setHref(url);

                damageLog.setWidget(row + 1, col++, b);
            } else {
                Label b = new Label("N/A");
                damageLog.setWidget(row + 1, col++, b);
            }
        } else if (d.shooter.equals("Preparation")) {
            Anchor b = new Anchor("Preparation");
            b.setTarget("_blank");
            b.setWordWrap(false);
            b.setHref("http://us.battle.net/d3/en/class/demon-hunter/active/preparation");
            damageLog.setWidget(row + 1, col++, b);

            Anchor b2 = new Anchor("Punishment");
            b2.setTarget("_blank");
            b2.setWordWrap(false);
            b2.setHref("http://us.battle.net/d3/en/class/demon-hunter/active/preparation#a+");
            damageLog.setWidget(row + 1, col++, b2);
        } else if (d.shooter.equals("Companion") && d.hatred != 0) {
            Anchor b = new Anchor("Companion");
            b.setTarget("_blank");
            b.setWordWrap(false);
            b.setHref("http://us.battle.net/d3/en/class/demon-hunter/active/companion");
            damageLog.setWidget(row + 1, col++, b);

            Anchor b2 = new Anchor("Bat");
            b2.setTarget("_blank");
            b2.setWordWrap(false);
            b2.setHref("http://us.battle.net/d3/en/class/demon-hunter/active/companion#d+");
            damageLog.setWidget(row + 1, col++, b2);
        } else if (d.shooter.equals("MFD") && d.hatred != 0) {
            Anchor b = new Anchor("MfD");
            b.setTarget("_blank");
            b.setWordWrap(false);
            b.setHref("http://us.battle.net/d3/en/class/demon-hunter/active/marked-for-death");
            damageLog.setWidget(row + 1, col++, b);

            Anchor b2 = new Anchor("Mortal Enemy");
            b2.setTarget("_blank");
            b2.setWordWrap(false);
            b2.setHref("http://us.battle.net/d3/en/class/demon-hunter/active/marked-for-death#d+");
            damageLog.setWidget(row + 1, col++, b2);
        } else {
            col += 2;
        }

        if (d.type != null)
            damageLog.setWidget(row + 1, col++, new Label(d.type.name(), false));
        else
            col++;

        if (d.hatred != 0) {
            Label hatredLabel = new Label(
                    ((d.hatred > 0) ? "+" : "") + Util.format(Math.round(d.hatred * 10.0) / 10.0), false);
            hatredLabel.addStyleName("dpsCol");
            damageLog.setWidget(row + 1, col++, hatredLabel);
        } else {
            col++;
        }

        Label hatredLabel2 = new Label(Util.format(Math.round(d.currentHatred * 10.0) / 10.0), false);
        hatredLabel2.addStyleName("dpsCol");
        damageLog.setWidget(row + 1, col++, hatredLabel2);

        if (d.disc != 0) {
            Label discLabel = new Label(
                    ((d.disc > 0) ? "+" : "") + Util.format(Math.round(d.disc * 10.0) / 10.0), false);
            discLabel.addStyleName("dpsCol");
            damageLog.setWidget(row + 1, col++, discLabel);
        } else {
            col++;
        }

        Label discLabel2 = new Label(Util.format(Math.round(d.currentDisc * 10.0) / 10.0), false);
        discLabel2.addStyleName("dpsCol");
        damageLog.setWidget(row + 1, col++, discLabel2);

        if (d.damage > 0) {
            Label totalLabel = new Label(Util.format(Math.round(d.damage)), false);
            totalLabel.addStyleName("dpsCol");
            damageLog.setWidget(row + 1, col++, totalLabel);

            Label dpsLabel = new Label(Util.format(Math.round((d.targetHp))), false);
            dpsLabel.addStyleName("dpsCol");
            damageLog.setWidget(row + 1, col++, dpsLabel);
            double pct = Math.round(d.targetHpPercent * 1000.0) / 10.0;
            Label pctLabel = new Label(Util.format(pct) + "%", false);
            pctLabel.addStyleName("dpsCol");
            damageLog.setWidget(row + 1, col++, pctLabel);
        } else {
            col += 3;
        }

        if (d.target != null) {
            damageLog.setWidget(row + 1, col++, new Label(d.target.toString(), false));
        } else {
            damageLog.setWidget(row + 1, col++, new Label("", false));
        }

        if (d.note != null) {
            damageLog.setWidget(row + 1, col++, new Label(d.note, false));
        } else {
            damageLog.setWidget(row + 1, col++, new Label("", false));
        }

        if (d.log != null) {
            Label log = new Label(d.log);
            log.setWordWrap(false);
            damageLog.setWidget(row + 1, col++, log);
        } else {
            damageLog.setWidget(row + 1, col++, new Label("", false));
        }

    }

    for (int i = summary.getRowCount(); i > 1; --i) {
        summary.removeRow(i - 1);
    }

    int row = 1;
    for (Map.Entry<DamageType, DamageHolder> e : types.entrySet()) {
        if ((row % 2) == 0)
            summary.getRowFormatter().addStyleName(row, "evenRow");
        else
            summary.getRowFormatter().addStyleName(row, "oddRow");

        summary.setWidget(row, 0, new Label(e.getKey().name(), false));

        int attacks = e.getValue().attacks;
        double d = e.getValue().damage;
        double da = Math.round((d / attacks));

        Label label1 = new Label(String.valueOf(attacks), false);
        label1.addStyleName("dpsCol");
        summary.setWidget(row, 1, label1);

        Label label2 = new Label(Util.format(da), false);
        label2.addStyleName("dpsCol");
        summary.setWidget(row, 2, label2);

        Label damageLabel = new Label(Util.format(Math.round(d)), false);
        damageLabel.addStyleName("dpsCol");
        summary.setWidget(row, 3, damageLabel);

        Label dpsLabel = new Label(Util.format(Math.round((d) / damage.duration)), false);
        dpsLabel.addStyleName("dpsCol");
        summary.setWidget(row, 4, dpsLabel);

        double pct = Math.round((d / total) * 10000.0) / 100.0;
        Label pctLabel = new Label(String.valueOf(pct) + "%", false);
        pctLabel.addStyleName("dpsCol");
        summary.setWidget(row, 5, pctLabel);
        row++;
    }

    for (int i = skillSummary.getRowCount(); i > 1; --i) {
        skillSummary.removeRow(i - 1);
    }

    row = 1;
    for (Map.Entry<DamageSource, DamageHolder> e : skillDamages.entrySet()) {
        if ((row % 2) == 0)
            skillSummary.getRowFormatter().addStyleName(row, "evenRow");
        else
            skillSummary.getRowFormatter().addStyleName(row, "oddRow");

        DamageSource source = e.getKey();

        Anchor a = new Anchor(source.getName());
        a.setTarget("_blank");
        a.setWordWrap(false);
        String url = source.getUrl();
        a.setHref(url);
        skillSummary.setWidget(row, 0, a);

        int attacks = e.getValue().attacks;
        double d = e.getValue().damage;
        double da = Math.round((d / attacks));

        Label label1 = new Label(String.valueOf(attacks), false);
        label1.addStyleName("dpsCol");
        skillSummary.setWidget(row, 1, label1);

        Label label2 = new Label(Util.format(da), false);
        label2.addStyleName("dpsCol");
        skillSummary.setWidget(row, 2, label2);

        Label damageLabel = new Label(Util.format(Math.round(d)), false);
        damageLabel.addStyleName("dpsCol");
        skillSummary.setWidget(row, 3, damageLabel);

        Label dpsLabel = new Label(Util.format(Math.round((d) / damage.duration)), false);
        dpsLabel.addStyleName("dpsCol");
        skillSummary.setWidget(row, 4, dpsLabel);

        double pct = Math.round((d / total) * 10000.0) / 100.0;
        Label pctLabel = new Label(String.valueOf(pct) + "%", false);
        pctLabel.addStyleName("dpsCol");
        skillSummary.setWidget(row, 5, pctLabel);
        row++;
    }

    row = 1;
    for (Map.Entry<String, DamageHolder> e : shooterDamages.entrySet()) {
        if ((row % 2) == 0)
            shooterSummary.getRowFormatter().addStyleName(row, "evenRow");
        else
            shooterSummary.getRowFormatter().addStyleName(row, "oddRow");

        Label a = new Label(e.getKey());
        a.setWordWrap(false);
        shooterSummary.setWidget(row, 0, a);

        int attacks = e.getValue().attacks;
        double d = e.getValue().damage;
        double da = Math.round((d / attacks));

        Label label1 = new Label(String.valueOf(attacks), false);
        label1.addStyleName("dpsCol");
        shooterSummary.setWidget(row, 1, label1);

        Label label2 = new Label(Util.format(da), false);
        label2.addStyleName("dpsCol");
        shooterSummary.setWidget(row, 2, label2);

        Label damageLabel = new Label(Util.format(Math.round(d)), false);
        damageLabel.addStyleName("dpsCol");
        shooterSummary.setWidget(row, 3, damageLabel);

        Label dpsLabel = new Label(Util.format(Math.round((d) / damage.duration)), false);
        dpsLabel.addStyleName("dpsCol");
        shooterSummary.setWidget(row, 4, dpsLabel);

        double pct = Math.round((d / total) * 10000.0) / 100.0;
        Label pctLabel = new Label(String.valueOf(pct) + "%", false);
        pctLabel.addStyleName("dpsCol");
        shooterSummary.setWidget(row, 5, pctLabel);
        row++;
    }

    double dps = (damage.duration > 0) ? Math.round(total / damage.duration) : total;

    weaponDamage.setText(Util.format(Math.round(data.getWeaponDamage() * 100.0) / 100.0));

    if (data.getOffHand_weaponType() != null) {
        offHand_weaponDamage.setText(Util.format(Math.round(data.getOffHand_weaponDamage() * 100.0) / 100.0));
        double dwDamage = (data.getWeaponDamage() + data.getOffHand_weaponDamage()) / 2.0;
        dw_weaponDamage.setText(Util.format(Math.round(dwDamage * 100.0) / 100.0) + " sec");
    } else {
        offHand_weaponDamage.setText("N/A");
        dw_weaponDamage.setText("N/A");

    }

    row = 1;

    this.dps.setText(Util.format(Math.round(dps)));
    this.totalDamage.setText(Util.format(Math.round(total)));
    this.eliteDamage.setText(Math.round(data.getTotalEliteDamage() * 100.0) + "%");
    this.timeElapsed.setText(Util.format(Math.round(damage.duration * 100.0) / 100.0) + " secs");

    row = 1;

    final CharacterData savedData = data.copy();

    final double baseline = total;
    final double duration = damage.duration;

    for (Stat stat : Stat.values()) {

        final StatAdapter adapter = stat.getAdapter();

        if (adapter.test(data, types.keySet())) {

            if ((row % 2) == 0)
                statTable.getRowFormatter().addStyleName(row, "evenRow");
            else
                statTable.getRowFormatter().addStyleName(row, "oddRow");

            HorizontalPanel panel = new HorizontalPanel();
            panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
            panel.setSpacing(0);

            panel.add(new Label("+", false));
            final DoubleSpinner spinner = new DoubleSpinner();
            double value = adapter.getDefaultValue();
            spinner.setMax(value * 100.0);
            spinner.setMin(value * -100.0);

            final String field = "Stat." + stat.getLabel();

            try {
                value = Double.parseDouble(this.getFieldValue(field, String.valueOf(value)));
            } catch (Exception e) {
                saveField(field, String.valueOf(value));
            }

            spinner.setValue(value);
            spinner.setVisibleLength(4);

            panel.add(spinner);

            String label = stat.getLabel();

            int col = 0;
            Label l1 = new Label(label);
            l1.setWordWrap(false);
            panel.add(l1);

            statTable.setWidget(row, col++, panel);

            final Label l2 = new Label("");
            l2.addStyleName("dpsCol");
            statTable.setWidget(row, col++, l2);

            final Label l2a = new Label("");
            l2a.addStyleName("dpsCol");
            statTable.setWidget(row, col++, l2a);

            final Label l2b = new Label("");
            l2b.addStyleName("dpsCol");
            statTable.setWidget(row, col++, l2b);

            final Label l3 = new Label("");
            l3.addStyleName("dpsCol");
            statTable.setWidget(row, col++, l3);

            final Label l4 = new Label("");
            l4.addStyleName("dpsCol");
            statTable.setWidget(row, col++, l4);

            updateStatTable(adapter, spinner, savedData, row, baseline, duration);

            final int r = row;

            spinner.addChangeHandler(new ChangeHandler() {

                @Override
                public void onChange(ChangeEvent event) {
                    saveField(field, String.valueOf(spinner.getValue()));
                    updateStatTable(adapter, spinner, savedData, r, baseline, duration);
                }
            });

            row++;
        }
    }
}

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

License:Open Source License

public ParagonPanel() {

    CaptionPanel captionPanel = new CaptionPanel("Paragon");
    initWidget(captionPanel);/*from   w w w .j  a  va 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.PlayerBuffPanel.java

License:Open Source License

public PlayerBuffPanel() {

    disableListeners = true;/*from   w w  w .  ja  va 2s  .  co m*/

    CaptionPanel cptnpnlNewPanel = new CaptionPanel("Other Player Buffs");
    initWidget(cptnpnlNewPanel);

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

    int row = 0;

    Anchor anchor = new Anchor("Companion/Wolf (from other DH):");
    anchor.setWordWrap(false);
    flexTable.setWidget(row, 0, anchor);
    anchor.setTarget("_blank");
    anchor.setHref("http://us.battle.net/d3/en/class/demon-hunter/active/companion#c");

    wolf = new SimpleCheckBox();
    flexTable.setWidget(row, 1, wolf);

    Label lblNewLabel = new Label("% Uptime:");
    lblNewLabel.setWordWrap(false);
    flexTable.setWidget(row, 2, lblNewLabel);

    wolfUptime = new DoubleSpinner();
    wolfUptime.setVisibleLength(5);
    wolfUptime.setValue(33.33);
    flexTable.setWidget(row, 3, wolfUptime);
    wolfUptime.setTitle("% of time that another player's Wolf will be active");

    calcWolfButton = new Button("Calculate");
    calcWolfButton.setTitle("Calculate Wolf uptime based on your effective Cooldown Reduction");
    flexTable.setWidget(row, 4, calcWolfButton);

    row++;

    Anchor anchor_1 = new Anchor("Big Bad Voodoo:");
    anchor_1.setWordWrap(false);
    anchor_1.setTarget("_blank");
    anchor_1.setHref("http://us.battle.net/d3/en/class/witch-doctor/active/big-bad-voodoo");
    flexTable.setWidget(row, 0, anchor_1);

    bbv = new SimpleCheckBox();
    flexTable.setWidget(row, 1, bbv);

    Label label = new Label("% Uptime:");
    label.setWordWrap(false);
    flexTable.setWidget(row, 2, label);

    bbvUptime = new DoubleSpinner();
    bbvUptime.setValue(17.67);
    bbvUptime.setVisibleLength(5);
    flexTable.setWidget(row, 3, bbvUptime);

    Anchor anchor_10 = new Anchor("Slam Dance:");
    anchor_10.setWordWrap(false);
    anchor_10.setTarget("_blank");
    anchor_10.setHref("http://us.battle.net/d3/en/class/witch-doctor/active/big-bad-voodoo#a+");
    flexTable.setWidget(row, 4, anchor_10);

    slamDance = new SimpleCheckBox();
    flexTable.setWidget(row, 5, slamDance);
    slamDance.setTitle("Check this box if the Witch Doctor is using the Slam Dance rune");

    row++;

    Anchor anchor_1a = new Anchor("Slow Time/Stretch Time:");
    anchor_1a.setWordWrap(false);
    anchor_1a.setTarget("_blank");
    anchor_1a.setHref("http://us.battle.net/d3/en/class/wizard/active/slow-time#e+");
    flexTable.setWidget(row, 0, anchor_1a);

    stretchTime = new SimpleCheckBox();
    flexTable.setWidget(row, 1, stretchTime);

    Label labela = new Label("% Uptime:");
    labela.setWordWrap(false);
    flexTable.setWidget(row, 2, labela);

    stretchTimeUptime = new NumberSpinner();
    stretchTimeUptime.setValue(0);
    stretchTimeUptime.setVisibleLength(5);
    flexTable.setWidget(row, 3, stretchTimeUptime);

    row++;

    Anchor anchor_1b = new Anchor("Slow Time/Time Warp:");
    anchor_1b.setWordWrap(false);
    anchor_1b.setTarget("_blank");
    anchor_1b.setHref("http://us.battle.net/d3/en/class/wizard/active/slow-time#a+");
    flexTable.setWidget(row, 0, anchor_1b);

    timeWarp = new SimpleCheckBox();
    flexTable.setWidget(row, 1, timeWarp);

    Label labelb = new Label("% Uptime:");
    labelb.setWordWrap(false);
    flexTable.setWidget(row, 2, labelb);

    timeWarpUptime = new NumberSpinner();
    timeWarpUptime.setValue(0);
    timeWarpUptime.setVisibleLength(5);
    flexTable.setWidget(row, 3, timeWarpUptime);

    row++;

    Anchor anchor_2 = new Anchor("Mass Confusion/Paranoia:");
    anchor_2.setWordWrap(false);
    anchor_2.setTarget("_blank");
    anchor_2.setHref("http://us.battle.net/d3/en/class/witch-doctor/active/mass-confusion#a+");
    flexTable.setWidget(row, 0, anchor_2);

    massConfusion = new SimpleCheckBox();
    flexTable.setWidget(row, 1, massConfusion);

    Label label_1 = new Label("% Uptime:");
    label_1.setWordWrap(false);
    flexTable.setWidget(row, 2, label_1);

    massConfusionUptime = new DoubleSpinner();
    massConfusionUptime.setVisibleLength(5);
    flexTable.setWidget(row, 3, massConfusionUptime);

    row++;

    Anchor anchor_6 = new Anchor("Piranhas:");
    anchor_6.setWordWrap(false);
    anchor_6.setTarget("_blank");
    anchor_6.setHref("http://us.battle.net/d3/en/class/witch-doctor/active/piranhas");
    flexTable.setWidget(row, 0, anchor_6);

    piranhas = new SimpleCheckBox();
    flexTable.setWidget(row, 1, piranhas);

    Label label_5 = new Label("% Uptime:");
    label_5.setWordWrap(false);
    flexTable.setWidget(row, 2, label_5);

    piranhasUptime = new DoubleSpinner();
    piranhasUptime.setVisibleLength(5);
    flexTable.setWidget(row, 3, piranhasUptime);

    row++;

    Anchor anchor_8 = new Anchor("Laws of Valor:");
    anchor_8.setWordWrap(false);
    anchor_8.setTarget("_blank");
    anchor_8.setHref("http://us.battle.net/d3/en/class/crusader/active/laws-of-valor");
    flexTable.setWidget(row, 0, anchor_8);

    valor = new SimpleCheckBox();
    flexTable.setWidget(row, 1, valor);

    Label label_4 = new Label("% Active:");
    label_4.setWordWrap(false);
    flexTable.setWidget(row, 2, label_4);

    valorActiveUptime = new DoubleSpinner();
    valorActiveUptime.setVisibleLength(5);
    flexTable.setWidget(row, 3, valorActiveUptime);
    valorActiveUptime.setTitle("Percent of the time that Laws of Valor's Active buff (only) applies");

    row++;

    Label label_4a = new Label("% Passive:");
    label_4a.setWordWrap(false);
    flexTable.setWidget(row, 2, label_4a);

    valorPassiveUptime = new DoubleSpinner();
    valorPassiveUptime.setVisibleLength(5);
    flexTable.setWidget(row, 3, valorPassiveUptime);
    valorPassiveUptime.setTitle("Percent of the time that Laws of Valor's Passive buff (only) applies");

    row++;

    Anchor anchor_3 = new Anchor("Inner Sanctuary/Forbidden Palace:");
    anchor_3.setWordWrap(false);
    anchor_3.setTarget("_blank");
    anchor_3.setHref("http://us.battle.net/d3/en/class/monk/active/inner-sanctuary#e+");
    flexTable.setWidget(row, 0, anchor_3);

    innerSanctuary = new SimpleCheckBox();
    flexTable.setWidget(row, 1, innerSanctuary);

    Label label_2 = new Label("% Uptime:");
    label_2.setWordWrap(false);
    flexTable.setWidget(row, 2, label_2);

    innerSanctuaryUptime = new DoubleSpinner();
    innerSanctuaryUptime.setVisibleLength(5);
    flexTable.setWidget(row, 3, innerSanctuaryUptime);

    row++;

    Anchor anchor_4 = new Anchor("Crippling Wave/Breaking Wave:");
    anchor_4.setWordWrap(false);
    anchor_4.setTarget("_blank");
    anchor_4.setHref("http://us.battle.net/d3/en/class/monk/active/crippling-wave#e+");
    flexTable.setWidget(row, 0, anchor_4);

    cripplingWave = new SimpleCheckBox();
    flexTable.setWidget(row, 1, cripplingWave);

    Label label_3 = new Label("% Uptime:");
    label_3.setWordWrap(false);
    flexTable.setWidget(row, 2, label_3);

    cripplingWaveUptime = new DoubleSpinner();
    cripplingWaveUptime.setVisibleLength(5);
    flexTable.setWidget(row, 3, cripplingWaveUptime);

    row++;

    Anchor anchor_9 = new Anchor("Mantra of Retribution/Transgression:");
    anchor_9.setWordWrap(false);
    anchor_9.setTarget("_blank");
    anchor_9.setHref("http://us.battle.net/d3/en/class/monk/active/mantra-of-retribution#b+");
    flexTable.setWidget(row, 0, anchor_9);

    retribution = new SimpleCheckBox();
    flexTable.setWidget(row, 1, retribution);

    Label label_6 = new Label("% Uptime:");
    label_6.setWordWrap(false);
    flexTable.setWidget(row, 2, label_6);

    retributionUptime = new DoubleSpinner();
    retributionUptime.setVisibleLength(5);
    flexTable.setWidget(row, 3, retributionUptime);

    row++;

    Anchor anchor_5 = new Anchor("Mantra of Conviction:");
    anchor_5.setWordWrap(false);
    anchor_5.setTarget("_blank");
    anchor_5.setHref("http://us.battle.net/d3/en/class/monk/active/mantra-of-conviction");
    flexTable.setWidget(row, 0, anchor_5);

    conviction = new SimpleCheckBox();
    flexTable.setWidget(row, 1, conviction);

    Label lblPassiveUptime = new Label("% Passive:");
    lblPassiveUptime.setWordWrap(false);
    flexTable.setWidget(row, 2, lblPassiveUptime);

    convictionPassiveUptime = new DoubleSpinner();
    convictionPassiveUptime.setVisibleLength(5);
    convictionPassiveUptime
            .setTitle("Percent of time that Mantra of Conviction's passive bonus [only] applies");
    flexTable.setWidget(row, 3, convictionPassiveUptime);

    Anchor anchor_7 = new Anchor("Overawe:");
    anchor_7.setWordWrap(false);
    anchor_7.setTarget("_blank");
    anchor_7.setHref("http://us.battle.net/d3/en/class/monk/active/mantra-of-conviction#a");
    flexTable.setWidget(row, 4, anchor_7);

    overawe = new SimpleCheckBox();
    overawe.setTitle("Check this box if the monk is using the Overawe rune.");
    flexTable.setWidget(row, 5, overawe);

    row++;

    Label lblActiveUptime = new Label("% Active:");
    lblActiveUptime.setWordWrap(false);
    flexTable.setWidget(row, 2, lblActiveUptime);

    convictionActiveUptime = new DoubleSpinner();
    convictionActiveUptime.setTitle("Percent of time that Matra of Conviction's active bonus [only] applies");
    convictionActiveUptime.setVisibleLength(5);
    flexTable.setWidget(row, 3, convictionActiveUptime);

    row++;

    wolfUptime.setMax(100.0);
    bbvUptime.setMax(100.0);
    massConfusionUptime.setMax(100.0);
    piranhasUptime.setMax(100.0);
    cripplingWaveUptime.setMax(100.0);
    innerSanctuaryUptime.setMax(100.0);
    convictionPassiveUptime.setMax(100.0);
    convictionActiveUptime.setMax(100.0);
    valorActiveUptime.setMax(100.0);
    valorPassiveUptime.setMax(100.0);
    retributionUptime.setMax(100.0);
    stretchTimeUptime.setMax(100);
    timeWarpUptime.setMax(100);

    convictionPassiveUptime.addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {

            if (!disableListeners) {
                disableListeners = true;

                double a = convictionPassiveUptime.getValue();
                double b = convictionActiveUptime.getValue();

                convictionActiveUptime.setValue(Math.min(100.0 - a, b));

                disableListeners = false;
            }

        }
    });

    convictionActiveUptime.addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {

            if (!disableListeners) {
                disableListeners = true;

                double a = convictionPassiveUptime.getValue();
                double b = convictionActiveUptime.getValue();

                convictionPassiveUptime.setValue(Math.min(100.0 - b, a));

                disableListeners = false;
            }

        }
    });

    valorPassiveUptime.addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {

            if (!disableListeners) {
                disableListeners = true;

                double a = valorPassiveUptime.getValue();
                double b = valorActiveUptime.getValue();

                valorActiveUptime.setValue(Math.min(100.0 - a, b));

                disableListeners = false;
            }

        }
    });

    valorActiveUptime.addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {

            if (!disableListeners) {
                disableListeners = true;

                double a = valorPassiveUptime.getValue();
                double b = valorActiveUptime.getValue();

                valorPassiveUptime.setValue(Math.min(100.0 - b, a));

                disableListeners = false;
            }

        }
    });

    disableListeners = false;

}