Package com.psddev.dari.db

Examples of com.psddev.dari.db.ColorDistribution


    }

    @Override
    protected void doService(final ToolPageContext page) throws IOException, ServletException {
        State state = State.getInstance(Query.from(Object.class).where("_id = ?", page.param(UUID.class, "id")).first());
        ColorDistribution distribution = state.as(ColorDistribution.Data.class).getDistribution();

        if (distribution == null) {
            return;
        }

        page.writeHeader();
            page.writeStart("div", "class", "widget");
                page.writeStart("h1", "class", "icon icon-tint");
                    page.writeHtml("Colors");
                page.writeEnd();

                page.writeStart("h2");
                    page.writeHtml("Dominant");
                page.writeEnd();

                for (Map.Entry<String, Object> entry : distribution.getState().entrySet()) {
                    String fieldName = entry.getKey();
                    Object percentage = entry.getValue();

                    if (fieldName.startsWith("o") && percentage != null) {
                        int percentageInt = (int) (((Double) percentage) * 100);
 
View Full Code Here

TOP

Related Classes of com.psddev.dari.db.ColorDistribution

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.