Package fr.soleil.comete.widget.properties

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


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


    /**
     * 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

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

    /**
     * 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

        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

    private ChartProperties chartProperties;
    private final Map<String, PlotProperties> plotPropertiesMap;

    public DrawableConfig1DImpl() {
        super();
        chartProperties = new ChartProperties();
        plotPropertiesMap = new HashMap<String, PlotProperties>();
    }
View Full Code Here

    /**
     * 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

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

    /**
     * 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

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.