Ignore:
Timestamp:
07/14/13 23:20:04 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • improve tree side notes
  • improve GUI layout
  • add foldable list of occured events to EventControl?
  • improve automatic type conversion in proxy listeners
  • implement several Access functionalities as algorithms independent of Access type
  • introduce draft base classes for distributed experiments
  • automatically register dependant Java classes to FramsClass? registry
  • add testing prime experiment and configuration
  • simplify and improve task dispatching

CHANGELOG:
Improve task dispatching in RemoteTree?.

GUI no longer hangs on connection problems.

Make all dispatchers joinables.

Refactorize Thread dispatcher.

Remove Task and PeriodicTask?.

Use Java utilities in those situations.

Reworking tasks dispatching.

Fix bug in EventControl? listener dispatching.

Minor improvements.

Add testing configuration for ExternalProcess? in GUI.

More improvement to prime.

Support for USERREADONLY in GUI.

Add that flag to various params in Java classes.

Remove redundant register clauses from several FramsClassAnnotations?.

Automatically gather and register dependant classes.

Add configuration for prime.

Improve Simulator class.

Add prime.xml configuration.

Introduce draft Experiment and Simulator classes.

Add prime experiment tests.

Enclose typical map with listeners into SimpleUniqueList?.

Needfile works in GUI.

Improve needfile handling in Browser.

More improvement with NeedFile?.

Implementing needfile.

Update test.

Rename ChangeEvent? to TestChangeEvent?.

Automatic argument type search in RemoteTree? listeners.

MultiParamLoader? uses AccessProvider?. By default old implementation
enclosed in AccessStash? or Registry.

Minor changes.

Rename SourceInterface? to Source.

Also improve toString of File and ListSource?.

Remove unused SimpleSource? class.

Add clearing in HistoryControl?.

Show entries in table at EventControl?.

Improve EventControl?.

Add listeners registration to EventControl?.

Add foldable table to HistoryControl?.

Add control row to Procedure and Event controls.

Improve layout of controls.

Another minor change to gui layout.

Minor improvement in the SliderControl?.

Minor changes.

Move ReflectionAccess?.Backend to separate file.

It was to cluttered.

Cleanup in ReflectionAccess?.

Move setMin, setMax, setDef to AccessOperations?.

Extract loading operation into AccessOperations?.

Append Framsticks to name of UnsupportedOperationException?.

The java.lang.UnsupportedOperationException? was shadowing this class.

Rename params.Util to params.ParamsUtil?.

Several improvements.

Minor changes.

Implement revert functionality.

Improve local changes management.

Minor improvement.

Remove methods rendered superfluous after SideNoteKey? improvement.

Improve SideNoteKey?.

It is now generic type, so explicit type specification at
call site is no more needed.

Introduce SideNoteKey? interface.

Only Objects implementing that key may be used as side note keys.

Minor improvements.

