public void drawScene(Graphics g)
{
- // boolean darker = false;
-
- int halfwidth = getSize().width / 2;
- int halfheight = getSize().height / 2;
-
for (int i = 0; i < npoint; i++)
{
SequencePoint sp = points.elementAt(i);
- int x = (int) ((sp.coord.x - centre.x) * scale) + halfwidth;
- int y = (int) ((sp.coord.y - centre.y) * scale)
- + halfheight;
- float z = sp.coord.y - centre.z;
-
SequenceI sequence = sp.getSequence();
- if (av.getSequenceColour(sequence) == Color.black)
- {
- g.setColor(Color.white);
- }
- else
- {
- g.setColor(av.getSequenceColour(sequence));
- }
-
+ Color sequenceColour = av.getSequenceColour(sequence);
+ g.setColor(
+ sequenceColour == Color.black ? Color.white : sequenceColour);
if (av.getSelectionGroup() != null)
{
if (av.getSelectionGroup().getSequences(null)
g.setColor(Color.gray);
}
}
- if (z < 0)
+
+ if (sp.coord.z < centre.z)
{
g.setColor(g.getColor().darker());
}
+ int halfwidth = getSize().width / 2;
+ int halfheight = getSize().height / 2;
+ int x = (int) ((sp.coord.x - centre.x) * scale) + halfwidth;
+ int y = (int) ((sp.coord.y - centre.y) * scale) + halfheight;
g.fillRect(x - 3, y - 3, 6, 6);
+
if (showLabels)
{
g.setColor(Color.red);
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
- int halfwidth = getWidth() / 2;
- int halfheight = getHeight() / 2;
-
for (int i = 0; i < npoint; i++)
{
+ /*
+ * sequence point colour as sequence id, but
+ * gray if sequence is currently selected
+ */
SequencePoint sp = points.elementAt(i);
- int x = (int) ((sp.coord.x - centre.x) * scale) + halfwidth;
- int y = (int) ((sp.coord.y - centre.y) * scale)
- + halfheight;
- float z = sp.coord.y - centre.z; // todo sp.coord.z JAL-2963
-
SequenceI sequence = sp.getSequence();
- if (av.getSequenceColour(sequence) == Color.black)
- {
- g.setColor(Color.white);
- }
- else
- {
- g.setColor(av.getSequenceColour(sequence));
- }
-
+ Color sequenceColour = av.getSequenceColour(sequence);
+ g.setColor(
+ sequenceColour == Color.black ? Color.white : sequenceColour);
if (av.getSelectionGroup() != null)
{
if (av.getSelectionGroup().getSequences(null)
}
}
- if (z < 0)
+ /*
+ * dim sequence points 'at the back'
+ */
+ if (sp.coord.z < centre.z)
{
g.setColor(g.getColor().darker());
}
+ int halfwidth = getWidth() / 2;
+ int halfheight = getHeight() / 2;
+ int x = (int) ((sp.coord.x - centre.x) * scale) + halfwidth;
+ int y = (int) ((sp.coord.y - centre.y) * scale) + halfheight;
g.fillRect(x - 3, y - 3, 6, 6);
+
if (showLabels)
{
g.setColor(Color.red);