Skip to content

Commit

Permalink
Clarify zoom in instructions for whole genome view. Fixes #1539
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinso committed Aug 14, 2024
1 parent 71e111a commit b730c8a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
6 changes: 5 additions & 1 deletion src/main/java/org/broad/igv/sam/AlignmentTrack.java
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,11 @@ public void render(RenderContext context, Rectangle rect) {
if (viewWindowSize > getVisibilityWindow()) {
Rectangle visibleRect = context.getVisibleRect().intersection(rect);
Graphics2D g2 = context.getGraphic2DForColor(Color.gray);
GraphicUtils.drawCenteredText("Zoom in to see alignments.", visibleRect, g2);
String message = context.getReferenceFrame().getChrName().equals(Globals.CHR_ALL) ?
"Select a chromosome and zoom in to see alignments." :
"Zoom in to see alignments.";

GraphicUtils.drawCenteredText(message, visibleRect, g2);
return;
}

Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/broad/igv/sam/CoverageTrack.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,10 @@ public void render(RenderContext context, Rectangle rect) {
if (viewWindowSize > getVisibilityWindow() && dataSource == null) {
Rectangle visibleRect = context.getVisibleRect().intersection(rect);
Graphics2D g = context.getGraphic2DForColor(Color.gray);
GraphicUtils.drawCenteredText("Zoom in to see coverage.", visibleRect, g);
String message = context.getReferenceFrame().getChrName().equals(Globals.CHR_ALL) ?
"Select a chromosome and zoom in to see coverage." :
"Zoom in to see coverage.";
GraphicUtils.drawCenteredText(message, visibleRect, g);
return;
}

Expand Down
11 changes: 4 additions & 7 deletions src/main/java/org/broad/igv/sam/SpliceJunctionTrack.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@ public void render(RenderContext context, Rectangle rect) {
if (!isShowFeatures(context.getReferenceFrame())) {
Rectangle visibleRect = context.getVisibleRect().intersection(rect);
Graphics2D g = context.getGraphic2DForColor(Color.gray);
GraphicUtils.drawCenteredText("Zoom in to see features.", visibleRect, g);
return;
String message = context.getReferenceFrame().getChrName().equals(Globals.CHR_ALL) ?
"Select a chromosome and zoom in to see features." :
"Zoom in to see features.";
GraphicUtils.drawCenteredText(message, visibleRect, g);
} else {
super.render(context, rect);
}
Expand Down Expand Up @@ -207,11 +209,6 @@ public float getRegionScore(String chr, int start, int end, int zoom, RegionScor
return 0;
}

@Override
protected String getZoomInMessage(String chr) {
return "Zoom in to see junctions.";
}

@Override
protected void renderFeatures(RenderContext context, Rectangle inputRect) {

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/broad/igv/track/FeatureTrack.java
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ protected void renderCoverage(RenderContext context, Rectangle inputRect) {
}

protected String getZoomInMessage(String chr) {
return chr.equals(Globals.CHR_ALL) ? "Zoom in to see features." :
return chr.equals(Globals.CHR_ALL) ? "Select a chromosome and zoom in to see features." :
"Zoom in to see features, or right-click to increase Feature Visibility Window.";
}

Expand Down

0 comments on commit b730c8a

Please sign in to comment.