Use strings instead of ValueControls? in several gui mappings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/remote/RemoteTree.java

    r100 r101  
    77import com.framsticks.communication.queries.SetRequest;
    88import com.framsticks.core.AbstractTree;
     9import com.framsticks.core.ListChange;
    910import com.framsticks.core.Path;
     11import com.framsticks.core.ValueChange;
    1012import com.framsticks.params.*;
    1113import com.framsticks.params.EventListener;
    12 import com.framsticks.params.annotations.AutoAppendAnnotation;
    1314import com.framsticks.params.annotations.FramsClassAnnotation;
    1415import com.framsticks.params.annotations.ParamAnnotation;
     
    1718import com.framsticks.parsers.Loaders;
    1819import com.framsticks.parsers.MultiParamLoader;
    19 import com.framsticks.core.Tree;
    2020import com.framsticks.util.*;
    2121import com.framsticks.util.dispatching.AtOnceDispatcher;
    2222import com.framsticks.util.dispatching.Dispatching;
    23 import com.framsticks.util.dispatching.Dispatching.DispatcherWaiter;
    2423import com.framsticks.util.dispatching.DispatchingFuture;
    2524import com.framsticks.util.dispatching.ExceptionResultHandler;
     
    5251
    5352        public RemoteTree() {
     53                bufferedDispatcher.setBuffer(true);
     54                registry.registerAndBuild(ListChange.class);
     55                registry.registerAndBuild(ValueChange.class);
    5456        }
    5557
    5658        @ParamAnnotation
    5759        public void setAddress(String address) {
    58                 setConnection(Connection.to(new ClientSideManagedConnection(), new Address(address)));
    59         }
    60 
    61         @ParamAnnotation
     60                this.connection = Connection.to(new ClientSideManagedConnection(), new Address(address));
     61                this.connection.setExceptionHandler(this);
     62                this.connection.setNeedFileAcceptor(this);
     63        }
     64
     65        @ParamAnnotation(flags = ParamFlags.USERREADONLY)
    6266        public String getAddress() {
    6367                return connection == null ? "<disconnected>" : connection.getAddress().toString();
    64         }
    65 
    66         @AutoAppendAnnotation
    67         public void setConnection(final ClientSideManagedConnection connection) {
    68                 this.connection = connection;
    69                 this.connection.setExceptionHandler(this);
    7068        }
    7169
     
    219217                super.joinableStart();
    220218
    221                 dispatch(new RunAt<RemoteTree>(ThrowExceptionHandler.getInstance()) {
     219                bufferedDispatcher.getTargetDispatcher().dispatch(new RunAt<RemoteTree>(ThrowExceptionHandler.getInstance()) {
    222220                        @Override
    223221                        protected void runAt() {
    224                                 final DispatcherWaiter<Tree, Tree> waiter = new DispatcherWaiter<Tree, Tree>(RemoteTree.this);
    225 
    226                                 connection.send(new InfoRequest().path("/"), waiter, new ClientSideResponseFuture(this) {
     222
     223                                connection.send(new InfoRequest().path("/"), bufferedDispatcher.getTargetDispatcher(), new ClientSideResponseFuture(this) {
    227224                                        @Override
    228225                                        protected void processOk(Response response) {
    229226                                                FramsClass framsClass = processFetchedInfo(RemoteTree.this, response.getFiles().get(0));
    230227                                                assignRootParam(Param.build().name("Tree").id(RemoteTree.this.getName()).type("o " + framsClass.getId()).finish(CompositeParam.class));
     228                                                bufferedDispatcher.setBuffer(false);
    231229                                        }
    232230                                });
    233231
    234                                 waiter.waitFor();
    235232                        }
    236233                });
     
    295292                                        protected void runAt() {
    296293                                                assert isActive();
    297                                                 if (argumentType.equals(Object.class)) {
     294                                                if (argumentType.equals(File.class)) {
    298295                                                        listener.action(Casting.tryCast(argumentType, file));
    299296                                                        return;
    300297                                                }
    301                                                 Access access = registry.createAccess(argumentType);
    302                                                 Object argument = access.createAccessee();
    303                                                 access.select(argument);
    304                                                 if (!argumentType.isInstance(argument)) {
    305                                                         throw new FramsticksException().msg("created argument is of wrond type").arg("expected", argumentType).arg("created", argument.getClass());
    306                                                 }
    307                                                 A typedArgument = argumentType.cast(argument);
     298                                                // Access access = registry.createAccess(argumentType);
    308299
    309300                                                // log.info("executing event with argument {}", argumentType);
     
    311302                                                loader.setNewSource(file.getContent());
    312303                                                loader.addBreakCondition(MultiParamLoader.Status.AfterObject);
    313                                                 loader.addAccess(access);
     304                                                loader.setAccessProvider(registry);
     305                                                // loader.addAccess(access);
    314306                                                loader.go();
    315 
    316                                                 listener.action(typedArgument);
     307                                                Object argument = loader.getLastAccess().getSelected();
     308                                                // Object argument = access.getSelected();
     309                                                if (argument == null) {
     310                                                        listener.action(null);
     311                                                }
     312                                                if (!argumentType.isInstance(argument)) {
     313                                                        throw new FramsticksException().msg("created argument is of wrong type").arg("expected", argumentType).arg("created", argument.getClass());
     314                                                }
     315                                                listener.action(argumentType.cast(argument));
    317316                                        }
    318317                                });
Note: See TracChangeset for help on using the changeset viewer.