private boolean isSelectedProfileModified() { final ProfileItem profileItem = getSelectedProfileItem(); final String[] profileRgbaExpressions = profileItem.getProfile().getRgbaExpressions(); final String[] userRgbaExpressions = getRgbaExpressions(); for (int i = 0; i < profileRgbaExpressions.length; i++) { final String userRgbaExpression = userRgbaExpressions[i]; final String profileRgbaExpression = profileRgbaExpressions[i]; if (!profileRgbaExpression.equals(userRgbaExpression)) { return true; } } return false; }
private void performSaveAs() { File file = promptForSaveFile(); if (file == null) { return; } RGBImageProfile profile = new RGBImageProfile(FileUtils.getFilenameWithoutExtension(file), getRgbaExpressions()); try { profile.store(file); } catch (IOException e) { JOptionPane.showMessageDialog(this, "Failed to save RGB-profile '" + file.getName() + "':\n" + e.getMessage(), "Open RGB-Image Profile", JOptionPane.ERROR_MESSAGE); return; } RGBImageProfileManager.getInstance().addProfile(profile); addNewProfile(profile); }
public void openProductSceneViewRGB(final Product product, final String helpId) { final VisatApp visatApp = VisatApp.getApp(); final RGBImageProfilePane profilePane = new RGBImageProfilePane(visatApp.getPreferences(), product); final String title = visatApp.getAppName() + " - Select RGB-Image Channels"; final boolean ok = profilePane.showDialog(visatApp.getMainFrame(), title, helpId); if (!ok) { return; } final String[] rgbaExpressions = profilePane.getRgbaExpressions(); if (profilePane.getStoreProfileInProduct()) { RGBImageProfile.storeRgbaExpressions(product, rgbaExpressions); } final String sceneName = createSceneName(product, profilePane.getSelectedProfile()); openProductSceneViewRGB(sceneName, product, rgbaExpressions); }