Examples of ModelPreferences


Examples of fr.soleil.salsa.client.view.util.ModelPreferences

        if (ModelPreferences.getInstance().getHashMap() == null
                || ModelPreferences.getInstance().getHashMap().isEmpty()) {
            return;
        }
        IChartViewer c = view.getComponent(ModelPreferences.getInstance());
        ModelPreferences prefs = ModelPreferences.getInstance();

        int loadedPreferences;
        if ("y1".equals(yKey)) {
            loadedPreferences = loadedY1Preferences;
        }
View Full Code Here

Examples of fr.soleil.salsa.client.view.util.ModelPreferences

    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);
View Full Code Here

Examples of fr.soleil.salsa.client.view.util.ModelPreferences

    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);
View Full Code Here

Examples of fr.soleil.salsa.client.view.util.ModelPreferences

        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.salsa.client.view.util.ModelPreferences

     */
    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,
View Full Code Here

Examples of fr.soleil.salsa.client.view.util.ModelPreferences

     * Saves the chart properties in the map
     */
    public void save() {

        ChartProperties chartProperties = view.getChartProperties();
        ModelPreferences modelPreferences = ModelPreferences.getInstance();

        if (chartProperties.isLegendsAreVisible()) {
            modelPreferences.setBoolean("viewer.general.legendsAreVisible", "true");
        }
        else {
            modelPreferences.setBoolean("viewer.general.legendsAreVisible", "false");
        }

        if (chartProperties.isAutoHighlightOnLegend()) {
            modelPreferences.setBoolean("viewer.general.autoHighlightOnLegend", "true");
        }
        else {
            modelPreferences.setBoolean("viewer.general.autoHighlightOnLegend", "false");
        }

        modelPreferences.setInteger("viewer.general.legendsPlacement", chartProperties
                .getLegendsPlacement());
        modelPreferences.setInteger("viewer.general.red", chartProperties.getBackgroundColor()
                .getRed());
        modelPreferences.setInteger("viewer.general.green", chartProperties.getBackgroundColor()
                .getGreen());
        modelPreferences.setInteger("viewer.general.blue", chartProperties.getBackgroundColor()
                .getBlue());
        modelPreferences.setInteger("viewer.general.alpha", chartProperties.getBackgroundColor()
                .getAlpha());
        modelPreferences.setString("viewer.general.headerFont.name", chartProperties
                .getHeaderFont().getName());
        modelPreferences.setInteger("viewer.general.headerFont.size", chartProperties
                .getHeaderFont().getSize());
        modelPreferences.setInteger("viewer.general.headerFont.style", chartProperties
                .getHeaderFont().getStyle());
        modelPreferences.setString("viewer.general.labelFont.name", chartProperties.getLabelFont()
                .getName());
        modelPreferences.setInteger("viewer.general.labelFont.size", chartProperties.getLabelFont()
                .getSize());
        modelPreferences.setInteger("viewer.general.labelFont.style", chartProperties
                .getLabelFont().getStyle());
        modelPreferences.setString("viewer.general.title", chartProperties.getTitle());
        modelPreferences.setDouble("viewer.general.displayDuration", chartProperties
                .getDisplayDuration());
        /*
        There is no function to get/set the general grid and the style of the line
        */

        modelPreferences.setDouble("viewer.xaxis.scaleMin", chartProperties.getXAxisProperties()
                .getScaleMin());
        modelPreferences.setDouble("viewer.xaxis.scaleMax", chartProperties.getXAxisProperties()
                .getScaleMax());
        modelPreferences.setInteger("viewer.xaxis.scaleMode", chartProperties.getXAxisProperties()
                .getScaleMode());

        if (chartProperties.getXAxisProperties().isAutoScale()) {
            modelPreferences.setBoolean("viewer.xaxis.autoScale", "true");
        }
        else {
            modelPreferences.setBoolean("viewer.xaxis.autoScale", "false");
        }

        if (chartProperties.getXAxisProperties().isSubGridVisible()) {
            modelPreferences.setBoolean("viewer.xaxis.subGridVisible", "true");
        }
        else {
            modelPreferences.setBoolean("viewer.xaxis.subGridVisible", "false");
        }

        if (chartProperties.getXAxisProperties().isDrawOpposite()) {
            modelPreferences.setBoolean("viewer.xaxis.drawOpposite", "true");
        }
        else {
            modelPreferences.setBoolean("viewer.xaxis.drawOpposite", "false");
        }

        if (chartProperties.getXAxisProperties().isVisible()) {
            modelPreferences.setBoolean("viewer.xaxis.visible", "true");
        }
        else {
            modelPreferences.setBoolean("viewer.xaxis.visible", "false");
        }

        modelPreferences.setInteger("viewer.xaxis.labelFormat", chartProperties
                .getXAxisProperties().getLabelFormat());
        modelPreferences.setString("viewer.xaxis.title", chartProperties.getXAxisProperties()
                .getTitle());
        modelPreferences.setInteger("viewer.xaxis.red", chartProperties.getXAxisProperties()
                .getColor().getRed());
        modelPreferences.setInteger("viewer.xaxis.green", chartProperties.getXAxisProperties()
                .getColor().getGreen());
        modelPreferences.setInteger("viewer.xaxis.blue", chartProperties.getXAxisProperties()
                .getColor().getBlue());
        modelPreferences.setInteger("viewer.xaxis.alpha", chartProperties.getXAxisProperties()
                .getColor().getAlpha());
        modelPreferences.setInteger("viewer.xaxis.position", chartProperties.getXAxisProperties()
                .getPosition());

        if (chartProperties.getY1AxisProperties().isAutoScale()) {
            modelPreferences.setBoolean("viewer.y1axis.autoScale", "true");
        }
        else {
            modelPreferences.setBoolean("viewer.y1axis.autoScale", "false");
        }

        if (chartProperties.getY1AxisProperties().isSubGridVisible()) {
            modelPreferences.setBoolean("viewer.y1axis.subGridVisible", "true");
        }
        else {
            modelPreferences.setBoolean("viewer.y1axis.subGridVisible", "false");
        }

        if (chartProperties.getY1AxisProperties().isDrawOpposite()) {
            modelPreferences.setBoolean("viewer.y1axis.drawOpposite", "true");
        }
        else {
            modelPreferences.setBoolean("viewer.y1axis.drawOpposite", "false");
        }

        if (chartProperties.getY1AxisProperties().isVisible()) {
            modelPreferences.setBoolean("viewer.y1axis.visible", "true");
        }
        else {
            modelPreferences.setBoolean("viewer.y1axis.visible", "false");
        }

        modelPreferences.setDouble("viewer.y1axis.scaleMin", chartProperties.getY1AxisProperties()
                .getScaleMin());
        modelPreferences.setDouble("viewer.y1axis.scaleMax", chartProperties.getY1AxisProperties()
                .getScaleMax());
        modelPreferences.setInteger("viewer.y1axis.scaleMode", chartProperties
                .getY1AxisProperties().getScaleMode());
        modelPreferences.setInteger("viewer.y1axis.labelFormat", chartProperties
                .getY1AxisProperties().getLabelFormat());
        modelPreferences.setString("viewer.y1axis.title", chartProperties.getY1AxisProperties()
                .getTitle());
        modelPreferences.setInteger("viewer.y1axis.red", chartProperties.getY1AxisProperties()
                .getColor().getRed());
        modelPreferences.setInteger("viewer.y1axis.green", chartProperties.getY1AxisProperties()
                .getColor().getGreen());
        modelPreferences.setInteger("viewer.y1axis.blue", chartProperties.getY1AxisProperties()
                .getColor().getBlue());
        modelPreferences.setInteger("viewer.y1axis.alpha", chartProperties.getY1AxisProperties()
                .getColor().getAlpha());
        modelPreferences.setInteger("viewer.y1axis.position", chartProperties.getY1AxisProperties()
                .getPosition());

        if (chartProperties.getY2AxisProperties().isAutoScale()) {
            modelPreferences.setBoolean("viewer.y2axis.autoScale", "true");
        }
        else {
            modelPreferences.setBoolean("viewer.y2axis.autoScale", "false");
        }

        if (chartProperties.getY2AxisProperties().isSubGridVisible()) {
            modelPreferences.setBoolean("viewer.y2axis.subGridVisible", "true");
        }
        else {
            modelPreferences.setBoolean("viewer.y2axis.subGridVisible", "false");
        }

        if (chartProperties.getY2AxisProperties().isDrawOpposite()) {
            modelPreferences.setBoolean("viewer.y2axis.drawOpposite", "true");
        }
        else {
            modelPreferences.setBoolean("viewer.y2axis.drawOpposite", "false");
        }

        if (chartProperties.getY2AxisProperties().isVisible()) {
            modelPreferences.setBoolean("viewer.y2axis.visible", "true");
        }
        else {
            modelPreferences.setBoolean("viewer.y2axis.visible", "false");
        }

        modelPreferences.setDouble("viewer.y2axis.scaleMin", chartProperties.getY2AxisProperties()
                .getScaleMin());
        modelPreferences.setDouble("viewer.y2axis.scaleMax", chartProperties.getY2AxisProperties()
                .getScaleMax());
        modelPreferences.setInteger("viewer.y2axis.scaleMode", chartProperties
                .getY2AxisProperties().getScaleMode());
        modelPreferences.setInteger("viewer.y2axis.labelFormat", chartProperties
                .getY2AxisProperties().getLabelFormat());
        modelPreferences.setString("viewer.y2axis.title", chartProperties.getY2AxisProperties()
                .getTitle());
        modelPreferences.setInteger("viewer.y2axis.red", chartProperties.getY2AxisProperties()
                .getColor().getRed());
        modelPreferences.setInteger("viewer.y2axis.green", chartProperties.getY2AxisProperties()
                .getColor().getGreen());
        modelPreferences.setInteger("viewer.y2axis.blue", chartProperties.getY2AxisProperties()
                .getColor().getBlue());
        modelPreferences.setInteger("viewer.y2axis.alpha", chartProperties.getY2AxisProperties()
                .getColor().getAlpha());
        modelPreferences.setInteger("viewer.y2axis.position", chartProperties.getY2AxisProperties()
                .getPosition());
    }
