public void actionPerformed(ActionEvent event) { final GraphBuilderDialog dialog = new GraphBuilderDialog(SnapApp.getDefault().getAppContext(), "Graph Builder", "graph_builder"); //dialog.getJDialog().setIconImage(IconUtils.esaPlanetIcon.getImage()); dialog.show(); InputStream graphFileStream = getClass().getClassLoader().getResourceAsStream("graphs/ReadWriteGraph.xml"); dialog.LoadGraph(graphFileStream, null); dialog.EnableInitialInstructions(true); } }
public void actionPerformed(final ActionEvent e) { DoProcessing(); } });
public void actionPerformed(final ActionEvent e) { SaveGraph(); } });
@Override protected ModelessDialog createOperatorDialog() { setHelpId(getPropertyString("helpId")); final GraphBuilderDialog dialog = new GraphBuilderDialog(getAppContext(), getDialogTitle(), getHelpId(), isEditingEnabled()); dialog.show(); final File graphPath = GraphBuilderDialog.getInternalGraphFolder(); final File graphFile = new File(graphPath, getGraphFileName()); addIcon(dialog); dialog.LoadGraph(graphFile); return dialog; } }
/** * Validates the input and then call the GPF to execute the graph */ public void DoProcessing() { if (ValidateAllNodes()) { if (!checkIfOutputExists()) { return; } SystemUtils.freeAllMemory(); progressBar.setValue(0); final ProcessThread processThread = new ProcessThread(progBarMonitor); processThread.execute(); } else { showErrorDialog(statusLabel.getText()); } }
switch(eventType) { case ADD_EVENT: tabbedPanel.addTab(node.getID(), null, CreateOperatorTab(node), node.getID() + " Operator"); refreshGraph(); break; case REMOVE_EVENT: tabbedPanel.remove(tabbedPanel.indexOfTab(node.getID())); refreshGraph(); break; case SELECT_EVENT: ValidateAllNodes(); break; case REFRESH_EVENT: refreshGraph(); break; default:
/** * Loads a new graph from a file * * @param file the graph file to load */ public void LoadGraph(final File file) { try { LoadGraph(new FileInputStream(file), file); if (allowGraphBuilding) { setTitle(file.getName()); } } catch (IOException e) { SnapApp.getDefault().handleError("Unable to load graph " + file.toString(), e); } }
public void actionPerformed(final ActionEvent e) { LoadGraph(); } });
/** * Call Help */ private void OnHelp() { new HelpCtx(getHelpID()).display(); }
return InitGraph();
/** * pass in a file list for a ProductSetReader * * @param product the product files */ public void setInputFile(final Product product) { final GraphNode readerNode = graphEx.getGraphNodeList().findGraphNodeByOperator( ReadOp.Spi.getOperatorAlias(ReadOp.class)); if (readerNode != null) { SourceUI ui = (SourceUI) readerNode.GetOperatorUI(); ui.setSourceProduct(product); ValidateAllNodes(); } }
/** * Loads a new graph from a file */ public void LoadGraph() { final SnapFileFilter fileFilter = new SnapFileFilter("XML", "xml", "Graph"); final File graphFile = Dialogs.requestFileForOpen("Load Graph", false, fileFilter, LAST_GRAPH_PATH); if (graphFile == null) return; LoadGraph(graphFile); }