package ie.dcu.apps.ist.views;
+import ie.dcu.apps.ist.AppWindow;
import ie.dcu.apps.ist.PainterRegistry;
import ie.dcu.apps.ist.event.*;
import ie.dcu.apps.ist.widgets.*;
// Houses various painters
private final PainterRegistry painters;
-
// View handling annotations (image pane)
private final AnnotatedImageControl view;
// tool bars
private final ToolBar mainToolbar, viewSelectionToolbar, termLookupBar;
+ private ToolBar termDetailToolbar;
+
// Composite for Term details
private Composite termDetailComposite;
// term detail table
- private final Table termDetailTable;
+ private Table termDetailTable;
// Control to change brush size
private final BrushControl brushControl;
// Combo box housing the selectable views
private Combo combo;
- public static Combo comboLabel;
+ public static Combo comboLabel,curatorCombo;
private static Button assign;
SetPainter,
SetLabel,
AssignButton,
+ SetCurator,
SegmenterOptions;
private ToolAction action;
this.props = props;
painters = new PainterRegistry();
-
mainToolbar = new ToolBar(this, SWT.RIGHT | SWT.FLAT);
viewSelectionToolbar = new ToolBar(this, SWT.RIGHT | SWT.FLAT);
termLookupBar = new ToolBar(this, SWT.RIGHT | SWT.FLAT);
view = new AnnotatedImageControl(this, SWT.BORDER);
- termDetailTable = new Table(this, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION);
+ termDetailComposite = new Composite(this, SWT.BORDER | SWT.RIGHT | SWT.FLAT);
brushControl = new BrushControl(getShell(), SWT.BORDER);
eventHandler = new EventHandler();
createToolViewSelectionToolbar();
createToolTermLookupBar();
createTermDetailTable();
+ createTermDetailFields();
// lay out the controls
layoutControls();
* Set initial properties of the Term Detail right pane
*/
private void createTermDetailTable() {
+ termDetailTable = new Table(termDetailComposite, SWT.BORDER | SWT.FULL_SELECTION);
termDetailTable.setLinesVisible (true);
termDetailTable.setHeaderVisible (true);
GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
- data.heightHint = 200;
+ //data.heightHint = 200;
termDetailTable.setLayoutData(data);
String[] titles = {"Label","Data"};
for (int i=0; i<titles.length; i++) {
- TableColumn column = new TableColumn (termDetailTable, SWT.NONE);
+ TableColumn column = new TableColumn (termDetailTable, SWT.BORDER_SOLID);
column.setText (titles [i]);
}
termDetailTable.setEnabled(false);
}
+ private void createTermDetailFields() {
+ termDetailToolbar = new ToolBar(termDetailComposite, SWT.RIGHT | SWT.FLAT);
+ SwtUtils.addLabel(termDetailToolbar, getAction(Tool.SetCurator).getText());
+ curatorCombo = SwtUtils.addCombo(termDetailToolbar, 175, SWT.READ_ONLY);
+ curatorCombo.setToolTipText( getAction(Tool.SetPainter).getToolTipText());
+ curatorCombo.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ execute(Tool.SetPainter, null);
+ }
+ });
+ String[] curatorsList = AppWindow.props.getProperty("CuratorNamesList").split(",");
+ for(String curator : curatorsList)
+ curatorCombo.add(curator);
+ termDetailToolbar.pack();
+ }
+
private void layoutControls() {
GridLayout layout = new GridLayout(3, false);
layout.marginHeight = 1;
gd.verticalSpan = 1;
termLookupBar.setLayoutData(gd);
- // Layout term detail table
+ // Inner composite properties
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.verticalAlignment = GridData.BEGINNING;
gd.verticalIndent = 1;
gd.verticalSpan = 1;
+ termDetailComposite.setLayoutData(gd);
+
+ // Layout term detail Composite
+ GridLayout termDetailLayout = new GridLayout(1, true);
+ termDetailComposite.setLayout(termDetailLayout);
+
+ // Layout term detail table
+ gd = new GridData(SWT.FILL,SWT.FILL,true,true);
+ gd.grabExcessHorizontalSpace = true;
+ gd.grabExcessVerticalSpace = true;
termDetailTable.setLayoutData(gd);
-
+
+ // Layout term lookup toolbar within ineer composite
+ gd = new GridData();
+ gd.horizontalAlignment = SWT.FILL;
+ gd.verticalAlignment = GridData.BEGINNING;
+ gd.verticalIndent = 1;
+ gd.verticalSpan = 1;
+ termDetailToolbar.setLayoutData(gd);
+
}