Package com.vaadin.terminal.gwt.client

Examples of com.vaadin.terminal.gwt.client.ValueMap


            }
        }

        // Set zoom levels visible
        if (uidl.hasAttribute("zoomLevels")) {
            ValueMap levelMap = uidl.getMapAttribute("zoomLevels");

            if (zoomBar != null) {
                for (Anchor lvl : zoomLevels.keySet()) {
                    zoomBar.remove(lvl);
                }
            }
            zoomLevels.clear();

            for (String caption : levelMap.getKeySet()) {
                Long time = Long.parseLong(levelMap.getString(caption));
                addZoomLevel(caption, time);
            }
        }

        // Set the chart mode
        if (uidl.hasAttribute("chartMode")) {
            initPlotMode = PlotMode.valueOf(uidl
                    .getStringAttribute("chartMode"));
            if (initStage1Done && initPlotMode != null) {
                display.setChartMode(initPlotMode, initDone);
            }
        }

        // Set the graph grid color
        if(uidl.hasAttribute("gridColor")) {
            String color = uidl.getStringAttribute("gridColor");
            if (color == null || color.equals("")) {
                initGridColor = null;
            } else {
                String[] rgba = color.split(";");
                initGridColor = "rgba(" + rgba[0] + "," + rgba[1] + ","
                + rgba[2] + "," + rgba[3] + ")";
            }

            if (initStage1Done) {
                display.setGridColor(initGridColor);
            }
        }

        // Initialization stage 1
        if(!initStage1Done){
            init();
            initStage1Done = true;

            // Initialization done
        } else if(!initDone){
            initDone = true;

            if (initStartDate != null && initEndDate != null) {

                // Request given init date
                display.setRange(initStartDate, initEndDate, true, true, false);
                browser.setRange(initStartDate, initEndDate);
            } else {
                // Request the default range
                display.setRange(getStartDate(), getEndDate(), true, true, false);
                browser.setRange(getStartDate(), getEndDate());
            }

            fireDateRangeChangedEvent();
        }

        // Data received
        if (uidl.hasAttribute("data")) {
            ValueMap map = uidl.getMapAttribute("data");
            ValueMap changedDensitiesMap = uidl.getMapAttribute("cdensities");

            List<Long> removableRequests = new LinkedList<Long>();

            //Check waiting data list
            for (Long req : waitingForData.keySet()) {
                for (String req2 : map.getKeySet()) {
                    if (req2.equals(req.toString())) {
                        VDataListener comp = waitingForData.get(req);

                        // Get the values.
                        List<String> values = new ArrayList<String>();
                        String valuesString = map.getString(req2);
                        if (valuesString != null && !valuesString.equals("")) {
                            for (String val : map.getString(req2).split(";")) {
                                values.add(val);
                            }
                        }

                        List<Float> fvalues = new ArrayList<Float>();
                        List<Date> dvalues = new ArrayList<Date>();
                        Integer density = densityMap.get(req);

                        if (changedDensitiesMap != null) {
                            /*
                             * Note: This might throw an exception when using
                             * hosted mode for an unknown reason. If that
                             * happens then continue to use the last known
                             * density which will work as expected.
                             */
                            try {
                                Integer newDensity = changedDensitiesMap
                                .getInt(req2);
                                if (newDensity != null) {
                                    density = newDensity;
                                }
                            } catch (Exception e) {
View Full Code Here


                    .hasNext();) {
                oldWidgets.add(iterator.next());
            }
            clear();

            ValueMap mapAttribute = null;
            if (uidl.hasAttribute("css")) {
                mapAttribute = uidl.getMapAttribute("css");
            }

            for (final Iterator<Object> i = uidl.getChildIterator(); i
                    .hasNext();) {
                final UIDL r = (UIDL) i.next();
                final Paintable child = client.getPaintable(r);
                if (oldWidgets.contains(child)) {
                    oldWidgets.remove(child);
                    VCaption vCaption = widgetToCaption.get(child);
                    if (vCaption != null) {
                        add(vCaption);
                        oldWidgets.remove(vCaption);
                    }
                }

                add((Widget) child);
                if (mapAttribute != null && mapAttribute.containsKey(r.getId())) {
                    String css = null;
                    try {
                        Style style = ((Widget) child).getElement().getStyle();
                        css = mapAttribute.getString(r.getId());
                        String[] cssRules = css.split(";");
                        for (int j = 0; j < cssRules.length; j++) {
                            String[] rule = cssRules[j].split(":");
                            if (rule.length == 0) {
                                continue;
View Full Code Here

                    .hasNext();) {
                oldWidgets.add(iterator.next());
            }
            clear();

            ValueMap mapAttribute = null;
            if (uidl.hasAttribute("css")) {
                mapAttribute = uidl.getMapAttribute("css");
            }

            for (final Iterator<Object> i = uidl.getChildIterator(); i
                    .hasNext();) {
                final UIDL r = (UIDL) i.next();
                final Paintable child = client.getPaintable(r);
                if (oldWidgets.contains(child)) {
                    oldWidgets.remove(child);
                }

                add((Widget) child);
                if (mapAttribute != null && mapAttribute.containsKey(r.getId())) {
                    String css = null;
                    try {
                        Style style = ((Widget) child).getElement().getStyle();
                        css = mapAttribute.getString(r.getId());
                        String[] cssRules = css.split(";");
                        for (int j = 0; j < cssRules.length; j++) {
                            String[] rule = cssRules[j].split(":");
                            if (rule.length == 0) {
                                continue;
View Full Code Here

                    .hasNext();) {
                oldWidgets.add(iterator.next());
            }
            clear();

            ValueMap mapAttribute = null;
            if (uidl.hasAttribute("css")) {
                mapAttribute = uidl.getMapAttribute("css");
            }

            for (final Iterator<Object> i = uidl.getChildIterator(); i
                    .hasNext();) {
                final UIDL r = (UIDL) i.next();
                final Paintable child = client.getPaintable(r);
                if (oldWidgets.contains(child)) {
                    oldWidgets.remove(child);
                }

                add((Widget) child);
                if (mapAttribute != null && mapAttribute.containsKey(r.getId())) {
                    String css = null;
                    try {
                        Style style = ((Widget) child).getElement().getStyle();
                        css = mapAttribute.getString(r.getId());
                        String[] cssRules = css.split(";");
                        for (int j = 0; j < cssRules.length; j++) {
                            String[] rule = cssRules[j].split(":");
                            if (rule.length == 0) {
                                continue;
View Full Code Here

            for (final Iterator<Widget> iterator = iterator(); iterator
                    .hasNext();) {
                oldWidgets.add(iterator.next());
            }

            ValueMap mapAttribute = null;
            if (uidl.hasAttribute("css")) {
                mapAttribute = uidl.getMapAttribute("css");
            }

            lastIndex = 0;
            for (final Iterator<Object> i = uidl.getChildIterator(); i
                    .hasNext();) {
                final UIDL r = (UIDL) i.next();
                final Paintable child = client.getPaintable(r);
                final Widget widget = (Widget) child;
                if (widget.getParent() == this) {
                    oldWidgets.remove(child);
                    VCaption vCaption = widgetToCaption.get(child);
                    if (vCaption != null) {
                        addOrMove(vCaption, lastIndex++);
                        oldWidgets.remove(vCaption);
                    }
                }

                addOrMove(widget, lastIndex++);
                if (mapAttribute != null && mapAttribute.containsKey(r.getId())) {
                    String css = null;
                    try {
                        Style style = widget.getElement().getStyle();
                        css = mapAttribute.getString(r.getId());
                        String[] cssRules = css.split(";");
                        for (int j = 0; j < cssRules.length; j++) {
                            String[] rule = cssRules[j].split(":");
                            if (rule.length == 0) {
                                continue;
View Full Code Here

                    .hasNext();) {
                oldWidgets.add(iterator.next());
            }
            clear();

            ValueMap mapAttribute = null;
            if (uidl.hasAttribute("css")) {
                mapAttribute = uidl.getMapAttribute("css");
            }

            for (final Iterator<Object> i = uidl.getChildIterator(); i
                    .hasNext();) {
                final UIDL r = (UIDL) i.next();
                final Paintable child = client.getPaintable(r);
                if (oldWidgets.contains(child)) {
                    oldWidgets.remove(child);
                    VCaption vCaption = widgetToCaption.get(child);
                    if (vCaption != null) {
                        add(vCaption);
                        oldWidgets.remove(vCaption);
                    }
                }

                add((Widget) child);
                if (mapAttribute != null && mapAttribute.containsKey(r.getId())) {
                    String css = null;
                    try {
                        Style style = ((Widget) child).getElement().getStyle();
                        css = mapAttribute.getString(r.getId());
                        String[] cssRules = css.split(";");
                        for (int j = 0; j < cssRules.length; j++) {
                            String[] rule = cssRules[j].split(":");
                            if (rule.length == 0) {
                                continue;
View Full Code Here

TOP

Related Classes of com.vaadin.terminal.gwt.client.ValueMap

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.