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/core/Entity.java

    r78 r84  
    11package com.framsticks.core;
    22
    3 import com.framsticks.util.*;
    4 import com.framsticks.util.Thread;
     3import com.framsticks.params.FramsClass;
     4import com.framsticks.util.dispatching.Thread;
     5import com.framsticks.util.dispatching.Dispatcher;
     6
     7import org.apache.commons.configuration.Configuration;
    58import org.apache.log4j.Logger;
    69
     
    811 * @author Piotr Sniegowski
    912 */
    10 public abstract class Entity extends Parameters implements Dispatcher {
     13public abstract class Entity implements Dispatcher {
    1114
    12     private final static Logger LOGGER = Logger.getLogger(Entity.class.getName());
     15        private final static Logger log = Logger.getLogger(Entity.class.getName());
    1316
    14     public Entity(Parameters parameters) {
    15         super(parameters);
    16         if (dispatcher == null) {
    17             dispatcher = new Thread(name);
    18         }
    19     }
     17        protected String name = "entity";
     18        protected EntityOwner owner;
     19        protected Dispatcher dispatcher;
    2020
    21     @Override
    22     public final boolean isActive() {
    23         return dispatcher.isActive();
    24     }
     21        public Entity() {
     22        }
    2523
    26     @Override
    27     public final void invokeLater(Runnable runnable) {
    28         dispatcher.invokeLater(runnable);
    29     }
     24        public final String getName() {
     25                return name;
     26        }
    3027
    31     protected void run() {
    32         assert isActive();
    33         LOGGER.info("running: " + this);
    34     }
     28        /**
     29         * @param name the name to set
     30         */
     31        public final void setName(String name) {
     32                this.name = name;
     33                if (dispatcher instanceof Thread) {
     34                        ((Thread) dispatcher).setName(name);
     35                }
     36        }
    3537
    36     public final void configurePublic() throws Exception {
    37         configure();
    38     }
     38        /**
     39         * @return the owner
     40         */
     41        public EntityOwner getOwner() {
     42                return owner;
     43        }
    3944
    40     protected void configure() throws Exception {
     45        /**
     46         * @param owner the owner to set
     47         */
     48        public void setOwner(EntityOwner owner) {
     49                this.owner = owner;
     50        }
    4151
    42     }
     52        @Override
     53        public final boolean isActive() {
     54                return dispatcher == null || dispatcher.isActive();
     55        }
    4356
    44     public Dispatcher getDispatcher() {
    45         return dispatcher;
    46     }
     57        @Override
     58        public final void invokeLater(Runnable runnable) {
     59                assert dispatcher != null;
     60                dispatcher.invokeLater(runnable);
     61        }
    4762
    48     public final void start() {
    49         invokeLater(new Runnable() {
    50             @Override
    51             public void run() {
    52                 Entity.this.run();
    53             }
    54         });
    55     }
     63        public Dispatcher createDefaultDispatcher() {
     64                return new Thread(name);
     65        }
     66
     67        protected void run() {
     68                assert isActive();
     69                log.info("running: " + this);
     70        }
     71
     72
     73        public void configure(Configuration config) {
     74        }
     75
     76        public Dispatcher getDispatcher() {
     77                return dispatcher;
     78        }
     79
     80        /**
     81         * @param dispatcher the dispatcher to set
     82         */
     83        public void setDispatcher(Dispatcher dispatcher) {
     84                this.dispatcher = dispatcher;
     85        }
     86
     87        public final void start() {
     88                if (dispatcher == null) {
     89                        log.debug("no dispatcher set for " + this + ", creating default one");
     90                        setDispatcher(createDefaultDispatcher());
     91                }
     92                invokeLater(new Runnable() {
     93                        @Override
     94                        public void run() {
     95                                Entity.this.run();
     96                        }
     97                });
     98        }
    5699
    57100        public final void done() {
    58                 LOGGER.info("stopping entity");
     101                log.info("stopping entity");
    59102                if (owner != null) {
    60103                        owner.onDone();
     
    62105        }
    63106
    64 
     107        public static void constructFramsClass(FramsClass.Constructor constructor) {
     108                constructor.method("getName");
     109        }
    65110}
Note: See TracChangeset for help on using the changeset viewer.