source: java/main/src/main/java/com/framsticks/observers/Endpoint.java @ 84

Last change on this file since 84 was 84, checked in by psniegowski, 11 years ago

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.

File size: 1.7 KB
Line 
1package com.framsticks.observers;
2
3import com.framsticks.core.Instance;
4import com.framsticks.core.InstanceListener;
5import com.framsticks.core.Path;
6import com.framsticks.params.FramsClass;
7import com.framsticks.core.ListChange;
8import com.framsticks.util.dispatching.Dispatcher;
9import org.apache.log4j.Logger;
10
11/**
12 * @author Piotr Sniegowski
13 */
14public class Endpoint implements Dispatcher, InstanceListener {
15        private final static Logger log = Logger.getLogger(Endpoint.class.getName());
16
17        protected Instance instance;
18        protected Observer observer;
19        protected String name;
20
21        public Endpoint() {
22        }
23
24        public final void configurePublic(Observer observer, Instance instance, String name) {
25                assert instance != null;
26                this.name = name;
27                this.observer = observer;
28                this.instance = instance;
29                instance.addListener(this);
30        }
31
32        public void start() {
33                instance.start();
34        }
35
36        @Override
37        public void onListChange(Path path, ListChange change) {
38                log.info("change " + change + " in " + path);
39        }
40
41        @Override
42        public void onRun(Exception e) {
43        }
44
45        @Override
46        public void onStop(Exception e) {
47        }
48
49        @Override
50        public void onFetch(Path path) {
51                log.trace("fetched " + path);
52        }
53
54        @Override
55        public String toString() {
56                return instance.toString();
57        }
58
59        public final Instance getInstance() {
60                return instance;
61        }
62
63        @Override
64        public final boolean isActive() {
65                return instance.isActive();
66        }
67
68        @Override
69        public final void invokeLater(Runnable runnable) {
70                instance.invokeLater(runnable);
71        }
72
73        public Observer getObserver() {
74                return observer;
75        }
76
77        public final String getName() {
78                return name;
79        }
80
81        public static void constructFramsClass(FramsClass.Constructor constructor) {
82                constructor.method("getName").method("getInstance");
83        }
84
85}
Note: See TracBrowser for help on using the repository browser.