Ignore:
Timestamp:
07/02/13 16:20:07 (11 years ago)
Author:
psniegowski
Message:

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:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/model/f0/Schema.java

    r88 r90  
    77import com.framsticks.params.annotations.AutoAppendAnnotation;
    88import com.framsticks.params.annotations.FramsClassAnnotation;
    9 import com.framsticks.parsers.XmlLoader;
    10 import com.framsticks.util.DoubleMap;
    11 import com.framsticks.util.FramsticksException;
     9import com.framsticks.params.annotations.ParamAnnotation;
     10import com.framsticks.util.lang.Casting;
    1211
    13 import com.framsticks.model.Package;
    1412
    1513/**
     
    2725
    2826        /** The neuro classes (classess representing different types of neurons). */
    29         private DoubleMap<String, FramsClass> framsClasses = new DoubleMap<>();
    30         private DoubleMap<String, NeuroClass> neuroClasses = new DoubleMap<>();
     27        private final Registry framsClasses = new Registry();
     28        private final Registry neuroClasses = new Registry();
     29        // private DoubleMap<String, FramsClass> framsClasses = new DoubleMap<>();
     30        // private DoubleMap<String, NeuroClass> neuroClasses = new DoubleMap<>();
    3131
    3232        public static InputStream getDefaultDefinitionAsStream() {
     
    3535        }
    3636
    37         public static Schema load(InputStream stream) {
     37        protected static Schema defaultSchema;
    3838
    39                 XmlLoader xmlLoader = new XmlLoader();
    40                 xmlLoader.setUseLowerCase(true);
    41                 xmlLoader.getRegistry()
    42                         .registerAndBuild(Schema.class)
    43                         .registerAndBuild(FramsClassBuilder.class)
    44                         .registerAndBuild(NeuroClassBuilder.class)
    45                         .registerAndBuild(ParamBuilder.class)
    46                         .registerAndBuild(NeuroParamBuilder.class)
    47                         .registerAndBuild(GroupBuilder.class)
    48                         ;
    49 
    50                 Package.register(xmlLoader.getRegistry());
    51 
    52                 Object object = xmlLoader.load(Schema.getDefaultDefinitionAsStream());
    53                 if (!(object instanceof Schema)) {
    54                         throw new FramsticksException().msg("failed to load schema");
     39        public synchronized static Schema getDefaultSchema() {
     40                if (defaultSchema == null) {
     41                        defaultSchema = new SchemaBuilder().stream(getDefaultDefinitionAsStream()).finish();
    5542                }
    56                 return (Schema) object;
     43                return defaultSchema;
    5744        }
    5845
     
    6047        }
    6148
     49        @AutoAppendAnnotation
    6250        public void addClass(FramsClass framsClass) {
    63                 registry.putInfoIntoCache(framsClass);
     51                registry.putFramsClass(framsClass);
    6452                if (framsClass instanceof NeuroClass) {
    65                         neuroClasses.put(framsClass.getId(), framsClass.getName(), (NeuroClass) framsClass);
     53                        neuroClasses.putFramsClass(framsClass);
    6654                        return;
    6755                }
    68                 framsClasses.put(framsClass.getId(), framsClass.getName(), framsClass);
     56                framsClasses.putFramsClass(framsClass);
    6957        }
    7058
     
    7462        }
    7563
    76         public Set<NeuroClass> getNeuroClasses() {
    77                 return neuroClasses.getValues();
     64        public Set<FramsClass> getNeuroClasses() {
     65                return neuroClasses.getFramsClasses();
    7866        }
    7967
    8068        public Set<FramsClass> getFramsClasses() {
    81                 return framsClasses.getValues();
     69                return framsClasses.getFramsClasses();
    8270        }
    8371
    8472        public NeuroClass getNeuroClass(String identifier) {
    85                 return neuroClasses.get(identifier);
     73                return Casting.throwCast(NeuroClass.class, neuroClasses.getFramsClass(identifier));
    8674        }
    8775
    8876        public FramsClass getFramsClass(String identifier) {
    89                 return framsClasses.get(identifier);
     77                return framsClasses.getFramsClass(identifier);
    9078        }
    9179
     80        @ParamAnnotation
    9281        public final Registry getRegistry() {
    9382                return registry;
    9483        }
    9584
     85        @ParamAnnotation
     86        public final Registry getFramsRegistry() {
     87                return framsClasses;
     88        }
     89
     90        @ParamAnnotation
     91        public final Registry getNeurosRegistry() {
     92                return neuroClasses;
     93        }
     94
     95
    9696}
Note: See TracChangeset for help on using the changeset viewer.