Package org.gephi.preview.api

Examples of org.gephi.preview.api.PreviewPreset


        PreviewUIController.findInstance().refreshPreview();
}//GEN-LAST:event_refreshButtonActionPerformed

    private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveButtonActionPerformed
        PreviewController previewController = Lookup.getDefault().lookup(PreviewController.class);
        PreviewPreset preset = previewController.getModel().getCurrentPreset();
        boolean saved = false;
        if (isDefaultPreset(preset)) {
            NotifyDescriptor.InputLine question = new NotifyDescriptor.InputLine(
                    NbBundle.getMessage(PreviewSettingsTopComponent.class, "PreviewSettingsTopComponent.savePreset.input"),
                    NbBundle.getMessage(PreviewSettingsTopComponent.class, "PreviewSettingsTopComponent.savePreset.input.title"));
            if (DialogDisplayer.getDefault().notify(question) == NotifyDescriptor.OK_OPTION) {
                String input = question.getInputText();
                if (input != null && !input.isEmpty()) {
                    previewController.savePreset(input);
                    saved = true;
                    StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(PreviewSettingsTopComponent.class, "PreviewSettingsTopComponent.savePreset.status", input));
                }
            }
        } else {
            previewController.savePreset(preset.getName());
            saved = true;
            StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(PreviewSettingsTopComponent.class, "PreviewSettingsTopComponent.savePreset.status", preset.getName()));
        }

        if (saved) {
            //refresh combo
            PreviewController controller = Lookup.getDefault().lookup(PreviewController.class);
View Full Code Here


        return presetsArray;
    }

    public void savePreset(String name) {
        if (model != null) {
            PreviewPreset preset = model.wrapPreset(name);
            presetUtils.savePreset(preset);
            model.setCurrentPreset(preset);
        }
    }
View Full Code Here

                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return new PreviewPreset(name, propertiesMap);
    }
View Full Code Here

    private List<PreviewPreset> presets;

    public void savePreset(PreviewPreset preset) {
        int exist = -1;
        for (int i = 0; i < presets.size(); i++) {
            PreviewPreset p = presets.get(i);
            if (p.getName().equals(preset.getName())) {
                exist = i;
                break;
            }
        }
        if (exist == -1) {
View Full Code Here

                    try {
                        InputStream stream = child.getInputStream();
                        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                        DocumentBuilder builder = factory.newDocumentBuilder();
                        Document document = builder.parse(stream);
                        PreviewPreset preset = readXML(document);
                        addPreset(preset);
                    } catch (Exception ex) {
                        ex.printStackTrace();
                    }
                }
View Full Code Here

                if (!value.isEmpty()) {
                    propertiesMap.put(name, value);
                }
            }
        }
        PreviewPreset preset = new PreviewPreset(presetE.getAttribute("name"), propertiesMap);
        return preset;
    }
View Full Code Here

        Lookup.getDefault().lookup(PreviewUIController.class).refreshPreview();
}//GEN-LAST:event_refreshButtonActionPerformed

    private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveButtonActionPerformed
        PreviewUIController previewController = Lookup.getDefault().lookup(PreviewUIController.class);
        PreviewPreset preset = previewController.getModel().getCurrentPreset();
        boolean saved = false;
        if (isDefaultPreset(preset)) {
            NotifyDescriptor.InputLine question = new NotifyDescriptor.InputLine(
                    NbBundle.getMessage(PreviewSettingsTopComponent.class, "PreviewSettingsTopComponent.savePreset.input"),
                    NbBundle.getMessage(PreviewSettingsTopComponent.class, "PreviewSettingsTopComponent.savePreset.input.title"));
            if (DialogDisplayer.getDefault().notify(question) == NotifyDescriptor.OK_OPTION) {
                String input = question.getInputText();
                if (input != null && !input.isEmpty()) {
                    previewController.savePreset(input);
                    saved = true;
                    StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(PreviewSettingsTopComponent.class, "PreviewSettingsTopComponent.savePreset.status", input));
                }
            }
        } else {
            previewController.savePreset(preset.getName());
            saved = true;
            StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(PreviewSettingsTopComponent.class, "PreviewSettingsTopComponent.savePreset.status", preset.getName()));
        }

        if (saved) {
            //refresh combo
            DefaultComboBoxModel comboBoxModel = new DefaultComboBoxModel();
View Full Code Here

                map.put(p.getName(), p.getValue());
            }
            for (Entry<String, Object> p : previewModel.getProperties().getSimpleValues()) {
                map.put(p.getKey(), p.getValue());
            }
            PreviewPreset preset = new PreviewPreset(name, map);
            presetUtils.savePreset(preset);
            model.setCurrentPreset(preset);
        }
    }
View Full Code Here

    private List<PreviewPreset> presets;

    public void savePreset(PreviewPreset preset) {
        int exist = -1;
        for (int i = 0; i < presets.size(); i++) {
            PreviewPreset p = presets.get(i);
            if (p.getName().equals(preset.getName())) {
                exist = i;
                break;
            }
        }
        if (exist == -1) {
View Full Code Here

                    try {
                        InputStream stream = child.getInputStream();
                        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                        DocumentBuilder builder = factory.newDocumentBuilder();
                        Document document = builder.parse(stream);
                        PreviewPreset preset = readXML(document);
                        addPreset(preset);
                    } catch (Exception ex) {
                        ex.printStackTrace();
                    }
                }
View Full Code Here

TOP

Related Classes of org.gephi.preview.api.PreviewPreset

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.