@Override public void actionPerformed(ActionEvent ae) { String cmd = ae.getActionCommand(); OVTK2Desktop desktop = OVTK2Desktop.getInstance(); // simple about message if (cmd.equals("TavernaMissing")) { JOptionPane.showInternalMessageDialog(desktop.getDesktopPane(), Config.language.getProperty("Taverna.Missing.Text"), Config.language.getProperty("Taverna.Missing.Title"), JOptionPane.PLAIN_MESSAGE, icon); } } }
@Override public void componentRemoved(ContainerEvent e) { OVTK2Desktop.getInstance().getDesktopPane().remove(e.getChild()); }
@Override public void componentAdded(ContainerEvent e) { OVTK2Desktop.getInstance().getDesktopPane().add(e.getChild()); }
this.pack(); OVTK2Desktop.getInstance().getDesktopPane().add(this); this.setVisible(true);
@Override public void start(File file) { this.file = file; OVTK2Desktop desktop = OVTK2Desktop.getInstance(); JOptionPane .showInternalMessageDialog( desktop.getDesktopPane(), "To export appearance of the graph, please make sure you saved appearance first.", "Info", JOptionPane.INFORMATION_MESSAGE); // add GUI to desktop JDesktopPane pane = desktop.getDesktopPane(); initGUI(); pane.add(gui); gui.setVisible(true); gui.toFront(); }
/** * shows the color legend frame. */ private void showLegendWindow() { // make sure there is only one legend if (legend != null) { try { legend.setClosed(true); } catch (PropertyVetoException e) { ErrorDialog.show(e); } } legend = new LegendFrame(this); if (Config.isApplet) { // close old legend if (frame != null) { frame.setVisible(false); frame.dispose(); } frame = new JFrame("Legend"); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.setContentPane(legend.getContentPane()); frame.pack(); frame.setVisible(true); } else { OVTK2Desktop.getInstance().getDesktopPane().add(legend); legend.setVisible(true); } }
int answer = JOptionPane.showInternalConfirmDialog(OVTK2Desktop.getInstance().getDesktopPane(), Config.language.getProperty("Dialog.Save.Warning.Text"), Config.language.getProperty("Dialog.Save.Warning.Title"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); if (answer == JOptionPane.NO_OPTION) return;
Object obj = cls.newInstance(); JInternalFrame frame = (JInternalFrame) obj; Rectangle visible = OVTK2Desktop.getInstance().getDesktopPane().getVisibleRect(); Dimension size = frame.getSize(); frame.setLocation((visible.width / 2) - (size.width / 2), (visible.height / 2) - (size.height / 2)); frame.setVisible(true); desktop.getDesktopPane().add(frame); try { frame.setSelected(true);
OVTK2Desktop.getInstance().getDesktopPane().add(this); this.setVisible(true);
@Override public void internalFrameClosing(InternalFrameEvent e) { OVTK2Desktop desktop = OVTK2Desktop.getInstance(); if (e.getInternalFrame() instanceof OVTK2LayoutOptions) { desktop.locations.remove(e.getInternalFrame()); options = null; } else if (e.getInternalFrame() instanceof OVTK2Viewer) { int count = 0; for (JInternalFrame jif : desktop.getDesktopPane().getAllFrames()) { if (jif instanceof OVTK2Viewer) count++; } // last OVTK2Viewer is closing if (count == 1) { close(options); } } }
int option = JOptionPane.showInternalConfirmDialog(desktop.getDesktopPane(), "Detected appearance attributes. Do you like to load appearance now?", "Load appearance...", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE); if (option == JOptionPane.YES_OPTION) { FileMenuAction.getInstance().actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "loadappearance"));
if (!an.getDataType().equals(Boolean.class)) { JOptionPane.showInternalMessageDialog(OVTK2Desktop .getInstance().getDesktopPane(), "Attribute name is not of type Boolean.");
int option = JOptionPane.showOptionDialog(OVTK2Desktop.getInstance().getDesktopPane(), Config.language.getProperty("Annotator.Save.Changes.Text"), Config.language.getProperty("Annotator.Save.Changes.Title"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]);
/** * starts the PDBViewer in a JInternalFrame * * @param attribute * attribute values with stored the PDB-Filename */ public PDBStructureEditor(Attribute attribute) { setLayout(new BorderLayout()); if (attribute != null) { // JTable for value table = new JTable(new GDSTableModel(attribute)); this.add(table, BorderLayout.NORTH); JmolPanel jmolPanel = new JmolPanel(); this.add(jmolPanel, BorderLayout.CENTER); // load PDB file String pdbFile = table.getValueAt(0, 0).toString(); String strError = jmolPanel.viewer .openFile("http://www2.rcsb.org/pdb/files/" + pdbFile + ".pdb1.gz"); if (strError == null) jmolPanel.viewer .script("set measurementUnits ANGSTROMS; select all;spacefill off; wireframe off; backbone off; cartoon on; color cartoon structure; color structure; select ligand;wireframe 0.16;spacefill 0.5; color cpk ; select all; model 0;set antialiasDisplay true; spin on; save STATE state_1"); else JOptionPane.showInternalMessageDialog(OVTK2Desktop .getInstance().getDesktopPane(), strError, "Error while loading...", JOptionPane.ERROR_MESSAGE); } }
int n = JOptionPane.showInternalOptionDialog(OVTK2Desktop.getInstance().getDesktopPane(), "Do you want to load NCBI Taxonomy from web?", "Taxonomy lookup", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[2]);
public void selectNextWindow() { JDesktopPane desktop = OVTK2Desktop.getInstance().getDesktopPane(); JInternalFrame[] frames = desktop.getAllFrames(); for (int i = 0; i < frames.length; i++) { if (frames[i].isSelected()) { /* * find next frame that isn't an icon * and can be selected */ try { int next = i + 1; // check just in case if (next > i) return; while (next != i && frames[next].isIcon()) next++; if (next == i) return; // all other frames are icons or veto selection frames[next].setSelected(true); frames[next].toFront(); return; } catch (PropertyVetoException e) { } } } }
for (JInternalFrame jif : desktop.getDesktopPane().getAllFrames()) { if (jif instanceof OVTK2Viewer) count++;
public void tileWindows() { JDesktopPane desktop = OVTK2Desktop.getInstance().getDesktopPane(); JInternalFrame[] frames = desktop.getAllFrames();
public void cascadeWindows() { JDesktopPane desktop = OVTK2Desktop.getInstance().getDesktopPane(); JInternalFrame[] frames = desktop.getAllFrames(); int x = 0; int y = 0; int width = desktop.getWidth() / 2; int height = desktop.getHeight() / 2; for (int i = 0; i < frames.length; i++) { if (!frames[i].isIcon()) { try { /* * try to make maximized frames resizable this might be * vetoed */ frames[i].setMaximum(false); frames[i].reshape(x, y, width, height); x += frameDistance; y += frameDistance; // wrap around at the desktop edge if (x + width > desktop.getWidth()) x = 0; if (y + height > desktop.getHeight()) y = 0; } catch (PropertyVetoException e) { } } } }
@Override public void internalFrameClosing(InternalFrameEvent e) { for (Component c : OVTK2Desktop.getInstance().getDesktopPane() .getComponents()) { if (c instanceof GCutAndPasteTransfer) {