Ignore:
Timestamp:
07/12/13 23:41:06 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • add <include/> to configuration
  • add side notes to tree
    • used to store arbitrary information alongside the tree structure
  • migrate to log4j2
    • supports lazy string evaluation of passed arguments
  • improve GUI tree
    • it stays in synchronization with actual state (even in high load test scenario)
  • improve panel management in GUI
  • make loading objects in GUI more lazy
  • offload parsing to connection receiver thread
    • info parsing
    • first step of objects parsing
  • fix connection parsing bug (eof in long values)
  • support zero-arguments procedure in table view

CHANGELOG:
Implement procedure calls from table view.

Refactorization around procedures in tables.

Add table editor for buttons.

Render buttons in the the list view.

Further improve Columns.

Add Column class for TableModel?.

Accept also non-arguments ProcedureParams? in tableView.

Increase maximal TextAreaControl? size.

Add tooltip to ProcedureControl?.

Fix bug of interpreting eofs in long values by connection reader.

Further rework connection parsing.

Simplify client connection processing.

Test ListChange? modification.

Test ListChange? events with java server.

Add TestChild?.

Fix bug with fast deregistering when connecting to running server.

Another minor refactorization in TreeOperations?.

Fix bug in SimpleAbstractAccess? loading routine.

Another minor improvement.

Minor change.

Make reading of List objects two-phase.

Another minor change.

Dispatch parsing into receiver thread.

Another step.

Enclose passing value in ObjectParam? case in closure.

Minor step.

Minor change on way to offload parsing.

Temporarily comment out single ValueParam? get.

It will be generalized to multi ValueParam?.

Process info in receiver thread.

Add DispatchingExceptionHandler?.

Make waits in browser test longer.

Use FETCHED_MARK.

It is honored in GUI, where it used to decide whether to get values

after user action.

It is set in standard algorithm for processing fetched values.

Add remove operation to side notes.

Make loading more lazy.

Improve loading policy.

On node choose load itself, on node expansion, load children.

Minor improvement.

Fix bug with panel interleaving.

Minor improvements.

Improve panel management.

More cleaning around panels.

Reorganize panels.

Further improve tree.

Fix bug in TreeModel?.

Remove children from TreeNode?.

Implement TreeNode? hashCode and equals.

Make TreeNode? delegate equals and hashcode to internal reference.

Move listeners from TreeNode? to side notes.

Store path.textual as a side note.

Side note params instead of accesses for objects.

More refactorizations.

In TreeNode? bindAccess based on side notes.

Minor step.

Hide createAccess.

Rename AccessInterface? to Access.

Minor changes.

Several improvements in high load scenarios.

Change semantics of ArrayListAccess?.set(index, null);

It now removes the element, making list shorter
(it was set to null before).

Add path remove handler.

Handle exceptions in Connection.

Update .gitignore

Configure logging to file.

Move registration to TreeModel?.

Further refactorization.

Minor refactorization.

Minor improvements.

Use specialized event also for Modify action of ListChange?.

Use remove events.

Use the insertion events for tree.

Further improve tree refreshing.

Further improve reacting on events in GUI.

Fix problem with not adding objects on addition list change.

Migrate to log4j lazy String construction interface.

Migrate imports to log4j2.

Drop dependency on adapter to version 1.2.

Switch log4j implementation to log4j2.

Add dirty mark to the NodeAtFrame?.

Make selecting in AccessInterfaces? type safe.

Ignore containers size settings in Model and Genotype.

Use tree side notes to remember local changes and panels.

Add sideNotes to tree.

They will be used to store various accompanying information
right in the tree.

Use ReferenceIdentityMap? from apache in TreeNode?.

It suits the need perfectly (weak semantics on both key and value).

Make ArrayListParam? do not react size changes.

Guard in TableModel? before not yet loaded objects.

Add <include/> clause and AutoInjector?.

