Ignore:
Timestamp:
06/22/13 21:51:33 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • simplification of entities management model
  • cleanup around params (improve hierarchy)
  • migrate from JUnit to TestNG
  • introduce FEST to automatically test GUI
  • improve slider control
  • loosen synchronization between gui tree and backend representation
  • and many other bug fixes

NOTICE:

  • a great many of lines is changed only because of substituting spaces with tabs

CHANGELOG (oldest changes at the bottom):

Some cleaning after fix found.

Fix bug with tree.

More changes with TreeNodes?.

Finally fix issue with tree.

Improve gui tree management.

Decouple update of values from fetch request in gui.

Minor changes.

Minor changes.

Minor change.

Change Path construction wording.

More fixes to SliderControl?.

Fix SliderControl?.

Fix SliderControl?.

Minor improvement.

Several changes.

Make NumberParam? a generic class.

Add robot to the gui test.

Setup common testing logging configuration.

Remove Parameters class.

Remove entityOwner from Parameters.

Move name out from Parameters class.

Move configuration to after the construction.

Simplify observers and endpoints.

Remove superfluous configureEntity overrides.

Add dependency on fest-swing-testng.

Use FEST for final print test.

Use FEST for more concise and readable assertions.

Divide test of F0Parser into multiple methods.

Migrate to TestNG

Minor change.

Change convention from LOGGER to log.

Fix reporting of errors during controls filling.

Bound maximal height of SliderControl?.

Minor improvements.

Improve tooltips for controls.

Also use Delimeted in more places.

Move static control utilities to Gui.

Rename package gui.components to controls.

Some cleaning in controls.

Improve Param classes placing.

Move ValueParam?, PrimitiveParam? and CompositeParam? one package up.

Improve ParamBuilder?.

Move getDef to ValueParam? and PrimitiveParam?.

Move getMax and getDef to ValueParam?.

Move getMin to ValueParam?.

Upgrade to laters apache commons versions.

Use filterInstanceof extensively.

Add instanceof filters.

Make ValueParam? in many places of Param.

Place assertions about ValueParam?.

Add ValueParam?

Rename ValueParam? to PrimitiveParam?

Minor changes.

Several improvements to params types.

Add NumberParam?.

Add TextControl? component.

Add .swp files to .gitignore

Greatly improved slider component.

Some improvements.

Make Param.reassign return also a state.

Add IterableIterator?.

Several changes.

  • Move util classes to better packages.
  • Remove warnings from eclim.

Several improvements.

Fix bug with BooleanParam?.

Some experiments with visualization.

Another fix to panel management.

Improve panel management.

Some refactorization around panels.

Add root class for panel.

Location:
java/main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • java/main

    • Property svn:ignore set to
      target
  • java/main/src/main/java/com/framsticks/parsers/Schema.java

    r78 r84  
    11package com.framsticks.parsers;
    22
    3 import java.io.File;
    4 import java.io.FileInputStream;
    53import java.io.IOException;
    64import java.io.InputStream;
     
    86import java.util.HashMap;
    97import java.util.Map;
    10 import java.util.Map.Entry;
    118
    129import com.framsticks.params.*;
    13 import com.framsticks.params.types.DecimalParam;
    14 import com.framsticks.params.types.FloatParam;
    15 import com.framsticks.params.types.StringParam;
     10import com.framsticks.util.lang.Numbers;
    1611import org.apache.log4j.Logger;
    1712
     
    224219        }
    225220
     221        private static <T extends Number> T extractAttribute(NamedNodeMap attributes, String name, Class<T> type) {
     222                String value = getAttribute(attributes, name);
     223                if (value == null) {
     224                        return null;
     225                }
     226                return Numbers.parse(value, type);
     227        }
    226228        /**
    227229         * It analyses the single property within the class
     
    265267                }
    266268
    267                 Map<String, String> minMaxDef = new HashMap<String, String>();
    268 
    269                 for (String key : new String[] { "MIN", "MAX", "DEF" }) {
    270                         String value = getAttribute(attributes, key);
    271                         if (value != null && !value.trim().equals(""))
    272                                 minMaxDef.put(key, value);
    273                 }
    274 
    275269                ParamBuilder builder = new ParamBuilder();
    276270                builder.setId(id).setName(name).setHelp(description).setGroup(group).setFlags(flags);
    277271
     272                builder.setType(type);
     273
    278274                if ("d".equals(type)) {
    279 
    280                         Map<String, Integer> minMaxDefInt = new HashMap<String, Integer>();
    281                         for (Entry<String, String> entry : minMaxDef.entrySet()) {
    282                                 try {
    283                                         minMaxDefInt.put(entry.getKey(),
    284                                                         Integer.parseInt(entry.getValue()));
    285                                 } catch (NumberFormatException e) {
    286                                         logger.warn(entry.getKey() + " attribute in property \""
    287                                                         + id + "\" getId in class \"" + classId
    288                                                         + "\" should be an integer value");
    289                                 }
    290                         }
    291 
    292                         builder.setType(DecimalParam.class);
    293                         builder.setMin(minMaxDefInt.get("MIN"));
    294                         builder.setMax(minMaxDefInt.get("MAX"));
    295                         builder.setDef(minMaxDefInt.get("DEF"));
    296 
     275                        builder.setMin(extractAttribute(attributes, "MIN", Integer.class));
     276                        builder.setMax(extractAttribute(attributes, "MAX", Integer.class));
     277                        builder.setDef(extractAttribute(attributes, "DEF", Integer.class));
    297278                } else if ("f".equals(type)) {
    298 
    299                         Map<String, Double> minMaxDefDouble = new HashMap<String, Double>();
    300                         for (Entry<String, String> entry : minMaxDef.entrySet()) {
    301                                 try {
    302                                         minMaxDefDouble.put(entry.getKey(),
    303                                                         Double.parseDouble(entry.getValue()));
    304                                 } catch (NumberFormatException e) {
    305                                         logger.warn(entry.getKey() + " attribute in property \""
    306                                                         + id + "\" getId in class \"" + classId
    307                                                         + "\" should be a double value");
    308                                 }
    309                         }
    310                         builder.setType(FloatParam.class);
    311                         builder.setMin(minMaxDefDouble.get("MIN"));
    312                         builder.setMax(minMaxDefDouble.get("MAX"));
    313                         builder.setDef(minMaxDefDouble.get("DEF"));
    314 
    315 
     279                        builder.setMin(extractAttribute(attributes, "MIN", Double.class));
     280                        builder.setMax(extractAttribute(attributes, "MAX", Double.class));
     281                        builder.setDef(extractAttribute(attributes, "DEF", Double.class));
    316282                } else if ("s".equals(type)) {
    317                         builder.setType(StringParam.class);
    318                         builder.setDef(minMaxDef.get("DEF"));
     283                        builder.setMin(extractAttribute(attributes, "MIN", Integer.class));
     284                        builder.setMax(extractAttribute(attributes, "MAX", Integer.class));
     285                        builder.setDef(extractAttribute(attributes, "DEF", Integer.class));
     286                        builder.setDef(getAttribute(attributes, "DEF"));
    319287                } else {
    320288                        builder.setType(type);
Note: See TracChangeset for help on using the changeset viewer.