Menu

VirtualRoot Simulator Programmers Manual

Teodor Ghetiu

General Details

Source code

The source code for this project is located in the RootGUI trunk folder.

Download

The source code can be downloaded through an SVN client, following the steps:

  1. select the location in which you want to download the project:

    e.g. for Linux

    cd ~/

  2. Check out the project:

    svn co https://svn.code.sf.net/p/virtualroot/code-0/trunk/RootGUI

This will create a RootGUI folder inside the folder that you previously selected (~/ in our example).
3. Using Eclipse / NetBeans or any other IDE, create a Java project that binds to your newly downloaded folder.

Bug tracking

You can record tickets using the project's Ticket page.

VirtualRoot Simulator

The VirtualRoot Simulator is programmed in Java (recommended Java 7) and currently does not depend on any additional libraries. The application follows (to a good extent) the MVC pattern and is composed of three main packages:

  1. rootgui
  2. simserver
  3. visualiser

Main class

The main class (starting point) of the application is rootgui.RootGUI.

rootgui

This package represents the GUI: the main model-view-controller (MVC) construct. Consequently, it hosts the main class of the application (RootGUI), and three subpackages, model, view and controller corresponding to the distinct areas of the MVC.

The rootgui.model package contains the VRootModel class, which represents the model of the GUI.

The rootgui.controller package is front-ended by the VRootController class, representing the controller of the GUI.

The rootgui.view package is front-ended by the DisplayViewFrame class. This is an extended JPanel that contains all the components visualised on the GUI so that it can be used both as a desktop application (by including it in a JFrame, as done in rootgui.RootGUI) or a Java applet.

simserver

This package deals with the server communication. A connection to the server is encapsulated by the SimServerClient class. The VRootController can instantiate one or more such server connections, one for each VisualiserTab.

visualiser

This package encapsulates the Visualiser part of the GUI (the right hand side simulation visualisation componets). Inside the Visualiser we have one or more VisualiserTabs. Each VisualiserTab contains one or more VisualiserPanels, depending on the species that the user selected for visualisation.

VisualiserTab

VisualiserPanel

The VisualiserPanel is composed of a CellDrawingPanel and a ControlBar. The CellDrawingPanel represents the panel on which the tissue is rendered. The ControlBar represents to toolbar situated at the bottom of the CellDrawingPanel, on which various controls are located e.g. zoom buttons, a Play button, the snapshot and species slider.

FAQ

How do I make the GUI connect to a different server

The connection between the GUI and the server is handled by the simserver package. The GUI can work with multiple connections to the server (one for each VisualiserTab); the server connections, encapsulated by the SimServerClient class, are only instantiated inside the VRootController, as the following code snipped shows:

@Override
public void createSimulationRun() {
final int srIndex = sscConnections.size();
    try {
    // creating server connection
    AbsSimServerClient ssc;
    consO.printlnStd(srIndex, "Establishing server connection...");
    ssc = new SimServerClient(srIndex, SERVER_NAME, SERVER_PORT, null);

To change the hostname of the simulation server, and make it point towards other hosts e.g. to your "localhost", the SERVER_NAME of the VRootController object needs to be modified and this can be done by using the setServerName() accessor method. The easiest (and recommended) route is through the rootgui.RootGUI class:

controller = new VRootController();
controller.setServerName("localhost");