Extract common columns configuration to separate xml,
that can be included by other configurations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/params/UniqueListAccess.java

    r99 r100  
    77import com.framsticks.util.lang.Casting;
    88import com.framsticks.util.lang.Numbers;
    9 import org.apache.log4j.Logger;
     9import org.apache.logging.log4j.Logger;
     10import org.apache.logging.log4j.LogManager;
    1011
    1112import java.util.*;
     
    1617public class UniqueListAccess extends ListAccess {
    1718
    18         private static final Logger log = Logger.getLogger(UniqueListAccess.class);
     19        private static final Logger log = LogManager.getLogger(UniqueListAccess.class);
    1920
    2021        Map<String, Object> map;
    2122
    22         final String uidName;
    23 
    24         public UniqueListAccess(AccessInterface elementAccess, String uidName) {
     23        protected final String uidName;
     24        protected final Access uidAccess;
     25
     26        public UniqueListAccess(Access elementAccess, String uidName) {
    2527                super(elementAccess);
    2628                this.uidName = uidName;
     29                uidAccess = elementAccess.cloneAccess();
    2730        }
    2831
     
    3538        }
    3639
     40        /**
     41         * @return the uidName
     42         */
     43        public String getUidName() {
     44                return uidName;
     45        }
     46
    3747        public static class UidComparator implements Comparator<String> {
    3848
    39                 protected String name;
     49                protected Object description;
     50
    4051
    4152                /**
    42                  * @param name
     53                 * @param description
    4354                 */
    44                 public UidComparator(String name) {
    45                         this.name = name;
     55                public UidComparator(Object description) {
     56                        this.description = description;
    4657                }
    4758
     
    6576                @Override
    6677                public String toString() {
    67                         return "comparator " + name;
    68                 }
    69 
    70 
     78                        return "comparator " + description;
     79                }
     80
     81
     82        }
     83
     84        public static <T> Map<String, T> createMap(Class<T> type, Object description) {
     85                return new TreeMap<String, T>(new UidComparator(description));
     86        }
     87
     88        public static <M, T extends M> int getNumberInMap(Map<String, M> map, T object) {
     89                Iterator<Map.Entry<String, M>> iterator = map.entrySet().iterator();
     90                int number = 0;
     91                while (iterator.hasNext()) {
     92                        if (iterator.next().getValue() == object) {
     93                                return number;
     94                        }
     95                        ++number;
     96                }
     97                return -1;
    7198        }
    7299
    73100        @Override
    74101        public Map<String, Object> createAccessee() {
    75                 return new TreeMap<String, Object>(new UidComparator(elementAccess.toString()));
     102                return createMap(Object.class, elementAccess);
    76103        }
    77104
     
    92119                        return null;
    93120                }
    94                 return paramBuilder.id(getUidOf(iterator.next().getValue())).finish(CompositeParam.class);
     121                return paramBuilder.id(iterator.next().getKey()).finish(CompositeParam.class);
    95122        }
    96123
     
    110137                return paramBuilder.id(id).finish(CompositeParam.class);
    111138        }
     139
    112140
    113141        @Override
     
    156184
    157185        public String getUidOf(Object value) {
    158                 Object tmp = elementAccess.getSelected();
    159                 elementAccess.select(value);
    160                 String uid = elementAccess.get(uidName, String.class);
    161                 elementAccess.select(tmp);
    162                 return uid;
     186                return uidAccess.select(value).get(uidName, String.class);
    163187        }
    164188
     
    227251        @Override
    228252        public UniqueListAccess select(Object object) {
    229                 assert (object instanceof Map);
    230                 map = (Map<String, Object>) object;
     253                map = Util.selectObjectForAccess(this, object, Map.class);
    231254                return this;
    232255        }
     
    242265        }
    243266
    244         public String computeIdentifierFor(Object selected) {
    245                 String uid = getUidOf(selected);
    246                 if (uid == null) {
    247                         log.error("missing uid field");
    248                         return null;
    249                 }
    250                 return uid;
    251         }
     267        // public String computeIdentifierFor(Object selected) {
     268        //      String uid = getUidOf(selected);
     269        //      if (uid == null) {
     270        //              log.error("missing uid field");
     271        //              return null;
     272        //      }
     273        //      return uid;
     274        // }
    252275
    253276        @Override
Note: See TracChangeset for help on using the changeset viewer.