View Full Code Here

Examples of fr.soleil.salsa.client.view.util.ModelPreferences

            this.perspectivesManager.getMenuBarViewTool().getMenuPerspective().getItem(
                    this.perspectivesManager.getMenuBarViewTool().getMenuPerspective()
                            .getItemCount() - 4).setSelected(true);

            perspectivesManager.setCurrentPerspective(newPerspective);
            ModelPreferences mp = ModelPreferences.getInstance();
            mp.setLastPerspectiveName(newPerspective.getName());
        }
    }
View Full Code Here

Examples of fr.soleil.salsa.client.view.util.ModelPreferences

        try {
            Perspective newCurrentPerspective = perspectivesManager
                    .getPerspectiveByName(((javax.swing.JRadioButtonMenuItem) source).getText());
            setWindowLayout(newCurrentPerspective.getWindowLayout());
            this.perspectivesManager.setCurrentPerspective(newCurrentPerspective);
            ModelPreferences mp = ModelPreferences.getInstance();
            mp.setLastPerspectiveName(newCurrentPerspective.getName());
        }
        catch (IOException e) {
            e.printStackTrace();
        }
    }
View Full Code Here

Examples of fr.soleil.salsa.client.view.util.ModelPreferences

        try {
            Perspective newCurrentPerspective = perspectivesManager
                    .getPerspectiveByName(perspectiveName);
            setWindowLayout(newCurrentPerspective.getWindowLayout());
            this.perspectivesManager.setCurrentPerspective(newCurrentPerspective);
            ModelPreferences mp = ModelPreferences.getInstance();
            mp.setLastPerspectiveName(newCurrentPerspective.getName());
        }
        catch (IOException e) {
            e.printStackTrace();
        }
    }
View Full Code Here

Examples of fr.soleil.salsa.client.view.util.ModelPreferences

            this.perspectivesManager.getMenuBarViewTool().getMenuPerspective().getItem(
                    this.perspectivesManager.getMenuBarViewTool().getMenuPerspective()
                            .getItemCount() - 4).setSelected(true);

            perspectivesManager.setCurrentPerspective(newPerspective);
            ModelPreferences mp = ModelPreferences.getInstance();
            mp.setLastPerspectiveName(newPerspective.getName());
        }
    }
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.