Examples of IChartViewer


Examples of fr.soleil.comete.definition.widget.IChartViewer

        return panel;
    }

    private static IChartViewer createChartViewer() {

        IChartViewer viewer = new ChartViewer();

        ChartViewerBox chartBox = new ChartViewerBox();

        TangoKey key = new TangoKey();
        TangoKeyTool.registerAttribute(key, "tango/tangotest/titan", "double_spectrum_ro");
View Full Code Here

Examples of fr.soleil.comete.definition.widget.IChartViewer

    public static void main(String[] args) {

        IFrame frame = new Frame();
        DataSourceProducerProvider.pushNewProducer(TangoRefreshingManager.class);

        IChartViewer chart = createChartViewer();

        final JPanel f = initPanel(chart);
        f.setSize(300, 300);
        f.setPreferredSize(f.getSize());
        f.setEnabled(true);
View Full Code Here

Examples of fr.soleil.comete.definition.widget.IChartViewer

        return panel;
    }

    private static IChartViewer createChartViewer() {

        IChartViewer viewer = new Chart();

        ChartViewerBox chartBox = new ChartViewerBox();

        TangoKey key = new TangoKey();
        TangoKeyTool.registerAttribute(key, "tango/tangotest/titan", "double_spectrum_ro");
View Full Code Here

Examples of fr.soleil.comete.definition.widget.IChartViewer

    // }

    public static void main(String[] args) {
        IFrame frame = new Frame();

        IChartViewer chart = createChartViewer();

        final JPanel f = initPanel(chart);
        f.setSize(300, 300);
        f.setPreferredSize(f.getSize());
        f.setEnabled(true);
View Full Code Here

Examples of fr.soleil.comete.definition.widget.IChartViewer

    }

    public static void main(String[] args) {
        IFrame frame = new Frame();

        IChartViewer chart = createChartViewer();

        final JPanel f = initPanel(chart);
        f.setSize(300, 300);
        f.setPreferredSize(f.getSize());
        f.setEnabled(true);
View Full Code Here

Examples of fr.soleil.comete.widget.IChartViewer

    public void loadDefaultDataViewY2(String yKey, List<String> yList) {
        if (ModelPreferences.getInstance().getHashMap().isEmpty()) {
            return;
        }
        IChartViewer c = view.getComponent(ModelPreferences.getInstance());
        ModelPreferences prefs = ModelPreferences.getInstance();

        if (yList != null) {

            for (int i = 0; i < yList.size(); i++) {
                String device = yList.get(i);
                String kPrefix = "view.dataview." + yKey + "." + i;

                try {

                    c.setDataViewLineWidth(device, 1);
                    c.setDataViewLineStyle(device, 0);

                    String keyDisplayName = kPrefix + ".displayName";
                    c.setDataViewDisplayName(device, prefs.getString(keyDisplayName));

                    c.setDataViewFillStyle(device, 0);
                    c.setDataViewCometeColor(device, getColor(prefs, kPrefix));
                    c.setDataViewCometeFillColor(device, getColor(prefs, kPrefix + ".fill"));
                    c.setDataViewBarWidth(device, 1);
                    c.setDataViewFillMethod(device, 2);
                    c.setDataViewTransformA0(device, 0.0);
                    c.setDataViewTransformA1(device, 1.0);
                    c.setDataViewTransformA2(device, 0.0);

                    MarkerProperties markerProperties = new MarkerProperties();

                    markerProperties.setLegendVisible(true);
                    c.setDataViewMarkerProperties(device, markerProperties);
                    c.setDataViewMarkerSize(device, 5);
                    c.setDataViewMarkerStyle(device, 0);
                    c.setDataViewMarkerCometeColor(device, getColor(prefs, kPrefix + ".marker"));
                    c.setDataViewSmoothingExtrapolation(device, 0);
                    c.setDataViewSmoothingGaussSigma(device, 0.5);
                    c.setDataViewSmoothingMethod(device, 0);
                    c.setDataViewSmoothingNeighbors(device, 3);
                    c.setDataViewInterpolationMethod(device, 0);
                    c.setDataViewInterpolationStep(device, 10);
                    c.setDataViewHermiteBias(device, 0.0);
                    c.setDataViewHermiteTension(device, 0.0);
                    c.setDataViewMathFunction(device, 0);

                }
                catch (Exception e) {
                    System.out.println("Erreur chargement : ");
                    e.printStackTrace();
View Full Code Here

Examples of fr.soleil.comete.widget.IChartViewer

        List<String> y2List = view.getY2();
        saveDataViewY("y2", y2List);
    }

    public void saveDataViewY(String yKey, List<String> yList) {
        IChartViewer component = view.getComponent(ModelPreferences.getInstance());
        ModelPreferences prefs = ModelPreferences.getInstance();
        if (yList != null) {

            for (int i = 0; i < yList.size(); i++) {
                String device = yList.get(i);
                String keyPrefix = "view.dataview." + yKey + "." + i;

                String keyLineWidth = keyPrefix + ".lineWidth";
                prefs.setInteger(keyLineWidth, component.getDataViewLineWidth(device));

                String keyLineStyle = keyPrefix + ".lineStyle";
                prefs.setInteger(keyLineStyle, component.getDataViewLineStyle(device));

                CometeColor curveColor = component.getDataViewCurveProperties(device).getColor();

                String greenKeyLineColor = keyPrefix + ".green";
                String redKeyLineColor = keyPrefix + ".red";
                String blueKeyLineColor = keyPrefix + ".blue";
                String alphaKeyLineColor = keyPrefix + ".alpha";

                if (curveColor != null) {
                    prefs.setInteger(greenKeyLineColor, curveColor.getGreen());
                    prefs.setInteger(redKeyLineColor, curveColor.getRed());
                    prefs.setInteger(blueKeyLineColor, curveColor.getBlue());
                    prefs.setInteger(alphaKeyLineColor, curveColor.getAlpha());
                }

                String keyFillStyle = keyPrefix + ".fillStyle";
                prefs.setInteger(keyFillStyle, component.getDataViewFillStyle(device));

                // The method getDataViewViewType() for Curve properties tab is missing

                // The method getDataViewCometeFillColor() is not working

                CometeColor curveFillColor = component.getDataViewCometeFillColor(device);

                String greenFillColor = keyPrefix + ".fill.green";
                String redFillColor = keyPrefix + ".fill.red";
                String blueFillColor = keyPrefix + ".fill.blue";
                String alphaFillColor = keyPrefix + ".fill.alpha";

                if (curveFillColor != null) {
                    prefs.setInteger(greenFillColor, curveFillColor.getGreen());
                    prefs.setInteger(redFillColor, curveFillColor.getRed());
                    prefs.setInteger(blueFillColor, curveFillColor.getBlue());
                    prefs.setInteger(alphaFillColor, curveFillColor.getAlpha());
                }

                String keyBarWidth = keyPrefix + ".barWidth";
                prefs.setInteger(keyBarWidth, component.getDataViewBarWidth(device));

                String keyFillMethod = keyPrefix + ".barFillMethod";
                prefs.setInteger(keyFillMethod, component.getDataViewFillMethod(device));

                // The methods getDataViewTransformA0(), getDataViewTransformA1(),
                // getDataViewTransformA2() are not working

                String keyTransformA0 = keyPrefix + ".transformA0";
                prefs.setDouble(keyTransformA0, component.getDataViewTransformA0(device));

                String keyTransformA1 = keyPrefix + ".transformA1";
                prefs.setDouble(keyTransformA1, component.getDataViewTransformA1(device));

                String keyTransformA2 = keyPrefix + ".transformA2";
                prefs.setDouble(keyTransformA2, component.getDataViewTransformA2(device));

                String keyMarkerVisible = keyPrefix + ".markerVisible";

                if (component.getDataViewMarkerProperties(device).isLegendVisible()) {
                    prefs.setBoolean(keyMarkerVisible, "true");
                }
                else {
                    prefs.setBoolean(keyMarkerVisible, "false");
                }

                String keyMarkerSize = keyPrefix + ".markerSize";
                prefs.setInteger(keyMarkerSize, component.getDataViewMarkerSize(device));

                String keyMarkerStyle = keyPrefix + ".markerStyle";
                prefs.setInteger(keyMarkerStyle, component.getDataViewMarkerStyle(device));

                CometeColor markerColor = component.getDataViewMarkerProperties(device).getColor();

                if (markerColor != null) {
                    String redMarkerCometeColor = keyPrefix + ".marker.red";
                    String greenMarkerCometeColor = keyPrefix + ".marker.green";
                    String blueMarkerCometeColor = keyPrefix + ".marker.blue";
                    String alphaMarkerCometeColor = keyPrefix + ".marker.alpha";

                    prefs.setInteger(redMarkerCometeColor, markerColor.getRed());
                    prefs.setInteger(greenMarkerCometeColor, markerColor.getGreen());
                    prefs.setInteger(blueMarkerCometeColor, markerColor.getBlue());
                    prefs.setInteger(alphaMarkerCometeColor, markerColor.getAlpha());
                }

                String smoothingExtrapolation = keyPrefix + ".smoothingExtrapolation";
                prefs.setInteger(smoothingExtrapolation, component
                        .getDataViewSmoothingExtrapolation(device));

                String smoothingGaussSigma = keyPrefix + ".smoothingGaussSigma";
                // The method getDataViewSmoothingGaussSigma() is not working
                prefs.setDouble(smoothingGaussSigma, component
                        .getDataViewSmoothingGaussSigma(device));

                String smoothingMethod = keyPrefix + ".smoothingMethod";
                prefs.setInteger(smoothingMethod, component.getDataViewSmoothingMethod(device));

                String smoothingNeighbors = keyPrefix + ".smoothingNeighbors";
                prefs.setInteger(smoothingNeighbors, component
                        .getDataViewSmoothingNeighbors(device));

                String interpolationMethod = keyPrefix + ".interpolationMethod";
                prefs.setInteger(interpolationMethod, component
                        .getDataViewInterpolationMethod(device));

                String interpolationStep = keyPrefix + ".interpolationStep";
                prefs.setInteger(interpolationStep, component.getDataViewInterpolationStep(device));

                String hermiteBias = keyPrefix + ".hermiteBias";
                // The method getDataViewHermiteBias() is not working
                prefs.setDouble(hermiteBias, component.getDataViewHermiteBias(device));

                String hermiteTension = keyPrefix + ".hermiteTension";
                // The method getDataViewHermiteTension() is not working
                prefs.setDouble(hermiteTension, component.getDataViewHermiteTension(device));

                String mathFunction = keyPrefix + ".mathFunction";
                prefs.setInteger(mathFunction, component.getDataViewMathFunction(device));
            }
        }
    }
View Full Code Here

Examples of fr.soleil.comete.widget.IChartViewer

     * Loads the chart properties
     */
    public void load() {
        try {
            if (!ModelPreferences.getInstance().getHashMap().isEmpty()) {
                IChartViewer component = view.getComponent(ModelPreferences.getInstance());
                ModelPreferences modelPreferences = ModelPreferences.getInstance();
                ChartProperties chartProperties = component.getChartProperties();

                chartProperties.setLegendsAreVisible(getBoolean(modelPreferences,
                        "viewer.general.legendsAreVisible", true));
                chartProperties.setAutoHighlightOnLegend(getBoolean(modelPreferences,
                        "viewer.general.autoHighlightOnLegend", false));
                chartProperties.setLegendsPlacement(getInteger(modelPreferences,
                        "viewer.general.legendsPlacement", 4));

                String generalPrefix = "viewer.general";
                chartProperties
                        .setBackgroundColor(getColorGeneral(modelPreferences, generalPrefix));

                chartProperties.setHeaderFont(getFont(modelPreferences, generalPrefix
                        + ".headerFont"));
                chartProperties
                        .setLabelFont(getFont(modelPreferences, generalPrefix + ".labelFont"));
                chartProperties.setTitle(getString(modelPreferences, "viewer.general.title", ""));

                chartProperties.setDisplayDuration(getDouble(modelPreferences,
                        "viewer.general.displayDuration", 100.0));

                AxisProperties xAxisProperties = chartProperties.getXAxisProperties();

                xAxisProperties.setScaleMin(getFloat(modelPreferences, "viewer.xaxis.scaleMin",
                        (float) 0.0));
                xAxisProperties.setScaleMax(getFloat(modelPreferences, "viewer.xaxis.scaleMax",
                        (float) 100.0));
                xAxisProperties.setScaleMode(getInteger(modelPreferences, "viewer.xaxis.scaleMode",
                        0));

                xAxisProperties.setAutoScale(getBoolean(modelPreferences, "viewer.xaxis.autoScale",
                        true));

                xAxisProperties.setLabelFormat(getInteger(modelPreferences,
                        "viewer.xaxis.labelFormat", 0));

                xAxisProperties.setTitle(getString(modelPreferences, "viewer.xaxis.title", ""));

                String xaxisPrefix = "viewer.xaxis";
                xAxisProperties.setColor(getColorAxis(modelPreferences, xaxisPrefix));

                xAxisProperties
                        .setPosition(getInteger(modelPreferences, "viewer.xaxis.position", 1));

                xAxisProperties.setSubGridVisible(getBoolean(modelPreferences,
                        "viewer.xaxis.subGridVisible", false));

                xAxisProperties.setDrawOpposite(getBoolean(modelPreferences,
                        "viewer.xaxis.drawOpposite", true));
                xAxisProperties.setVisible(getBoolean(modelPreferences, "viewer.xaxis.visible",
                        true));

                AxisProperties y1AxisProperties = chartProperties.getY1AxisProperties();
                y1AxisProperties.setScaleMin(getFloat(modelPreferences, "viewer.y1axis.scaleMin",
                        (float) 0.0));

                y1AxisProperties.setScaleMax(getFloat(modelPreferences, "viewer.y1axis.scaleMin",
                        (float) 100.0));

                y1AxisProperties.setScaleMode(getInteger(modelPreferences,
                        "viewer.y1axis.scaleMode", 0));

                y1AxisProperties.setAutoScale(getBoolean(modelPreferences,
                        "viewer.y1axis.autoScale", true));

                y1AxisProperties.setLabelFormat(getInteger(modelPreferences,
                        "viewer.y1axis.labelFormat", 0));
                y1AxisProperties.setTitle(getString(modelPreferences, "viewer.y1axis.title", ""));

                String y1axisPrefix = "viewer.y1axis";
                y1AxisProperties.setColor(getColorAxis(modelPreferences, y1axisPrefix));

                y1AxisProperties.setPosition(getInteger(modelPreferences, "viewer.y1axis.position",
                        6));

                y1AxisProperties.setSubGridVisible(getBoolean(modelPreferences,
                        "viewer.y1axis.subGridVisible", false));

                y1AxisProperties.setDrawOpposite(getBoolean(modelPreferences,
                        "viewer.y1axis.drawOpposite", true));

                y1AxisProperties.setVisible(getBoolean(modelPreferences, "viewer.y1axis.visible",
                        true));

                AxisProperties y2AxisProperties = chartProperties.getY2AxisProperties();

                y2AxisProperties.setScaleMin(getFloat(modelPreferences, "viewer.y2axis.scaleMin",
                        (float) 0.0));

                y2AxisProperties.setScaleMax(getFloat(modelPreferences, "viewer.y2axis.scaleMax",
                        (float) 100.0));

                y2AxisProperties.setScaleMode(getInteger(modelPreferences,
                        "viewer.y2axis.scaleMode", 0));

                y2AxisProperties.setAutoScale(getBoolean(modelPreferences,
                        "viewer.y2axis.autoScale", true));

                y2AxisProperties.setLabelFormat(getInteger(modelPreferences,
                        "viewer.y2axis.labelFormat", 0));

                y2AxisProperties.setTitle(getString(modelPreferences, "viewer.y2axis.title", ""));

                String y2axisPrefix = "viewer.y2axis";
                y2AxisProperties.setColor(getColorAxis(modelPreferences, y2axisPrefix));

                y2AxisProperties.setPosition(getInteger(modelPreferences, "viewer.y2axis.position",
                        5));

                y2AxisProperties.setSubGridVisible(getBoolean(modelPreferences,
                        "viewer.y2axis.subGridVisible", false));

                y2AxisProperties.setDrawOpposite(getBoolean(modelPreferences,
                        "viewer.y2axis.drawOpposite", true));

                y2AxisProperties.setVisible(getBoolean(modelPreferences, "viewer.y2axis.visible",
                        true));

                chartProperties.setXAxisProperties(xAxisProperties);
                chartProperties.setY1AxisProperties(y1AxisProperties);
                chartProperties.setY2AxisProperties(y2AxisProperties);

                component.setChartProperties(chartProperties);
            }
        }
        catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

Examples of fr.soleil.comete.widget.IChartViewer

        }
    }

    public void notifyScanRunning(boolean running) {
        this.scanRunning = running;
        IChartViewer c = view.getComponent(ModelPreferences.getInstance());
        if (c != null) {
            c.setDataSendingEnabled(!running);
        }
    }
View Full Code Here

Examples of fr.soleil.comete.widget.IChartViewer

    public void loadDefaultDataViewY1(String yKey, List<String> yList) {
        if (ModelPreferences.getInstance().getHashMap().isEmpty()) {
            return;
        }
        IChartViewer c = view.getComponent(ModelPreferences.getInstance());
        ModelPreferences prefs = ModelPreferences.getInstance();

        if (yList != null) {

            for (int i = 0; i < yList.size(); i++) {
                String device = yList.get(i);
                String kPrefix = "view.dataview." + yKey + "." + i;

                try {

                    c.setDataViewLineWidth(device, 1);
                    c.setDataViewLineStyle(device, 0);
                    c.setDataViewFillStyle(device, 0);
                    c.setDataViewCometeColor(device, getColor(prefs, kPrefix));
                    c.setDataViewCometeFillColor(device, getColor(prefs, kPrefix + ".fill"));
                    c.setDataViewBarWidth(device, 1);
                    c.setDataViewFillMethod(device, 2);
                    c.setDataViewTransformA0(device, 0.0);
                    c.setDataViewTransformA1(device, 1.0);
                    c.setDataViewTransformA2(device, 0.0);

                    MarkerProperties markerProperties = new MarkerProperties();

                    markerProperties.setLegendVisible(true);
                    c.setDataViewMarkerProperties(device, markerProperties);
                    c.setDataViewMarkerSize(device, 5);
                    c.setDataViewMarkerStyle(device, 0);
                    c.setDataViewMarkerCometeColor(device, getColor(prefs, kPrefix + ".marker"));
                    c.setDataViewSmoothingExtrapolation(device, 0);
                    c.setDataViewSmoothingGaussSigma(device, 0.5);
                    c.setDataViewSmoothingMethod(device, 0);
                    c.setDataViewSmoothingNeighbors(device, 3);
                    c.setDataViewInterpolationMethod(device, 0);
                    c.setDataViewInterpolationStep(device, 10);
                    c.setDataViewHermiteBias(device, 0.0);
                    c.setDataViewHermiteTension(device, 0.0);
                    c.setDataViewMathFunction(device, 0);

                }
                catch (Exception e) {
                    System.out.println("Erreur chargement : ");
                    e.printStackTrace();
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.