view
Class DataView

java.lang.Object
  extended by view.DataView

public class DataView
extends java.lang.Object

Title: Bioinformatics Project

Description: Genomes Comparacent

Copyright: Copyright (c) 2005-2006

DataView is the Viewer of the system. loads the main window of the application, sets it with the initial values, updates buttom/view accordingly.

Version:
1.0
Author:
Shadi Ibrahem.

Field Summary
private  org.eclipse.swt.widgets.Group ActionGroup
          Group containing the combo boxes and the main tab buttons.
private  org.eclipse.swt.widgets.Button AddGenomeButton
          Add new genome button.
private  org.eclipse.swt.widgets.Combo comboGene1
          First genome combo box.
private  org.eclipse.swt.widgets.Combo comboGene2
          Second genome combo box.
private  IDataHandler controller_
          The controller of magic.
(package private)  org.eclipse.swt.widgets.Display display
          The display of magic.
private  org.eclipse.swt.widgets.Button HistoryButton
          History button, opens a new tab.
private  java.lang.String inputDirectory
          Input directory path, default is Magic root/Data.
private  org.eclipse.swt.widgets.Group Instructions
          Instructions groups, meanwhile conatining a label.
private  Magic magic
          An object holding magic default settings/or settings set by the user.
private  org.eclipse.swt.widgets.Group mainGroup
          The main group, mean while holding only the action group.
private  org.eclipse.swt.custom.CTabItem mainitem
          Main tab item, contains the main tab components.
private  org.eclipse.swt.widgets.Composite maintab
          The composite of the main tab item.
private  org.eclipse.swt.custom.CTabFolder MainTab
          The main tab viewed when running MAGIC.
private  org.eclipse.swt.widgets.MessageBox messageBox
          A default message box.
private  java.util.ResourceBundle messages
          A resource bundle set to enable internationalization.
private  java.lang.String outputDirectory
          Output directory path, default is Magic root/Data.
private  org.eclipse.swt.custom.CTabItem paraitem
          Parameters tab item.
protected  PaintChart PChart
          An object building and viewing the chart canvas.
protected  ParametersFrame PFrame
          Parameters tab object.
private  org.eclipse.swt.widgets.Button RemoveGenomeButton
          Remove genome button, DISABLED.
private  org.eclipse.swt.widgets.Button RunGenomeButton
          Run new button, opens a new tab.
(package private)  org.eclipse.swt.widgets.Shell shell
          The display shell(SWT properties).
 
Constructor Summary
DataView(java.lang.String[] args, IDataHandler handler)
          C'tor, sets the main menu and the main tab, initialize the system according to the settings file.
 
Method Summary
 org.eclipse.swt.widgets.Display getDisplay()
          Returns DataView main display.
 java.lang.String getInputDirectory()
          Retruns input directory as imported from the magic object.
 int getMagicLang()
          Returns language index from "magic" as initiated, used by controller.
 java.lang.String getOutDirectory()
          Retruns output directory as imported from the magic object.
 org.eclipse.swt.widgets.Shell getShell()
          Returns DataView main shell.
private  void initComponents()
          Inits the main tab and menu and components that will be use as containters.
 void initFrame()
          Inits the main tab item component with buttons, sets menu details and listeners, "creat and shows GUI".
 void setGenomes()
          Imports genome names by the controller, and sets combo boxes with the received set of names.
 void setLanguage(java.lang.String string)
          Sets the language index, used by controller.
private  void setWorkplace(boolean writeToFile)
          Sets the parameters as read from the settings file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

controller_

private IDataHandler controller_
The controller of magic.


display

org.eclipse.swt.widgets.Display display
The display of magic.


shell

org.eclipse.swt.widgets.Shell shell
The display shell(SWT properties).


PFrame

protected ParametersFrame PFrame
Parameters tab object.


MainTab

private org.eclipse.swt.custom.CTabFolder MainTab
The main tab viewed when running MAGIC.


PChart

protected PaintChart PChart
An object building and viewing the chart canvas.


mainitem

private org.eclipse.swt.custom.CTabItem mainitem
Main tab item, contains the main tab components.


paraitem

private org.eclipse.swt.custom.CTabItem paraitem
Parameters tab item.


maintab

private org.eclipse.swt.widgets.Composite maintab
The composite of the main tab item. In order for a tab item to include components, it should has a control of composite type.


messageBox

private org.eclipse.swt.widgets.MessageBox messageBox
A default message box.


mainGroup

private org.eclipse.swt.widgets.Group mainGroup
The main group, mean while holding only the action group.


ActionGroup

private org.eclipse.swt.widgets.Group ActionGroup
Group containing the combo boxes and the main tab buttons.


comboGene1

private org.eclipse.swt.widgets.Combo comboGene1
First genome combo box.


comboGene2

private org.eclipse.swt.widgets.Combo comboGene2
Second genome combo box.


AddGenomeButton

private org.eclipse.swt.widgets.Button AddGenomeButton
Add new genome button.


RemoveGenomeButton

private org.eclipse.swt.widgets.Button RemoveGenomeButton
Remove genome button, DISABLED.


HistoryButton

private org.eclipse.swt.widgets.Button HistoryButton
History button, opens a new tab.


RunGenomeButton

private org.eclipse.swt.widgets.Button RunGenomeButton
Run new button, opens a new tab.


Instructions

private org.eclipse.swt.widgets.Group Instructions
Instructions groups, meanwhile conatining a label.


inputDirectory

private java.lang.String inputDirectory
Input directory path, default is Magic root/Data.


outputDirectory

private java.lang.String outputDirectory
Output directory path, default is Magic root/Data.


magic

private Magic magic
An object holding magic default settings/or settings set by the user. Low priority: It should move to controller.


messages

private java.util.ResourceBundle messages
A resource bundle set to enable internationalization.

Constructor Detail

DataView

public DataView(java.lang.String[] args,
                IDataHandler handler)
C'tor, sets the main menu and the main tab, initialize the system according to the settings file.

Parameters:
args - Strings[]: not used, only for extending option.
handler - IDataHandler: the controller of MAGIC.
Method Detail

initComponents

private void initComponents()
Inits the main tab and menu and components that will be use as containters.


setWorkplace

private void setWorkplace(boolean writeToFile)
Sets the parameters as read from the settings file. writeToFile option is for a case dameged or missing system(MAGIC) settings file, if deleted it will automaticly create a new file with the needed info.

Parameters:
writeToFile - boolean: true if the settings file is messing.

initFrame

public void initFrame()
Inits the main tab item component with buttons, sets menu details and listeners, "creat and shows GUI".


getInputDirectory

public java.lang.String getInputDirectory()
Retruns input directory as imported from the magic object. note: moves with magic to the controller.

Returns:
String : input directory.

getOutDirectory

public java.lang.String getOutDirectory()
Retruns output directory as imported from the magic object. note: moves with magic to the controller.

Returns:
String : output directory.

getMagicLang

public int getMagicLang()
Returns language index from "magic" as initiated, used by controller. note: this should move to controller too.

Returns:
int: the language index.

setLanguage

public void setLanguage(java.lang.String string)
Sets the language index, used by controller. note: this should move to controller too.

Parameters:
string - String: the langauage index.

getShell

public org.eclipse.swt.widgets.Shell getShell()
Returns DataView main shell.

Returns:
DataView main shell.

getDisplay

public org.eclipse.swt.widgets.Display getDisplay()
Returns DataView main display.

Returns:
DataView main display.

setGenomes

public void setGenomes()
Imports genome names by the controller, and sets combo boxes with the received set of names.