package jalview.appletgui;
import jalview.renderer.OverviewRenderer;
-import jalview.renderer.seqfeatures.FeatureColourFinder;
import jalview.viewmodel.OverviewDimensions;
import java.awt.Color;
{
fr.transferSettings(transferRenderer);
}
- FeatureColourFinder finder = new FeatureColourFinder(fr);
setPreferredSize(new Dimension(od.getWidth(), od.getHeight()));
- OverviewRenderer or = new OverviewRenderer(sr, finder, od);
+ OverviewRenderer or = new OverviewRenderer(sr, fr, od);
miniMe = nullFrame.createImage(od.getWidth(), od.getHeight());
offscreen = nullFrame.createImage(od.getWidth(), od.getHeight());
import java.awt.BorderLayout;
import java.awt.Dimension;
+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.ComponentAdapter;
import java.awt.event.ComponentEvent;
+import java.awt.event.InputEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
-import javax.swing.JMenuItem;
-import javax.swing.JPopupMenu;
-import javax.swing.SwingUtilities;
-
public class OverviewPanel extends Panel implements Runnable,
MouseMotionListener, MouseListener
{
@Override
public void mouseClicked(MouseEvent evt)
{
- if (SwingUtilities.isRightMouseButton(evt))
+ // right button press
+ if ((evt.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK)
{
showPopupMenu(evt);
}
private void mouseAction(MouseEvent evt)
{
- if (SwingUtilities.isRightMouseButton(evt))
+ // right button press
+ if ((evt.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK)
{
if (!Platform.isAMac())
{
*/
private void showPopupMenu(MouseEvent e)
{
- JPopupMenu popup = new JPopupMenu();
+ PopupMenu popup = new PopupMenu();
ActionListener menuListener = new ActionListener()
{
@Override
toggleHiddenColumns();
}
};
- JMenuItem item = new JMenuItem(
+ MenuItem item = new MenuItem(
MessageManager.getString("label.togglehidden"));
popup.add(item);
item.addActionListener(menuListener);
import jalview.api.AlignViewportI;
import jalview.renderer.OverviewRenderer;
-import jalview.renderer.seqfeatures.FeatureColourFinder;
import jalview.viewmodel.OverviewDimensions;
import java.awt.Color;
{
fr.transferSettings(transferRenderer);
}
- FeatureColourFinder finder = new FeatureColourFinder(fr);
setPreferredSize(new Dimension(od.getWidth(), od.getHeight()));
- OverviewRenderer or = new OverviewRenderer(sr, finder, od);
+ OverviewRenderer or = new OverviewRenderer(sr, fr, od);
miniMe = or.draw(od.getRows(av.getAlignment()),
od.getColumns(av.getAlignment().getHiddenColumns()));
import jalview.datamodel.Annotation;
import jalview.datamodel.SequenceI;
import jalview.renderer.seqfeatures.FeatureColourFinder;
+import jalview.renderer.seqfeatures.FeatureRenderer;
import jalview.viewmodel.OverviewDimensions;
import java.awt.Color;
private float pixelsPerSeq;
public OverviewRenderer(jalview.api.SequenceRenderer seqRenderer,
- FeatureColourFinder colfinder, OverviewDimensions od)
+ FeatureRenderer ftRenderer, OverviewDimensions od)
{
sr = seqRenderer;
- finder = colfinder;
+ finder = new FeatureColourFinder(ftRenderer);
pixelsPerCol = od.getPixelsPerCol();
pixelsPerSeq = od.getPixelsPerSeq();