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/dumping/LoadStream.java

    r77 r84  
    66import com.framsticks.core.Instance;
    77import com.framsticks.util.*;
     8import com.framsticks.util.dispatching.Future;
     9import com.framsticks.util.lang.Pair;
     10import com.framsticks.util.lang.Strings;
    811import org.apache.log4j.Logger;
    912
     
    1821public class LoadStream {
    1922
    20     private final static Logger LOGGER = Logger.getLogger(LoadStream.class.getName());
     23        private final static Logger log = Logger.getLogger(LoadStream.class.getName());
    2124
    22     protected final Instance instance;
    23     protected final Path mountPath;
    24     protected final BufferedReader stream;
    25     protected final Future<Path> future;
    26     protected final Stopwatch stopwatch = new Stopwatch();
     25        protected final Instance instance;
     26        protected final Path mountPath;
     27        protected final BufferedReader stream;
     28        protected final Future<Path> future;
     29        protected final Stopwatch stopwatch = new Stopwatch();
    2730
    2831
    29     public LoadStream(Path mountPath, BufferedReader stream, Instance instance, Future<Path> future) {
    30         this.instance = instance;
    31         this.mountPath = mountPath;
    32         this.stream = stream;
    33         this.future = future;
    34     }
     32        public LoadStream(Path mountPath, BufferedReader stream, Instance instance, Future<Path> future) {
     33                this.instance = instance;
     34                this.mountPath = mountPath;
     35                this.stream = stream;
     36                this.future = future;
     37        }
    3538
    36     public void load() {
    37         try {
    38             String line;
    39             Pair<String, String> query = null;
    40             List<File> files = null;
    41             List<String> content = null;
    42             //File file;
    43             while ((line = stream.readLine()) != null) {
    44                 if (query == null) {
    45                     query = Strings.splitIntoPair(line, ' ', "\n");
    46                     files = new LinkedList<File>();
    47                     LOGGER.trace("loading " + line);
    48                     continue;
    49                 }
    50                 if (content == null) {
    51                     if (line.equals("file")) {
    52                         content = new LinkedList<String>();
    53                         continue;
    54                     }
    55                     if (line.equals("ok")) {
    56                         if (query.first.equals("get")) {
    57                             Path path = instance.createIfNeeded(query.second);
    58                             instance.processFetchedValues(path, files);
    59                         } else if (query.first.equals("info")) {
    60                             assert files.size() == 1;
    61                             instance.processFetchedInfo(files.get(0));
    62                         } else {
    63                             assert false;
    64                         }
    65                         query = null;
    66                         files = null;
    67                         continue;
    68                     }
    69                     assert false;
    70                     continue;
    71                 }
    72                 if (line.equals("eof")) {
    73                     files.add(new File(query.second, new ListSource(content)));
    74                     content = null;
    75                     continue;
    76                 }
    77                 content.add(line);
    78             }
    79         } catch (IOException e) {
    80             LOGGER.error("failed to load: " + e);
    81             future.result(null, e);
    82             return;
    83         }
    84         LOGGER.info("loaded in: " + stopwatch);
    85         future.result(new Path(instance, mountPath.getTextual()), null);
    86     }
     39        public void load() {
     40                try {
     41                        String line;
     42                        Pair<String, String> query = null;
     43                        List<File> files = null;
     44                        List<String> content = null;
     45                        //File file;
     46                        while ((line = stream.readLine()) != null) {
     47                                if (query == null) {
     48                                        query = Strings.splitIntoPair(line, ' ', "\n");
     49                                        files = new LinkedList<File>();
     50                                        log.trace("loading " + line);
     51                                        continue;
     52                                }
     53                                if (content == null) {
     54                                        if (line.equals("file")) {
     55                                                content = new LinkedList<String>();
     56                                                continue;
     57                                        }
     58                                        if (line.equals("ok")) {
     59                                                if (query.first.equals("get")) {
     60                                                        Path path = instance.createIfNeeded(query.second);
     61                                                        instance.processFetchedValues(path, files);
     62                                                } else if (query.first.equals("info")) {
     63                                                        assert files.size() == 1;
     64                                                        instance.processFetchedInfo(files.get(0));
     65                                                } else {
     66                                                        assert false;
     67                                                }
     68                                                query = null;
     69                                                files = null;
     70                                                continue;
     71                                        }
     72                                        assert false;
     73                                        continue;
     74                                }
     75                                if (line.equals("eof")) {
     76                                        files.add(new File(query.second, new ListSource(content)));
     77                                        content = null;
     78                                        continue;
     79                                }
     80                                content.add(line);
     81                        }
     82                } catch (IOException e) {
     83                        log.error("failed to load: " + e);
     84                        future.result(null, e);
     85                        return;
     86                }
     87                log.info("loaded in: " + stopwatch);
     88                future.result(instance.getPath(mountPath.getTextual()), null);
     89        }
    8790
    8891
Note: See TracChangeset for help on using the changeset viewer.