*/
package jalview.gui;
+import jalview.api.AlignViewportI;
import jalview.api.AlignViewControllerGuiI;
import jalview.api.FeatureSettingsControllerI;
import jalview.api.SplitContainerI;
import jalview.util.MessageManager;
import jalview.util.Platform;
import jalview.viewmodel.AlignmentViewport;
-
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import javax.swing.event.InternalFrameAdapter;
import javax.swing.event.InternalFrameEvent;
+
/**
* An internal frame on the desktop that hosts a horizontally split view of
* linked DNA and Protein alignments. Additional views can be created in linked
* estimate width and height of SplitFrame; this.getInsets() doesn't seem to
* give the full additional size (a few pixels short)
*/
- int widthFudge = Platform.isAMac() ? MAC_INSETS_WIDTH
+ int widthFudge = Platform.isAMacAndNotJS() ? MAC_INSETS_WIDTH
: WINDOWS_INSETS_WIDTH;
- int heightFudge = Platform.isAMac() ? MAC_INSETS_HEIGHT
+ int heightFudge = Platform.isAMacAndNotJS() ? MAC_INSETS_HEIGHT
: WINDOWS_INSETS_HEIGHT;
int width = ((AlignFrame) getTopFrame()).getWidth() + widthFudge;
int height = ((AlignFrame) getTopFrame()).getHeight()
// allow about 65 pixels for Desktop decorators on Windows
int newHeight = Math.min(height,
- Desktop.instance.getHeight() - DESKTOP_DECORATORS_HEIGHT);
+ Desktop.getInstance().getHeight() - DESKTOP_DECORATORS_HEIGHT);
if (newHeight != height)
{
int oldDividerLocation = getDividerLocation();
// TODO if CommandListener is only ever 1:1 for complementary views,
// may change broadcast pattern to direct messaging (more efficient)
final StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.instance);
+ .getStructureSelectionManager(Desktop.getInstance());
ssm.addCommandListener(((AlignFrame) getTopFrame()).getViewport());
ssm.addCommandListener(((AlignFrame) getBottomFrame()).getViewport());
}
topFrame.alignPanel.adjustAnnotationHeight();
bottomFrame.alignPanel.adjustAnnotationHeight();
- final AlignViewport topViewport = topFrame.viewport;
- final AlignViewport bottomViewport = bottomFrame.viewport;
+ final AlignViewportI topViewport = topFrame.viewport;
+ final AlignViewportI bottomViewport = bottomFrame.viewport;
final AlignmentI topAlignment = topViewport.getAlignment();
final AlignmentI bottomAlignment = bottomViewport.getAlignment();
boolean topAnnotations = topViewport.isShowAnnotation();
/*
* estimate ratio of (topFrameContent / bottomFrameContent)
*/
- int insets = Platform.isAMac() ? MAC_INSETS_HEIGHT
+ int insets = Platform.isAMacAndNotJS() ? MAC_INSETS_HEIGHT
: WINDOWS_INSETS_HEIGHT;
// allow 3 'rows' for scale, scrollbar, status bar
int topHeight = insets + (3 + topCount) * topCharHeight
* Ctrl-W / Cmd-W - close view or window
*/
KeyStroke key_cmdW = KeyStroke.getKeyStroke(KeyEvent.VK_W,
- jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), false);
+ Platform.SHORTCUT_KEY_MASK, false);
action = new AbstractAction()
{
@Override
* Ctrl-T / Cmd-T open new view
*/
KeyStroke key_cmdT = KeyStroke.getKeyStroke(KeyEvent.VK_T,
- jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), false);
+ Platform.SHORTCUT_KEY_MASK, false);
AbstractAction action = new AbstractAction()
{
@Override
adjustLayout();
final StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.instance);
+ .getStructureSelectionManager(Desktop.getInstance());
ssm.addCommandListener(newTopPanel.av);
ssm.addCommandListener(newBottomPanel.av);
}
*/
protected void expandViews_actionPerformed()
{
- Desktop.instance.explodeViews(this);
+ Desktop.getInstance().explodeViews(this);
}
/**
*/
protected void gatherViews_actionPerformed()
{
- Desktop.instance.gatherViews(this);
+ Desktop.getInstance().gatherViews(this);
}
/**
* Ctrl-F / Cmd-F open Finder dialog, 'focused' on the right alignment
*/
KeyStroke key_cmdF = KeyStroke.getKeyStroke(KeyEvent.VK_F,
- jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), false);
+ Platform.SHORTCUT_KEY_MASK, false);
AbstractAction action = new AbstractAction()
{
@Override
if (c != null && c instanceof AlignFrame)
{
AlignFrame af = (AlignFrame) c;
- new Finder(af.alignPanel);
+ boolean dna = af.getViewport().getAlignment().isNucleotide();
+ String scope = MessageManager.getString("label.in") + " "
+ + (dna ? MessageManager.getString("label.nucleotide")
+ : MessageManager.getString("label.protein"));
+ new Finder(af.alignPanel, true, scope);
}
}
};
if (showInternalFrame)
{
- if (Platform.isAMac())
+ if (Platform.isAMacAndNotJS())
{
Desktop.addInternalFrame(featureSettingsUI,
MessageManager.getString(
{
return featureSettingsUI != null && !featureSettingsUI.isClosed();
}
-}
\ No newline at end of file
+}