Package simtools.ui

Examples of simtools.ui.UserProperties$Info


        public void getProperties(){
            nbColumns = ((Integer)nbColInput.getValue()).intValue();
            nbRows = ((Integer)nbRowInput.getValue()).intValue();
           
            // save properties
            UserProperties prop = Run.getProperties();
            if (prop!=null){
                prop.setInt("jsynoptic.base.GridShapesTemplate.nbColumns", nbColumns);
                prop.setInt("jsynoptic.base.GridShapesTemplate.nbRows", nbRows);
            }
        }
View Full Code Here


        DataSourcePool.global.addProvider(new DataSourceAnimatorProvider());
        DataSourcePool.global.addProvider(new RangeSourceProvider());
        DataSourcePool.global.addProvider(new RandomSourceProvider());
        DataSourcePool.global.addProvider(new AsciiProvider());
     
        UserProperties prop = Run.getProperties();
        jsynoptic.builtin.TextShape.groupTextDigits = prop.getBoolean("jsynoptic.builtin.Text.groupTextDigits",
                jsynoptic.builtin.TextShape.groupTextDigits);
        String imageDefaultDirectoryName = prop.getString("jsynoptic.builtin.ui.ImagePropertiesPanel.defaultDirectory",
                null);
        if (imageDefaultDirectoryName != null) {
            jsynoptic.builtin.ui.ImagePropertiesPanel.defaultDirectory = new File(imageDefaultDirectoryName);
            simtools.ui.ImageMapper.defaultDirectory = new File(imageDefaultDirectoryName);
        }
        /**
         * take property PreferredXGraduation and PreferredYGraduation for plot
         */
        jsynoptic.builtin.Plot.preferredXGraduation = prop.getInt("jsynoptic.builtin.Plot.preferredXGraduation",
                jsynoptic.builtin.Plot.preferredXGraduation);
        jsynoptic.builtin.Plot.preferredYGraduation = prop.getInt("jsynoptic.builtin.Plot.preferredYGraduation",
                jsynoptic.builtin.Plot.preferredYGraduation);
        /**
         * the type of the line in the grid false : simple lines for the grid
         * true : dashed lines for the grid
         */
        simtools.shapes.AxisShape.preferredDashedGrid = prop.getBoolean(
                "simtools.shapes.AxisShape.preferredDashedGrid", simtools.shapes.AxisShape.preferredDashedGrid);
        /**
         * Indicate the presence of grids for the initialization
         */
        simtools.shapes.AxisShape.preferredShowGrid = prop.getBoolean("simtools.shapes.AxisShape.preferredShowGrid",
                simtools.shapes.AxisShape.preferredShowGrid);
        hasAlreadyPutProviders = true;
        /**
         * Update several reading date formats
         */
        String readTimeZone = prop.getString("simtools.data.readTimeZone", null);
        if (readTimeZone == null) {
            prop.setString("simtools.data.readTimeZone", "GMT");
            readTimeZone = prop.getString("simtools.data.readTimeZone", null);
        }
       
        TextShape.dateFormatPattern =  prop.getString("simtools.data.dateFormat", TextShape.dateFormatPattern);
        TextShape.shortTimeFormatPattern =  prop.getString("simtools.data.shortTimeFormat", TextShape.shortTimeFormatPattern);
        TextShape.longTimeFormatPattern =  prop.getString("simtools.data.longTimeFormat", TextShape.longTimeFormatPattern);

        if (prop.getString("simtools.data.longTimeFormat", null) != null){
            TimeStampedDataSourceInformation.dateTimeFormatter =  new SimpleDateFormat(prop.getString("simtools.data.longTimeFormat", null));
        }
       
        String pattern;
        String newPattern;
        pattern = AsciiFileDataSourceCollection.dateFormat.toPattern();
        newPattern = prop.getString("simtools.data.dateFormat", null);
        if (newPattern == null) {
            // set property to default value
            prop.setString("simtools.data.dateFormat", pattern);
        } else {
            // apply property value
            AsciiFileDataSourceCollection.dateFormat = new SimpleDateFormat(newPattern);
        }
        pattern = AsciiFileDataSourceCollection.shortTimeFormat.toPattern();
        newPattern = prop.getString("simtools.data.shortTimeFormat", null);
        if (newPattern == null) {
            // set property to default value
            prop.setString("simtools.data.shortTimeFormat", pattern);
        } else {
            // apply property value
            AsciiFileDataSourceCollection.shortTimeFormat = new SimpleDateFormat(newPattern);
        }
        pattern = AsciiFileDataSourceCollection.longTimeFormat.toPattern();
        newPattern = prop.getString("simtools.data.longTimeFormat", null);
        if (newPattern == null) {
            // set property to default value
            prop.setString("simtools.data.longTimeFormat", pattern);
        } else {
            // apply property value
            AsciiFileDataSourceCollection.longTimeFormat = new SimpleDateFormat(newPattern);
        }
        AsciiFileDataSourceCollection.dateFormat.setTimeZone(TimeZone.getTimeZone(readTimeZone));
        AsciiFileDataSourceCollection.shortTimeFormat.setTimeZone(TimeZone.getTimeZone(readTimeZone));
        AsciiFileDataSourceCollection.longTimeFormat.setTimeZone(TimeZone.getTimeZone(readTimeZone));
        /**
         * Update several wrinting date formats
         *
         */
        String displayTimeZone = prop.getString("simtools.ui.displayTimeZone", null);
        if (displayTimeZone == null) {
            prop.setString("simtools.ui.displayTimeZone", "GMT");
            displayTimeZone = prop.getString("simtools.ui.displayTimeZone", null);
        }
        TimeCurveStatisticPanel.dateTimeFormatter.setTimeZone(TimeZone.getTimeZone(displayTimeZone));
        TimePlotStatisticsDialog.dateTimeFormatter.setTimeZone(TimeZone.getTimeZone(displayTimeZone));
        TimeStampedDataSourceInformation.dateTimeFormatter.setTimeZone(TimeZone.getTimeZone(displayTimeZone));
        TextShape.timeZone = displayTimeZone;
        // Text properties
        TextShape.DEFAULT_FIXED_FONT = prop.getBoolean("jsynoptic.builtin.TextShape.fixedFont",
                TextShape.DEFAULT_FIXED_FONT);
        TextShape.DEFAULT_FIXED_FRAME = prop.getBoolean("jsynoptic.builtin.TextShape.fixedFrame",
                TextShape.DEFAULT_FIXED_FRAME);
        TextShape.DEFAUT_CHAR_NUMBER = prop.getInt("jsynoptic.builtin.TextShape.charNumber",
                TextShape.DEFAUT_CHAR_NUMBER);
        TextShape.DEFAULT_TEXT_SIZE = prop.getInt("jsynoptic.builtin.TextShape.textSize", TextShape.DEFAULT_TEXT_SIZE);
        TextShape.DEFAULT_TEXT_FONT = prop.getString("jsynoptic.builtin.TextShape.textFont",
                TextShape.DEFAULT_TEXT_FONT);
        TextShape.DEFAULT_FORMAT = prop.getInt("jsynoptic.builtin.TextShape.format", TextShape.DEFAULT_FORMAT);
        TextShape.DEFAULT_DISPLAY_NAME = prop.getBoolean("jsynoptic.builtin.TextShape.displayName",
                TextShape.DEFAULT_DISPLAY_NAME);
        TextShape.DEFAULT_DISPLAY_VALUE = prop.getBoolean("jsynoptic.builtin.TextShape.displayValue",
                TextShape.DEFAULT_DISPLAY_VALUE);
        TextShape.DEFAULT_DISPLAY_UNIT = prop.getBoolean("jsynoptic.builtin.TextShape.displayUnit",
                TextShape.DEFAULT_DISPLAY_UNIT);
        TextShape.DEFAULT_DISPLAY_COMMENTS = prop.getBoolean("jsynoptic.builtin.TextShape.displayComments",
                TextShape.DEFAULT_DISPLAY_COMMENTS);
               
        // Plot properties
        Plot.DEFAULT_DISPLAY_DATA_SOURCE_ID = prop.getBoolean("jsynoptic.builtin.Plot.displayDataSourceId",
                Plot.DEFAULT_DISPLAY_DATA_SOURCE_ID);
       
        // Curve statistic properties
        CurveShape.SHOW_X_MIN = prop.getBoolean("simtools.shapes.CurveShape.showXMin", CurveShape.SHOW_X_MIN);
        CurveShape.SHOW_X_MAX = prop.getBoolean("simtools.shapes.CurveShape.showXMax", CurveShape.SHOW_X_MAX);
        CurveShape.SHOW_Y_MIN = prop.getBoolean("simtools.shapes.CurveShape.showYMin", CurveShape.SHOW_Y_MIN);
        CurveShape.SHOW_Y_MAX = prop.getBoolean("simtools.shapes.CurveShape.showYMax", CurveShape.SHOW_Y_MAX);
        CurveShape.SHOW_POINT_NUMBER = prop.getBoolean("simtools.shapes.CurveShape.showPointNumber", CurveShape.SHOW_POINT_NUMBER);
        CurveShape.SHOW_MEAN = prop.getBoolean("simtools.shapes.CurveShape.showMean", CurveShape.SHOW_MEAN);
        CurveShape.SHOW_DEVIATION = prop.getBoolean("simtools.shapes.CurveShape.ShowDeviation", CurveShape.SHOW_DEVIATION);
        CurveShape.SHOW_INTEGRAL = prop.getBoolean("simtools.shapes.CurveShape.showIntegral", CurveShape.SHOW_INTEGRAL);
        CurveShape.STATISTIC_ACCURACY = prop.getInt("simtools.shapes.CurveShape.statisticAccuracy", CurveShape.STATISTIC_ACCURACY);
    }             
View Full Code Here

TOP

Related Classes of simtools.ui.UserProperties$Info

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.