Package fr.soleil.comete.definition.widget.properties

Examples of fr.soleil.comete.definition.widget.properties.ChartProperties


    }

    @Override
    public void setChartProperties(ChartProperties chartProperties) {

        ChartProperties oldValue = getChartProperties();
        // System.out.println("setChartProperties=" + chartProperties);
        if (!ComparatorUtil.chartPropertiesEquals(oldValue, chartProperties)) {
            baseBean.setChartProperties(chartProperties);
            firePropertyChange("chartProperties", oldValue, chartProperties);
            setModified(true);
View Full Code Here


                        }
                        bookmarks.appendChild(e);
                    }
                }

                ChartProperties chartProperties = UIPreferences.getChartProperties();
                if (chartProperties != null) {
                    Element chartPropertiesElement = document.createElement("chartproperties");
                    String chartXml = ChartPropertiesXmlManager.toXmlString(chartProperties);
                    // chartPropertiesElement.setNodeValue(chartXml);
                    chartPropertiesElement.setAttribute("value", chartXml);
                    root.appendChild(chartPropertiesElement);
                }

                Map<String, PlotProperties> plotPropertiesMap = UIPreferences.getPlotPropertiesMap();
                if (plotPropertiesMap != null && !plotPropertiesMap.isEmpty()) {
                    Element plotPropertiesElement = document.createElement("plotproperties");
                    root.appendChild(plotPropertiesElement);
                    Set<String> plotKeySet = plotPropertiesMap.keySet();
                    String plotXml = null;
                    for (String key : plotKeySet) {
                        Element itemElement = document.createElement("item");
                        itemElement.setAttribute("key", key);
                        plotXml = PlotPropertiesXmlManager.toXmlString(plotPropertiesMap.get(key));
                        itemElement.setTextContent(plotXml);
                        plotPropertiesElement.appendChild(itemElement);
                    }
                }

                Map<String, ImageProperties> imagePropertiesMap = UIPreferences.getImagePropertiesMap();
                if (imagePropertiesMap != null && !imagePropertiesMap.isEmpty()) {
                    Element imagePropertiesElement = document.createElement("imageproperties");
                    root.appendChild(imagePropertiesElement);
                    Set<String> imageKeySet = imagePropertiesMap.keySet();
                    String imageXml = null;
                    ImageProperties prop = null;
                    for (String key : imageKeySet) {
                        prop = imagePropertiesMap.get(key);
                        if (prop != null) {
                            Element itemElement = document.createElement("item");
                            itemElement.setAttribute("key", key);
                            imageXml = ImagePropertiesXmlManager.toXmlString(prop);
                            itemElement.setTextContent(imageXml);
                            imagePropertiesElement.appendChild(itemElement);
                        }
                    }
                }

                Map<String, ChartProperties> chartPropertiesMap = UIPreferences.getChartPropertiesMap();
                if (chartPropertiesMap != null && !chartPropertiesMap.isEmpty()) {
                    Element chartPropertiesElement = document.createElement("chartpropertiesmap");
                    root.appendChild(chartPropertiesElement);
                    Set<String> chartKeySet = chartPropertiesMap.keySet();
                    String chartXml = null;
                    ChartProperties prop = null;
                    for (String key : chartKeySet) {
                        prop = chartPropertiesMap.get(key);
                        if (prop != null) {
                            Element itemElement = document.createElement("item");
                            itemElement.setAttribute("key", key);
View Full Code Here

    public static boolean updatePropertiesFromScanAddOn(IConfig<?> config) {
        boolean done = false;
        boolean xAsDate = false;
        if ((config != null) && (config.getScanAddOn() != null)
                && (config.getScanAddOn().getDisplay() != null)) {
            ChartProperties chartProperties = config.getChartProperties();
            if (chartProperties == null) {
                chartProperties = new ChartProperties();
            }
            else {
                chartProperties = chartProperties.clone();
            }
            List<DisplayAxis> axisList = config.getScanAddOn().getDisplay().getAxisList();
            List<IDevice> deviceList = new ArrayList<IDevice>();
            if (config.getSensorsList() != null) {
                deviceList.addAll(config.getSensorsList());
            }
            if ((config.getDimensionX() != null)
                    && (config.getDimensionX().getActuatorsList() != null)) {
                deviceList.addAll(config.getDimensionX().getActuatorsList());
            }
            if (config instanceof IConfig2D) {
                IConfig2D config2D = (IConfig2D) config;
                if ((config2D.getDimensionY() != null)
                        && (config2D.getDimensionX().getActuatorsList() != null)) {
                    deviceList.addAll(config2D.getDimensionY().getActuatorsList());
                }
            }
            List<String> displayableList = extractAvailableDeviceNames(true, deviceList);
            deviceList.clear();
            int size = Math.min(axisList.size(), displayableList.size());
            for (int i = 0; i < size; i++) {
                String viewId = displayableList.get(i);
                PlotProperties properties = config.getPlotProperties(viewId);
                if (properties == null) {
                    properties = new PlotProperties(CometeColorUtil.getNewColor());
                    properties.getCurve().setName(viewId);
                }
                else {
                    properties = properties.clone();
                }
                int axis = convertDisplayAxisToAxis(axisList.get(i));
                if (axis != -1) {
                    properties.setAxisChoice(axis);
                }
                if (axis == IChartViewer.X) {
                    if (TIME_STAMP_NAME.equals(viewId)) {
                        xAsDate = true;
                        chartProperties.getXAxisProperties().setLabelFormat(
                                IChartViewer.DATE_FORMAT);
                    }
                }
                config.setPlotProperties(viewId, properties);
            }
            if (xAsDate) {
                chartProperties.getXAxisProperties().setLabelFormat(IChartViewer.DATE_FORMAT);
            }
            else {
                chartProperties.getXAxisProperties().setLabelFormat(IChartViewer.AUTO_FORMAT);
            }
            config.setChartProperties(chartProperties);
            done = true;
        }
        return done;
View Full Code Here

        return baseBean.getChartProperties();
    }

    @Override
    public void setChartProperties(ChartProperties chartProperties) {
        ChartProperties oldValue = getChartProperties();
        baseBean.setChartProperties(chartProperties);
        firePropertyChange("chartProperties", oldValue, getChartProperties());
    }
View Full Code Here

     *
     * @param configId The configuration id
     * @return Some {@link ChartProperties}
     */
    private ChartProperties getChartPropertiesByIdAux(Integer configId) throws SQLException {
        ChartProperties result = null;
        if (configId != null) {
            String query = "SELECT data FROM chart_properties WHERE configid=" + configId;

            if (stmt != null) {
                ResultSet rs = stmt.executeQuery(query);
View Full Code Here

                if ((chartPropertiesMap != null) && !chartPropertiesMap.isEmpty()) {
                    Element chartPropertiesElement = document.createElement("chartpropertiesmap");
                    root.appendChild(chartPropertiesElement);
                    String chartXml = null;
                    String key = null;
                    ChartProperties prop = null;
                    for (Map.Entry<String, ChartProperties> entry : chartPropertiesMap.entrySet()) {
                        key = entry.getKey();
                        prop = entry.getValue();
                        if (prop != null) {
                            Element itemElement = document.createElement("item");
                            itemElement.setAttribute("key", key);
                            chartXml = ChartPropertiesXmlManager.toXmlString(prop);
                            itemElement.setTextContent(chartXml);
                            chartPropertiesElement.appendChild(itemElement);
                        }
                    }
                }

                Map<String, ScanProperties> scanPropertiesMap = UIPreferences.getInstance()
                .getCurrentScanPropertiesMap();
                if ((scanPropertiesMap != null) && !scanPropertiesMap.isEmpty()) {
                    Element scanConfigElement = document.createElement("scanconfiglist");
                    root.appendChild(scanConfigElement);
                    ScanProperties prop = null;
                    String key = null;
                    String chartXml = null;
                    for (Map.Entry<String, ScanProperties> entry : scanPropertiesMap.entrySet()) {
                        key = entry.getKey();
                        prop = entry.getValue();
                        if (prop != null) {
                            Element itemElement = document.createElement("item");
                            itemElement.setAttribute("key", key);

                            if (prop.getChartProperties() != null) {
                                Element chartElement = document.createElement("chart");
                                chartXml = ChartPropertiesXmlManager.toXmlString(prop.getChartProperties());
                                chartElement.setTextContent(chartXml);
                                itemElement.appendChild(chartElement);
                            }

                            Element y1Element = createAxisElement(document, prop.getY1AttributeList(), "y1List");
                            if (y1Element != null) {
                                itemElement.appendChild(y1Element);
                            }

                            Element y2Element = createAxisElement(document, prop.getY2AttributeList(), "y2List");
                            if (y2Element != null) {
                                itemElement.appendChild(y2Element);
                            }

                            Element zElement = createAxisElement(document, prop.getZAttributeList(), "zList");
                            if (zElement != null) {
                                itemElement.appendChild(zElement);
                            }

                            String xAttribute = prop.getXAttribute();
                            if ((xAttribute != null) && !xAttribute.isEmpty()) {
                                Element xElement = document.createElement("xAttribute");
                                xElement.setAttribute("name", xAttribute);
                                itemElement.appendChild(xElement);
                            }
View Full Code Here

                        }
                        bookmarks.appendChild(e);
                    }
                }

                ChartProperties chartProperties = UIPreferences.getChartProperties();
                if (chartProperties != null) {
                    Element chartPropertiesElement = document.createElement("chartproperties");
                    String chartXml = ChartPropertiesXmlManager.toXmlString(chartProperties);
                    // chartPropertiesElement.setNodeValue(chartXml);
                    chartPropertiesElement.setAttribute("value", chartXml);
                    root.appendChild(chartPropertiesElement);
                }

                Map<String, PlotProperties> plotPropertiesMap = UIPreferences.getPlotPropertiesMap();
                if (plotPropertiesMap != null && !plotPropertiesMap.isEmpty()) {
                    Element plotPropertiesElement = document.createElement("plotproperties");
                    root.appendChild(plotPropertiesElement);
                    Set<String> plotKeySet = plotPropertiesMap.keySet();
                    String plotXml = null;
                    for (String key : plotKeySet) {
                        Element itemElement = document.createElement("item");
                        itemElement.setAttribute("key", key);
                        plotXml = PlotPropertiesXmlManager.toXmlString(plotPropertiesMap.get(key));
                        itemElement.setTextContent(plotXml);
                        plotPropertiesElement.appendChild(itemElement);
                    }
                }

                Map<String, ImageProperties> imagePropertiesMap = UIPreferences.getImagePropertiesMap();
                if (imagePropertiesMap != null && !imagePropertiesMap.isEmpty()) {
                    Element imagePropertiesElement = document.createElement("imageproperties");
                    root.appendChild(imagePropertiesElement);
                    Set<String> imageKeySet = imagePropertiesMap.keySet();
                    String imageXml = null;
                    ImageProperties prop = null;
                    for (String key : imageKeySet) {
                        prop = imagePropertiesMap.get(key);
                        if (prop != null) {
                            Element itemElement = document.createElement("item");
                            itemElement.setAttribute("key", key);
                            imageXml = ImagePropertiesXmlManager.toXmlString(prop);
                            itemElement.setTextContent(imageXml);
                            imagePropertiesElement.appendChild(itemElement);
                        }
                    }
                }

                Map<String, ChartProperties> chartPropertiesMap = UIPreferences.getChartPropertiesMap();
                if (chartPropertiesMap != null && !chartPropertiesMap.isEmpty()) {
                    Element chartPropertiesElement = document.createElement("chartpropertiesmap");
                    root.appendChild(chartPropertiesElement);
                    Set<String> chartKeySet = chartPropertiesMap.keySet();
                    String chartXml = null;
                    ChartProperties prop = null;
                    for (String key : chartKeySet) {
                        prop = chartPropertiesMap.get(key);
                        if (prop != null) {
                            Element itemElement = document.createElement("item");
                            itemElement.setAttribute("key", key);
View Full Code Here

                        }
                        bookmarks.appendChild(e);
                    }
                }

                ChartProperties chartProperties = uiPreferences.getChartProperties();
                if (chartProperties != null) {
                    Element chartPropertiesElement = document.createElement("chartproperties");
                    String chartXml = ChartPropertiesXmlManager.toXmlString(chartProperties);
                    //chartPropertiesElement.setNodeValue(chartXml);
                    chartPropertiesElement.setAttribute("value", chartXml);
View Full Code Here

                        }
                        bookmarks.appendChild(e);
                    }
                }

                ChartProperties chartProperties = uiPreferences.getChartProperties();
                if (chartProperties != null) {
                    Element chartPropertiesElement = document.createElement("chartproperties");
                    String chartXml = ChartPropertiesXmlManager.toXmlString(chartProperties);
                    // chartPropertiesElement.setNodeValue(chartXml);
                    chartPropertiesElement.setAttribute("value", chartXml);
View Full Code Here

    public ConfigImpl() {
        super();
        modified = false;
        lastModificationDate = 0;
        plotPropertiesMap = new HashMap<String, PlotProperties>();
        chartProperties = new ChartProperties();
    }
View Full Code Here

TOP

Related Classes of fr.soleil.comete.definition.widget.properties.ChartProperties

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.