label.eps_file = EPS file
label.png_image = PNG image
status.saving_file = Saving {0}
-status.export_complete = Export complete.
+status.export_complete = {0} Export completed.
status.fetching_pdb = Fetching PDB {0}
status.refreshing_news = Refreshing news
status.importing_vamsas_session_from = Importing VAMSAS session from {0}
exception.pdb_server_unreachable = Jalview is unable to reach the PDBe Solr server. \nPlease ensure that you are connected to the internet and try again.
label.nw_mapping = Needleman & Wunsch Alignment
label.sifts_mapping = SIFTs Mapping
-label.mapping_method = Sequence \u27f7 Structure mapping method
\ No newline at end of file
+label.mapping_method = Sequence \u27f7 Structure mapping method
+status.waiting_for_user_to_select_output_file = Waiting for user to select {0} file
+status.cancelled_image_export_operation = Cancelled {0} export operation
+info.error_creating_file = Error creating {0} file.
\ No newline at end of file
Desktop.addInternalFrame(this, title.toString(), 400, 400);
}
+ @Override
public void run()
{
try
{
this.addKeyListener(new KeyAdapter()
{
+ @Override
public void keyPressed(KeyEvent evt)
{
pdbcanvas.keyPressed(evt);
png.setText("PNG");
png.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
png_actionPerformed(e);
eps.setText("EPS");
eps.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
eps_actionPerformed(e);
mapping.setText(MessageManager.getString("label.view_mapping"));
mapping.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
mapping_actionPerformed(e);
wire.setText(MessageManager.getString("label.wireframe"));
wire.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
wire_actionPerformed(e);
depth.setText(MessageManager.getString("label.depthcue"));
depth.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
depth_actionPerformed(e);
zbuffer.setText(MessageManager.getString("label.z_buffering"));
zbuffer.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
zbuffer_actionPerformed(e);
charge.setText(MessageManager.getString("label.charge_cysteine"));
charge.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
charge_actionPerformed(e);
chain.setText(MessageManager.getString("action.by_chain"));
chain.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
chain_actionPerformed(e);
seqButton.setText(MessageManager.getString("action.by_sequence"));
seqButton.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
seqButton_actionPerformed(e);
allchains.setText(MessageManager.getString("label.show_all_chains"));
allchains.addItemListener(new ItemListener()
{
+ @Override
public void itemStateChanged(ItemEvent e)
{
allchains_itemStateChanged(e);
zappo.setText(MessageManager.getString("label.zappo"));
zappo.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
zappo_actionPerformed(e);
taylor.setText(MessageManager.getString("label.taylor"));
taylor.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
taylor_actionPerformed(e);
hydro.setText(MessageManager.getString("label.hydrophobicity"));
hydro.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
hydro_actionPerformed(e);
helix.setText(MessageManager.getString("label.helix_propensity"));
helix.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
helix_actionPerformed(e);
strand.setText(MessageManager.getString("label.strand_propensity"));
strand.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
strand_actionPerformed(e);
turn.setText(MessageManager.getString("label.turn_propensity"));
turn.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
turn_actionPerformed(e);
buried.setText(MessageManager.getString("label.buried_index"));
buried.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
buried_actionPerformed(e);
user.setText(MessageManager.getString("action.user_defined"));
user.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
user_actionPerformed(e);
.setText(MessageManager.getString("action.background_colour"));
background.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
background_actionPerformed(e);
savePDB.setText(MessageManager.getString("label.pdb_file"));
savePDB.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
savePDB_actionPerformed(e);
radioItem.setName("USER_DEFINED");
radioItem.addMouseListener(new MouseAdapter()
{
+ @Override
public void mousePressed(MouseEvent evt)
{
if (evt.isControlDown()
{
radioItem.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent evt)
{
user_actionPerformed(evt);
});
radioItem.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent evt)
{
user_actionPerformed(evt);
{
im = new jalview.util.ImageMaker(this,
jalview.util.ImageMaker.TYPE.PNG, "Make PNG image from view",
- width, height, null, null);
+ width, height, null, null, null, 0, false);
}
else if (type == jalview.util.ImageMaker.TYPE.EPS)
{
im = new jalview.util.ImageMaker(this,
jalview.util.ImageMaker.TYPE.EPS, "Make EPS file from view",
- width, height, null, this.getTitle());
+ width, height, null, this.getTitle(), null, 0, false);
}
else
{
im = new jalview.util.ImageMaker(this,
jalview.util.ImageMaker.TYPE.SVG, "Make SVG file from PCA",
- width, height, null, this.getTitle());
+ width, height, null, this.getTitle(), null, 0, false);
}
if (im.getGraphics() != null)
final AlignmentPanel ap = this;
av.addPropertyChangeListener(new PropertyChangeListener()
{
+ @Override
public void propertyChange(PropertyChangeEvent evt)
{
if (evt.getPropertyName().equals("alignment"))
* automatically adjust annotation panel height for new annotation whilst
* ensuring the alignment is still visible.
*/
+ @Override
public void adjustAnnotationHeight()
{
// TODO: display vertical annotation scrollbar if necessary
* @param evt
* DOCUMENT ME!
*/
+ @Override
public void adjustmentValueChanged(AdjustmentEvent evt)
{
int oldX = av.getStartRes();
// as preference setting
SwingUtilities.invokeLater(new Runnable()
{
+ @Override
public void run()
{
setScrollValues(av.getStartRes(), av.getStartSeq());
* Repaint the alignment including the annotations and overview panels (if
* shown).
*/
+ @Override
public void paintAlignment(boolean updateOverview)
{
final AnnotationSorter sorter = new AnnotationSorter(getAlignment(),
* @param g
* DOCUMENT ME!
*/
+ @Override
public void paintComponent(Graphics g)
{
invalidate();
* @throws PrinterException
* DOCUMENT ME!
*/
+ @Override
public int print(Graphics pg, PageFormat pf, int pi)
throws PrinterException
{
void makeAlignmentImage(jalview.util.ImageMaker.TYPE type, File file)
{
- long progress = System.currentTimeMillis();
+ long pSessionId = System.currentTimeMillis();
headless = (System.getProperty("java.awt.headless") != null && System
.getProperty("java.awt.headless").equals("true"));
if (alignFrame != null && !headless)
{
- alignFrame.setProgressBar(MessageManager.formatMessage(
+ if (file != null)
+ {
+ alignFrame.setProgressBar(MessageManager.formatMessage(
"status.saving_file", new Object[] { type.getLabel() }),
- progress);
+ pSessionId);
+ }
}
try
{
im = new jalview.util.ImageMaker(this, type, imageAction,
aDimension.getWidth(), aDimension.getHeight(), file,
- imageTitle);
+ imageTitle, alignFrame, pSessionId, headless);
if (av.getWrapAlignment())
{
if (im.getGraphics() != null)
im.writeImage();
}
}
+
} catch (OutOfMemoryError err)
{
// Be noisy here.
}
} finally
{
- if (alignFrame != null && !headless)
- {
- alignFrame.setProgressBar(
- MessageManager.getString("status.export_complete"),
- progress);
- }
+
}
}
MessageManager.getString("label.all"));
menuItem.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent evt)
{
allChainsSelected = true;
menuItem = new JCheckBoxMenuItem(chain, true);
menuItem.addItemListener(new ItemListener()
{
+ @Override
public void itemStateChanged(ItemEvent evt)
{
if (!allChainsSelected)
jmb.centerViewer(toshow);
}
+ @Override
public void closeViewer(boolean closeExternalViewer)
{
// Jmol does not use an external viewer
jmb = null;
}
+ @Override
public void run()
{
_started = true;
{
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
+ @Override
public void run()
{
if (jmb.viewer.isScriptExecuting())
{
im = new jalview.util.ImageMaker(this,
jalview.util.ImageMaker.TYPE.PNG, "Make PNG image from view",
- width, height, null, null);
+ width, height, null, null, null, 0, false);
}
else if (type == jalview.util.ImageMaker.TYPE.EPS)
{
im = new jalview.util.ImageMaker(this,
jalview.util.ImageMaker.TYPE.EPS, "Make EPS file from view",
- width, height, null, this.getTitle());
+ width, height, null, this.getTitle(), null, 0, false);
}
else
{
im = new jalview.util.ImageMaker(this,
jalview.util.ImageMaker.TYPE.SVG, "Make SVG file from PCA",
- width, height, null, this.getTitle());
+ width, height, null, this.getTitle(), null, 0, false);
}
if (im.getGraphics() != null)
}
+ @Override
public void setJalviewColourScheme(ColourSchemeI ucs)
{
jmb.setJalviewColourScheme(ucs);
this.delegate = delegate;
}
+ @Override
public void activateFrame(JInternalFrame f)
{
try
}
}
+ @Override
public void beginDraggingFrame(JComponent f)
{
delegate.beginDraggingFrame(f);
}
+ @Override
public void beginResizingFrame(JComponent f, int direction)
{
delegate.beginResizingFrame(f, direction);
}
+ @Override
public void closeFrame(JInternalFrame f)
{
delegate.closeFrame(f);
}
+ @Override
public void deactivateFrame(JInternalFrame f)
{
delegate.deactivateFrame(f);
}
+ @Override
public void deiconifyFrame(JInternalFrame f)
{
delegate.deiconifyFrame(f);
}
+ @Override
public void dragFrame(JComponent f, int newX, int newY)
{
if (newY < 0)
delegate.dragFrame(f, newX, newY);
}
+ @Override
public void endDraggingFrame(JComponent f)
{
delegate.endDraggingFrame(f);
}
+ @Override
public void endResizingFrame(JComponent f)
{
delegate.endResizingFrame(f);
}
+ @Override
public void iconifyFrame(JInternalFrame f)
{
delegate.iconifyFrame(f);
}
+ @Override
public void maximizeFrame(JInternalFrame f)
{
delegate.maximizeFrame(f);
}
+ @Override
public void minimizeFrame(JInternalFrame f)
{
delegate.minimizeFrame(f);
}
+ @Override
public void openFrame(JInternalFrame f)
{
delegate.openFrame(f);
delegate.resizeFrame(f, newX, newY, newWidth, newHeight);
}
+ @Override
public void setBoundsForFrame(JComponent f, int newX, int newY,
int newWidth, int newHeight)
{
this.addWindowListener(new WindowAdapter()
{
+ @Override
public void windowClosing(WindowEvent evt)
{
quit();
MouseAdapter ma;
this.addMouseListener(ma = new MouseAdapter()
{
+ @Override
public void mousePressed(MouseEvent evt)
{
if (SwingUtilities.isRightMouseButton(evt))
// Spawn a thread that shows the splashscreen
SwingUtilities.invokeLater(new Runnable()
{
+ @Override
public void run()
{
new SplashScreen();
// takes to open it later on.
new Thread(new Runnable()
{
+ @Override
public void run()
{
Cache.log.debug("Filechooser init thread started.");
// reselected again.
boolean refresh = true;
+ @Override
public void menuCanceled(MenuEvent e)
{
refresh = true;
}
+ @Override
public void menuDeselected(MenuEvent e)
{
refresh = true;
}
+ @Override
public void menuSelected(MenuEvent e)
{
if (refresh)
MessageManager.getString("label.paste_new_window"));
item.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent evt)
{
paste();
final JMenuItem menuItem = new JMenuItem(title);
frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
{
+ @Override
public void internalFrameActivated(
javax.swing.event.InternalFrameEvent evt)
{
}
+ @Override
public void internalFrameClosed(
javax.swing.event.InternalFrameEvent evt)
{
menuItem.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
try
}
}
+ @Override
public void lostOwnership(Clipboard clipboard, Transferable contents)
{
if (!internalCopy)
internalCopy = false;
}
+ @Override
public void dragEnter(DropTargetDragEvent evt)
{
}
+ @Override
public void dragExit(DropTargetEvent evt)
{
}
+ @Override
public void dragOver(DropTargetDragEvent evt)
{
}
* @param evt
* DOCUMENT ME!
*/
+ @Override
public void drop(DropTargetDropEvent evt)
{
boolean success = true;
// message.toString(), "About Jalview", JOptionPane.INFORMATION_MESSAGE);
new Thread(new Runnable()
{
+ @Override
public void run()
{
new SplashScreen(true);
new Thread(new Runnable()
{
+ @Override
public void run()
{
// TODO: refactor to Jalview desktop session controller action.
selectedFile.getParent());
new Thread(new Runnable()
{
+ @Override
public void run()
{
setProgressBar(
sessit.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
if (dsktp.v_client == null)
Thread rthr = new Thread(new Runnable()
{
+ @Override
public void run()
{
dsktp.v_client = new VamsasApplication(dsktp, mysesid);
return showMemoryUsage;
}
+ @Override
public void run()
{
df = java.text.NumberFormat.getNumberInstance();
groovyShell.setText(MessageManager.getString("label.groovy_console"));
groovyShell.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
groovyShell_actionPerformed();
*
* @see jalview.gui.IProgressIndicator#setProgressBar(java.lang.String, long)
*/
+ @Override
public void setProgressBar(String message, long id)
{
if (progressBars == null)
* @see jalview.gui.IProgressIndicator#registerHandler(long,
* jalview.gui.IProgressIndicatorHandler)
*/
+ @Override
public void registerHandler(final long id,
final IProgressIndicatorHandler handler)
{
cancel.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
handler.cancelActivity(id);
// only run if we aren't already displaying one of these.
addDialogThread(serviceChangedDialog = new Runnable()
{
+ @Override
public void run()
{
{
new Thread(new Runnable()
{
+ @Override
public void run()
{
try
{
dialogExecutor.submit(new Runnable()
{
+ @Override
public void run()
{
if (dialogPause)
ImageMaker im = new jalview.util.ImageMaker(this, ImageMaker.TYPE.EPS,
"View of Desktop", getWidth(), getHeight(), of = new File(
"Jalview_snapshot" + System.currentTimeMillis()
- + ".eps"), "View of desktop");
+ + ".eps"), "View of desktop", null, 0, false);
try
{
paintAll(im.getGraphics());
}
}
+ @Override
public void bgcolour_actionPerformed(ActionEvent e)
{
Color col = JColorChooser.showDialog(this,
/**
* DOCUMENT ME!
*/
+ @Override
public void run()
{
long progId = System.currentTimeMillis();
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void xCombobox_actionPerformed(ActionEvent e)
{
doDimensionChange();
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void yCombobox_actionPerformed(ActionEvent e)
{
doDimensionChange();
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void zCombobox_actionPerformed(ActionEvent e)
{
doDimensionChange();
}
+ @Override
public void outputValues_actionPerformed(ActionEvent e)
{
CutAndPasteTransfer cap = new CutAndPasteTransfer();
}
}
+ @Override
public void showLabels_actionPerformed(ActionEvent e)
{
rc.showLabels(showLabels.getState());
}
+ @Override
public void print_actionPerformed(ActionEvent e)
{
PCAPrinter printer = new PCAPrinter();
printer.start();
}
+ @Override
public void originalSeqData_actionPerformed(ActionEvent e)
{
// this was cut'n'pasted from the equivalent TreePanel method - we should
class PCAPrinter extends Thread implements Printable
{
+ @Override
public void run()
{
PrinterJob printJob = PrinterJob.getPrinterJob();
}
}
+ @Override
public int print(Graphics pg, PageFormat pf, int pi)
throws PrinterException
{
* @param e
* DOCUMENT ME!
*/
+ @Override
public void eps_actionPerformed(ActionEvent e)
{
makePCAImage(jalview.util.ImageMaker.TYPE.EPS);
* @param e
* DOCUMENT ME!
*/
+ @Override
public void png_actionPerformed(ActionEvent e)
{
makePCAImage(jalview.util.ImageMaker.TYPE.PNG);
{
im = new jalview.util.ImageMaker(this,
jalview.util.ImageMaker.TYPE.PNG, "Make PNG image from PCA",
- width, height, null, null);
+ width, height, null, null, null, 0, false);
}
else if (type == jalview.util.ImageMaker.TYPE.EPS)
{
im = new jalview.util.ImageMaker(this,
jalview.util.ImageMaker.TYPE.EPS, "Make EPS file from PCA",
- width, height, null, this.getTitle());
+ width, height, null, this.getTitle(), null, 0, false);
}
else
{
im = new jalview.util.ImageMaker(this,
jalview.util.ImageMaker.TYPE.SVG, "Make SVG file from PCA",
- width, height, null, this.getTitle());
+ width, height, null, this.getTitle(), null, 0, false);
}
}
}
+ @Override
public void viewMenu_menuSelected()
{
buildAssociatedViewMenu();
buttonGroup.add(item);
item.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent evt)
{
rc.applyToAllViews = false;
itemf.setSelected(rc.applyToAllViews);
itemf.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent evt)
{
rc.applyToAllViews = itemf.isSelected();
* jalview.jbgui.GPCAPanel#outputPoints_actionPerformed(java.awt.event.ActionEvent
* )
*/
+ @Override
protected void outputPoints_actionPerformed(ActionEvent e)
{
CutAndPasteTransfer cap = new CutAndPasteTransfer();
* jalview.jbgui.GPCAPanel#outputProjPoints_actionPerformed(java.awt.event
* .ActionEvent)
*/
+ @Override
protected void outputProjPoints_actionPerformed(ActionEvent e)
{
CutAndPasteTransfer cap = new CutAndPasteTransfer();
import jalview.bin.Jalview;
import jalview.gui.EPSOptions;
+import jalview.gui.IProgressIndicator;
import jalview.gui.SVGOptions;
import jalview.io.JalviewFileChooser;
}
public ImageMaker(Component parent, TYPE type, String title, int width,
- int height, File file, String fileTitle)
+ int height, File file, String fileTitle,
+ IProgressIndicator pIndicator, long pSessionId, boolean headless)
{
this.type = type;
if (file == null)
{
+ if (pIndicator != null && !headless)
+ {
+ pIndicator.setProgressBar(
+ MessageManager.formatMessage(
+ "status.waiting_for_user_to_select_output_file",
+ type.name), pSessionId);
+ }
JalviewFileChooser chooser;
chooser = type.getChooser();
chooser.setFileView(new jalview.io.JalviewFileView());
.getSelectedFile().getParent());
file = chooser.getSelectedFile();
}
+ else
+ {
+ if (pIndicator != null && !headless)
+ {
+ pIndicator.setProgressBar(MessageManager.formatMessage(
+ "status.cancelled_image_export_operation", type.name),
+ pSessionId);
+ }
+ }
}
if (file != null)
{
setupPNG(width, height);
}
-
+ if (pIndicator != null && !headless)
+ {
+ pIndicator.setProgressBar(
+MessageManager.formatMessage(
+ "status.export_complete", type.getName()),
+ pSessionId);
+ }
} catch (Exception ex)
{
System.out.println("Error creating " + type.getName() + " file.");
+
+ pIndicator.setProgressBar(MessageManager.formatMessage(
+ "info.error_creating_file", type.getName()), pSessionId);
}
}
}