/** * Default constructor * * @param figureId id of the exported figure */ public SwingScilabExportFileChooser(Integer figureUID) { super(); this.figureUID = figureUID; SwingScilabDockablePanel tab = (SwingScilabDockablePanel) SwingView.getFromId(figureUID); setParentFrame(tab.getParentWindow()); exportCustomFileChooser(figureUID); }
public void setEnabled(boolean status) { if (status == isEnabled()) { return; } if (status) { // Enable the frame super.setEnabled(status); // Enable its children according to their __GO_UI_ENABLE__ property Integer[] children = (Integer[]) GraphicController.getController().getProperty(getId(), __GO_CHILDREN__); for (int kChild = 0; kChild < children.length; kChild++) { Boolean childStatus = (Boolean) GraphicController.getController().getProperty(children[kChild], __GO_UI_ENABLE__); SwingView.getFromId(children[kChild]).update(__GO_UI_ENABLE__, childStatus); } } else { // Disable the frame super.setEnabled(status); // Disable its children Component[] components = getComponents(); for (int compIndex = 0; compIndex < components.length; compIndex++) { components[compIndex].setEnabled(false); } } }
/** * Export a vectorial file * * @param userExtension extension caught by the user */ public void vectorialExport(String userExtension) { SwingScilabDockablePanel tab = (SwingScilabDockablePanel) SwingView.getFromId(figureUID); Component c = DrawerVisitor.getVisitor(figureUID).getComponent(); ExportData exportData = new ExportData(figureUID, this.exportName, userExtension, null); String actualFilename = exportData.getExportName(); if (this.getExtension(actualFilename) == null) { actualFilename += "." + userExtension; } if (!canWriteFile(actualFilename)) { return; } ExportOptionWindow exportOptionWindow = new ExportOptionWindow(exportData); exportOptionWindow.displayOptionWindow(tab); exportOptionWindow.landscapePortraitOption(); }