Examples of StyleObjectModel


Examples of org.openfaces.renderkit.cssparser.StyleObjectModel

* @author Ekaterina Shliakhovetskaya
*/
class AxisUtil {

    public static void setupAxisPresentation(String label, Axis axis, FakeAxisStyle axisStyle) {
        StyleObjectModel model = axisStyle.getStyleObjectModel();
        StyleBorderModel border = model.getBorder();
        if (border != null) {
            if (border.getColor() != null) {
                axis.setAxisLinePaint(border.getColor());
            }

            if (!border.isNone()) {
                axis.setAxisLineVisible(true);
                axis.setAxisLineStroke(PropertiesConverter.toStroke(border));
                axis.setTickMarkPaint(border.getColor());
                axis.setTickMarksVisible(true);
                if (!axis.isTickMarksVisible())
                    axis.setTickMarksVisible(false);
            }

            if (border.getStyle().equalsIgnoreCase("none")) {
                axis.setAxisLineVisible(false);
                axis.setTickMarksVisible(false);
                if (axis.isTickMarksVisible())
                    axis.setTickMarksVisible(true);
            }

        }

        axis.setTickLabelsVisible(axisStyle.isTickLabelsVisible());

        if (axisStyle.isLabelVisible() && label != null) {
            axis.setLabel(label);
            axis.setLabelPaint(model.getColor());
            axis.setLabelFont(CSSUtil.getFont(model));
        }

        if (axisStyle.isTickLabelsVisible()) {
            axis.setTickLabelsVisible(true);
            axis.setTickLabelPaint(model.getColor());
            axis.setTickLabelFont(CSSUtil.getFont(model));
        } else {
            axis.setTickLabelsVisible(false);
        }

View Full Code Here

Examples of org.openfaces.renderkit.cssparser.StyleObjectModel

            //set style
            Boolean showInLegend = lineProperties.getShowInLegend();
            if (showInLegend != null)
                renderer.setSeriesVisibleInLegend(j, showInLegend);

            StyleObjectModel linePropertiesStyleModel = lineProperties.getStyleObjectModel();
            if (linePropertiesStyleModel != null && lineProperties.getStyleObjectModel().getBorder() != null) {
                StyleBorderModel model = lineProperties.getStyleObjectModel().getBorder();
                Color color = model.getColor();
                if (color != null)
                    renderer.setSeriesPaint(j, color);
View Full Code Here

Examples of org.openfaces.renderkit.cssparser.StyleObjectModel

            //set style
            Boolean showInLegend = lineProperties.getShowInLegend();
            if (showInLegend != null)
                renderer.setSeriesVisibleInLegend(j, showInLegend);

            StyleObjectModel linePropertiesStyleModel = lineProperties.getStyleObjectModel();
            if (linePropertiesStyleModel != null && linePropertiesStyleModel.getBorder() != null) {
                StyleBorderModel model = linePropertiesStyleModel.getBorder();
                Color color = model.getColor();
                if (color != null)
                    renderer.setSeriesPaint(j, color);
                renderer.setSeriesLinesVisible(j, Boolean.valueOf(!model.isNone()));
                renderer.setSeriesStroke(j, PropertiesConverter.toStroke(model));
View Full Code Here

Examples of org.openfaces.renderkit.cssparser.StyleObjectModel

        if (gridLines == null || gridLines.size() <= 0)
            return;

        ChartGridLines viewBaseGrid = view.getBaseGrid();
        if (viewBaseGrid != null) {
            StyleObjectModel cssStyle = viewBaseGrid.getStyleObjectModel();
            if (cssStyle != null &&
                    cssStyle.getBorder() != null &&
                    cssStyle.getBorder().getColor() != null &&
                    !cssStyle.getBorder().getStyle().equalsIgnoreCase("none")) {

                setDomainGridlinesVisible(plot, true);
                setDomainGridlineStrokeAndPaint(plot, PropertiesConverter.toStroke(cssStyle.getBorder()), cssStyle.getBorder().getColor());

                setRangeGridlinesVisible(plot, true);
                setRangeGridlineStrokeAndPaint(plot, PropertiesConverter.toStroke(cssStyle.getBorder()), cssStyle.getBorder().getColor());
            }
        } else {
            setDomainGridlinesVisible(plot, false);
            setRangeGridlinesVisible(plot, false);
        }

        for (ChartGridLines lines : gridLines) {
            StyleObjectModel cssStyle = lines.getStyleObjectModel();
            if (lines.getDomain().equals(ChartDomain.KEY)) {
                if (cssStyle != null &&
                        cssStyle.getBorder() != null &&
                        cssStyle.getBorder().getColor() != null &&
                        !cssStyle.getBorder().getStyle().equalsIgnoreCase("none")) {

                    setDomainGridlinesVisible(plot, true);
                    setDomainGridlineStrokeAndPaint(plot, PropertiesConverter.toStroke(cssStyle.getBorder()), cssStyle.getBorder().getColor());
                }

            } else if (lines.getDomain().equals(ChartDomain.VALUE)) {
                if (cssStyle != null &&
                        cssStyle.getBorder() != null &&
                        cssStyle.getBorder().getColor() != null &&
                        !cssStyle.getBorder().getStyle().equalsIgnoreCase("none")) {

                    setRangeGridlinesVisible(plot, true);
                    setRangeGridlineStrokeAndPaint(plot, PropertiesConverter.toStroke(cssStyle.getBorder()), cssStyle.getBorder().getColor());
                }
            }
        }

    }
View Full Code Here

Examples of org.openfaces.renderkit.cssparser.StyleObjectModel

        }

    }

