| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
|
| 21 |
|
package jalview.gui; |
| 22 |
|
|
| 23 |
|
import java.awt.BorderLayout; |
| 24 |
|
import java.awt.Color; |
| 25 |
|
import java.awt.Dimension; |
| 26 |
|
import java.awt.Font; |
| 27 |
|
import java.awt.FontMetrics; |
| 28 |
|
import java.awt.Graphics; |
| 29 |
|
import java.awt.Graphics2D; |
| 30 |
|
import java.awt.RenderingHints; |
| 31 |
|
import java.awt.image.BufferedImage; |
| 32 |
|
import java.beans.PropertyChangeEvent; |
| 33 |
|
import java.util.List; |
| 34 |
|
|
| 35 |
|
import javax.swing.JPanel; |
| 36 |
|
|
| 37 |
|
import jalview.datamodel.SequenceI; |
| 38 |
|
import jalview.viewmodel.ViewportListenerI; |
| 39 |
|
import jalview.viewmodel.ViewportRanges; |
| 40 |
|
|
| 41 |
|
|
| 42 |
|
|
| 43 |
|
|
| 44 |
|
@author |
| 45 |
|
@version |
| 46 |
|
|
| |
|
| 85.6% |
Uncovered Elements: 41 (285) |
Complexity: 73 |
Complexity Density: 0.39 |
|
| 47 |
|
public class IdCanvas extends JPanel implements ViewportListenerI |
| 48 |
|
{ |
| 49 |
|
protected AlignViewport av; |
| 50 |
|
|
| 51 |
|
protected boolean showScores = true; |
| 52 |
|
|
| 53 |
|
protected int maxIdLength = -1; |
| 54 |
|
|
| 55 |
|
protected String maxIdStr = null; |
| 56 |
|
|
| 57 |
|
BufferedImage image; |
| 58 |
|
|
| 59 |
|
|
| 60 |
|
|
| 61 |
|
int imgHeight = 0; |
| 62 |
|
|
| 63 |
|
boolean fastPaint = false; |
| 64 |
|
|
| 65 |
|
List<SequenceI> searchResults; |
| 66 |
|
|
| 67 |
|
AnnotationPanel ap; |
| 68 |
|
|
| 69 |
|
private Font idfont; |
| 70 |
|
|
| 71 |
|
|
| 72 |
|
|
| 73 |
|
|
| 74 |
|
@param |
| 75 |
|
|
| 76 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 77 |
501 |
public IdCanvas(AlignViewport av)... |
| 78 |
|
{ |
| 79 |
501 |
setLayout(new BorderLayout()); |
| 80 |
501 |
this.av = av; |
| 81 |
501 |
PaintRefresher.Register(this, av.getSequenceSetId()); |
| 82 |
501 |
av.getRanges().addPropertyChangeListener(this); |
| 83 |
|
} |
| 84 |
|
|
| 85 |
|
|
| 86 |
|
|
| 87 |
|
|
| 88 |
|
@param |
| 89 |
|
|
| 90 |
|
@param |
| 91 |
|
|
| 92 |
|
@param |
| 93 |
|
|
| 94 |
|
@param |
| 95 |
|
|
| 96 |
|
@param |
| 97 |
|
|
| 98 |
|
@param |
| 99 |
|
|
| 100 |
|
|
| |
|
| 60.7% |
Uncovered Elements: 11 (28) |
Complexity: 8 |
Complexity Density: 0.4 |
|
| 101 |
790 |
public void drawIdString(Graphics2D g, boolean hiddenRows, SequenceI s,... |
| 102 |
|
int i, int starty, int ypos) |
| 103 |
|
{ |
| 104 |
790 |
int xPos = 0; |
| 105 |
790 |
int panelWidth = getWidth(); |
| 106 |
790 |
int charHeight = av.getCharHeight(); |
| 107 |
|
|
| 108 |
790 |
if ((searchResults != null) && searchResults.contains(s)) |
| 109 |
|
{ |
| 110 |
0 |
g.setColor(Color.black); |
| 111 |
0 |
g.fillRect(0, ((i - starty) * charHeight) + ypos, getWidth(), |
| 112 |
|
charHeight); |
| 113 |
0 |
g.setColor(Color.white); |
| 114 |
|
} |
| 115 |
790 |
else if ((av.getSelectionGroup() != null) |
| 116 |
|
&& av.getSelectionGroup().getSequences(null).contains(s)) |
| 117 |
|
{ |
| 118 |
0 |
g.setColor(Color.lightGray); |
| 119 |
0 |
g.fillRect(0, ((i - starty) * charHeight) + ypos, getWidth(), |
| 120 |
|
charHeight); |
| 121 |
0 |
g.setColor(Color.white); |
| 122 |
|
} |
| 123 |
|
else |
| 124 |
|
{ |
| 125 |
790 |
g.setColor(av.getSequenceColour(s)); |
| 126 |
790 |
g.fillRect(0, ((i - starty) * charHeight) + ypos, getWidth(), |
| 127 |
|
charHeight); |
| 128 |
790 |
g.setColor(Color.black); |
| 129 |
|
} |
| 130 |
|
|
| 131 |
790 |
if (av.isRightAlignIds()) |
| 132 |
|
{ |
| 133 |
0 |
FontMetrics fm = g.getFontMetrics(); |
| 134 |
0 |
xPos = panelWidth |
| 135 |
|
- fm.stringWidth(s.getDisplayId(av.getShowJVSuffix())) - 4; |
| 136 |
|
} |
| 137 |
|
|
| 138 |
790 |
g.drawString(s.getDisplayId(av.getShowJVSuffix()), xPos, |
| 139 |
|
(((i - starty + 1) * charHeight) + ypos) - (charHeight / 5)); |
| 140 |
|
|
| 141 |
790 |
if (hiddenRows && av.getShowHiddenMarkers()) |
| 142 |
|
{ |
| 143 |
566 |
drawMarker(g, av, i, starty, ypos); |
| 144 |
|
} |
| 145 |
|
|
| 146 |
|
} |
| 147 |
|
|
| 148 |
|
|
| 149 |
|
|
| 150 |
|
|
| 151 |
|
@param |
| 152 |
|
|
| 153 |
|
|
| |
|
| 91.2% |
Uncovered Elements: 3 (34) |
Complexity: 7 |
Complexity Density: 0.29 |
|
| 154 |
44 |
public void fastPaint(int vertical)... |
| 155 |
|
{ |
| 156 |
|
|
| 157 |
|
|
| 158 |
|
|
| 159 |
|
|
| 160 |
44 |
if (image == null || av.getWrapAlignment()) |
| 161 |
|
{ |
| 162 |
10 |
repaint(); |
| 163 |
|
|
| 164 |
10 |
return; |
| 165 |
|
} |
| 166 |
|
|
| 167 |
34 |
ViewportRanges ranges = av.getRanges(); |
| 168 |
|
|
| 169 |
34 |
Graphics2D gg = image.createGraphics(); |
| 170 |
34 |
gg.copyArea(0, 0, getWidth(), imgHeight, 0, |
| 171 |
|
-vertical * av.getCharHeight()); |
| 172 |
|
|
| 173 |
34 |
int ss = ranges.getStartSeq(); |
| 174 |
34 |
int es = ranges.getEndSeq(); |
| 175 |
34 |
int transY = 0; |
| 176 |
|
|
| 177 |
34 |
if (vertical > 0) |
| 178 |
|
{ |
| 179 |
18 |
ss = es - vertical; |
| 180 |
|
|
| 181 |
18 |
if (ss < ranges.getStartSeq()) |
| 182 |
|
{ |
| 183 |
8 |
ss = ranges.getStartSeq(); |
| 184 |
|
} |
| 185 |
|
else |
| 186 |
|
{ |
| 187 |
10 |
transY = imgHeight - ((vertical + 1) * av.getCharHeight()); |
| 188 |
|
} |
| 189 |
|
} |
| 190 |
16 |
else if (vertical < 0) |
| 191 |
|
{ |
| 192 |
16 |
es = ss - vertical; |
| 193 |
|
|
| 194 |
16 |
if (es > ranges.getEndSeq()) |
| 195 |
|
{ |
| 196 |
0 |
es = ranges.getEndSeq(); |
| 197 |
|
} |
| 198 |
|
} |
| 199 |
|
|
| 200 |
34 |
gg.translate(0, transY); |
| 201 |
|
|
| 202 |
34 |
drawIds(gg, av, ss, es, searchResults, true, getWidth()); |
| 203 |
|
|
| 204 |
34 |
gg.translate(0, -transY); |
| 205 |
|
|
| 206 |
34 |
gg.dispose(); |
| 207 |
|
|
| 208 |
34 |
fastPaint = true; |
| 209 |
|
|
| 210 |
|
|
| 211 |
|
|
| 212 |
|
|
| 213 |
34 |
av.getAlignPanel().repaint(); |
| 214 |
|
} |
| 215 |
|
|
| 216 |
|
|
| 217 |
|
|
| 218 |
|
|
| 219 |
|
@param |
| 220 |
|
|
| 221 |
|
|
| |
|
| 92% |
Uncovered Elements: 2 (25) |
Complexity: 5 |
Complexity Density: 0.26 |
|
| 222 |
3054 |
@Override... |
| 223 |
|
public void paintComponent(Graphics g) |
| 224 |
|
{ |
| 225 |
3054 |
g.setColor(Color.white); |
| 226 |
3054 |
g.fillRect(0, 0, getWidth(), getHeight()); |
| 227 |
|
|
| 228 |
3054 |
if (fastPaint) |
| 229 |
|
{ |
| 230 |
12 |
fastPaint = false; |
| 231 |
12 |
g.drawImage(image, 0, 0, this); |
| 232 |
|
|
| 233 |
12 |
return; |
| 234 |
|
} |
| 235 |
|
|
| 236 |
3042 |
int oldHeight = imgHeight; |
| 237 |
|
|
| 238 |
3042 |
imgHeight = getHeight(); |
| 239 |
3042 |
imgHeight -= (imgHeight % av.getCharHeight()); |
| 240 |
|
|
| 241 |
3042 |
if (imgHeight < 1) |
| 242 |
|
{ |
| 243 |
0 |
return; |
| 244 |
|
} |
| 245 |
|
|
| 246 |
3042 |
if (oldHeight != imgHeight || image.getWidth(this) != getWidth()) |
| 247 |
|
{ |
| 248 |
498 |
image = new BufferedImage(getWidth(), imgHeight, |
| 249 |
|
BufferedImage.TYPE_INT_RGB); |
| 250 |
|
} |
| 251 |
|
|
| 252 |
3042 |
Graphics2D gg = image.createGraphics(); |
| 253 |
|
|
| 254 |
|
|
| 255 |
3042 |
gg.setColor(Color.white); |
| 256 |
3042 |
gg.fillRect(0, 0, getWidth(), imgHeight); |
| 257 |
|
|
| 258 |
3042 |
drawIds(gg, av, av.getRanges().getStartSeq(), |
| 259 |
|
av.getRanges().getEndSeq(), searchResults, true, getWidth()); |
| 260 |
|
|
| 261 |
3042 |
gg.dispose(); |
| 262 |
|
|
| 263 |
3042 |
g.drawImage(image, 0, 0, this); |
| 264 |
|
} |
| 265 |
|
|
| 266 |
|
|
| 267 |
|
|
| 268 |
|
|
| 269 |
|
|
| 270 |
|
|
| 271 |
|
|
| 272 |
|
@param |
| 273 |
|
@param |
| 274 |
|
@param |
| 275 |
|
@param |
| 276 |
|
@param |
| 277 |
|
@param |
| 278 |
|
|
| 279 |
|
@param |
| 280 |
|
|
| 281 |
|
|
| 282 |
|
|
| 283 |
|
|
| |
|
| 85.5% |
Uncovered Elements: 9 (62) |
Complexity: 16 |
Complexity Density: 0.4 |
|
| 284 |
3114 |
void drawIds(Graphics2D g, AlignViewport alignViewport,... |
| 285 |
|
final int startSeq, final int endSeq, List<SequenceI> selection, |
| 286 |
|
boolean forGUI, int panelWidth) |
| 287 |
|
{ |
| 288 |
3114 |
Font font = alignViewport.getFont(); |
| 289 |
3114 |
if (alignViewport.isSeqNameItalics()) |
| 290 |
|
{ |
| 291 |
3114 |
setIdfont(new Font(font.getName(), Font.ITALIC, font.getSize())); |
| 292 |
|
} |
| 293 |
|
else |
| 294 |
|
{ |
| 295 |
0 |
setIdfont(font); |
| 296 |
|
} |
| 297 |
|
|
| 298 |
3114 |
g.setFont(getIdfont()); |
| 299 |
3114 |
FontMetrics fm = g.getFontMetrics(); |
| 300 |
|
|
| 301 |
3114 |
if (alignViewport.antiAlias) |
| 302 |
|
{ |
| 303 |
1153 |
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, |
| 304 |
|
RenderingHints.VALUE_ANTIALIAS_ON); |
| 305 |
|
} |
| 306 |
|
|
| 307 |
3114 |
Color currentColor = Color.white; |
| 308 |
3114 |
Color currentTextColor = Color.black; |
| 309 |
|
|
| 310 |
3114 |
boolean hasHiddenRows = alignViewport.hasHiddenRows(); |
| 311 |
|
|
| 312 |
3114 |
if (alignViewport.getWrapAlignment()) |
| 313 |
|
{ |
| 314 |
297 |
drawIdsWrapped(g, alignViewport, startSeq, getHeight(), |
| 315 |
297 |
isManuallyAdjusted() ? panelWidth : -1, forGUI); |
| 316 |
297 |
return; |
| 317 |
|
} |
| 318 |
|
|
| 319 |
|
|
| 320 |
2817 |
int xPos = 0; |
| 321 |
|
|
| 322 |
|
|
| 323 |
16183 |
for (int i = startSeq; i <= endSeq; i++) |
| 324 |
|
{ |
| 325 |
13366 |
SequenceI sequence = alignViewport.getAlignment().getSequenceAt(i); |
| 326 |
|
|
| 327 |
13366 |
if (sequence == null) |
| 328 |
|
{ |
| 329 |
0 |
continue; |
| 330 |
|
} |
| 331 |
|
|
| 332 |
13366 |
if (hasHiddenRows || alignViewport.isDisplayReferenceSeq()) |
| 333 |
|
{ |
| 334 |
3731 |
g.setFont(getHiddenFont(sequence, alignViewport)); |
| 335 |
3731 |
fm = g.getFontMetrics(); |
| 336 |
|
} |
| 337 |
|
|
| 338 |
|
|
| 339 |
13366 |
if (selection != null && selection.contains(sequence)) |
| 340 |
|
{ |
| 341 |
0 |
currentColor = Color.black; |
| 342 |
0 |
currentTextColor = Color.white; |
| 343 |
|
} |
| 344 |
13366 |
else if ((alignViewport.getSelectionGroup() != null) && alignViewport |
| 345 |
|
.getSelectionGroup().getSequences(null).contains(sequence)) |
| 346 |
|
{ |
| 347 |
45 |
currentColor = Color.lightGray; |
| 348 |
45 |
currentTextColor = Color.black; |
| 349 |
|
} |
| 350 |
|
else |
| 351 |
|
{ |
| 352 |
13321 |
currentColor = alignViewport.getSequenceColour(sequence); |
| 353 |
13321 |
currentTextColor = Color.black; |
| 354 |
|
} |
| 355 |
|
|
| 356 |
13366 |
g.setColor(currentColor); |
| 357 |
|
|
| 358 |
13366 |
int charHeight = alignViewport.getCharHeight(); |
| 359 |
13366 |
g.fillRect(0, (i - startSeq) * charHeight, getWidth(), charHeight); |
| 360 |
|
|
| 361 |
13366 |
g.setColor(currentTextColor); |
| 362 |
|
|
| 363 |
13366 |
String string = sequence |
| 364 |
|
.getDisplayId(alignViewport.getShowJVSuffix()); |
| 365 |
|
|
| 366 |
13366 |
if (alignViewport.isRightAlignIds()) |
| 367 |
|
{ |
| 368 |
0 |
xPos = panelWidth - fm.stringWidth(string) - 4; |
| 369 |
|
} |
| 370 |
|
|
| 371 |
13366 |
g.drawString(string, xPos, |
| 372 |
|
(((i - startSeq) * charHeight) + charHeight) |
| 373 |
|
- (charHeight / 5)); |
| 374 |
|
|
| 375 |
13366 |
if (hasHiddenRows && av.getShowHiddenMarkers()) |
| 376 |
|
{ |
| 377 |
3731 |
drawMarker(g, alignViewport, i, startSeq, 0); |
| 378 |
|
} |
| 379 |
|
} |
| 380 |
|
} |
| 381 |
|
|
| 382 |
|
|
| 383 |
|
|
| 384 |
|
|
| 385 |
|
|
| 386 |
|
@param |
| 387 |
|
@param |
| 388 |
|
@param |
| 389 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 390 |
0 |
void drawIdsWrapped(Graphics2D g, AlignViewport alignViewport,... |
| 391 |
|
int startSeq, int pageHeight) |
| 392 |
|
{ |
| 393 |
0 |
drawIdsWrapped(g, alignViewport, startSeq, pageHeight, -1, true); |
| 394 |
|
} |
| 395 |
|
|
| 396 |
|
|
| 397 |
|
|
| 398 |
|
|
| 399 |
|
@param |
| 400 |
|
@param |
| 401 |
|
@param |
| 402 |
|
@param |
| 403 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 404 |
0 |
public void drawIdsWrappedNoGUI(Graphics2D g, AlignViewport av2,... |
| 405 |
|
int startSeq, int totalHeight) |
| 406 |
|
{ |
| 407 |
0 |
drawIdsWrapped(g, av2, startSeq, totalHeight, -1, false); |
| 408 |
|
} |
| 409 |
|
|
| |
|
| 94% |
Uncovered Elements: 3 (50) |
Complexity: 12 |
Complexity Density: 0.35 |
|
| 410 |
297 |
public void drawIdsWrapped(Graphics2D g, AlignViewport alignViewport,... |
| 411 |
|
int startSeq, int pageHeight, int idWidth, boolean forGUI) |
| 412 |
|
{ |
| 413 |
297 |
int alignmentWidth = alignViewport.getAlignment().getWidth(); |
| 414 |
297 |
final int alheight = alignViewport.getAlignment().getHeight(); |
| 415 |
|
|
| 416 |
|
|
| 417 |
|
|
| 418 |
|
|
| 419 |
297 |
SeqCanvas seqCanvas = alignViewport.getAlignPanel() |
| 420 |
|
.getSeqPanel().seqCanvas; |
| 421 |
|
|
| 422 |
297 |
final int charHeight = alignViewport.getCharHeight(); |
| 423 |
|
|
| 424 |
297 |
AnnotationLabels labels = null; |
| 425 |
297 |
if (alignViewport.isShowAnnotation()) |
| 426 |
|
{ |
| 427 |
|
|
| 428 |
|
|
| 429 |
|
|
| 430 |
297 |
labels = new AnnotationLabels(alignViewport); |
| 431 |
|
} |
| 432 |
|
|
| 433 |
297 |
ViewportRanges ranges = alignViewport.getRanges(); |
| 434 |
|
|
| 435 |
297 |
int rowSize = ranges.getViewportWidth(); |
| 436 |
|
|
| 437 |
|
|
| 438 |
|
|
| 439 |
|
|
| 440 |
|
|
| 441 |
297 |
boolean hasHiddenRows = alignViewport.hasHiddenRows(); |
| 442 |
297 |
int ypos = seqCanvas.wrappedSpaceAboveAlignment; |
| 443 |
297 |
int rowStartRes = ranges.getStartRes(); |
| 444 |
594 |
while ((ypos <= pageHeight) && (rowStartRes < alignmentWidth)) |
| 445 |
|
{ |
| 446 |
1087 |
for (int i = startSeq; i < alheight; i++) |
| 447 |
|
{ |
| 448 |
790 |
SequenceI s = alignViewport.getAlignment().getSequenceAt(i); |
| 449 |
790 |
if (hasHiddenRows || alignViewport.isDisplayReferenceSeq()) |
| 450 |
|
{ |
| 451 |
566 |
g.setFont(getHiddenFont(s, alignViewport)); |
| 452 |
|
} |
| 453 |
|
else |
| 454 |
|
{ |
| 455 |
224 |
g.setFont(getIdfont()); |
| 456 |
|
} |
| 457 |
790 |
drawIdString(g, hasHiddenRows, s, i, 0, ypos); |
| 458 |
|
} |
| 459 |
|
|
| 460 |
297 |
if (labels != null && alignViewport.isShowAnnotation()) |
| 461 |
|
{ |
| 462 |
297 |
int getWidth = getWidth(); |
| 463 |
297 |
int thisIdWidth = getWidth; |
| 464 |
297 |
g.translate(0, ypos + (alheight * charHeight)); |
| 465 |
297 |
if (!isManuallyAdjusted()) |
| 466 |
|
{ |
| 467 |
14 |
int getAnnotationsIdWidth = labels.drawLabels(g, false, -1, false, |
| 468 |
|
forGUI, null, false); |
| 469 |
14 |
thisIdWidth = idWidth < 0 ? getAnnotationsIdWidth : idWidth; |
| 470 |
14 |
if (thisIdWidth > getWidth) |
| 471 |
|
{ |
| 472 |
9 |
this.setPreferredSize( |
| 473 |
|
new Dimension(thisIdWidth, this.getHeight())); |
| 474 |
9 |
this.repaint(); |
| 475 |
9 |
alignViewport.setIdWidth(thisIdWidth); |
| 476 |
|
} |
| 477 |
|
} |
| 478 |
297 |
labels.drawComponent(g, false, thisIdWidth, forGUI); |
| 479 |
297 |
g.translate(0, -ypos - (alheight * charHeight)); |
| 480 |
|
} |
| 481 |
|
|
| 482 |
297 |
ypos += seqCanvas.wrappedRepeatHeightPx; |
| 483 |
297 |
rowStartRes += rowSize; |
| 484 |
|
} |
| 485 |
|
} |
| 486 |
|
|
| 487 |
|
|
| 488 |
|
|
| 489 |
|
|
| 490 |
|
|
| 491 |
|
@param |
| 492 |
|
@param |
| 493 |
|
@param |
| 494 |
|
@param |
| 495 |
|
@param |
| 496 |
|
|
| |
|
| 95% |
Uncovered Elements: 2 (40) |
Complexity: 8 |
Complexity Density: 0.31 |
|
| 497 |
4297 |
void drawMarker(Graphics2D g, AlignViewport alignViewport, int seqIndex,... |
| 498 |
|
int starty, int yoffset) |
| 499 |
|
{ |
| 500 |
4297 |
SequenceI[] hseqs = alignViewport.getAlignment() |
| 501 |
|
.getHiddenSequences().hiddenSequences; |
| 502 |
|
|
| 503 |
|
|
| 504 |
4297 |
int hSize = hseqs.length; |
| 505 |
|
|
| 506 |
4297 |
int hiddenIndex = seqIndex; |
| 507 |
4297 |
int lastIndex = seqIndex - 1; |
| 508 |
4297 |
int nextIndex = seqIndex + 1; |
| 509 |
|
|
| 510 |
73049 |
for (int j = 0; j < hSize; j++) |
| 511 |
|
{ |
| 512 |
68752 |
if (hseqs[j] != null) |
| 513 |
|
{ |
| 514 |
16255 |
if (j - 1 < hiddenIndex) |
| 515 |
|
{ |
| 516 |
230 |
hiddenIndex++; |
| 517 |
|
} |
| 518 |
16255 |
if (j - 1 < lastIndex) |
| 519 |
|
{ |
| 520 |
0 |
lastIndex++; |
| 521 |
|
} |
| 522 |
16255 |
if (j - 1 < nextIndex) |
| 523 |
|
{ |
| 524 |
4652 |
nextIndex++; |
| 525 |
|
} |
| 526 |
|
} |
| 527 |
|
} |
| 528 |
|
|
| 529 |
|
|
| 530 |
|
|
| 531 |
|
|
| 532 |
4297 |
boolean below = (hiddenIndex > lastIndex + 1); |
| 533 |
4297 |
boolean above = (nextIndex > hiddenIndex + 1); |
| 534 |
|
|
| 535 |
4297 |
g.setColor(Color.blue); |
| 536 |
4297 |
int charHeight = av.getCharHeight(); |
| 537 |
|
|
| 538 |
|
|
| 539 |
|
|
| 540 |
|
|
| 541 |
4297 |
int[] xPoints = new int[] { getWidth() - charHeight, |
| 542 |
|
getWidth() - charHeight, getWidth() }; |
| 543 |
4297 |
int yShift = seqIndex - starty; |
| 544 |
|
|
| 545 |
4297 |
if (below) |
| 546 |
|
{ |
| 547 |
230 |
int[] yPoints = new int[] { yShift * charHeight + yoffset, |
| 548 |
|
yShift * charHeight + yoffset + charHeight / 4, |
| 549 |
|
yShift * charHeight + yoffset }; |
| 550 |
230 |
g.fillPolygon(xPoints, yPoints, 3); |
| 551 |
|
} |
| 552 |
4297 |
if (above) |
| 553 |
|
{ |
| 554 |
743 |
yShift++; |
| 555 |
743 |
int[] yPoints = new int[] { yShift * charHeight + yoffset, |
| 556 |
|
yShift * charHeight + yoffset - charHeight / 4, |
| 557 |
|
yShift * charHeight + yoffset }; |
| 558 |
743 |
g.fillPolygon(xPoints, yPoints, 3); |
| 559 |
|
} |
| 560 |
|
} |
| 561 |
|
|
| 562 |
|
|
| 563 |
|
|
| 564 |
|
|
| 565 |
|
|
| 566 |
|
@param |
| 567 |
|
@param |
| 568 |
|
@return |
| 569 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
| 570 |
4297 |
private Font getHiddenFont(SequenceI seq, AlignViewport alignViewport)... |
| 571 |
|
{ |
| 572 |
4297 |
if (av.isReferenceSeq(seq) || av.isHiddenRepSequence(seq)) |
| 573 |
|
{ |
| 574 |
134 |
return new Font(av.getFont().getName(), Font.BOLD, |
| 575 |
|
av.getFont().getSize()); |
| 576 |
|
} |
| 577 |
4163 |
return getIdfont(); |
| 578 |
|
} |
| 579 |
|
|
| 580 |
|
|
| 581 |
|
|
| 582 |
|
|
| 583 |
|
@param |
| 584 |
|
|
| 585 |
|
|
| |
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 586 |
0 |
public void setHighlighted(List<SequenceI> list)... |
| 587 |
|
{ |
| 588 |
0 |
searchResults = list; |
| 589 |
0 |
repaint(); |
| 590 |
|
} |
| 591 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 592 |
7501 |
public Font getIdfont()... |
| 593 |
|
{ |
| 594 |
7501 |
return idfont; |
| 595 |
|
} |
| 596 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 597 |
3114 |
public void setIdfont(Font idfont)... |
| 598 |
|
{ |
| 599 |
3114 |
this.idfont = idfont; |
| 600 |
|
} |
| 601 |
|
|
| 602 |
|
|
| 603 |
|
|
| 604 |
|
|
| 605 |
|
|
| 606 |
|
|
| 607 |
|
|
| 608 |
|
|
| 609 |
|
|
| 610 |
|
|
| 611 |
|
|
| 612 |
|
|
| 613 |
|
|
| |
|
| 69.2% |
Uncovered Elements: 4 (13) |
Complexity: 6 |
Complexity Density: 0.86 |
|
| 614 |
772 |
@Override... |
| 615 |
|
public void propertyChange(PropertyChangeEvent evt) |
| 616 |
|
{ |
| 617 |
772 |
String propertyName = evt.getPropertyName(); |
| 618 |
772 |
if (propertyName.equals(ViewportRanges.STARTSEQ) |
| 619 |
|
|| (av.getWrapAlignment() |
| 620 |
|
&& propertyName.equals(ViewportRanges.STARTRES))) |
| 621 |
|
{ |
| 622 |
44 |
fastPaint((int) evt.getNewValue() - (int) evt.getOldValue()); |
| 623 |
|
} |
| 624 |
728 |
else if (propertyName.equals(ViewportRanges.STARTRESANDSEQ)) |
| 625 |
|
{ |
| 626 |
0 |
fastPaint(((int[]) evt.getNewValue())[1] |
| 627 |
|
- ((int[]) evt.getOldValue())[1]); |
| 628 |
|
} |
| 629 |
728 |
else if (propertyName.equals(ViewportRanges.MOVE_VIEWPORT)) |
| 630 |
|
{ |
| 631 |
0 |
repaint(); |
| 632 |
|
} |
| 633 |
|
} |
| 634 |
|
|
| 635 |
|
private boolean manuallyAdjusted = false; |
| 636 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 637 |
6443 |
public boolean isManuallyAdjusted()... |
| 638 |
|
{ |
| 639 |
6443 |
return manuallyAdjusted; |
| 640 |
|
} |
| 641 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 642 |
92 |
public void setManuallyAdjusted(boolean b)... |
| 643 |
|
{ |
| 644 |
92 |
manuallyAdjusted = b; |
| 645 |
|
} |
| 646 |
|
|
| 647 |
|
} |