action.cluster_matrix = Cluster matrix
action.clustering_matrix_for = Calculating tree for matrix {0} and clustering at {1}
action.cluster_matrix_tooltip = Computes an average distance tree for the matrix and displays it
-
+label.all_known_alignment_files = All known alignment files
label.nothing_selected = Nada seleccionado
prompt.google_analytics_title = Jalview Estadísticas de Uso
prompt.google_analytics = ¿Quiere ayudar a mejorar Jalview habilitando la recopilación de estadísticas de uso con Google Analytics?\nPuede habilitar o deshabilitar el seguimiento de uso en las preferencias.
+label.all_known_alignment_files = Todos los archivos de alineación conocidos
import jalview.viewmodel.ViewportRanges;
import jalview.ws.DBRefFetcher;
import jalview.ws.DBRefFetcher.FetchFinishedListenerI;
-import jalview.ws.datamodel.alphafold.PAEContactMatrix;
import jalview.ws.jws1.Discoverer;
import jalview.ws.jws2.Jws2Discoverer;
import jalview.ws.jws2.jabaws2.Jws2Instance;
protected void htmlMenuItem_actionPerformed(ActionEvent e)
{
HtmlSvgOutput htmlSVG = new HtmlSvgOutput(alignPanel);
- try {
+ try
+ {
htmlSVG.exportHTML(null);
- } catch (ImageOutputException x) {
+ } catch (ImageOutputException x)
+ {
// report problem to console and raise dialog
}
}
public void bioJSMenuItem_actionPerformed(ActionEvent e)
{
BioJsHTMLOutput bjs = new BioJsHTMLOutput(alignPanel);
- try {
- bjs.exportHTML(null);
- } catch (ImageOutputException x) {
- // report problem to console and raise dialog
- }
+ try
+ {
+ bjs.exportHTML(null);
+ } catch (ImageOutputException x)
+ {
+ // report problem to console and raise dialog
+ }
}
public void createImageMap(File file, String image)
{
- try {
- alignPanel.makePNGImageMap(file, image);
- } catch (ImageOutputException x) {
+ try
+ {
+ alignPanel.makePNGImageMap(file, image);
+ } catch (ImageOutputException x)
+ {
// report problem to console and raise dialog
}
}
@Override
- public void createPNG_actionPerformed(ActionEvent e) {
- try{
+ public void createPNG_actionPerformed(ActionEvent e)
+ {
+ try
+ {
createPNG(null);
} catch (ImageOutputException ioex)
{
// raise dialog, and report via console
}
}
+
@Override
- public void createEPS_actionPerformed(ActionEvent e) {
- try{
+ public void createEPS_actionPerformed(ActionEvent e)
+ {
+ try
+ {
createEPS(null);
} catch (ImageOutputException ioex)
{
// raise dialog, and report via console
}
-
+
}
+
@Override
- public void createSVG_actionPerformed(ActionEvent e) {
- try{
+ public void createSVG_actionPerformed(ActionEvent e)
+ {
+ try
+ {
createSVG(null);
} catch (ImageOutputException ioex)
{
// raise dialog, and report via console
}
-
+
}
+
/**
* Creates a PNG image of the alignment and writes it to the given file. If
* the file is null, the user is prompted to choose a file.
createPNG(f, null, BitmapImageSizing.nullBitmapImageSizing());
}
- public void createPNG(File f, String renderer, BitmapImageSizing userBis) throws ImageOutputException
+ public void createPNG(File f, String renderer, BitmapImageSizing userBis)
+ throws ImageOutputException
{
alignPanel.makeAlignmentImage(TYPE.PNG, f, renderer, userBis);
}
*
* @param f
*/
- public void createEPS(File f) throws ImageOutputException
+ public void createEPS(File f) throws ImageOutputException
{
createEPS(f, null);
}
*
* @param f
*/
- public void createSVG(File f) throws ImageOutputException
+ public void createSVG(File f) throws ImageOutputException
{
createSVG(f, null);
}
// annotation was duplicated earlier
alignment.addAnnotation(sequences[i].getAnnotation()[a]);
// take care of contact matrix too
- ContactMatrixI cm=sequences[i].getContactMatrixFor(sequences[i].getAnnotation()[a]);
- if (cm!=null)
+ ContactMatrixI cm = sequences[i]
+ .getContactMatrixFor(sequences[i].getAnnotation()[a]);
+ if (cm != null)
{
- alignment.addContactListFor(sequences[i].getAnnotation()[a], cm);
+ alignment.addContactListFor(sequences[i].getAnnotation()[a],
+ cm);
}
-
+
alignment.setAnnotationIndex(sequences[i].getAnnotation()[a],
a);
}
}
JInternalFrame frame = new JInternalFrame();
-
+ frame.setFrameIcon(null);
frame.getContentPane().add(new JScrollPane(pane));
Desktop.addInternalFrame(frame, MessageManager
return alignPanel.overviewPanel;
}
JInternalFrame frame = new JInternalFrame();
+ frame.setFrameIcon(null);
final OverviewPanel overview = new OverviewPanel(alignPanel, frame,
showHidden);
frame.setContentPane(overview);
Desktop.addInternalFrame(frame, "", true, frame.getWidth(),
frame.getHeight(), true, true);
- frame.setFrameIcon(null);
frame.pack();
frame.setLayer(JLayeredPane.PALETTE_LAYER);
final AlignmentPanel thePanel = this.alignPanel;
else
{
JInternalFrame frame = new JInternalFrame();
+ frame.setFrameIcon(null);
frame.setContentPane(new PairwiseAlignPanel(viewport));
Desktop.addInternalFrame(frame,
MessageManager.getString("action.pairwise_alignment"), 600,
return tp;
}
- public void showContactMapTree(AlignmentAnnotation aa,
- ContactMatrixI cm)
+ public void showContactMapTree(AlignmentAnnotation aa, ContactMatrixI cm)
{
int x = 4, y = 5;
int w = 400, h = 500;
}
// Thread off a new instance of the file chooser - this reduces the time
- // it
- // takes to open it later on.
+ // it takes to open it later on.
new Thread(new Runnable()
{
@Override
public void run()
{
jalview.bin.Console.debug("Filechooser init thread started.");
- String fileFormat = Cache.getProperty("DEFAULT_FILE_FORMAT");
+ String fileFormat = FileLoader.getUseDefaultFileFormat()
+ ? Cache.getProperty("DEFAULT_FILE_FORMAT")
+ : null;
JalviewFileChooser.forRead(Cache.getProperty("LAST_DIRECTORY"),
fileFormat);
jalview.bin.Console.debug("Filechooser init thread finished.");
@Override
public void inputLocalFileMenuItem_actionPerformed(AlignViewport viewport)
{
- String fileFormat = Cache.getProperty("DEFAULT_FILE_FORMAT");
+ String fileFormat = FileLoader.getUseDefaultFileFormat()
+ ? Cache.getProperty("DEFAULT_FILE_FORMAT")
+ : null;
JalviewFileChooser chooser = JalviewFileChooser.forRead(
Cache.getProperty("LAST_DIRECTORY"), fileFormat,
BackupFiles.getEnabled());
if (Platform.isJS())
{
details = new JInternalFrame();
+ details.setFrameIcon(null);
JPanel panel = new JPanel(new BorderLayout());
panel.setOpaque(true);
panel.setBackground(Color.white);
pane.setBackground(Color.WHITE);
pane.add(textLabel, BorderLayout.NORTH);
frame = new JInternalFrame();
+ frame.setFrameIcon(null);
frame.getContentPane().add(new JScrollPane(pane));
}
else
});
featureSettingsUI = new JInternalFrame(MessageManager.getString(
"label.sequence_feature_settings_for_CDS_and_Protein"));
+ featureSettingsUI.setFrameIcon(null);
featureSettingsPanels.setOpaque(true);
JPanel dialog = new JPanel();
private File selectedFile;
+ private static boolean useDefaultFileFormat = false;
+
/**
* default constructor always raised errors in GUI dialog boxes
*/
}
this.setShouldBeSaved();
+ // after first file loaded we revert to assuming a default file format
+ useDefaultFileFormat = true;
}
/**
QuitHandler.Message.UNSAVED_ALIGNMENTS);
}
+ public static boolean getUseDefaultFileFormat()
+ {
+ return useDefaultFileFormat;
+ }
+
}
import java.util.Vector;
import javax.swing.BoxLayout;
-import javax.swing.DefaultListCellRenderer;
import javax.swing.JCheckBox;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
+import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
+import javax.swing.ListCellRenderer;
import javax.swing.SpringLayout;
+import javax.swing.SwingConstants;
+import javax.swing.SwingUtilities;
+import javax.swing.border.TitledBorder;
import javax.swing.filechooser.FileFilter;
import javax.swing.plaf.basic.BasicFileChooserUI;
// file filters to fix bug on Mac OSX
setAcceptAllFileFilterUsed(acceptAny);
+ // add a "All known alignment files" option
+ List<String> allExtensions = new ArrayList<>();
+ for (String[] format : formats)
+ {
+ String[] extensions = format[0].split(",");
+ for (String ext : extensions)
+ {
+ if (!allExtensions.contains(ext))
+ {
+ allExtensions.add(ext);
+ }
+ }
+ }
+ allExtensions.sort(null);
+ JalviewFileFilter alljvf = new JalviewFileFilter(
+ allExtensions.toArray(new String[] {}),
+ MessageManager.getString("label.all_known_alignment_files"));
+ alljvf.setExtensionListInDescription(false);
+ addChoosableFileFilter(alljvf);
+
+ if (selected == null)
+ {
+ chosen = alljvf;
+ }
+
for (String[] format : formats)
{
JalviewFileFilter jvf = new JalviewFileFilter(format[0], format[1]);
}
}
+ if (!file.isAbsolute() && file.exists())
+ {
+ file = file.getAbsoluteFile();
+ }
+
setSelectedFile(file);
}
}
}
list = new JList<>(recent);
-
- DefaultListCellRenderer dlcr = new DefaultListCellRenderer();
- dlcr.setHorizontalAlignment(DefaultListCellRenderer.RIGHT);
- list.setCellRenderer(dlcr);
+ list.setCellRenderer(new recentlyOpenedCellRenderer());
list.addMouseListener(new MouseAdapter()
{
}
});
- this.setBorder(new javax.swing.border.TitledBorder(
- MessageManager.getString("label.recently_opened")));
+ TitledBorder recentlyOpenedBorder = new TitledBorder(
+ MessageManager.getString("label.recently_opened"));
+ recentlyOpenedBorder.setTitleFont(
+ recentlyOpenedBorder.getTitleFont().deriveFont(10f));
+ this.setBorder(recentlyOpenedBorder);
final JScrollPane scroller = new JScrollPane(list);
layout.putConstraint(SpringLayout.NORTH, scroller, 5,
SpringLayout.NORTH, this);
- if (Platform.isAMacAndNotJS())
- {
- scroller.setPreferredSize(new Dimension(500, 100));
- }
- else
- {
- scroller.setPreferredSize(new Dimension(530, 200));
- }
-
+ // one size okay for all
+ scroller.setPreferredSize(new Dimension(280, 105));
this.add(scroller);
- javax.swing.SwingUtilities.invokeLater(new Runnable()
+ SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
}
+ class recentlyOpenedCellRenderer extends JLabel
+ implements ListCellRenderer<String>
+ {
+ private final static int maxChars = 46;
+
+ private final static String ellipsis = "...";
+
+ @Override
+ public Component getListCellRendererComponent(
+ JList<? extends String> list, String value, int index,
+ boolean isSelected, boolean cellHasFocus)
+ {
+ String filename = value.toString();
+ String displayFilename;
+ if (filename.length() > maxChars)
+ {
+ StringBuilder displayFileSB = new StringBuilder();
+ File file = new File(filename);
+ displayFileSB.append(file.getName());
+ if (file.getParent() != null)
+ {
+ File parent = file;
+ boolean spaceleft = true;
+ while (spaceleft && parent.getParent() != null)
+ {
+ parent = parent.getParentFile();
+ String name = parent.getName();
+ displayFileSB.insert(0, File.separator);
+ if (displayFileSB.length() + name.length() < maxChars - 1)
+ {
+ displayFileSB.insert(0, name);
+ }
+ else
+ {
+ displayFileSB.insert(0, ellipsis);
+ spaceleft = false;
+ }
+ }
+ if (spaceleft && filename.startsWith(File.separator)
+ && !(displayFileSB.charAt(0) == File.separatorChar))
+ {
+ displayFileSB.insert(0, File.separator);
+ }
+ }
+ displayFilename = displayFileSB.toString();
+ }
+ else
+ {
+ displayFilename = filename;
+ }
+ this.setText(displayFilename.toString());
+ this.setToolTipText(filename);
+ if (isSelected)
+ {
+ setBackground(list.getSelectionBackground());
+ setForeground(list.getSelectionForeground());
+ }
+ else
+ {
+ setBackground(list.getBackground());
+ setForeground(list.getForeground());
+ }
+ this.setHorizontalAlignment(SwingConstants.TRAILING);
+ this.setEnabled(list.isEnabled());
+ this.setFont(list.getFont().deriveFont(12f));
+ this.setOpaque(true);
+ return this;
+ }
+
+ }
+
/*
@Override
public JalviewFileChooser setResponseHandler(Object response,
*/
package jalview.io;
-import java.util.Locale;
-
import java.io.File;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.LinkedHashMap;
+import java.util.Locale;
import java.util.Map;
import java.util.StringTokenizer;
while (extensions.hasNext())
{
- fullDescription += (", " + extensions.next());
+ fullDescription += (", ." + extensions.next());
}
}
import jalview.gui.JvSwingUtils;
import jalview.gui.Preferences;
import jalview.io.FileFormats;
-import jalview.io.exceptions.ImageOutputException;
import jalview.schemes.ResidueColourScheme;
import jalview.util.MessageManager;
import jalview.util.Platform;
{
try
{
+ setFrameIcon(null);
// for Web-page embedding using id=align-frame-div
setName("jalview-alignment");
protected void createPNG_actionPerformed(ActionEvent object)
{
// TODO Auto-generated method stub
-
+
}
protected void createEPS_actionPerformed(ActionEvent object)
{
// TODO Auto-generated method stub
-
+
}
protected void createSVG_actionPerformed(ActionEvent object)
{
// TODO Auto-generated method stub
-
+
}
protected void copyHighlightedColumns_actionPerformed(
{
}
-
protected void font_actionPerformed(ActionEvent e)
{
}
}
-
protected void loadTreeMenuItem_actionPerformed(ActionEvent e)
{