    private void colorInit(GridChartView chartView, AbstractRenderer renderer) {
        StyleObjectModel cssViewModel = chartView.getStyleObjectModel();

        ChartLabels labels = chartView.getLabels();

        if (labels != null) {
            StyleObjectModel cssLabelsModel = labels.getStyleObjectModel();
            renderer.setBaseItemLabelPaint(cssLabelsModel.getColor());
            renderer.setBaseItemLabelFont(CSSUtil.getFont(cssLabelsModel));

        } else {
            renderer.setBaseItemLabelPaint(cssViewModel.getColor());
            renderer.setBaseItemLabelFont(CSSUtil.getFont(cssViewModel));
View Full Code Here

Examples of org.openfaces.renderkit.cssparser.StyleObjectModel

        if (marker.getOutlineStyle() != null) {
            chartMarker.setOutlinePaint(marker.getOutlineStyle().getColor());
            chartMarker.setOutlineStroke(marker.getOutlineStyle().getStroke());
        }

        StyleObjectModel markerStyleModel = marker.getStyleObjectModel();
        chartMarker.setLabelPaint(markerStyleModel.getColor());
        chartMarker.setLabelFont(CSSUtil.getFont(markerStyleModel));

        if (marker.getLabelOffset() != null) {
            final StyleObjectModel offsetStyleModel = CSSUtil.getChartMarkerLabelOffsetModel(marker.getLabelOffset());

            final int top = offsetStyleModel.getMargin(0);
            final int left = offsetStyleModel.getMargin(1);
            final int bottom = offsetStyleModel.getMargin(2);
            final int right = offsetStyleModel.getMargin(3);

            final RectangleInsets offsetInsets = new RectangleInsets(top, left, bottom, right);

            chartMarker.setLabelOffset(offsetInsets);
        }
View Full Code Here

Examples of org.openfaces.renderkit.cssparser.StyleObjectModel

    public PlotColorsConfigurator() {
    }

    public void configure(ConfigurablePlot configurablePlot, ChartView view) {
        StyleObjectModel cssChartViewModel = view.getStyleObjectModel();

        Plot plot = (Plot) configurablePlot;

        if (view.getBackgroundPaint() != null) {
            plot.setBackgroundPaint(null);
        } else {
            plot.setBackgroundPaint(cssChartViewModel.getBackground());
        }

        StyleBorderModel border = cssChartViewModel.getBorder();
        plot.setOutlinePaint(border == null || border.isNone()
                ? cssChartViewModel.getBackground()
                : border.getColor());
    }
View Full Code Here

Examples of org.openfaces.renderkit.cssparser.StyleObjectModel

            setURLText(title.getUrl());
        }

        setToolTipText(title.getTooltip());

        StyleObjectModel styleModel = title.getStyleObjectModel();
        if (styleModel != null) {
            setFont(CSSUtil.getFont(styleModel));

            final boolean chartTitlePaintDefined = chart.getChartView().getBackgroundPaint() != null;

            if (chartTitlePaintDefined) {
                setExpandToFitSpace(true);
                setBackgroundPaint(chart.getChartView().getTitlePaint());
            }

            if (styleModel.getBackground() != null && !chartTitlePaintDefined) {
                setBackgroundPaint(styleModel.getBackground());
                setBorder(new BlockBorder(styleModel.getBackground()));
            }

            if (styleModel.getColor() != null) {
                setPaint(styleModel.getColor());
            }

            StyleBorderModel border = styleModel.getBorder();
            if (border != null) {
                if (!border.isNone() && border.getColor() != null) {
                    BlockBorder bb = new BlockBorder(border.getColor());
                    setBorder(bb);
                }
            }

            setMargin(styleModel.getMargin(0), styleModel.getMargin(1), styleModel.getMargin(2), styleModel.getMargin(3));
        }

        setNotify(true);
    }
View Full Code Here

Examples of org.openfaces.renderkit.cssparser.StyleObjectModel

