| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
|
| 21 |
|
package jalview.appletgui; |
| 22 |
|
|
| 23 |
|
import jalview.analysis.AnnotationSorter; |
| 24 |
|
import jalview.api.AlignViewportI; |
| 25 |
|
import jalview.api.AlignmentViewPanel; |
| 26 |
|
import jalview.bin.JalviewLite; |
| 27 |
|
import jalview.datamodel.AlignmentI; |
| 28 |
|
import jalview.datamodel.SearchResultsI; |
| 29 |
|
import jalview.datamodel.SequenceI; |
| 30 |
|
import jalview.structure.StructureSelectionManager; |
| 31 |
|
import jalview.viewmodel.ViewportListenerI; |
| 32 |
|
import jalview.viewmodel.ViewportRanges; |
| 33 |
|
|
| 34 |
|
import java.awt.BorderLayout; |
| 35 |
|
import java.awt.Color; |
| 36 |
|
import java.awt.Dimension; |
| 37 |
|
import java.awt.FontMetrics; |
| 38 |
|
import java.awt.Frame; |
| 39 |
|
import java.awt.Graphics; |
| 40 |
|
import java.awt.Panel; |
| 41 |
|
import java.awt.Scrollbar; |
| 42 |
|
import java.awt.event.AdjustmentEvent; |
| 43 |
|
import java.awt.event.AdjustmentListener; |
| 44 |
|
import java.awt.event.ComponentAdapter; |
| 45 |
|
import java.awt.event.ComponentEvent; |
| 46 |
|
import java.beans.PropertyChangeEvent; |
| 47 |
|
import java.util.List; |
| 48 |
|
|
| 49 |
|
@SuppressWarnings("serial") |
| |
|
| 0% |
Uncovered Elements: 547 (547) |
Complexity: 121 |
Complexity Density: 0.32 |
|
| 50 |
|
public class AlignmentPanel extends Panel |
| 51 |
|
implements AdjustmentListener, AlignmentViewPanel, ViewportListenerI |
| 52 |
|
{ |
| 53 |
|
|
| 54 |
|
public AlignViewport av; |
| 55 |
|
|
| 56 |
|
OverviewPanel overviewPanel; |
| 57 |
|
|
| 58 |
|
SeqPanel seqPanel; |
| 59 |
|
|
| 60 |
|
IdPanel idPanel; |
| 61 |
|
|
| 62 |
|
IdwidthAdjuster idwidthAdjuster; |
| 63 |
|
|
| 64 |
|
public AlignFrame alignFrame; |
| 65 |
|
|
| 66 |
|
ScalePanel scalePanel; |
| 67 |
|
|
| 68 |
|
AnnotationPanel annotationPanel; |
| 69 |
|
|
| 70 |
|
AnnotationLabels alabels; |
| 71 |
|
|
| 72 |
|
ViewportRanges vpRanges; |
| 73 |
|
|
| 74 |
|
|
| 75 |
|
boolean fastPaint = true; |
| 76 |
|
|
| |
|
| 0% |
Uncovered Elements: 35 (35) |
Complexity: 2 |
Complexity Density: 0.06 |
|
| 77 |
0 |
public AlignmentPanel(AlignFrame af, final AlignViewport av)... |
| 78 |
|
{ |
| 79 |
0 |
try |
| 80 |
|
{ |
| 81 |
0 |
jbInit(); |
| 82 |
|
} catch (Exception e) |
| 83 |
|
{ |
| 84 |
0 |
e.printStackTrace(); |
| 85 |
|
} |
| 86 |
|
|
| 87 |
0 |
alignFrame = af; |
| 88 |
0 |
this.av = av; |
| 89 |
0 |
vpRanges = av.getRanges(); |
| 90 |
0 |
seqPanel = new SeqPanel(av, this); |
| 91 |
0 |
idPanel = new IdPanel(av, this); |
| 92 |
0 |
scalePanel = new ScalePanel(av, this); |
| 93 |
0 |
idwidthAdjuster = new IdwidthAdjuster(this); |
| 94 |
0 |
annotationPanel = new AnnotationPanel(this); |
| 95 |
0 |
annotationPanelHolder.add(annotationPanel, BorderLayout.CENTER); |
| 96 |
|
|
| 97 |
0 |
sequenceHolderPanel.add(annotationPanelHolder, BorderLayout.SOUTH); |
| 98 |
0 |
alabels = new AnnotationLabels(this); |
| 99 |
|
|
| 100 |
0 |
setAnnotationVisible(av.isShowAnnotation()); |
| 101 |
|
|
| 102 |
0 |
idPanelHolder.add(idPanel, BorderLayout.CENTER); |
| 103 |
0 |
idSpaceFillerPanel1.add(idwidthAdjuster, BorderLayout.CENTER); |
| 104 |
0 |
annotationSpaceFillerHolder.add(alabels, BorderLayout.CENTER); |
| 105 |
0 |
scalePanelHolder.add(scalePanel, BorderLayout.CENTER); |
| 106 |
0 |
seqPanelHolder.add(seqPanel, BorderLayout.CENTER); |
| 107 |
|
|
| 108 |
0 |
fontChanged(); |
| 109 |
0 |
setScrollValues(0, 0); |
| 110 |
|
|
| 111 |
0 |
apvscroll.addAdjustmentListener(this); |
| 112 |
0 |
hscroll.addAdjustmentListener(this); |
| 113 |
0 |
vscroll.addAdjustmentListener(this); |
| 114 |
|
|
| 115 |
0 |
addComponentListener(new ComponentAdapter() |
| 116 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 4 |
Complexity Density: 0.4 |
|
| 117 |
0 |
@Override... |
| 118 |
|
public void componentResized(ComponentEvent evt) |
| 119 |
|
{ |
| 120 |
|
|
| 121 |
|
|
| 122 |
|
|
| 123 |
0 |
if (av.getWrapAlignment()) |
| 124 |
|
{ |
| 125 |
0 |
int widthInRes = seqPanel.seqCanvas |
| 126 |
|
.getWrappedCanvasWidth(seqPanel.seqCanvas.getWidth()); |
| 127 |
0 |
vpRanges.setViewportWidth(widthInRes); |
| 128 |
|
} |
| 129 |
|
else |
| 130 |
|
{ |
| 131 |
0 |
int widthInRes = seqPanel.seqCanvas.getWidth() |
| 132 |
|
/ av.getCharWidth(); |
| 133 |
0 |
int heightInSeq = seqPanel.seqCanvas.getHeight() |
| 134 |
|
/ av.getCharHeight(); |
| 135 |
|
|
| 136 |
0 |
vpRanges.setViewportWidth(widthInRes); |
| 137 |
0 |
vpRanges.setViewportHeight(heightInSeq); |
| 138 |
|
} |
| 139 |
|
|
| 140 |
0 |
if (getSize().height > 0 |
| 141 |
|
&& annotationPanelHolder.getSize().height > 0) |
| 142 |
|
{ |
| 143 |
0 |
validateAnnotationDimensions(false); |
| 144 |
|
} |
| 145 |
0 |
repaint(); |
| 146 |
|
} |
| 147 |
|
|
| 148 |
|
}); |
| 149 |
|
|
| 150 |
0 |
Dimension d = calculateIdWidth(); |
| 151 |
0 |
idPanel.idCanvas.setSize(d); |
| 152 |
|
|
| 153 |
0 |
hscrollFillerPanel.setSize(d.width, annotationPanel.getSize().height); |
| 154 |
|
|
| 155 |
0 |
idPanel.idCanvas.setSize(d.width, seqPanel.seqCanvas.getSize().height); |
| 156 |
0 |
annotationSpaceFillerHolder.setSize(d.width, |
| 157 |
|
annotationPanel.getSize().height); |
| 158 |
0 |
alabels.setSize(d.width, annotationPanel.getSize().height); |
| 159 |
0 |
final AlignmentPanel ap = this; |
| 160 |
0 |
av.addPropertyChangeListener(new java.beans.PropertyChangeListener() |
| 161 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 162 |
0 |
@Override... |
| 163 |
|
public void propertyChange(java.beans.PropertyChangeEvent evt) |
| 164 |
|
{ |
| 165 |
0 |
if (evt.getPropertyName().equals("alignment")) |
| 166 |
|
{ |
| 167 |
0 |
PaintRefresher.Refresh(ap, av.getSequenceSetId(), true, true); |
| 168 |
0 |
alignmentChanged(); |
| 169 |
|
} |
| 170 |
|
} |
| 171 |
|
}); |
| 172 |
0 |
av.getRanges().addPropertyChangeListener(this); |
| 173 |
|
} |
| 174 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 175 |
0 |
@Override... |
| 176 |
|
public AlignViewportI getAlignViewport() |
| 177 |
|
{ |
| 178 |
0 |
return av; |
| 179 |
|
} |
| 180 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 181 |
0 |
public SequenceRenderer getSequenceRenderer()... |
| 182 |
|
{ |
| 183 |
0 |
return seqPanel.seqCanvas.sr; |
| 184 |
|
} |
| 185 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 186 |
0 |
@Override... |
| 187 |
|
public jalview.api.FeatureRenderer getFeatureRenderer() |
| 188 |
|
{ |
| 189 |
0 |
return seqPanel.seqCanvas.fr; |
| 190 |
|
} |
| 191 |
|
|
| |
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 192 |
0 |
@Override... |
| 193 |
|
public jalview.api.FeatureRenderer cloneFeatureRenderer() |
| 194 |
|
{ |
| 195 |
0 |
FeatureRenderer nfr = new FeatureRenderer(av); |
| 196 |
0 |
nfr.transferSettings(seqPanel.seqCanvas.fr); |
| 197 |
0 |
return nfr; |
| 198 |
|
} |
| 199 |
|
|
| |
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
| 200 |
0 |
public void alignmentChanged()... |
| 201 |
|
{ |
| 202 |
0 |
av.alignmentChanged(this); |
| 203 |
|
|
| 204 |
0 |
if (overviewPanel != null) |
| 205 |
|
{ |
| 206 |
0 |
overviewPanel.updateOverviewImage(); |
| 207 |
|
} |
| 208 |
|
|
| 209 |
0 |
alignFrame.updateEditMenuBar(); |
| 210 |
|
|
| 211 |
0 |
repaint(); |
| 212 |
|
} |
| 213 |
|
|
| |
|
| 0% |
Uncovered Elements: 16 (16) |
Complexity: 1 |
Complexity Density: 0.06 |
|
| 214 |
0 |
public void fontChanged()... |
| 215 |
|
{ |
| 216 |
|
|
| 217 |
|
|
| 218 |
0 |
idPanel.idCanvas.image = null; |
| 219 |
0 |
FontMetrics fm = getFontMetrics(av.getFont()); |
| 220 |
|
|
| 221 |
0 |
scalePanel.setSize( |
| 222 |
|
new Dimension(10, av.getCharHeight() + fm.getDescent())); |
| 223 |
0 |
idwidthAdjuster.setSize( |
| 224 |
|
new Dimension(10, av.getCharHeight() + fm.getDescent())); |
| 225 |
0 |
av.updateSequenceIdColours(); |
| 226 |
0 |
annotationPanel.image = null; |
| 227 |
0 |
int ap = annotationPanel.adjustPanelHeight(false); |
| 228 |
0 |
Dimension d = calculateIdWidth(); |
| 229 |
0 |
d.setSize(d.width + 4, seqPanel.seqCanvas.getSize().height); |
| 230 |
0 |
alabels.setSize(d.width + 4, ap); |
| 231 |
|
|
| 232 |
0 |
idPanel.idCanvas.setSize(d); |
| 233 |
0 |
hscrollFillerPanel.setSize(d); |
| 234 |
|
|
| 235 |
0 |
validateAnnotationDimensions(false); |
| 236 |
0 |
annotationPanel.repaint(); |
| 237 |
0 |
validate(); |
| 238 |
0 |
repaint(); |
| 239 |
|
} |
| 240 |
|
|
| |
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
| 241 |
0 |
public void setIdWidth(int w, int h)... |
| 242 |
|
{ |
| 243 |
0 |
idPanel.idCanvas.setSize(w, h); |
| 244 |
0 |
idPanelHolder.setSize(w, idPanelHolder.getSize().height); |
| 245 |
0 |
annotationSpaceFillerHolder.setSize(w, |
| 246 |
|
annotationSpaceFillerHolder.getSize().height); |
| 247 |
0 |
alabels.setSize(w, alabels.getSize().height); |
| 248 |
0 |
validate(); |
| 249 |
|
} |
| 250 |
|
|
| |
|
| 0% |
Uncovered Elements: 36 (36) |
Complexity: 8 |
Complexity Density: 0.33 |
|
| 251 |
0 |
Dimension calculateIdWidth()... |
| 252 |
|
{ |
| 253 |
0 |
if (av.nullFrame == null) |
| 254 |
|
{ |
| 255 |
0 |
av.nullFrame = new Frame(); |
| 256 |
0 |
av.nullFrame.addNotify(); |
| 257 |
|
} |
| 258 |
|
|
| 259 |
0 |
Graphics g = av.nullFrame.getGraphics(); |
| 260 |
|
|
| 261 |
0 |
FontMetrics fm = g.getFontMetrics(av.font); |
| 262 |
0 |
AlignmentI al = av.getAlignment(); |
| 263 |
|
|
| 264 |
0 |
int i = 0; |
| 265 |
0 |
int idWidth = 0; |
| 266 |
0 |
String id; |
| 267 |
0 |
while (i < al.getHeight() && al.getSequenceAt(i) != null) |
| 268 |
|
{ |
| 269 |
0 |
SequenceI s = al.getSequenceAt(i); |
| 270 |
0 |
id = s.getDisplayId(av.getShowJVSuffix()); |
| 271 |
|
|
| 272 |
0 |
if (fm.stringWidth(id) > idWidth) |
| 273 |
|
{ |
| 274 |
0 |
idWidth = fm.stringWidth(id); |
| 275 |
|
} |
| 276 |
0 |
i++; |
| 277 |
|
} |
| 278 |
|
|
| 279 |
|
|
| 280 |
0 |
i = 0; |
| 281 |
0 |
if (al.getAlignmentAnnotation() != null) |
| 282 |
|
{ |
| 283 |
0 |
fm = g.getFontMetrics(av.nullFrame.getFont()); |
| 284 |
0 |
while (i < al.getAlignmentAnnotation().length) |
| 285 |
|
{ |
| 286 |
0 |
String label = al.getAlignmentAnnotation()[i].label; |
| 287 |
0 |
if (fm.stringWidth(label) > idWidth) |
| 288 |
|
{ |
| 289 |
0 |
idWidth = fm.stringWidth(label); |
| 290 |
|
} |
| 291 |
0 |
i++; |
| 292 |
|
} |
| 293 |
|
} |
| 294 |
|
|
| 295 |
0 |
return new Dimension(idWidth, idPanel.idCanvas.getSize().height); |
| 296 |
|
} |
| 297 |
|
|
| 298 |
|
|
| 299 |
|
|
| 300 |
|
|
| 301 |
|
|
| |
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 302 |
0 |
public void highlightSearchResults(SearchResultsI results)... |
| 303 |
|
{ |
| 304 |
0 |
scrollToPosition(results); |
| 305 |
0 |
seqPanel.seqCanvas.highlightSearchResults(results); |
| 306 |
|
} |
| 307 |
|
|
| 308 |
|
|
| 309 |
|
|
| 310 |
|
|
| 311 |
|
|
| 312 |
|
@param |
| 313 |
|
@return |
| 314 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 315 |
0 |
public boolean scrollToPosition(SearchResultsI results)... |
| 316 |
|
{ |
| 317 |
0 |
return scrollToPosition(results, true); |
| 318 |
|
} |
| 319 |
|
|
| 320 |
|
|
| 321 |
|
|
| 322 |
|
|
| 323 |
|
|
| 324 |
|
@param |
| 325 |
|
@param |
| 326 |
|
|
| 327 |
|
@return |
| 328 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 329 |
0 |
public boolean scrollToPosition(SearchResultsI results,... |
| 330 |
|
boolean redrawOverview) |
| 331 |
|
{ |
| 332 |
0 |
return scrollToPosition(results, 0, redrawOverview, false); |
| 333 |
|
} |
| 334 |
|
|
| 335 |
|
|
| 336 |
|
|
| 337 |
|
|
| 338 |
|
|
| 339 |
|
@param |
| 340 |
|
@param |
| 341 |
|
|
| 342 |
|
@return |
| 343 |
|
|
| |
|
| 0% |
Uncovered Elements: 41 (41) |
Complexity: 10 |
Complexity Density: 0.4 |
|
| 344 |
0 |
public boolean scrollToPosition(SearchResultsI results,... |
| 345 |
|
int verticalOffset, boolean redrawOverview, boolean centre) |
| 346 |
|
{ |
| 347 |
|
|
| 348 |
0 |
if (results != null && results.getCount() > 0) |
| 349 |
|
{ |
| 350 |
0 |
AlignmentI alignment = av.getAlignment(); |
| 351 |
0 |
int seqIndex = alignment.findIndex(results); |
| 352 |
0 |
if (seqIndex == -1) |
| 353 |
|
{ |
| 354 |
0 |
return false; |
| 355 |
|
} |
| 356 |
|
|
| 357 |
|
|
| 358 |
|
|
| 359 |
|
|
| 360 |
0 |
SequenceI seq = alignment.getSequenceAt(seqIndex); |
| 361 |
0 |
int[] r = results.getResults(seq, 0, alignment.getWidth()); |
| 362 |
0 |
if (r == null) |
| 363 |
|
{ |
| 364 |
0 |
if (JalviewLite.debug) |
| 365 |
|
{ |
| 366 |
0 |
jalview.bin.Console.outPrintln( |
| 367 |
|
"DEBUG: scroll didn't happen - results not within alignment : " |
| 368 |
|
+ seq.getStart() + "," + seq.getEnd()); |
| 369 |
|
} |
| 370 |
0 |
return false; |
| 371 |
|
} |
| 372 |
0 |
if (JalviewLite.debug) |
| 373 |
|
{ |
| 374 |
|
|
| 375 |
|
|
| 376 |
|
|
| 377 |
|
|
| 378 |
|
|
| 379 |
|
|
| 380 |
|
|
| 381 |
|
} |
| 382 |
0 |
int start = r[0]; |
| 383 |
0 |
int end = r[1]; |
| 384 |
|
|
| 385 |
|
|
| 386 |
|
|
| 387 |
|
|
| 388 |
|
|
| 389 |
0 |
if (centre) |
| 390 |
|
{ |
| 391 |
0 |
int offset = (vpRanges.getEndRes() - vpRanges.getStartRes() + 1) / 2 |
| 392 |
|
- 1; |
| 393 |
0 |
start = Math.max(start - offset, 0); |
| 394 |
0 |
end = end + offset - 1; |
| 395 |
|
|
| 396 |
|
} |
| 397 |
|
|
| 398 |
0 |
if (start < 0) |
| 399 |
|
{ |
| 400 |
0 |
return false; |
| 401 |
|
} |
| 402 |
0 |
if (end == seq.getEnd()) |
| 403 |
|
{ |
| 404 |
0 |
return false; |
| 405 |
|
} |
| 406 |
|
|
| 407 |
|
|
| 408 |
|
|
| 409 |
|
|
| 410 |
0 |
seqIndex = Math.max(0, seqIndex - verticalOffset); |
| 411 |
0 |
return scrollTo(start, end, seqIndex, false, redrawOverview); |
| 412 |
|
} |
| 413 |
0 |
return true; |
| 414 |
|
} |
| 415 |
|
|
| |
|
| 0% |
Uncovered Elements: 38 (38) |
Complexity: 10 |
Complexity Density: 0.45 |
|
| 416 |
0 |
public boolean scrollTo(int ostart, int end, int seqIndex,... |
| 417 |
|
boolean scrollToNearest, boolean redrawOverview) |
| 418 |
|
{ |
| 419 |
0 |
int startv, endv, starts, ends; |
| 420 |
|
|
| 421 |
0 |
int start = -1; |
| 422 |
0 |
if (av.hasHiddenColumns()) |
| 423 |
|
{ |
| 424 |
0 |
AlignmentI al = av.getAlignment(); |
| 425 |
0 |
start = al.getHiddenColumns().absoluteToVisibleColumn(ostart); |
| 426 |
0 |
end = al.getHiddenColumns().absoluteToVisibleColumn(end); |
| 427 |
0 |
if (start == end) |
| 428 |
|
{ |
| 429 |
0 |
if (!scrollToNearest && !al.getHiddenColumns().isVisible(ostart)) |
| 430 |
|
{ |
| 431 |
|
|
| 432 |
0 |
return false; |
| 433 |
|
} |
| 434 |
|
} |
| 435 |
|
} |
| 436 |
|
else |
| 437 |
|
{ |
| 438 |
0 |
start = ostart; |
| 439 |
|
} |
| 440 |
|
|
| 441 |
0 |
if (!av.getWrapAlignment()) |
| 442 |
|
{ |
| 443 |
|
|
| 444 |
|
|
| 445 |
|
|
| 446 |
|
|
| 447 |
|
|
| 448 |
|
|
| 449 |
|
|
| 450 |
|
|
| 451 |
|
|
| 452 |
|
|
| 453 |
|
|
| 454 |
|
|
| 455 |
|
|
| 456 |
|
|
| 457 |
|
|
| 458 |
|
|
| 459 |
|
|
| 460 |
|
|
| 461 |
|
|
| 462 |
|
|
| 463 |
|
|
| 464 |
|
|
| 465 |
|
|
| 466 |
|
|
| 467 |
|
|
| 468 |
|
|
| 469 |
|
|
| 470 |
|
|
| 471 |
|
|
| 472 |
|
|
| 473 |
|
|
| 474 |
|
|
| 475 |
|
|
| 476 |
|
|
| 477 |
|
|
| 478 |
|
|
| 479 |
0 |
if ((startv = vpRanges.getStartRes()) >= start) |
| 480 |
|
{ |
| 481 |
|
|
| 482 |
|
|
| 483 |
|
|
| 484 |
0 |
setScrollValues(start - 1, seqIndex); |
| 485 |
|
} |
| 486 |
0 |
else if ((endv = vpRanges.getEndRes()) <= end) |
| 487 |
|
{ |
| 488 |
|
|
| 489 |
|
|
| 490 |
|
|
| 491 |
0 |
setScrollValues(startv + 1 + end - endv, seqIndex); |
| 492 |
|
} |
| 493 |
0 |
else if ((starts = vpRanges.getStartSeq()) > seqIndex) |
| 494 |
|
{ |
| 495 |
|
|
| 496 |
|
|
| 497 |
|
|
| 498 |
0 |
setScrollValues(vpRanges.getStartRes(), seqIndex); |
| 499 |
|
} |
| 500 |
0 |
else if ((ends = vpRanges.getEndSeq()) <= seqIndex) |
| 501 |
|
{ |
| 502 |
|
|
| 503 |
|
|
| 504 |
|
|
| 505 |
0 |
setScrollValues(vpRanges.getStartRes(), |
| 506 |
|
starts + seqIndex - ends + 1); |
| 507 |
|
} |
| 508 |
|
|
| 509 |
|
|
| 510 |
|
|
| 511 |
|
} |
| 512 |
|
else |
| 513 |
|
{ |
| 514 |
0 |
vpRanges.scrollToWrappedVisible(start); |
| 515 |
|
} |
| 516 |
|
|
| 517 |
0 |
paintAlignment(redrawOverview, false); |
| 518 |
0 |
return true; |
| 519 |
|
} |
| 520 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 521 |
0 |
public OverviewPanel getOverviewPanel()... |
| 522 |
|
{ |
| 523 |
0 |
return overviewPanel; |
| 524 |
|
} |
| 525 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 526 |
0 |
public void setOverviewPanel(OverviewPanel op)... |
| 527 |
|
{ |
| 528 |
0 |
overviewPanel = op; |
| 529 |
|
} |
| 530 |
|
|
| |
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 2 |
Complexity Density: 0.29 |
|
| 531 |
0 |
public void setAnnotationVisible(boolean b)... |
| 532 |
|
{ |
| 533 |
0 |
if (!av.getWrapAlignment()) |
| 534 |
|
{ |
| 535 |
0 |
annotationSpaceFillerHolder.setVisible(b); |
| 536 |
0 |
annotationPanelHolder.setVisible(b); |
| 537 |
|
} |
| 538 |
|
else |
| 539 |
|
{ |
| 540 |
0 |
annotationSpaceFillerHolder.setVisible(false); |
| 541 |
0 |
annotationPanelHolder.setVisible(false); |
| 542 |
|
} |
| 543 |
0 |
validate(); |
| 544 |
0 |
repaint(); |
| 545 |
|
} |
| 546 |
|
|
| 547 |
|
|
| 548 |
|
|
| 549 |
|
|
| 550 |
|
|
| |
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 2 |
Complexity Density: 0.25 |
|
| 551 |
0 |
@Override... |
| 552 |
|
public void adjustAnnotationHeight() |
| 553 |
|
{ |
| 554 |
|
|
| 555 |
|
|
| 556 |
0 |
if (alignFrame.getSize().height == 0) |
| 557 |
|
{ |
| 558 |
0 |
jalview.bin.Console.outPrintln( |
| 559 |
|
"adjustAnnotationHeight frame size zero NEEDS FIXING"); |
| 560 |
|
} |
| 561 |
0 |
fontChanged(); |
| 562 |
0 |
validateAnnotationDimensions(true); |
| 563 |
0 |
apvscroll.addNotify(); |
| 564 |
0 |
hscroll.addNotify(); |
| 565 |
0 |
validate(); |
| 566 |
0 |
paintAlignment(true, false); |
| 567 |
|
} |
| 568 |
|
|
| 569 |
|
|
| 570 |
|
|
| 571 |
|
|
| 572 |
|
|
| |
|
| 0% |
Uncovered Elements: 32 (32) |
Complexity: 5 |
Complexity Density: 0.21 |
|
| 573 |
0 |
protected void validateAnnotationDimensions(boolean adjustPanelHeight)... |
| 574 |
|
{ |
| 575 |
0 |
int rowHeight = av.getCharHeight(); |
| 576 |
0 |
int alignmentHeight = rowHeight * av.getAlignment().getHeight(); |
| 577 |
0 |
int annotationHeight = av.calcPanelHeight(); |
| 578 |
|
|
| 579 |
0 |
int mheight = annotationHeight; |
| 580 |
0 |
Dimension d = sequenceHolderPanel.getSize(); |
| 581 |
|
|
| 582 |
0 |
int availableHeight = d.height - scalePanelHolder.getHeight(); |
| 583 |
|
|
| 584 |
0 |
if (adjustPanelHeight) |
| 585 |
|
{ |
| 586 |
|
|
| 587 |
|
|
| 588 |
|
|
| 589 |
|
|
| 590 |
0 |
if (annotationHeight + alignmentHeight > availableHeight) |
| 591 |
|
{ |
| 592 |
0 |
annotationHeight = Math.min(annotationHeight, |
| 593 |
|
availableHeight - 2 * rowHeight); |
| 594 |
|
} |
| 595 |
|
} |
| 596 |
|
else |
| 597 |
|
{ |
| 598 |
|
|
| 599 |
0 |
annotationHeight = annotationPanelHolder.getSize().height; |
| 600 |
|
} |
| 601 |
|
|
| 602 |
0 |
if (availableHeight - annotationHeight < 5) |
| 603 |
|
{ |
| 604 |
0 |
annotationHeight = availableHeight; |
| 605 |
|
} |
| 606 |
|
|
| 607 |
0 |
annotationPanel.setSize(new Dimension(d.width, annotationHeight)); |
| 608 |
0 |
annotationPanelHolder.setSize(new Dimension(d.width, annotationHeight)); |
| 609 |
|
|
| 610 |
0 |
seqPanel.seqCanvas.setSize(d.width, |
| 611 |
|
seqPanel.seqCanvas.getSize().height); |
| 612 |
|
|
| 613 |
0 |
Dimension e = idPanel.getSize(); |
| 614 |
0 |
alabels.setSize(new Dimension(e.width, annotationHeight)); |
| 615 |
0 |
annotationSpaceFillerHolder |
| 616 |
|
.setSize(new Dimension(e.width, annotationHeight)); |
| 617 |
|
|
| 618 |
0 |
int s = apvscroll.getValue(); |
| 619 |
0 |
if (s > mheight - annotationHeight) |
| 620 |
|
{ |
| 621 |
0 |
s = 0; |
| 622 |
|
} |
| 623 |
0 |
apvscroll.setValues(s, annotationHeight, 0, mheight); |
| 624 |
0 |
annotationPanel.setScrollOffset(apvscroll.getValue(), false); |
| 625 |
0 |
alabels.setScrollOffset(apvscroll.getValue(), false); |
| 626 |
|
} |
| 627 |
|
|
| |
|
| 0% |
Uncovered Elements: 20 (20) |
Complexity: 3 |
Complexity Density: 0.19 |
|
| 628 |
0 |
public void setWrapAlignment(boolean wrap)... |
| 629 |
|
{ |
| 630 |
0 |
vpRanges.setStartEndSeq(0, vpRanges.getVisibleAlignmentHeight()); |
| 631 |
0 |
vpRanges.setStartRes(0); |
| 632 |
0 |
scalePanelHolder.setVisible(!wrap); |
| 633 |
|
|
| 634 |
0 |
hscroll.setVisible(!wrap); |
| 635 |
0 |
idwidthAdjuster.setVisible(!wrap); |
| 636 |
|
|
| 637 |
0 |
if (wrap) |
| 638 |
|
{ |
| 639 |
0 |
annotationPanelHolder.setVisible(false); |
| 640 |
0 |
annotationSpaceFillerHolder.setVisible(false); |
| 641 |
|
} |
| 642 |
0 |
else if (av.isShowAnnotation()) |
| 643 |
|
{ |
| 644 |
0 |
annotationPanelHolder.setVisible(true); |
| 645 |
0 |
annotationSpaceFillerHolder.setVisible(true); |
| 646 |
|
} |
| 647 |
|
|
| 648 |
0 |
idSpaceFillerPanel1.setVisible(!wrap); |
| 649 |
|
|
| 650 |
0 |
fontChanged(); |
| 651 |
|
|
| 652 |
0 |
validate(); |
| 653 |
0 |
sequenceHolderPanel.validate(); |
| 654 |
0 |
repaint(); |
| 655 |
|
|
| 656 |
|
} |
| 657 |
|
|
| 658 |
|
int hextent = 0; |
| 659 |
|
|
| 660 |
|
int vextent = 0; |
| 661 |
|
|
| |
|
| 0% |
Uncovered Elements: 45 (45) |
Complexity: 9 |
Complexity Density: 0.31 |
|
| 662 |
0 |
public void setScrollValues(int xpos, int ypos)... |
| 663 |
|
{ |
| 664 |
0 |
int x = xpos; |
| 665 |
0 |
int y = ypos; |
| 666 |
|
|
| 667 |
0 |
if (av.getWrapAlignment()) |
| 668 |
|
{ |
| 669 |
0 |
setScrollingForWrappedPanel(x); |
| 670 |
|
} |
| 671 |
|
else |
| 672 |
|
{ |
| 673 |
0 |
int width = av.getAlignment().getVisibleWidth(); |
| 674 |
0 |
int height = av.getAlignment().getHeight(); |
| 675 |
|
|
| 676 |
0 |
if (x < 0) |
| 677 |
|
{ |
| 678 |
0 |
x = 0; |
| 679 |
|
} |
| 680 |
|
|
| 681 |
0 |
hextent = seqPanel.seqCanvas.getSize().width / av.getCharWidth(); |
| 682 |
0 |
vextent = seqPanel.seqCanvas.getSize().height / av.getCharHeight(); |
| 683 |
|
|
| 684 |
0 |
if (hextent > width) |
| 685 |
|
{ |
| 686 |
0 |
hextent = width; |
| 687 |
|
} |
| 688 |
|
|
| 689 |
0 |
if (vextent > height) |
| 690 |
|
{ |
| 691 |
0 |
vextent = height; |
| 692 |
|
} |
| 693 |
|
|
| 694 |
0 |
if ((hextent + x) > width) |
| 695 |
|
{ |
| 696 |
0 |
jalview.bin.Console |
| 697 |
|
.errPrintln("hextent was " + hextent + " and x was " + x); |
| 698 |
|
|
| 699 |
0 |
x = width - hextent; |
| 700 |
|
} |
| 701 |
|
|
| 702 |
0 |
if ((vextent + y) > height) |
| 703 |
|
{ |
| 704 |
0 |
y = height - vextent; |
| 705 |
|
} |
| 706 |
|
|
| 707 |
0 |
if (y < 0) |
| 708 |
|
{ |
| 709 |
0 |
y = 0; |
| 710 |
|
} |
| 711 |
|
|
| 712 |
0 |
if (x < 0) |
| 713 |
|
{ |
| 714 |
0 |
jalview.bin.Console.errPrintln("x was " + x); |
| 715 |
0 |
x = 0; |
| 716 |
|
} |
| 717 |
|
|
| 718 |
0 |
hscroll.setValues(x, hextent, 0, width); |
| 719 |
0 |
vscroll.setValues(y, vextent, 0, height); |
| 720 |
|
|
| 721 |
|
|
| 722 |
|
|
| 723 |
0 |
adjustHorizontal(x); |
| 724 |
0 |
adjustVertical(y); |
| 725 |
|
|
| 726 |
0 |
sendViewPosition(); |
| 727 |
|
} |
| 728 |
|
} |
| 729 |
|
|
| 730 |
|
|
| 731 |
|
|
| 732 |
|
|
| 733 |
|
|
| 734 |
|
@param |
| 735 |
|
|
| 736 |
|
|
| 737 |
|
|
| |
|
| 0% |
Uncovered Elements: 15 (15) |
Complexity: 7 |
Complexity Density: 0.78 |
|
| 738 |
0 |
@Override... |
| 739 |
|
public void adjustmentValueChanged(AdjustmentEvent evt) |
| 740 |
|
{ |
| 741 |
|
|
| 742 |
|
|
| 743 |
|
|
| 744 |
0 |
if (evt == null || evt.getSource() == apvscroll) |
| 745 |
|
{ |
| 746 |
0 |
annotationPanel.setScrollOffset(apvscroll.getValue(), false); |
| 747 |
0 |
alabels.setScrollOffset(apvscroll.getValue(), false); |
| 748 |
|
} |
| 749 |
0 |
if (evt == null || evt.getSource() == hscroll) |
| 750 |
|
{ |
| 751 |
0 |
int x = hscroll.getValue(); |
| 752 |
0 |
adjustHorizontal(x); |
| 753 |
|
} |
| 754 |
|
|
| 755 |
0 |
if (evt == null || evt.getSource() == vscroll) |
| 756 |
|
{ |
| 757 |
0 |
int offy = vscroll.getValue(); |
| 758 |
0 |
adjustVertical(offy); |
| 759 |
|
} |
| 760 |
|
|
| 761 |
|
} |
| 762 |
|
|
| |
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 5 |
Complexity Density: 0.56 |
|
| 763 |
0 |
private void adjustHorizontal(int x)... |
| 764 |
|
{ |
| 765 |
0 |
int oldX = vpRanges.getStartRes(); |
| 766 |
0 |
int oldwidth = vpRanges.getViewportWidth(); |
| 767 |
0 |
int width = seqPanel.seqCanvas.getWidth() / av.getCharWidth(); |
| 768 |
|
|
| 769 |
|
|
| 770 |
|
|
| 771 |
|
|
| 772 |
0 |
if ((x == oldX) && (width == oldwidth)) |
| 773 |
|
{ |
| 774 |
0 |
return; |
| 775 |
|
} |
| 776 |
0 |
vpRanges.setViewportStartAndWidth(x, width); |
| 777 |
|
|
| 778 |
0 |
if (av.getWrapAlignment() || !fastPaint) |
| 779 |
|
{ |
| 780 |
0 |
repaint(); |
| 781 |
|
} |
| 782 |
0 |
sendViewPosition(); |
| 783 |
|
} |
| 784 |
|
|
| |
|
| 0% |
Uncovered Elements: 30 (30) |
Complexity: 9 |
Complexity Density: 0.5 |
|
| 785 |
0 |
private void adjustVertical(int newY)... |
| 786 |
|
{ |
| 787 |
0 |
if (av.getWrapAlignment()) |
| 788 |
|
{ |
| 789 |
|
|
| 790 |
|
|
| 791 |
|
|
| 792 |
|
|
| 793 |
|
|
| 794 |
0 |
int oldX = vpRanges.getStartRes(); |
| 795 |
0 |
int oldY = vpRanges.getWrappedScrollPosition(oldX); |
| 796 |
0 |
if (oldY == newY) |
| 797 |
|
{ |
| 798 |
0 |
return; |
| 799 |
|
} |
| 800 |
0 |
if (newY > -1) |
| 801 |
|
{ |
| 802 |
|
|
| 803 |
|
|
| 804 |
|
|
| 805 |
0 |
int rowSize = vpRanges.getViewportWidth(); |
| 806 |
0 |
int newX = newY > oldY ? oldX + rowSize : oldX - rowSize; |
| 807 |
0 |
vpRanges.setViewportStartAndWidth(Math.max(0, newX), rowSize); |
| 808 |
|
} |
| 809 |
|
} |
| 810 |
|
else |
| 811 |
|
{ |
| 812 |
0 |
int height = seqPanel.seqCanvas.getHeight() / av.getCharHeight(); |
| 813 |
0 |
int oldY = vpRanges.getStartSeq(); |
| 814 |
0 |
int oldheight = vpRanges.getViewportHeight(); |
| 815 |
|
|
| 816 |
|
|
| 817 |
|
|
| 818 |
|
|
| 819 |
0 |
if ((newY == oldY) && (height == oldheight)) |
| 820 |
|
{ |
| 821 |
0 |
return; |
| 822 |
|
} |
| 823 |
0 |
vpRanges.setViewportStartAndHeight(newY, height); |
| 824 |
|
} |
| 825 |
0 |
if (av.getWrapAlignment() || !fastPaint) |
| 826 |
|
{ |
| 827 |
0 |
repaint(); |
| 828 |
|
} |
| 829 |
0 |
sendViewPosition(); |
| 830 |
|
} |
| 831 |
|
|
| 832 |
|
|
| 833 |
|
|
| 834 |
|
|
| 835 |
|
|
| 836 |
|
@return |
| 837 |
|
|
| |
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 4 |
Complexity Density: 0.5 |
|
| 838 |
0 |
private AlignmentPanel getComplementPanel()... |
| 839 |
|
{ |
| 840 |
0 |
AlignmentPanel ap = null; |
| 841 |
0 |
if (alignFrame != null) |
| 842 |
|
{ |
| 843 |
0 |
SplitFrame sf = alignFrame.getSplitFrame(); |
| 844 |
0 |
if (sf != null) |
| 845 |
|
{ |
| 846 |
0 |
AlignFrame other = sf.getComplement(alignFrame); |
| 847 |
0 |
if (other != null) |
| 848 |
|
{ |
| 849 |
0 |
ap = other.alignPanel; |
| 850 |
|
} |
| 851 |
|
} |
| 852 |
|
} |
| 853 |
0 |
return ap; |
| 854 |
|
} |
| 855 |
|
|
| 856 |
|
|
| 857 |
|
|
| 858 |
|
|
| 859 |
|
|
| 860 |
|
@param |
| 861 |
|
|
| 862 |
|
|
| 863 |
|
@param |
| 864 |
|
|
| 865 |
|
|
| |
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 3 |
Complexity Density: 0.3 |
|
| 866 |
0 |
protected void scrollToCentre(SearchResultsI sr, int seqOffset)... |
| 867 |
|
{ |
| 868 |
|
|
| 869 |
|
|
| 870 |
|
|
| 871 |
|
|
| 872 |
|
|
| 873 |
0 |
SequenceI mappedTo = sr.getResults().get(0).getSequence(); |
| 874 |
0 |
List<SequenceI> seqs = av.getAlignment().getSequences(); |
| 875 |
|
|
| 876 |
|
|
| 877 |
|
|
| 878 |
|
|
| 879 |
|
|
| 880 |
0 |
boolean matched = false; |
| 881 |
0 |
for (SequenceI seq : seqs) |
| 882 |
|
{ |
| 883 |
0 |
if (mappedTo == seq.getDatasetSequence()) |
| 884 |
|
{ |
| 885 |
0 |
matched = true; |
| 886 |
0 |
break; |
| 887 |
|
} |
| 888 |
|
} |
| 889 |
0 |
if (!matched) |
| 890 |
|
{ |
| 891 |
0 |
return; |
| 892 |
|
} |
| 893 |
|
|
| 894 |
|
|
| 895 |
|
|
| 896 |
|
|
| 897 |
|
|
| 898 |
0 |
scrollToPosition(sr, seqOffset, true, true); |
| 899 |
|
} |
| 900 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 901 |
0 |
private void sendViewPosition()... |
| 902 |
|
{ |
| 903 |
0 |
StructureSelectionManager.getStructureSelectionManager(av.applet) |
| 904 |
|
.sendViewPosition(this, vpRanges.getStartRes(), |
| 905 |
|
vpRanges.getEndRes(), vpRanges.getStartSeq(), |
| 906 |
|
vpRanges.getEndSeq()); |
| 907 |
|
} |
| 908 |
|
|
| 909 |
|
|
| 910 |
|
|
| 911 |
|
|
| |
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 4 |
Complexity Density: 0.5 |
|
| 912 |
0 |
@Override... |
| 913 |
|
public void paintAlignment(boolean updateOverview, |
| 914 |
|
boolean updateStructures) |
| 915 |
|
{ |
| 916 |
0 |
final AnnotationSorter sorter = new AnnotationSorter(getAlignment(), |
| 917 |
|
av.isShowAutocalculatedAbove()); |
| 918 |
0 |
sorter.sort(getAlignment().getAlignmentAnnotation(), |
| 919 |
|
av.getSortAnnotationsBy()); |
| 920 |
0 |
repaint(); |
| 921 |
|
|
| 922 |
0 |
if (updateStructures) |
| 923 |
|
{ |
| 924 |
0 |
jalview.structure.StructureSelectionManager |
| 925 |
|
.getStructureSelectionManager(av.applet) |
| 926 |
|
.sequenceColoursChanged(this); |
| 927 |
|
} |
| 928 |
0 |
if (updateOverview) |
| 929 |
|
{ |
| 930 |
0 |
if (overviewPanel != null) |
| 931 |
|
{ |
| 932 |
0 |
overviewPanel.updateOverviewImage(); |
| 933 |
|
} |
| 934 |
|
} |
| 935 |
|
} |
| 936 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 937 |
0 |
@Override... |
| 938 |
|
public void update(Graphics g) |
| 939 |
|
{ |
| 940 |
0 |
paint(g); |
| 941 |
|
} |
| 942 |
|
|
| |
|
| 0% |
Uncovered Elements: 19 (19) |
Complexity: 4 |
Complexity Density: 0.31 |
|
| 943 |
0 |
@Override... |
| 944 |
|
public void paint(Graphics g) |
| 945 |
|
{ |
| 946 |
0 |
invalidate(); |
| 947 |
0 |
Dimension d = idPanel.idCanvas.getSize(); |
| 948 |
0 |
final int canvasHeight = seqPanel.seqCanvas.getSize().height; |
| 949 |
0 |
if (canvasHeight != d.height) |
| 950 |
|
{ |
| 951 |
0 |
idPanel.idCanvas.setSize(d.width, canvasHeight); |
| 952 |
|
} |
| 953 |
|
|
| 954 |
0 |
setScrollValues(vpRanges.getStartRes(), vpRanges.getStartSeq()); |
| 955 |
|
|
| 956 |
0 |
seqPanel.seqCanvas.repaint(); |
| 957 |
0 |
idPanel.idCanvas.repaint(); |
| 958 |
0 |
if (!av.getWrapAlignment()) |
| 959 |
|
{ |
| 960 |
0 |
if (av.isShowAnnotation()) |
| 961 |
|
{ |
| 962 |
0 |
alabels.repaint(); |
| 963 |
0 |
annotationPanel.repaint(); |
| 964 |
|
} |
| 965 |
0 |
scalePanel.repaint(); |
| 966 |
|
} |
| 967 |
|
|
| 968 |
|
} |
| 969 |
|
|
| 970 |
|
|
| 971 |
|
|
| 972 |
|
|
| 973 |
|
@param |
| 974 |
|
|
| 975 |
|
|
| |
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 976 |
0 |
private void setScrollingForWrappedPanel(int topLeftColumn)... |
| 977 |
|
{ |
| 978 |
0 |
int scrollPosition = vpRanges.getWrappedScrollPosition(topLeftColumn); |
| 979 |
0 |
int maxScroll = vpRanges.getWrappedMaxScroll(topLeftColumn); |
| 980 |
|
|
| 981 |
|
|
| 982 |
|
|
| 983 |
|
|
| 984 |
|
|
| 985 |
0 |
vscroll.setUnitIncrement(1); |
| 986 |
0 |
vscroll.setValues(scrollPosition, 1, 0, maxScroll + 1); |
| 987 |
|
} |
| 988 |
|
|
| 989 |
|
protected Panel sequenceHolderPanel = new Panel(); |
| 990 |
|
|
| 991 |
|
protected Scrollbar vscroll = new Scrollbar(); |
| 992 |
|
|
| 993 |
|
protected Scrollbar hscroll = new Scrollbar(); |
| 994 |
|
|
| 995 |
|
protected Panel seqPanelHolder = new Panel(); |
| 996 |
|
|
| 997 |
|
protected Panel scalePanelHolder = new Panel(); |
| 998 |
|
|
| 999 |
|
protected Panel idPanelHolder = new Panel(); |
| 1000 |
|
|
| 1001 |
|
protected Panel idSpaceFillerPanel1 = new Panel(); |
| 1002 |
|
|
| 1003 |
|
public Panel annotationSpaceFillerHolder = new Panel(); |
| 1004 |
|
|
| 1005 |
|
protected Panel hscrollFillerPanel = new Panel(); |
| 1006 |
|
|
| 1007 |
|
Panel annotationPanelHolder = new Panel(); |
| 1008 |
|
|
| 1009 |
|
protected Scrollbar apvscroll = new Scrollbar(); |
| 1010 |
|
|
| 1011 |
|
|
| 1012 |
|
|
| 1013 |
|
|
| 1014 |
|
|
| 1015 |
|
private boolean scrollComplementaryPanel = true; |
| 1016 |
|
|
| |
|
| 0% |
Uncovered Elements: 33 (33) |
Complexity: 1 |
Complexity Density: 0.03 |
|
| 1017 |
0 |
private void jbInit() throws Exception... |
| 1018 |
|
{ |
| 1019 |
|
|
| 1020 |
0 |
this.setLayout(new BorderLayout()); |
| 1021 |
|
|
| 1022 |
|
|
| 1023 |
0 |
sequenceHolderPanel.setLayout(new BorderLayout()); |
| 1024 |
0 |
seqPanelHolder.setLayout(new BorderLayout()); |
| 1025 |
0 |
scalePanelHolder.setBackground(Color.white); |
| 1026 |
|
|
| 1027 |
|
|
| 1028 |
0 |
scalePanelHolder.setLayout(new BorderLayout()); |
| 1029 |
0 |
idPanelHolder.setLayout(new BorderLayout()); |
| 1030 |
0 |
idSpaceFillerPanel1.setBackground(Color.white); |
| 1031 |
|
|
| 1032 |
|
|
| 1033 |
0 |
idSpaceFillerPanel1.setLayout(new BorderLayout()); |
| 1034 |
0 |
annotationSpaceFillerHolder.setBackground(Color.white); |
| 1035 |
|
|
| 1036 |
|
|
| 1037 |
0 |
annotationSpaceFillerHolder.setLayout(new BorderLayout()); |
| 1038 |
0 |
hscroll.setOrientation(Scrollbar.HORIZONTAL); |
| 1039 |
|
|
| 1040 |
0 |
Panel hscrollHolder = new Panel(); |
| 1041 |
0 |
hscrollHolder.setLayout(new BorderLayout()); |
| 1042 |
0 |
hscrollFillerPanel.setBackground(Color.white); |
| 1043 |
0 |
apvscroll.setOrientation(Scrollbar.VERTICAL); |
| 1044 |
0 |
apvscroll.setVisible(true); |
| 1045 |
0 |
apvscroll.addAdjustmentListener(this); |
| 1046 |
|
|
| 1047 |
0 |
annotationPanelHolder.setBackground(Color.white); |
| 1048 |
0 |
annotationPanelHolder.setLayout(new BorderLayout()); |
| 1049 |
0 |
annotationPanelHolder.add(apvscroll, BorderLayout.EAST); |
| 1050 |
|
|
| 1051 |
0 |
hscrollHolder.setBackground(Color.white); |
| 1052 |
|
|
| 1053 |
|
|
| 1054 |
|
|
| 1055 |
0 |
seqPanelHolder.setBackground(Color.white); |
| 1056 |
0 |
idPanelHolder.setBackground(Color.white); |
| 1057 |
0 |
sequenceHolderPanel.add(scalePanelHolder, BorderLayout.NORTH); |
| 1058 |
0 |
sequenceHolderPanel.add(seqPanelHolder, BorderLayout.CENTER); |
| 1059 |
0 |
seqPanelHolder.add(vscroll, BorderLayout.EAST); |
| 1060 |
|
|
| 1061 |
|
|
| 1062 |
0 |
this.add(idPanelHolder, BorderLayout.WEST); |
| 1063 |
0 |
idPanelHolder.add(idSpaceFillerPanel1, BorderLayout.NORTH); |
| 1064 |
0 |
idPanelHolder.add(annotationSpaceFillerHolder, BorderLayout.SOUTH); |
| 1065 |
0 |
this.add(hscrollHolder, BorderLayout.SOUTH); |
| 1066 |
0 |
hscrollHolder.add(hscroll, BorderLayout.CENTER); |
| 1067 |
0 |
hscrollHolder.add(hscrollFillerPanel, BorderLayout.WEST); |
| 1068 |
0 |
this.add(sequenceHolderPanel, BorderLayout.CENTER); |
| 1069 |
|
} |
| 1070 |
|
|
| 1071 |
|
|
| 1072 |
|
|
| 1073 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1074 |
0 |
public void updateAnnotation()... |
| 1075 |
|
{ |
| 1076 |
0 |
updateAnnotation(false); |
| 1077 |
|
} |
| 1078 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1079 |
0 |
public void updateAnnotation(boolean applyGlobalSettings)... |
| 1080 |
|
{ |
| 1081 |
0 |
updateAnnotation(applyGlobalSettings, false); |
| 1082 |
|
} |
| 1083 |
|
|
| |
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 1084 |
0 |
public void updateAnnotation(boolean applyGlobalSettings,... |
| 1085 |
|
boolean preserveNewGroupSettings) |
| 1086 |
|
{ |
| 1087 |
0 |
av.updateGroupAnnotationSettings(applyGlobalSettings, |
| 1088 |
|
preserveNewGroupSettings); |
| 1089 |
0 |
adjustAnnotationHeight(); |
| 1090 |
|
} |
| 1091 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1092 |
0 |
@Override... |
| 1093 |
|
public AlignmentI getAlignment() |
| 1094 |
|
{ |
| 1095 |
0 |
return av.getAlignment(); |
| 1096 |
|
} |
| 1097 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1098 |
0 |
@Override... |
| 1099 |
|
public String getViewName() |
| 1100 |
|
{ |
| 1101 |
0 |
return getName(); |
| 1102 |
|
} |
| 1103 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1104 |
0 |
@Override... |
| 1105 |
|
public StructureSelectionManager getStructureSelectionManager() |
| 1106 |
|
{ |
| 1107 |
0 |
return StructureSelectionManager |
| 1108 |
|
.getStructureSelectionManager(av.applet); |
| 1109 |
|
} |
| 1110 |
|
|
| |
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 1111 |
0 |
@Override... |
| 1112 |
|
public void raiseOOMWarning(String string, OutOfMemoryError error) |
| 1113 |
|
{ |
| 1114 |
|
|
| 1115 |
0 |
jalview.bin.Console.errPrintln("Out of memory whilst '" + string + "'"); |
| 1116 |
0 |
error.printStackTrace(); |
| 1117 |
|
} |
| 1118 |
|
|
| 1119 |
|
|
| 1120 |
|
|
| 1121 |
|
|
| 1122 |
|
@param |
| 1123 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1124 |
0 |
protected void setToScrollComplementPanel(boolean b)... |
| 1125 |
|
{ |
| 1126 |
0 |
this.scrollComplementaryPanel = b; |
| 1127 |
|
} |
| 1128 |
|
|
| 1129 |
|
|
| 1130 |
|
|
| 1131 |
|
|
| 1132 |
|
@return |
| 1133 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 1134 |
0 |
protected boolean isSetToScrollComplementPanel()... |
| 1135 |
|
{ |
| 1136 |
0 |
return this.scrollComplementaryPanel; |
| 1137 |
|
} |
| 1138 |
|
|
| |
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 2 |
Complexity Density: 0.29 |
|
| 1139 |
0 |
@Override... |
| 1140 |
|
|
| 1141 |
|
|
| 1142 |
|
|
| 1143 |
|
|
| 1144 |
|
public void propertyChange(PropertyChangeEvent evt) |
| 1145 |
|
{ |
| 1146 |
|
|
| 1147 |
0 |
int x = vpRanges.getStartRes(); |
| 1148 |
0 |
int y = vpRanges.getStartSeq(); |
| 1149 |
0 |
setScrollValues(x, y); |
| 1150 |
|
|
| 1151 |
|
|
| 1152 |
|
|
| 1153 |
0 |
if (isSetToScrollComplementPanel()) |
| 1154 |
|
{ |
| 1155 |
0 |
setToScrollComplementPanel(false); |
| 1156 |
0 |
av.scrollComplementaryAlignment(getComplementPanel()); |
| 1157 |
0 |
setToScrollComplementPanel(true); |
| 1158 |
|
} |
| 1159 |
|
|
| 1160 |
|
} |
| 1161 |
|
|
| 1162 |
|
} |