import jalview.structure.StructureSelectionManager;
import java.awt.Component;
-import java.awt.MouseInfo;
-import java.awt.Point;
-import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
}
/**
- * Returns the split pane component the mouse is in, or null if neither.
- *
- * @return
- */
- protected GAlignFrame getFrameAtMouse()
- {
- Point loc = MouseInfo.getPointerInfo().getLocation();
-
- if (isIn(loc, getTopFrame()))
- {
- return getTopFrame();
- }
- else if (isIn(loc, getBottomFrame()))
- {
- return getBottomFrame();
- }
- return null;
- }
-
- private boolean isIn(Point loc, JComponent comp)
- {
- Point p = comp.getLocationOnScreen();
- Rectangle r = new Rectangle(p.x, p.y, comp.getWidth(), comp.getHeight());
- return r.contains(loc);
- }
-
- /**
* Set key bindings (recommended for Swing over key accelerators).
*/
private void addKeyBindings()
* Note this is _not_ multiple tabs, each hosting a split pane view, rather it
* is a single split pane with each split holding multiple tabs which are
* linked in pairs.
+ * <p>
+ * TODO implement instead with a tabbed holder in the SplitView, each tab
+ * holding a single JSplitPane. Would avoid a duplicated tab, at the cost of
+ * some additional coding.
*/
protected void newView_actionPerformed()
{
- System.out.println("newView " + this.hashCode());
AlignFrame topFrame = (AlignFrame) getTopFrame();
AlignFrame bottomFrame = (AlignFrame) getBottomFrame();