Package fr.soleil.comete.widget.properties

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


    public static boolean updatePropertiesFromScanAddOn(ISpectrumConfig<?> 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.getNextColor());
                    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


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

        ResultSet rs = stmt.executeQuery(query);

        while (rs.next()) {
View Full Code Here

            public void configurationChanged(String id) {
                if (listener == null) {
                    return;
                }

                ChartProperties newProperties = chartViewer.getChartProperties();
                listener.chartPropertiesChange(newProperties);
            }
        });
    }
View Full Code Here

            public void configurationChanged(String id) {
                if (listener == null) {
                    return;
                }

                ChartProperties newProperties = chartViewer.getChartProperties();
                listener.chartPropertiesChange(newProperties);
            }

            @Override
            public void selectedIndexChanged(int index) {
View Full Code Here

            public void configurationChanged(String id) {
                if (listener == null) {
                    return;
                }

                ChartProperties newProperties = chartViewer.getChartProperties();
                listener.chartPropertiesChange(newProperties);
            }

            @Override
            public void selectedIndexChanged(int index) {
View Full Code Here

            public void configurationChanged(String id) {
                if (listener == null) {
                    return;
                }

                ChartProperties newProperties = chartViewer.getChartProperties();
                listener.chartPropertiesChange(newProperties);
            }

            @Override
            public void selectedIndexChanged(int index) {
View Full Code Here

            public void configurationChanged(String id) {
                if (listener == null) {
                    return;
                }

                ChartProperties newProperties = chartViewer.getChartProperties();
                listener.chartPropertiesChange(newProperties);
            }

            @Override
            public void selectedIndexChanged(int index) {
View Full Code Here

TOP

Related Classes of fr.soleil.comete.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.