From 8251d6927053ad8e0ae31e05b245b51e0f0348ba Mon Sep 17 00:00:00 2001 From: preecej Date: Wed, 25 Jan 2012 22:34:24 +0000 Subject: [PATCH] Renamed bar3 (toolbar 3) to termLookupBar, added accessionId attribute to SegmentationMask, parsed term accession id from lookup service and populated accessionId svn path=/; revision=277 --- .../dcu/apps/ist/views/SegmentationView.java | 23 +++++++++++-------- .../src/ie/dcu/segment/SegmentationMask.java | 5 +++- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Annotation/src/ie/dcu/apps/ist/views/SegmentationView.java b/Annotation/src/ie/dcu/apps/ist/views/SegmentationView.java index 2bc5cb4..6840180 100644 --- a/Annotation/src/ie/dcu/apps/ist/views/SegmentationView.java +++ b/Annotation/src/ie/dcu/apps/ist/views/SegmentationView.java @@ -46,7 +46,7 @@ public class SegmentationView extends Composite { // Left and right tool bar - private final ToolBar bar1, bar2, bar3; + private final ToolBar bar1, bar2, termLookupBar; // Control to change brush size private final BrushControl brushControl; @@ -120,7 +120,7 @@ public class SegmentationView extends Composite { painters = new PainterRegistry(); bar1 = new ToolBar(this, SWT.RIGHT | SWT.FLAT); bar2 = new ToolBar(this, SWT.RIGHT | SWT.FLAT); - bar3 = new ToolBar(this, SWT.RIGHT | SWT.FLAT); + termLookupBar = new ToolBar(this, SWT.RIGHT | SWT.FLAT); view = new AnnotatedImageControl(this, SWT.BORDER); brushControl = new BrushControl(getShell(), SWT.BORDER); eventHandler = new EventHandler(); @@ -137,7 +137,8 @@ public class SegmentationView extends Composite { initTools(); createToolbar1(); createToolbar2(); - createToolbar3(); + createToolTermLookupBar(); + //createToolTermDetailPanel(); layoutControls(); updatePainters(); addListeners(); @@ -202,19 +203,20 @@ public class SegmentationView extends Composite { }); bar2.pack(); } + /** * Third tool bar for holding the Annotate Combo box. */ - private void createToolbar3() { - SwtUtils.addLabel(bar3, getAction(Tool.SetLabel).getText()); - comboLabel = SwtUtils.addCombo(bar3, 150, SWT.SIMPLE); + private void createToolTermLookupBar() { + SwtUtils.addLabel(termLookupBar, getAction(Tool.SetLabel).getText()); + comboLabel = SwtUtils.addCombo(termLookupBar, 150, SWT.SIMPLE); comboLabel.setToolTipText( getAction(Tool.SetLabel).getToolTipText()); comboLabel.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent e) { dropdownLabels(e); } }); - assign = SwtUtils.addButton(bar3, 50, "Assign"); + assign = SwtUtils.addButton(termLookupBar, 52, "Assign"); assign.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent arg0) { if(view.getContext().isEnabled()) @@ -222,6 +224,7 @@ public class SegmentationView extends Composite { if(comboLabel.getText().indexOf('{') != -1) { view.getContext().getEnabledMask().segmentName = comboLabel.getText().substring(0,comboLabel.getText().indexOf('{')-1); + view.getContext().getEnabledMask().accessionId = comboLabel.getText().substring(comboLabel.getText().indexOf('{')+1,comboLabel.getText().length()-1); } else { @@ -231,7 +234,7 @@ public class SegmentationView extends Composite { execute(Tool.AssignButton, null); } }); - bar3.pack(); + termLookupBar.pack(); } /** @@ -297,13 +300,13 @@ public class SegmentationView extends Composite { gd.verticalAlignment = SWT.FILL; view.setLayoutData(gd); - // Layout toolbar 3 + // Layout right panel gd = new GridData(); gd.horizontalAlignment = SWT.FILL; gd.verticalAlignment = GridData.BEGINNING; gd.verticalIndent = 1; gd.verticalSpan = 2; - bar3.setLayoutData(gd); + termLookupBar.setLayoutData(gd); } diff --git a/Annotation/src/ie/dcu/segment/SegmentationMask.java b/Annotation/src/ie/dcu/segment/SegmentationMask.java index a8e9f8e..bc9c35e 100644 --- a/Annotation/src/ie/dcu/segment/SegmentationMask.java +++ b/Annotation/src/ie/dcu/segment/SegmentationMask.java @@ -60,6 +60,9 @@ public class SegmentationMask extends ByteMatrix{ //The name(label) associated with each segment. public String segmentName; + + // accession id associated with the segmentName + public String accessionId; //The maskImage each segment. public Image maskImage; @@ -69,7 +72,7 @@ public class SegmentationMask extends ByteMatrix{ //Whether the segment needs to be enabled(highlighted) or not ? public boolean enabled; - + /** * Create a segmentation mask using the specified dimensions. All pixels in * the mask are initially set to {@link SegmentationMask#UNKNOWN}. -- 2.34.1