source: java/main/src/main/java/com/framsticks/gui/SwingJoinable.java @ 97

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

HIGHLIGHTS:

  • add proper exception passing between communication sides:

if exception occur during handling client request, it is
automatically passed as comment to error response.

it may be used to snoop communication between peers

  • fix algorithm choosing text controls in GUI
  • allow GUI testing in virtual frame buffer (xvfb)

FEST had some problem with xvfb but workaround was found

supports tab-completion based on requests history

CHANGELOG:
Further improve handling of exceptions in GUI.

Add StatusBar? implementing ExceptionResultHandler?.

Make completion processing asynchronous.

Minor changes.

Improve completion in console.

Improve history in InteractiveConsole?.

First working version of DirectConsole?.

Minor changes.

Make Connection.address non final.

It is more suitable to use in configuration.

Improvement of consoles.

Improve PopupMenu? and closing of FrameJoinable?.

Fix BrowserTest?.

Found bug with FEST running under xvfb.

JButtonFixture.click() is not working under xvfb.
GuiTest? has wrapper which uses JButton.doClick() directly.

Store CompositeParam? param in TreeNode?.

Simplify ClientSideManagedConnection? connecting.

There is now connectedFunctor needed, ApplicationRequests? can be
send right after creation. They are buffered until the version
and features are negotiated.

Narow down interface of ClientSideManagedConnection?.

Allow that connection specialization send only
ApplicationRequests?.

Improve policy of text control choosing.

Change name of Genotype in BrowserTest?.

Make BrowserTest? change name of Genotype.

Minor change.

First working draft of TrackConsole?.

Simplify Consoles.

More improvements with gui joinables.

Unify initialization on gui joinables.

More rework of Frame based entities.

Refactorize structure of JFrames based entities.

Extract GuiTest? from BrowserBaseTest?.

Reorganize Console classes structure.

Add Collection view to JoinableCollection?.

Configure timeout in testing.

Minor changes.

Rework connections hierarchy.

Add Mode to the get operation.

Make get and set in Tree take PrimitiveParam?.

Unify naming of operations.

Make RunAt? use the given ExceptionHandler?.

It wraps the virtual runAt() method call with
try-catch passing exception to handler.

Force RunAt? to include ExceptionHandler?.

Improve ClientAtServer?.

Minor change.

Another sweep with FindBugs?.

Rename Instance to Tree.

Minor changes.

Minor changes.

Further clarify semantics of Futures.

Add FutureHandler?.

FutureHandler? is refinement of Future, that proxifies
exception handling to ExceptionResultHandler? given
at construction time.

Remove StateFunctor? (use Future<Void> instead).

Make Connection use Future<Void>.

Unparametrize *ResponseFuture?.

Remove StateCallback? not needed anymore.

Distinguish between sides of ResponseFuture?.

Base ResponseCallback? on Future (now ResponseFuture?).

Make asynchronous store taking Future for flags.

Implement storeValue in ObjectInstance?.

File size: 1.4 KB
Line 
1package com.framsticks.gui;
2
3
4import com.framsticks.util.FramsticksException;
5import com.framsticks.util.dispatching.AbstractJoinable;
6import com.framsticks.util.dispatching.Dispatcher;
7import com.framsticks.util.dispatching.RunAt;
8import com.framsticks.util.dispatching.ThrowExceptionHandler;
9
10public abstract class SwingJoinable<Swing> extends AbstractJoinable implements Dispatcher<SwingJoinable<Swing>> {
11
12        private Swing swing;
13
14        /**
15         * @return the swing
16         */
17        public Swing getSwing() {
18                if (swing == null) {
19                        throw new FramsticksException().msg("swing has not yet been initialized").arg("in", this);
20                }
21                return swing;
22        }
23
24        public boolean hasSwing() {
25                return swing != null;
26        }
27
28        /**
29         * @param swing the swing to set
30         */
31        protected void setSwing(Swing swing) {
32                this.swing = swing;
33        }
34
35
36        protected abstract void initializeGui();
37
38        @Override
39        protected void joinableStart() {
40                dispatch(new RunAt<SwingJoinable<Swing>>(ThrowExceptionHandler.getInstance()) {
41                        @Override
42                        protected void runAt() {
43                                initializeGui();
44                        }
45                });
46        }
47
48        @Override
49        public boolean isActive() {
50                return SwingDispatcher.instance.isActive();
51        }
52
53        @Override
54        public void dispatch(RunAt<? extends SwingJoinable<Swing>> runnable) {
55                SwingDispatcher.getInstance().dispatch(runnable);
56        }
57
58        @Override
59        protected void joinableInterrupt() {
60
61        }
62
63        @Override
64        protected void joinableFinish() {
65
66        }
67
68        @Override
69        protected void joinableJoin() throws InterruptedException {
70
71        }
72
73}
Note: See TracBrowser for help on using the repository browser.