source: java/main/src/main/java/com/framsticks/params/ListAccess.java @ 90

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

HIGHLIGHTS:

CHANGELOG:
Make ProcedureParam? hold only ValueParams?.

Use id instead of names when naming gui components internally.

Basic procedure calling in GUI.

The actual procedure call is currently only backed
by the ObjectInstance?.

Add UnimplementedException?.

Improve naming of various gui elements.

Allow easy navigating in FEST Swing testing.

Add optional explicit order attribute to FramsClassAnnotation?.

That's because java reflection does return declared members
in any specific order. That ordering is needed only for
classes that have no representation in framsticks and need
a deterministic ordering of params.

Add ControlOwner? interface.

Add test for procedure calling in Browser.

First version of ParamAnnotation? for procedures.

Development of ProcedureParam?.

Add draft version of ProcedureParam? implementation in ReflectionAccess?.

Allow viewing FramsClasses? in gui Browser.

Extract ResourceBuilder? from ModelBuilder?.

Remove internalId from Param.

It was currently completely not utilised. Whether it is still needed
after introduction of ParamAnnotation? is arguable.

Add remaining param attributes to ParamAnnotation?.

Change AutoBuilder? semantics.

AutoBuilder? returns list of objects that are to be appended
with methods @AutoAppendAnnotation?.

This allows to omit explicit addition of ModelPackage? to instance
if the instance uses ModelBuilder? (registration of ModelPackage? comes
from schema).

Fix params ordering problem in auto created FramsClasses?.

Improve ObjectInstance?.

Several fixes to ModelBuilder?.

Improve test for ObjectInstance? in Browser.

Make initialization of robot static.

With robot recreated for second browser test, the test hanged
deep in AWT.

Add base convenience base test for Browser tests.

More tests to ObjectInstance?.

Rename Dispatcher.invokeLater() to dispatch().

Add assertDispatch.

It allows assertions in other threads, than TestNGInvoker.
Assertions are gathered after each method invocation and rethrown.

Use timeOut annotation attribute for tests involving some waiting.

Remove firstTask method (merge with joinableStart).

Clean up leftovers.

Remove unused FavouritesXMLFactory (the reading part is already
completely done with generic XmlLoader?, and writing part will be done
based on the same approach if needed).
Move UserFavourite? to the com.framsticks.gui.configuration package.

Remove GenotypeBrowser? as to specific.

This functionality will be available in ObjectInstance?.

Add interface ParamsPackage?.

Package containing registration of Java classes meant to use with
ReflectionAccess? may be in Instance using configuration.

Minor changes.

Make Group immutable.

Add AutoBuilder? interface extending Builder - only those would
be used to automatically build from XML.

Fix groups in FramsClass?.

Minor naming cleanup in Registry.

Add ModelComponent? interface.

All class creating the Model are implementing that interface.

Extract Model.build into ModelBuilder?.

ModelBuilder? will be compatible with other builders
and allow using it from configuration.

Fix NeuroConnection?.

Add synchronous get operation for dispatchers.

Rename JoinableMonitor? to Monitor.

Add ObjectInstance?.

This class is mainly for demonstration
and testing purposes.

Improve FramsServer? runner.

  • improve ExternalProcess? runner,
  • runner can kill the server but also react properly, when the server exists on it's own,
  • set default path to search for framsticks server installation,
  • add LoggingOutputListener?.
File size: 1.9 KB
Line 
1package com.framsticks.params;
2
3
4
5import static com.framsticks.util.lang.Containers.filterInstanceof;
6
7import com.framsticks.params.types.ProcedureParam;
8
9/**
10 * @author Piotr Sniegowski
11 */
12public abstract class ListAccess implements AccessInterface {
13
14        final AccessInterface elementAccess;
15
16        public ListAccess(AccessInterface elementAccess) {
17                this.elementAccess = elementAccess;
18        }
19
20        // @Override
21        // public Param getGroupMember(int gi, int n) {
22        //      return null;
23        // }
24
25        @Override
26        public void setDefault(boolean numericOnly) {
27        }
28
29        @Override
30        public void setDefault(int i, boolean numericOnly) {
31        }
32
33        @Override
34        public void setMin() {
35        }
36
37        @Override
38        public void setMin(int i) {
39        }
40
41        @Override
42        public void setMax() {
43        }
44
45        @Override
46        public void setMax(int i) {
47        }
48
49        @Override
50        public void copyFrom(AccessInterface src) {
51        }
52
53        @Override
54        public void save(SinkInterface sink) {
55                for (CompositeParam p : filterInstanceof(getParams(), CompositeParam.class)) {
56                        Object child = get(p, Object.class);
57                        //this is probably an assertion
58                        assert child != null;
59                        elementAccess.select(child);
60                        elementAccess.save(sink);
61                }
62        }
63
64        @Override
65        public void load(SourceInterface stream) throws Exception {
66        }
67
68        public AccessInterface getElementAccess() {
69                return elementAccess;
70        }
71
72        public abstract String computeIdentifierFor(Object selected);
73
74        @Override
75        public final FramsClass getFramsClass() {
76                return elementAccess.getFramsClass();
77        }
78
79        //TODO it could actually be used also
80        @Override
81        public boolean tryAutoAppend(Object object) {
82                return false;
83        }
84
85        @Override
86        public Object call(String id, Object[] arguments) {
87                throw new InvalidOperationException().msg("list access does not support calling methods").arg("id", id);
88        }
89
90        @Override
91        public Object call(ProcedureParam param, Object[] arguments) {
92                throw new InvalidOperationException().msg("list access does not support calling methods").arg("param", param);
93        }
94
95};
Note: See TracBrowser for help on using the repository browser.