*/
package jalview.appletgui;
-import java.awt.*;
-import java.awt.event.*;
-
-import jalview.datamodel.*;
+import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.SequenceGroup;
import jalview.util.MessageManager;
+import java.awt.Color;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.MenuItem;
+import java.awt.Panel;
+import java.awt.PopupMenu;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.InputEvent;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionListener;
+
public class ScalePanel extends Panel implements MouseMotionListener,
MouseListener
{
res = av.getColumnSelection().adjustForHiddenColumns(res);
reveal = null;
+ if (av.getColumnSelection().getHiddenColumns() != null)
+ {
for (int i = 0; i < av.getColumnSelection().getHiddenColumns().size(); i++)
{
int[] region = (int[]) av.getColumnSelection().getHiddenColumns()
break;
}
}
+ }
repaint();
}
}
gg.drawLine(
- (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
+ ((i - startx - 1) * av.charWidth) + (av.charWidth / 2),
y + 2,
- (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
+ ((i - startx - 1) * av.charWidth) + (av.charWidth / 2),
y + (fm.getDescent() * 2));
}
else
{
gg.drawLine(
- (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
+ ((i - startx - 1) * av.charWidth) + (av.charWidth / 2),
y + fm.getDescent(),
- (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
+ ((i - startx - 1) * av.charWidth) + (av.charWidth / 2),
y + (fm.getDescent() * 2));
}
}
{
gg.setColor(Color.blue);
int res;
- if (av.getShowHiddenMarkers())
+ if (av.getColumnSelection().getHiddenColumns() != null
+ && av.getShowHiddenMarkers())
{
for (int i = 0; i < av.getColumnSelection().getHiddenColumns()
.size(); i++)
*/
package jalview.appletgui;
-import java.awt.*;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.SearchResults;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
-import jalview.datamodel.*;
+import java.awt.Color;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.Panel;
public class SeqCanvas extends Panel
{
void drawPanel(Graphics g1, int startRes, int endRes, int startSeq,
int endSeq, int offset)
{
+
+
if (!av.hasHiddenColumns())
{
draw(g1, startRes, endRes, startSeq, endSeq, offset);
}
else
{
- java.util.Vector regions = av.getColumnSelection().getHiddenColumns();
+
+
int screenY = 0;
int blockStart = startRes;
int blockEnd = endRes;
+ if (av.getColumnSelection() != null
+ && av.getColumnSelection().getHiddenColumns() != null)
+ {
+ java.util.Vector regions = av.getColumnSelection()
+ .getHiddenColumns();
+
for (int i = 0; i < regions.size(); i++)
{
int[] region = (int[]) regions.elementAt(i);
screenY += blockEnd - blockStart + 1;
blockStart = hideEnd + 1;
}
-
+ }
if (screenY <= (endRes - startRes))
{
blockEnd = blockStart + (endRes - startRes) - screenY;
if ((group == null) && (av.getAlignment().getGroups().size() > 0))
{
- group = (SequenceGroup) av.getAlignment().getGroups().get(0);
+ group = av.getAlignment().getGroups().get(0);
groupIndex = 0;
}
break;
}
- group = (SequenceGroup) av.getAlignment().getGroups()
+ group = av.getAlignment().getGroups()
.get(groupIndex);
} while (groupIndex < av.getAlignment().getGroups().size());