source: java/main/src/main/java/com/framsticks/model/Part.java @ 86

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

HIGHLIGHTS:

  • use java annotations to mark classes and fields to be used when:
    • using java classes with ReflectionAccess? to represent remote objects with FramsClass? description found by "info ..." requests
    • to build up FramsClass? representation of objects not present at remote server
  • allow using primitive types (instead of wraping counterparts) in reflected classes
  • rework FramsClass? creation process (add FramsClassBuilder?)
  • add more tests

CHANGELOG:
Prepare model.World class.

Minor change.

Use primitive types for Genotype and Creature classes.

Use primitive types in model.Neuro* classes.

Use primitive types in model.Joint* classes.

Use primitive types in model.Part* classes.

Fix primitive values.

Extract FramsClassBuilder?.

Add tests of Model classes.

More fixes.

Refactorize out ParamCandidate?.

Several fixes.

Fix all regressions after introducing annotations.

Use annotations throughout the project.

Add exception classes.

Improve creation of FramsClass?.

More changes.

Many changes regarding annotations.

Annotate classes in com.framsticks.model package.

Remove manual FramsClass? constructor.

Construct FramsClass? for Creature. Add test.

Add default values to the ParamAnnotation?.

Add ParamBuilderTest? and ParamAnnotation?.

Add FramsClassAnnotation?.

File size: 875 bytes
Line 
1package com.framsticks.model;
2
3
4import com.framsticks.params.annotations.FramsClassAnnotation;
5import com.framsticks.params.annotations.ParamAnnotation;
6import com.framsticks.util.math.Point3d;
7
8/**
9 * The Class Part.
10 */
11@FramsClassAnnotation(id = "p")
12public class Part extends BasePart {
13
14        @ParamAnnotation
15        public double rx, ry, rz;
16
17
18        public Point3d getRotation() { return new Point3d(rx, ry, rz); }
19        public void setRotation(Point3d r) { rx = r.x; ry = r.y; rz = r.z; }
20
21        @ParamAnnotation(id = "dn")
22        public double density;
23
24        @ParamAnnotation(id = "ing")
25        public double ingestion;
26
27        @ParamAnnotation(id = "as")
28        public double assimilation;
29
30        @ParamAnnotation(id = "i")
31        public String info;
32
33        @ParamAnnotation(id = "Vstyle")
34        public String visualizationStyle;
35
36        @ParamAnnotation(id = "vs")
37        public double visualThickness;
38
39        @ParamAnnotation
40        public double vr, vg, vb;
41
42}
Note: See TracBrowser for help on using the repository browser.