source: java/main/src/main/java/com/framsticks/model/f0/NeuroClass.java @ 88

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

HIGHLIGHTS:

  • loading f0 schema with XmlLoader?
  • use XmlLoader? to load configuration
  • introduce unified fork-join model of various entities

(Instances, Connections, GUI Frames, etc.),
all those entities clean up gracefully on
shutdown, which may be initialized by user
or by some entity

  • basing on above, simplify several organizing classes

(Observer, main class)

(to host native frams server process from Java level)

CHANGELOG:
Remove redundant Observer class.

Clean up in AbstractJoinable?.

Update ExternalProcess? class to changes in joining model.

Another sweep through code with FindBugs?.

Find bug with not joining RemoteInstance?.

Joining almost works.

Much improved joining model.

More improvement to joining model.

Add logging messages around joinable operations.

Rename methods in AbstractJoinable?.

Improve Joinable.

Rewrite of entity structure.

More simplifications with entities.

Further improve joinables.

Let Frame compose from JFrame instead of inheriting.

Add join classes.

Improvements of closing.

Add Builder interface.

Add FramsServerTest?.xml

FramsServer? may be configured through xml.

Make Framsticks main class an Observer of Entities.

Make Observer a generic type.

Remove variables regarding to removed endpoint.

Simplify observer (remove endpoints).

More changes to Observer and Endpoint.

Minor improvements.

Add OutputListener? to ExternalProcess?.

Improve testing of ExternalProcess?.

Add ExternalProcess? runner.

Rename the Program class to Framsticks.

Migrate Program to use XmlLoader? configuration.

First steps with configuration using XmlLoader?.

Fix several bugs.

Move all f0 classes to apriopriate package.

XmlLoader? is able to load Schema.

XmlLoader? is loading classes and props.

Add GroupBuilder?.

File size: 1.8 KB
Line 
1package com.framsticks.model.f0;
2
3import java.util.ArrayList;
4import java.util.Collections;
5import java.util.List;
6
7import javax.annotation.concurrent.Immutable;
8
9import com.framsticks.params.FramsClass;
10import com.framsticks.params.annotations.FramsClassAnnotation;
11
12import static com.framsticks.util.Misc.throwIfNull;
13import static com.framsticks.util.Misc.returnNotNull;
14
15@Immutable
16@FramsClassAnnotation(id = "neuroclass", name = "neuroclass")
17public class NeuroClass extends FramsClass {
18
19
20        public NeuroClass(NeuroClassBuilder builder) {
21                super(builder);
22
23                preferredInputs = throwIfNull(builder.getPreferredInputs());
24                preferredOutput = throwIfNull(builder.getPreferredOutput());
25                preferredLocation = throwIfNull(builder.getPreferredLocation());
26                visualHints = returnNotNull(builder.getVisualHints(), 0);
27
28                if (builder.getSymbolGlyph() != null) {
29                        symbolGlyph = new ArrayList<>();
30                        for (String s : builder.getSymbolGlyph().split(",")) {
31                                symbolGlyph.add(Integer.valueOf(s));
32                        }
33                } else {
34                        symbolGlyph = null;
35                }
36
37        }
38
39        protected final int preferredInputs;
40
41        protected final int preferredOutput;
42
43        protected final int preferredLocation;
44
45        protected final int visualHints;
46
47        protected final List<Integer> symbolGlyph;
48
49        /**
50         * @return the preferredInputs
51         */
52        public int getPreferredInputs() {
53                return preferredInputs;
54        }
55
56        /**
57         * @return the preferredOutput
58         */
59        public int getPreferredOutput() {
60                return preferredOutput;
61        }
62
63        /**
64         * @return the preferredLocation
65         */
66        public int getPreferredLocation() {
67                return preferredLocation;
68        }
69
70        /**
71         * @return the visualHints
72         */
73        public int getVisualHints() {
74                return visualHints;
75        }
76
77        /**
78         * @return the symbolGlyph
79         */
80        public List<Integer> getSymbolGlyph() {
81                return Collections.unmodifiableList(symbolGlyph);
82        }
83
84}
Note: See TracBrowser for help on using the repository browser.