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/LocalInstance.java

    r78 r84  
    22
    33import com.framsticks.hosting.InstanceClient;
    4 import com.framsticks.params.AccessInterface;
    5 import com.framsticks.params.Param;
    6 import com.framsticks.util.*;
    7 import com.framsticks.util.Thread;
     4import com.framsticks.util.dispatching.Thread;
     5
     6import org.apache.commons.configuration.Configuration;
    87import org.apache.log4j.Logger;
    98
     
    2120public abstract class LocalInstance extends Instance {
    2221
    23     private static final Logger LOGGER = Logger.getLogger(LocalInstance.class.getName());
     22        private static final Logger log = Logger.getLogger(LocalInstance.class.getName());
    2423
    25     public LocalInstance(Parameters parameters) {
    26         super(parameters);
     24        public LocalInstance() {
    2725
    28         Integer accept = config.getInteger("accept", null);
    29         if (accept != null) {
    30             try {
    31                 acceptSocket = new ServerSocket();
    32                 acceptSocket.setReuseAddress(true);
    33                 acceptThread = new Thread(name + "-accept");
    34                 tryBind(accept);
    35             } catch (IOException e) {
    36                 LOGGER.fatal("failed to create accept socket: " + e);
    37             }
    38         }
    39     }
     26        }
    4027
    41     @Override
    42     protected void run() {
    43         super.run();
    44     }
     28        @Override
     29        public void configure(Configuration config) {
     30                Integer accept = config.getInteger("accept", null);
     31                if (accept != null) {
     32                        try {
     33                                acceptSocket = new ServerSocket();
     34                                acceptSocket.setReuseAddress(true);
     35                                acceptThread = new Thread(name + "-accept");
     36                                tryBind(accept);
     37                        } catch (IOException e) {
     38                                log.fatal("failed to create accept socket: " + e);
     39                        }
     40                }
     41        }
    4542
    46     @Override
    47     protected void configure() throws Exception {
    48         super.configure();
    49     }
     43        protected final Set<InstanceClient> clients = new HashSet<InstanceClient>();
     44        ServerSocket acceptSocket;
     45        Thread acceptThread;
    5046
    51     protected final Set<InstanceClient> clients = new HashSet<InstanceClient>();
    52     ServerSocket acceptSocket;
    53     Thread acceptThread;
     47        protected void acceptNext() {
     48                acceptThread.invokeLater(new Runnable() {
     49                        @Override
     50                        public void run() {
     51                                try {
     52                                        final Socket socket = acceptSocket.accept();
     53                                        assert socket != null;
     54                                        log.debug("accepted socket: " + socket.getInetAddress().getHostAddress());
     55                                        invokeLater(new Runnable() {
     56                                                @Override
     57                                                public void run() {
     58                                                        InstanceClient client = new InstanceClient(LocalInstance.this, socket);
     59                                                        clients.add(client);
     60                                                        log.info("client connected: " + client);
     61                                                }
     62                                        });
     63                                } catch (IOException e) {
     64                                        log.error("failed to accept socket: " + e);
     65                                }
     66                                acceptNext();
     67                        }
     68                });
     69        }
    5470
    55     protected void acceptNext() {
    56         acceptThread.invokeLater(new Runnable() {
    57             @Override
    58             public void run() {
    59                 try {
    60                     final Socket socket = acceptSocket.accept();
    61                     assert socket != null;
    62                     LOGGER.debug("accepted socket: " + socket.getInetAddress().getHostAddress());
    63                     invokeLater(new Runnable() {
    64                         @Override
    65                         public void run() {
    66                             InstanceClient client = new InstanceClient(LocalInstance.this, socket);
    67                             clients.add(client);
    68                             LOGGER.info("client connected: " + client);
    69                         }
    70                     });
    71                 } catch (IOException e) {
    72                     LOGGER.error("failed to accept socket: " + e);
    73                 }
    74                 acceptNext();
    75             }
    76         });
    77     }
    78 
    79     public void tryBind(final Integer accept) {
    80         acceptThread.invokeLater(new Runnable() {
    81             @Override
    82             public void run() {
    83                 try {
    84                     acceptSocket.bind(new InetSocketAddress(accept));
    85                     LOGGER.debug("started accepting on port " + accept);
    86                     acceptNext();
    87                 } catch (IOException e) {
    88                     LOGGER.fatal("failed to accept on port " + accept + ": " + e);
    89                 }
    90                 try {
    91                     java.lang.Thread.sleep(1000);
    92                 } catch (InterruptedException ignored) {
    93                 }
    94                 tryBind(accept);
    95             }
    96         });
    97     }
     71        public void tryBind(final Integer accept) {
     72                acceptThread.invokeLater(new Runnable() {
     73                        @Override
     74                        public void run() {
     75                                try {
     76                                        acceptSocket.bind(new InetSocketAddress(accept));
     77                                        log.debug("started accepting on port " + accept);
     78                                        acceptNext();
     79                                } catch (IOException e) {
     80                                        log.fatal("failed to accept on port " + accept + ": " + e);
     81                                }
     82                                try {
     83                                        java.lang.Thread.sleep(1000);
     84                                } catch (InterruptedException ignored) {
     85                                }
     86                                tryBind(accept);
     87                        }
     88                });
     89        }
    9890
    9991}
Note: See TracChangeset for help on using the changeset viewer.