Ignore:
Timestamp:
06/22/13 21:51:33 (11 years ago)
Author:
psniegowski
Message:

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.

Location:
java/main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • java/main

    • Property svn:ignore set to
      target
  • java/main/src/main/java/com/framsticks/params/ArrayListAccess.java

    r77 r84  
    11package com.framsticks.params;
    22
    3 import com.framsticks.util.Numbers;
     3import com.framsticks.util.lang.Numbers;
    44
    55import java.util.ArrayList;
     
    1313public class ArrayListAccess extends ListAccess {
    1414
    15     List list;
     15        List<Object> list;
    1616
     17        public ArrayListAccess(AccessInterface elementAccess) {
     18                super(elementAccess);
     19        }
    1720
    18     public ArrayListAccess(AccessInterface elementAccess) {
    19         super(elementAccess);
    20     }
     21        @Override
     22        public ArrayListAccess cloneAccess() {
     23                return new ArrayListAccess(elementAccess.cloneAccess());
     24        }
    2125
    22     @Override
    23     public ArrayListAccess cloneAccess() {
    24         return new ArrayListAccess(elementAccess.cloneAccess());
    25     }
     26        @Override
     27        public List<?> createAccessee() {
     28                return new ArrayList<Object>();
     29        }
    2630
    27     @Override
    28     public List createAccessee() {
    29         return new ArrayList();
    30     }
     31        @Override
     32        public Param getParam(int i) {
     33                return new ParamBuilder().setId(Integer.toString(i)).setName(elementAccess.getId()).setType("o " + elementAccess.getId()).build();
     34        }
    3135
    32     @Override
    33     public Param getParam(int i) {
    34         return new ParamBuilder().setId(Integer.toString(i)).setName(elementAccess.getId()).setType("o " + elementAccess.getId()).build();
    35     }
     36        @Override
     37        public Param getParam(String id) {
     38                Integer i = Numbers.parse(id, Integer.class);
     39                return (i == null ? null : getParam(i));
     40        }
    3641
    37     @Override
    38     public Param getParam(String id) {
    39         Integer i = Numbers.parse(id, Integer.class);
    40         return (i == null ? null : getParam(i));
    41     }
     42        @Override
     43        public String getId() {
     44                return "l " + elementAccess.getId();
     45        }
    4246
    43     @Override
    44     public String getId() {
    45         return "l " + elementAccess.getId();
    46     }
     47        @Override
     48        public int getParamCount() {
     49                return list.size();
     50        }
    4751
    48     @Override
    49     public int getParamCount() {
    50         return list.size();
    51     }
     52        @Override
     53        public <T> T get(int i, Class<T> type) {
     54                if (i < list.size()) {
     55                        return type.cast(list.get(i));
     56                }
     57                return null;
     58        }
    5259
    53     @Override
    54     public <T> T get(int i, Class<T> type) {
    55         if (i < list.size()) {
    56             return type.cast(list.get(i));
    57         }
    58         return null;
    59     }
     60        @Override
     61        public <T> T get(String id, Class<T> type) {
     62                return get(Integer.parseInt(id), type);
     63        }
    6064
    61     @Override
    62     public <T> T get(String id, Class<T> type) {
    63         return get(Integer.parseInt(id), type);
    64     }
     65        @Override
     66        public <T> T get(ValueParam param, Class<T> type) {
     67                return get(param.getId(), type);
     68        }
    6569
    66     @Override
    67     public <T> T get(Param param, Class<T> type) {
    68         return get(param.getId(), type);
    69     }
     70        @Override
     71        public <T> int set(int i, T value) {
     72                while (i >= list.size()) {
     73                        list.add(null);
     74                }
     75                list.set(i, value);
     76                return 0;
     77        }
    7078
    71     @Override
    72     public <T> int set(int i, T value) {
    73         while (i >= list.size()) {
    74             list.add(null);
    75         }
    76         list.set(i, value);
    77         return 0;
    78     }
     79        @Override
     80        public <T> int set(String id, T value) {
     81                return set(Integer.parseInt(id), value);
     82        }
    7983
    80     @Override
    81     public <T> int set(String id, T value) {
    82         return set(Integer.parseInt(id), value);
    83     }
     84        @Override
     85        public <T> int set(ValueParam param, T value) {
     86                return set(param.getId(), value);
     87        }
    8488
    85     @Override
    86     public <T> int set(Param param, T value) {
    87         return set(param.getId(), value);
    88     }
     89        @Override
     90        public void clearValues() {
     91                list.clear();
     92        }
    8993
    90     @Override
    91     public void clearValues() {
    92         list.clear();
    93     }
     94        /** covariant */
     95        @Override
     96        public List<Object> getSelected() {
     97                return list;
     98        }
    9499
    95     /** covariant */
    96     @Override
    97     public List getSelected() {
    98         return list;
    99     }
     100        @SuppressWarnings("unchecked")
     101        @Override
     102        public ArrayListAccess select(Object object) {
     103                list = (List<Object>) object;
     104                return this;
     105        }
    100106
    101     @Override
    102     public void select(Object object) {
    103         list = (List)object;
    104     }
     107        @Override
     108        public String computeIdentifierFor(Object selected) {
     109                return Integer.toString(list.size());
     110        }
    105111
    106     @Override
    107     public String computeIdentifierFor(Object selected) {
    108         return Integer.toString(list.size());
    109     }
    110 
    111     @Override
    112     public Collection<Param> getParams() {
    113         List<Param> result = new LinkedList<Param>();
    114         if (list == null) {
    115             return result;
    116         }
    117         for (int i = 0; i < list.size(); ++i) {
    118             result.add(getParam(i));
    119         }
    120         return result;
    121     }
     112        @Override
     113        public Collection<Param> getParams() {
     114                List<Param> result = new LinkedList<Param>();
     115                if (list == null) {
     116                        return result;
     117                }
     118                for (int i = 0; i < list.size(); ++i) {
     119                        result.add(getParam(i));
     120                }
     121                return result;
     122        }
    122123
    123124
Note: See TracChangeset for help on using the changeset viewer.