Ignore:
Timestamp:
07/18/13 23:52:25 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • add auto loading and saving algorithms between

frams files format and Java classes

  • respect ValueChange? events in GUI (do not reload object)
  • support results of procedures in Java server
  • make Experiment automatically convert between frams file and NetFile? object
  • add MessageLogger? (compatible with original frams server messages)
  • WorkPackageLogic? now validates results, is able to discard them, reschedule

whole package, or only uncomputed remainder

CHANGELOG:
Show just a short description in PrimeExperiment?.

Add primes_changed event to the PrimeExperiment?.

Make WorkPackageLogic? robust to frams server returning invalid results.

Add MessageLogger? to logics.

Add NetFile? interface. Support Messages from server.

Minor changes to connections.

Merge results in the PrimeExperiment?.

More netload class->file conversion to Simulator.

Move netsave parsing to Simulator.

Fix bug with inverted ordering of events firing in Experiment.

Minor changes.

Minor logging changes.

Use AccessOperations?.convert in NetLoadSaveLogic?

NetLoadSaveLogic? now encloses the conversion.

Use more generic AccessOperations? saveAll and loadAll in PrimePackage?.

Add Result class for enclosing of call invocations' results.

Improve feature request handling in Connections.

Use AccessOperations?.convert in RemoteTree? events parsing.

Minor change.

Add some information params to Java server root and CLI objects.

A draft implementation of loadAll algorithm.

That algorithm tries to load objects into a tree structure.

Add AccessOperationsTest? test.

Develop WorkPackageLogic?.

  • add state tracking fields
  • add work package generation

Add utility class SimplePrimitive?.

Meant for Java backend classes, enclose a single primitive value
and set of listeners.

Improve primitive value refresh in GUI.

When ValueChange? found in called event, do not reload whole
object, but only update GUI (no communication is performed).

Use ValueChange? in the TestClass? test.

Minor changes.

Sending all packages in PrimeExperiment? to the frams servers.

Develop AccessOperations?.loadComposites().

Remove addAccess from MultiParamLoader? interface.

There is now no default AccessProvider? in MultiParamLoader?.
User must explicitely set AccessStash? or Registry.

Improve saving algorithms in AccessOperations?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/test/TestClass.java

    r101 r103  
    77
    88import com.framsticks.core.ListChange;
     9import com.framsticks.core.ValueChange;
    910import com.framsticks.params.EventListener;
    10 import com.framsticks.params.EventListeners;
     11import com.framsticks.params.SimplePrimitive;
    1112import com.framsticks.params.SimpleUniqueList;
     13import com.framsticks.params.annotations.AutoAppendAnnotation;
    1214import com.framsticks.params.annotations.FramsClassAnnotation;
    1315import com.framsticks.params.annotations.ParamAnnotation;
     
    2729)
    2830public class TestClass {
    29         private static final Logger log =
    30                 LogManager.getLogger(TestClass.class);
     31        private static final Logger log = LogManager.getLogger(TestClass.class);
    3132
    3233
    3334        protected String name = "test";
    34         protected String history = "initial|";
    35         protected final EventListeners<TestChangeEvent> historyListeners = new EventListeners<>();
     35        protected final SimplePrimitive<String> history = new SimplePrimitive<>("initial|");
    3636
    3737        protected final SimpleUniqueList<TestChild> children = new SimpleUniqueList<>(TestChild.class, 'c');
     
    6464        @ParamAnnotation
    6565        public String getHistory() {
    66                 return history;
     66                return history.get();
    6767        }
    6868
     
    7272        @ParamAnnotation
    7373        public void setHistory(String history) {
    74                 this.history = history;
     74                this.history.set(history);
    7575        }
    7676
     
    8080        @ParamAnnotation
    8181        public Map<String, TestChild> getChildren() {
    82                 return children.getView();
     82                return children.getMap();
    8383        }
    8484
     
    8686        public int appendHistory(String line) {
    8787                log.debug("appending '{}'", line);
    88                 history = history + line + "|";
    89                 fireHistoryChange();
    90                 return history.length();
     88                history.set(history.get() + line + "|");
     89                // fireHistoryChange();
     90                return history.get().length();
    9191        }
    9292
     
    9494        public void resetHistory() {
    9595                log.debug("reseting");
    96                 history = "";
    97                 fireHistoryChange();
     96                history.set("");
    9897        }
    9998
    10099        @ParamAnnotation(paramType = ProcedureParam.class)
    101100        public void createChild(String name) {
    102                 TestChild child = new TestChild(this);
     101                TestChild child = new TestChild();
    103102                child.name = name;
     103                addChild(child);
     104        }
     105
     106        @AutoAppendAnnotation
     107        public void addChild(TestChild child) {
     108                child.parent = this;
    104109                children.add(child);
    105110        }
    106111
    107         protected void fireHistoryChange() {
    108                 TestChangeEvent event = new TestChangeEvent();
    109                 event.history = history;
    110                 historyListeners.actionForAll(event);
    111         }
    112 
    113 
    114112        @ParamAnnotation(id = "history_changed")
    115         public void addHistoryListener(EventListener<TestChangeEvent> listener) {
    116                 historyListeners.add(listener);
     113        public void addHistoryListener(EventListener<ValueChange> listener) {
     114                history.addListener(listener);
    117115        }
    118116
    119117        @ParamAnnotation(id = "history_changed")
    120         public void removeHistoryListener(EventListener<TestChangeEvent> listener) {
    121                 historyListeners.remove(listener);
     118        public void removeHistoryListener(EventListener<ValueChange> listener) {
     119                history.removeListener(listener);
    122120        }
    123121
Note: See TracChangeset for help on using the changeset viewer.