Client Frame

The client frame displays the user interface pane in a window. It is also the mediator between the pane and the interpreter stub. There is not much to say about the implementation of the client frame. It mirrors the implementation of the standalone frame. The Java class has just a different name, but repertoire of methods is the same. The only difference is that the client frame makes use of the interpreter stub instead of the query interpreter. This is already seen in the initialization, which starts as follows:

    /**
     * <p>Setup the knowledgebase and init the pane.</p>
     */
    private Client() {
/* init the pane */
pane.initPane(getRootPane(), this);
setTitle("Deployment Study - Client");
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

/* load the Prolog */
pane.startJob(() -> {
initKnowledgebase();
}, new Runnable() {
public void run() {
}
});

We also equipped the user interface panel of the client frame with a progress bar. The man-agement of the Swing GUI progress bar is done by the method startJob(). The rest of the code is an analogue adaption. The full code can be found in the appendix. We could have added an input field to the client frame, so that the end-user can specify the URL of the desired web server. For simplicity we did not do so. Currently this has to be changed in the Prolog text of the agent.

Kommentare