Ignore:
Timestamp:
06/24/13 13:38:40 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • upgrade to Java 7
    • use try-multi-catch clauses
    • use try-with-resources were appropriate
  • configure FindBugs? (use mvn site and then navigate in browser to the report)
    • remove most bugs found
  • parametrize Dispatching environment (Dispatcher, RunAt?) to enforce more control on the place of closures actual call

CHANGELOG:
Rework FavouritesXMLFactory.

FindBugs?. Thread start.

FindBugs?. Minor change.

FindBugs?. Iterate over entrySet.

FindBugs?. Various.

FindBug?.

FindBug?. Encoding.

FindBug?. Final fields.

FindBug?.

Remove synchronization bug in ClientConnection?.

Experiments with findbugs.

Finish parametrization.

Make RunAt? an abstract class.

More changes in parametrization.

More changes in parametrizing dispatching.

Several changes to parametrize tasks.

Rename Runnable to RunAt?.

Add specific framsticks Runnable.

Add JSR305 (annotations).

Add findbugs reporting.

More improvements to ParamBuilder? wording.

Make FramsClass? accept also ParamBuilder?.

Change wording of ParamBuilder?.

Change wording of Request creation.

Use Java 7 exception catch syntax.

Add ScopeEnd? class.

Upgrade to Java 7.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/gui/TreeNode.java

    r84 r85  
    11package com.framsticks.gui;
    22
     3import com.framsticks.communication.Connection;
    34import com.framsticks.communication.Subscription;
    45import com.framsticks.communication.util.LoggingStateCallback;
     6import com.framsticks.core.Instance;
    57import com.framsticks.core.ListChange;
    68import com.framsticks.core.Path;
     
    1820import com.framsticks.util.StateFunctor;
    1921import org.apache.log4j.Logger;
     22import com.framsticks.util.dispatching.RunAt;
    2023
    2124import javax.swing.tree.DefaultMutableTreeNode;
     
    4043        final protected EndpointAtFrame endpoint;
    4144
    42         final protected Map<EventParam, Subscription> userSubscriptions = new HashMap<EventParam, Subscription>();
     45        final protected Map<EventParam, Subscription<?>> userSubscriptions = new HashMap<>();
    4346        protected Map<ValueControl, Object> localChanges = null;
    4447        protected String tooltip;
     
    5962                iconName = TreeCellRenderer.findIconName(name, path.getTextual());
    6063                tooltip = "?";
    61                 path.getInstance().invokeLater(new Runnable() {
     64                path.getInstance().invokeLater(new RunAt<Instance>() {
    6265                        @Override
    6366                        public void run() {
     
    8285                assert p.getInstance().isActive();
    8386                if (Logging.log(log, "fetch", TreeNode.this, e)) {
    84                         frame.invokeLater(new Runnable() {
     87                        frame.invokeLater(new RunAt<Frame>() {
    8588                                @Override
    8689                                public void run() {
     
    9295                }
    9396                updateChildren(p);
    94                 frame.invokeLater(new Runnable() {
     97                frame.invokeLater(new RunAt<Frame>() {
    9598                        @Override
    9699                        public void run() {
     
    104107                assert !frame.isActive();
    105108                /** TODO those two actions could be merged into single closure */
    106                 frame.invokeLater(new Runnable() {
     109                frame.invokeLater(new RunAt<Frame>() {
    107110                        @Override
    108111                        public void run() {
     
    149152                /**If some child were found, update in frame context.*/
    150153                if (childrenPaths.size() > 0) {
    151                         frame.invokeLater(new Runnable() {
     154                        frame.invokeLater(new RunAt<Frame>() {
    152155                                @Override
    153156                                public void run() {
     
    186189                final Path p = path;
    187190
    188                 p.getInstance().invokeLater(new Runnable() {
     191                p.getInstance().invokeLater(new RunAt<Instance>() {
    189192                        @Override
    190193                        public void run() {
     
    246249                final String name = (nameParam != null ? access.get(nameParam, String.class) : path.getTop().getParam().getId());
    247250
    248                 frame.invokeLater(new Runnable() {
     251                frame.invokeLater(new RunAt<Frame>() {
    249252                        @Override
    250253                        public void run() {
     
    303306                assert p.isResolved();
    304307                panel.setCurrentTreeNode(this);
    305                 p.getInstance().invokeLater(new Runnable() {
     308                p.getInstance().invokeLater(new RunAt<Instance>() {
    306309                        @Override
    307310                        public void run() {
     
    309312                                panel.pullValuesFromLocalToUser(access);
    310313
    311                                 frame.invokeLater(new Runnable() {
     314                                frame.invokeLater(new RunAt<Frame>() {
    312315                                        @Override
    313316                                        public void run() {
     
    341344                final Path p = path;
    342345                log.debug("preparing panel: " + p);
    343                 p.getInstance().invokeLater(new Runnable() {
     346                p.getInstance().invokeLater(new RunAt<Instance>() {
    344347                        @Override
    345348                        public void run() {
     
    347350                                final CompositeParam param = p.getTop().getParam();
    348351                                final FramsClass framsClass = p.getInstance().getInfoFromCache(param.getContainedTypeName());
    349                                 frame.invokeLater(new Runnable() {
     352                                frame.invokeLater(new RunAt<Frame>() {
    350353                                        @Override
    351354                                        public void run() {
     
    410413                        return;
    411414                }
    412                 userSubscriptions.get(eventParam).unsubscribe(new LoggingStateCallback(log, "unsubscribed " + eventParam));
     415                userSubscriptions.get(eventParam).unsubscribe(new LoggingStateCallback<Connection>(log, "unsubscribed " + eventParam));
    413416                userSubscriptions.remove(eventParam);
    414417        }
     
    500503                final Map<ValueControl, Object> changes = localChanges;
    501504                localChanges = null;
    502                 endpoint.getEndpoint().invokeLater(new Runnable() {
     505                endpoint.getEndpoint().invokeLater(new RunAt<Instance>() {
    503506                        @Override
    504507                        public void run() {
     
    514517                                                        }
    515518                                                        log.debug("applied changes for: " + p);
    516                                                         frame.invokeLater(new Runnable() {
     519                                                        frame.invokeLater(new RunAt<Frame>() {
    517520                                                                @Override
    518521                                                                public void run() {
     
    526529                });
    527530        }
    528 
    529531}
Note: See TracChangeset for help on using the changeset viewer.