            setBackgroundPaint(chart.getChartView().getBackgroundPaint());
        }

        //TODO: separate style properties

        StyleObjectModel cssChartModel = chart.getStyleObjectModel();
        if (cssChartModel != null) {
            if (!chartBackgroundPaintDefined) {
                setBackgroundPaint(cssChartModel.getBackground());
            }

            StyleBorderModel border = cssChartModel.getBorder();
            if (border != null && !border.isNone()) {
                setBorderPaint(border.getColor());
                setBorderVisible(true);
            } else {
                setBorderVisible(false);
            }
        }

        Float foregroundAlpha = chart.getChartView().getForegroundAlpha();
        if (foregroundAlpha != null) {
            plot.setForegroundAlpha(foregroundAlpha);
        }

        ChartNoDataMessage chartNoDataMessage = chart.getNoDataMessage();
        if (chartNoDataMessage != null && chartNoDataMessage.getText() != null) {
            plot.setNoDataMessage(chartNoDataMessage.getText());

            StyleObjectModel cssMessageModel = chartNoDataMessage.getStyleObjectModel();
            if (cssMessageModel != null) {
                plot.setNoDataMessagePaint(cssMessageModel.getColor());
                plot.setNoDataMessageFont(CSSUtil.getFont(cssMessageModel));
            }
        }
    }
View Full Code Here

Examples of org.openfaces.renderkit.cssparser.StyleObjectModel

        super(plot);
        ChartLegend legend = chart.getLegend();

        setPosition(RectangleEdge.BOTTOM);

        StyleObjectModel cssLegendModel = (legend != null)
                ? legend.getStyleObjectModel()
                : chart.getStyleObjectModel();

        final boolean chartBackgroundPaintDefined = chart.getChartView().getBackgroundPaint() != null;
        if (chartBackgroundPaintDefined) {
            setBackgroundPaint(chart.getChartView().getBackgroundPaint());
        } else {
            setBackgroundPaint(cssLegendModel.getBackground());
        }

        StyleBorderModel border = cssLegendModel.getBorder();

        if (border != null && !border.isNone()) {
            setBorder(new BlockBorder(border.getColor()));
        } else {
            setBorder(new BlockBorder(cssLegendModel.getBackground()));
        }

        setMargin(cssLegendModel.getMargin(0), cssLegendModel.getMargin(1), cssLegendModel.getMargin(2), cssLegendModel.getMargin(3));

        if (legend != null) {
            LegendPosition position = legend.getPosition();
            setPosition(position != null ? position.toRectangleEdge() : RectangleEdge.BOTTOM);
        }

        //from legend labels
        ChartLabels labels = (legend != null) ? legend.getLabels() : null;
        if (labels != null) {
            StyleObjectModel cssLabelsModel = labels.getStyleObjectModel();
            setItemPaint(cssLabelsModel.getColor());
            setItemFont(CSSUtil.getFont(cssLabelsModel));
        } else {
            setItemPaint(cssLegendModel.getColor());
            setItemFont(CSSUtil.getFont(cssLegendModel));
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.