/** * Default constructor. */ public CytoscapeImporter() { this(OVTK2Desktop.getInstance().getMainFrame()); }
/** * Returns the component containing the accumulated error messages. */ private void getErrors(String errors) { errorReport.setText(errors.substring(1, errors.length())); // show possible errors if (errorReport.getText().length() > 0) { JOptionPane.showMessageDialog(OVTK2Desktop.getInstance() .getMainFrame(), new JScrollPane(errorReport), "The following warnings were created during import...", JOptionPane.WARNING_MESSAGE); } }
@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); } } }
public void run() { OVTK2Desktop.getInstance().setRunningProcess( "AllPairsShortestPathFilter"); try { filter(selection, dirBox.isSelected(), invBox.isSelected()); } catch (InvalidPluginArgumentException e1) { ErrorDialog.show(e1); } OVTK2Desktop.getInstance().setRunningProcess("none"); } };
private ErrorDialog(boolean running, Throwable throwable, Thread thread) { super(running ? OVTK2Desktop.getInstance().getMainFrame() : null, "Error"); this.throwable = throwable; this.thread = thread; this.running = running; setupGUI(); boolean debug = Boolean.parseBoolean(Config.config.getProperty("flags.debug")); if (debug) throwable.printStackTrace(); }
public void run() { OVTK2Desktop.getInstance().setRunningProcess("GraphSynchronization"); gs.run(); OVTK2Desktop.getInstance().setRunningProcess("none"); } };
@Override public void actionPerformed(ActionEvent e) { if (box.getSelectedItem() instanceof AttributeName) { AttributeName an = (AttributeName) box.getSelectedItem(); Class<?> clazz = an.getDataType(); if (!Comparable.class.isAssignableFrom(clazz)) { JOptionPane .showMessageDialog( OVTK2Desktop.getInstance().getMainFrame(), "Selected values are not comparable. Please make a different selection.", "Error in value selection", JOptionPane.ERROR_MESSAGE); } } }
@Override public void warning(TranscoderException arg0) throws TranscoderException { JOptionPane.showMessageDialog(OVTK2Desktop.getInstance().getMainFrame(), arg0.getMessage(), "Warning", JOptionPane.WARNING_MESSAGE); } }
public void actionPerformed(ActionEvent arg0) { if (ovtk2layouter != null && viewer != null) { VisualisationUtils.relayout(viewer, OVTK2Desktop.getInstance().getMainFrame()); } }
@Override public void setGraph(ONDEXGraph graph) { OVTK2Desktop desktop = OVTK2Desktop.getInstance(); // hack to get to the visualisation viewer this.viewer = desktop.getDesktopResources().getSelectedViewer() .getVisualizationViewer(); }
@Override public void componentAdded(ContainerEvent e) { OVTK2Desktop.getInstance().getDesktopPane().add(e.getChild()); }
@Override public void componentRemoved(ContainerEvent e) { OVTK2Desktop.getInstance().getDesktopPane().remove(e.getChild()); }
public static OutputPrinter getCommandLine() { // check if there is an active viewer present OVTK2PropertiesAggregator viewer = (OVTK2PropertiesAggregator) OVTK2Desktop.getDesktopResources().getSelectedViewer(); if (viewer == null) { FileMenuAction.getInstance().actionPerformed(new ActionEvent(OVTK2Desktop.getInstance(), ActionEvent.ACTION_PERFORMED, "new")); } return getCommandLine(viewer); }
@Override public void fireCommandEvent(CommandEvent evt) { CommandProcess m = new CommandProcess(this, evt); m.start(); JFrame parent = null; if (!Config.isApplet) parent = OVTK2Desktop.getInstance().getMainFrame(); OVTKProgressMonitor.start(parent, "Please wait...", m); }
@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); } } }
/** * Method for compatibility with previous versions * * @param title * @param process */ public static void start(String title, final Monitorable process) { // running in Desktop version if (OVTK2Desktop.getDesktopResources().getSelectedViewer() instanceof OVTK2Viewer) start(OVTK2Desktop.getInstance().getMainFrame(), title, process); else start(null, title, process); }
/** * Shows the options frame. * * @param viewer * what viewer to show options for */ private static void showOptions(OVTK2Viewer viewer) { OVTK2Desktop desktop = OVTK2Desktop.getInstance(); // check if there is already a options if (options == null) { options = new OVTK2LayoutOptions(viewer); options.addInternalFrameListener(desktop); desktop.display(options, Position.right); } else { options.setViewer(viewer); options.toFront(); } }
@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 all relations between the currently visible nodes. * */ public void showAllRelations() { StateEdit edit = new StateEdit(new VisibilityUndo(this.getONDEXJUNGGraph()), Config.language.getProperty("Undo.ShowAllRelations")); undoManager.addEdit(edit); OVTK2Desktop.getInstance().getOVTK2Menu().updateUndoRedo(this); for (ONDEXConcept ondexNode : graph.getVertices()) { for (ONDEXRelation r : graph.getRelationsOfConcept(ondexNode)) { graph.setVisibility(r, true); } } edit.end(); }
public static void colourByContexts(OVTK2PropertiesAggregator viewer) { ONDEXGraph graph = viewer.getONDEXJUNGGraph(); Color color = JColorChooser.showDialog(OVTK2Desktop.getInstance().getMainFrame(), "Choose Background Color", Color.blue); if (color == null) return; System.err.println(color); PickedState<ONDEXConcept> state = viewer.getVisualizationViewer().getPickedVertexState(); Set<ONDEXConcept> set = state.getPicked(); for (ONDEXConcept n : set) { ONDEXConcept context = graph.getConcept(n.getId()); Annotation.setColor(viewer, context, color); for (ONDEXConcept c : graph.getConceptsOfTag(context)) { Annotation.setColor(viewer, c, color); } } }