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/hosting/ServerInstance.java

    r78 r84  
    22
    33import com.framsticks.core.*;
     4import com.framsticks.params.CompositeParam;
    45import com.framsticks.params.FramsClass;
    56import com.framsticks.params.ParamBuilder;
    6 import com.framsticks.params.types.CompositeParam;
    77import com.framsticks.core.LocalInstance;
    8 import com.framsticks.util.Future;
     8import com.framsticks.util.dispatching.Future;
     9
     10import org.apache.commons.configuration.Configuration;
    911import org.apache.log4j.Logger;
    1012
     
    1416public class ServerInstance extends LocalInstance {
    1517
    16     private final static Logger LOGGER = Logger.getLogger(ServerInstance.class.getName());
     18        private final static Logger log = Logger.getLogger(ServerInstance.class.getName());
    1719
    18     Entity hosted;
     20        Entity hosted;
    1921
    20     public ServerInstance(Parameters parameters) {
    21         super(parameters);
    22     }
     22        public ServerInstance() {
     23        }
    2324
    24     @Override
    25     protected void run() {
    26         super.run();
    27         assert hosted != null;
    28         hosted.start();
    29     }
     25        @Override
     26        protected void run() {
     27                super.run();
     28                assert hosted != null;
     29                hosted.start();
     30        }
    3031
    31     @Override
    32     protected void configure() throws Exception {
    33         super.configure();
     32        @Override
     33        public void configure(Configuration config) {
     34                super.configure(config);
    3435
    35         Parameters p = new Parameters(config.subset("hosted.entity"), "hosted", this, null);
    36         hosted = Program.configureEntity(p);
    37         if (hosted == null) {
    38             LOGGER.fatal("failed to create hosted entity");
    39             return;
    40         }
    41         hosted.configurePublic();
    42         root = new Node((CompositeParam)new ParamBuilder().setName("root").setId("root").setType("o" + hosted.getClass().getCanonicalName()).build(), hosted);
    43     }
     36                Configuration hostedConfig = config.subset("hosted.entity");
     37                hosted = Program.configureEntity(hostedConfig);
     38                if (hosted == null) {
     39                        log.fatal("failed to create hosted entity");
     40                        return;
     41                }
     42                hosted.setName("hosted");
     43                hosted.configure(hostedConfig);
     44                root = new Node((CompositeParam)new ParamBuilder().setName("root").setId("root").setType("o" + hosted.getClass().getCanonicalName()).build(), hosted);
     45        }
    4446
    45     @Override
    46     public FramsClass getInfoFromCache(String id) {
    47         assert isActive();
    48         if (id == null) {
    49             return null;
    50         }
     47        @Override
     48        public FramsClass getInfoFromCache(String id) {
     49                assert isActive();
     50                if (id == null) {
     51                        return null;
     52                }
    5153                FramsClass cached = registry.getInfoFromCache(id);
    52         if (cached != null) {
     54                if (cached != null) {
    5355                        return cached;
    54         }
    55         try {
    56             Class nativeClass = Class.forName(id);
    57             FramsClass framsClass = new FramsClass.Constructor(nativeClass, id).getResult();
     56                }
     57                try {
     58                        Class<?> nativeClass = Class.forName(id);
     59                        FramsClass framsClass = new FramsClass.Constructor(nativeClass, id).getResult();
    5860
    59             registry.registerReflectedClass(null, id, nativeClass);
    60             registry.putInfoIntoCache(framsClass);
    61             return framsClass;
    62         } catch (ClassNotFoundException ignored) {
    63         }
     61                        registry.registerReflectedClass(null, id, nativeClass);
     62                        registry.putInfoIntoCache(framsClass);
     63                        return framsClass;
     64                } catch (ClassNotFoundException ignored) {
     65                }
    6466
    65         return null;
    66     }
     67                return null;
     68        }
    6769
    68     @Override
    69     protected void fetchInfo(Path path, Future<FramsClass> future) {
    70         assert isActive();
     70        @Override
     71        protected void fetchInfo(Path path, Future<FramsClass> future) {
     72                assert isActive();
    7173
    72         FramsClass framsClass = getInfoFromCache(path.getTop().getObject().getClass().getCanonicalName());
    73         if (framsClass == null) {
    74             LOGGER.error("failed to create frams class for: " + path.getTop().getObject().getClass());
    75             future.result(null, new Exception());
    76             return;
    77         }
    78         future.result(framsClass, null);
     74                FramsClass framsClass = getInfoFromCache(path.getTop().getObject().getClass().getCanonicalName());
     75                if (framsClass == null) {
     76                        log.error("failed to create frams class for: " + path.getTop().getObject().getClass());
     77                        future.result(null, new Exception());
     78                        return;
     79                }
     80                future.result(framsClass, null);
    7981
    80     }
     82        }
    8183
    82     @Override
    83     protected void tryRegisterOnChangeEvents(Path path) {
    84     }
     84        @Override
     85        protected void tryRegisterOnChangeEvents(Path path) {
     86        }
    8587
    8688}
Note: See TracChangeset for help on using the changeset viewer.