Package org.thechiselgroup.choosel.core.client.ui

Examples of org.thechiselgroup.choosel.core.client.ui.TextBoundsEstimator


        chartHeight = height - BORDER_BOTTOM - BORDER_TOP;
    }

    private int calculateHorizontalLabelSpace() {
        TextBoundsEstimator estimator = new TextBoundsEstimator();
        estimator.applyFontSettings(FONT_FAMILY, FONT_STYLE, FONT_WEIGHT,
                FONT_SIZE);

        // max over widths for labels
        int maxWidth = 0;
        for (int i = 0; i < viewItemsJsArray.length(); i++) {
            String label = viewItemsJsArray.get(i).getValue(BAR_LABEL);
            estimator.setText(label);
            int width = estimator.getWidth();

            if (maxWidth < width) {
                maxWidth = width;
            }
        }
View Full Code Here


        if (shapeLegend == null) {
            return;
        }

        // calculate widths
        TextBoundsEstimator estimator = new TextBoundsEstimator(FONT_FAMILY,
                FONT_STYLE, FONT_WEIGHT, FONT_SIZE);

        final Map<String, Integer> textWidths = estimator.getWidths(shapeLegend
                .values());

        int descriptionsWidth = 0;
        for (Integer integer : textWidths.values()) {
            descriptionsWidth += integer;
        }
        descriptionsWidth += textWidths.size()
                * (SHAPE_SIZE + SHAPE_LEGEND_LABEL_SPACING);
        int legendLabelWidth = estimator.getWidth(shapeLegendLabel);
        int shapePanelWidth = legendLabelWidth > descriptionsWidth ? legendLabelWidth
                : descriptionsWidth;

        // panel for legend
        PVPanel shapePanel = getChart()
View Full Code Here

        chartHeight = height - BORDER_BOTTOM - BORDER_TOP;
    }

    private int calculateHorizontalLabelSpace() {
        TextBoundsEstimator estimator = new TextBoundsEstimator();
        estimator.applyFontSettings(FONT_FAMILY, FONT_STYLE, FONT_WEIGHT,
                FONT_SIZE);

        // max over widths for labels
        int maxWidth = 0;
        for (int i = 0; i < visualItemsJsArray.length(); i++) {
            String label = visualItemsJsArray.get(i).getValue(BAR_LABEL);
            estimator.setText(label);
            int width = estimator.getWidth();

            if (maxWidth < width) {
                maxWidth = width;
            }
        }
View Full Code Here

        if (shapeLegend == null) {
            return;
        }

        // calculate widths
        TextBoundsEstimator estimator = new TextBoundsEstimator(FONT_FAMILY,
                FONT_STYLE, FONT_WEIGHT, FONT_SIZE);

        final Map<String, Integer> textWidths = estimator
                .getWidths(shapeLegend.values());

        int descriptionsWidth = 0;
        for (Integer integer : textWidths.values()) {
            descriptionsWidth += integer;
        }
        descriptionsWidth += textWidths.size()
                * (SHAPE_SIZE + SHAPE_LEGEND_LABEL_SPACING);
        int legendLabelWidth = estimator.getWidth(shapeLegendLabel);
        int shapePanelWidth = legendLabelWidth > descriptionsWidth ? legendLabelWidth
                : descriptionsWidth;

        // panel for legend
        PVPanel shapePanel = getChart()
View Full Code Here

TOP

Related Classes of org.thechiselgroup.choosel.core.client.ui.TextBoundsEstimator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.