-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix double-click behavior for non-transcript features in AnnotatorPan…
…el (#1386) * Fix double-click behavior for non-transcript features in AnnotatorPanel * change method definition for displayFeature
- Loading branch information
1 parent
189eb9e
commit 04a9034
Showing
1 changed file
with
31 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -428,7 +428,7 @@ private static void updateAnnotationInfo(AnnotationInfo annotationInfo) { | |
geneDetailPanel.updateData(annotationInfo); | ||
tabPanel.getTabWidget(1).getParent().setVisible(false); | ||
break; | ||
case "Transcript": | ||
case "transcript": | ||
transcriptDetailPanel.updateData(annotationInfo); | ||
tabPanel.getTabWidget(1).getParent().setVisible(true); | ||
exonDetailPanel.updateData(annotationInfo,selectedAnnotationInfo); | ||
|
@@ -446,7 +446,6 @@ private static void updateAnnotationInfo(AnnotationInfo annotationInfo) { | |
break; | ||
case "transposable_element": | ||
case "repeat_region": | ||
// fireAnnotationInfoChangeEvent(annotationInfo); | ||
repeatRegionDetailPanel.updateData(annotationInfo); | ||
tabPanel.getTabWidget(1).getParent().setVisible(false); | ||
break; | ||
|
@@ -688,9 +687,28 @@ public void displayTranscript(int geneIndex, String uniqueName) { | |
MainPanel.updateGenomicViewerForLocation(selectedAnnotationInfo.getSequence(), min, max, false); | ||
} | ||
|
||
// also used by javascript function | ||
public void displayFeature(int featureIndex) { | ||
AnnotationInfo annotationInfo = dataGrid.getVisibleItem(Math.abs(dataGrid.getVisibleRange().getStart() - featureIndex)); | ||
String type = annotationInfo.getType(); | ||
if (type.equals("transposable_element") || type.equals("repeat_region")) { | ||
// do nothing | ||
} | ||
else { | ||
exonDetailPanel.updateData(annotationInfo); | ||
} | ||
gotoAnnotation.setEnabled(true); | ||
lastGeneIndex = featureIndex; | ||
Integer min = selectedAnnotationInfo.getMin() - 50; | ||
Integer max = selectedAnnotationInfo.getMax() + 50; | ||
min = min < 0 ? 0 : min; | ||
MainPanel.updateGenomicViewerForLocation(selectedAnnotationInfo.getSequence(), min, max, false); | ||
} | ||
|
||
public static native void exportStaticMethod(AnnotatorPanel annotatorPanel) /*-{ | ||
var that = this; | ||
$wnd.displayTranscript = $entry([email protected]::displayTranscript(ILjava/lang/String;)); | ||
$wnd.displayFeature = $entry([email protected]::displayFeature(I)); | ||
$wnd.enableGoto = $entry([email protected]::enableGoto(ILjava/lang/String;)); | ||
// $wnd.showInAnnotatorPanel = $entry(@org.bbop.apollo.gwt.client.AnnotatorPanel::showInAnnotatorPanel(Ljava/lang/String;Ljava/lang/String;)); | ||
}-*/; | ||
|
@@ -732,7 +750,17 @@ private void buildAnnotationRow(final AnnotationInfo rowValue, int absRowIndex, | |
SafeHtml htmlString = new SafeHtmlBuilder().appendHtmlConstant(html.getHTML()).toSafeHtml(); | ||
td.html(htmlString); | ||
} else { | ||
renderCell(td, createContext(0), nameColumn, rowValue); | ||
String type = rowValue.getType(); | ||
if (type.equals("gene") || type.equals("pseudogene")) { | ||
renderCell(td, createContext(0), nameColumn, rowValue); | ||
} | ||
else { | ||
// handles singleton features | ||
String featureStyle = "color: #800080;"; | ||
HTML html = new HTML("<a style='" + featureStyle + "' ondblclick=\"displayFeature(" + absRowIndex + ")\");\">" + rowValue.getName() + "</a>"); | ||
SafeHtml htmlString = new SafeHtmlBuilder().appendHtmlConstant(html.getHTML()).toSafeHtml(); | ||
td.html(htmlString); | ||
} | ||
} | ||
td.endTD(); | ||
|
||
|