The source code for this project is located in the RootGUI trunk folder.
The source code can be downloaded through an SVN client, following the steps:
select the location in which you want to download the project:
e.g. for Linux
cd ~/
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.
You can record tickets using the project's Ticket page.
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:
The main class (starting point) of the application is 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.
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.
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.
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.
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");