Search in sources :

Example 6 with PluginParametersSwingDialog

use of au.gov.asd.tac.constellation.plugins.gui.PluginParametersSwingDialog in project constellation by constellation-app.

the class LayerByTimeAction method actionPerformed.

@Override
public void actionPerformed(final ActionEvent ev) {
    final Plugin plugin = PluginRegistry.get(ArrangementPluginRegistry.TIME);
    final PluginParameters params = plugin.createParameters();
    final Graph graph = context.getGraph();
    plugin.updateParameters(graph, params);
    final PluginParametersSwingDialog dialog = new PluginParametersSwingDialog(Bundle.CTL_LayerByTimeAction(), params);
    dialog.showAndWait();
    if (PluginParametersDialog.OK.equals(dialog.getResult())) {
        PluginExecution.withPlugin(plugin).withParameters(params).executeLater(graph);
    }
}
Also used : PluginParametersSwingDialog(au.gov.asd.tac.constellation.plugins.gui.PluginParametersSwingDialog) Graph(au.gov.asd.tac.constellation.graph.Graph) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters) Plugin(au.gov.asd.tac.constellation.plugins.Plugin)

Example 7 with PluginParametersSwingDialog

use of au.gov.asd.tac.constellation.plugins.gui.PluginParametersSwingDialog in project constellation by constellation-app.

the class NewNebulaAction method actionPerformed.

@Override
public void actionPerformed(final ActionEvent e) {
    final PluginParameters params = new PluginParameters();
    final PluginParameter<FileParameterValue> fileParam = FileParameterType.build(NEBULA_FILE_PARAMETER_ID);
    fileParam.setName("Nebula file");
    FileParameterType.setFileFilters(fileParam, new ExtensionFilter("Nebula file", "*.nebula"));
    fileParam.getParameterValue().setKind(FileParameterKind.SAVE);
    fileParam.setHelpID("au.gov.asd.tac.constellation.file.nebula");
    params.addParameter(fileParam);
    final PluginParameter<ColorParameterValue> colorParam = ColorParameterType.build(COLOR_PARAMETER_ID);
    colorParam.setName("Nebula colour");
    params.addParameter(colorParam);
    final PluginParametersSwingDialog dialog = new PluginParametersSwingDialog(Bundle.CTL_NewNebulaAction(), params);
    dialog.showAndWait();
    if (PluginParametersDialog.OK.equals(dialog.getResult())) {
        final FileParameterValue fpv = fileParam.getParameterValue();
        if (!fpv.get().isEmpty()) {
            final Properties props = new Properties();
            final ConstellationColor c = colorParam.getColorValue();
            props.setProperty("colour", String.format("%f,%f,%f", c.getRed(), c.getGreen(), c.getBlue()));
            File f = fpv.get().get(0);
            if (!StringUtils.endsWithIgnoreCase(f.getName(), FileExtensionConstants.NEBULA)) {
                f = new File(f.getAbsoluteFile() + FileExtensionConstants.NEBULA);
            }
            try {
                try (final FileOutputStream fos = new FileOutputStream(f)) {
                    props.store(fos, null);
                    NebulaDataObject.addRecent(f);
                }
            } catch (final IOException ex) {
                LOGGER.log(Level.SEVERE, ex.getLocalizedMessage(), ex);
            }
        }
    }
}
Also used : ConstellationColor(au.gov.asd.tac.constellation.utilities.color.ConstellationColor) PluginParametersSwingDialog(au.gov.asd.tac.constellation.plugins.gui.PluginParametersSwingDialog) FileParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.FileParameterType.FileParameterValue) ExtensionFilter(javafx.stage.FileChooser.ExtensionFilter) FileOutputStream(java.io.FileOutputStream) ColorParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.ColorParameterType.ColorParameterValue) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters) IOException(java.io.IOException) Properties(java.util.Properties) File(java.io.File)

Example 8 with PluginParametersSwingDialog

use of au.gov.asd.tac.constellation.plugins.gui.PluginParametersSwingDialog in project constellation by constellation-app.

the class HistogramControls method binFormatterComboActionPerformed.

// GEN-LAST:event_attributeChoiceActionPerformed
private void binFormatterComboActionPerformed(java.awt.event.ActionEvent evt) {
    // GEN-FIRST:event_binFormatterComboActionPerformed
    if (!isAdjusting) {
        final BinFormatter binFormatter = (BinFormatter) binFormatterCombo.getSelectedItem();
        final PluginParameters parameters;
        if (currentHistogramState != null && binFormatter.getClass() == currentHistogramState.getBinFormatter().getClass()) {
            PluginParameters p = currentHistogramState.getBinFormatterParameters();
            parameters = p == null ? null : p.copy();
            binFormatter.updateParameters(parameters);
        } else if (CURRENT_PARAMETER_IDS.containsKey(binFormatter)) {
            parameters = CURRENT_PARAMETER_IDS.get(binFormatter).copy();
            binFormatter.updateParameters(parameters);
        } else {
            parameters = binFormatter.createParameters();
            binFormatter.updateParameters(parameters);
        }
        if (parameters != null) {
            final PluginParametersSwingDialog dialog = new PluginParametersSwingDialog(binFormatter.getLabel(), parameters);
            dialog.showAndWait();
            if (PluginParametersDialog.OK.equals(dialog.getResult())) {
                CURRENT_PARAMETER_IDS.put(binFormatter, parameters.copy());
                topComponent.setBinFormatter((BinFormatter) binFormatterCombo.getSelectedItem(), parameters);
            } else if (currentHistogramState != null) {
                binFormatterCombo.setSelectedItem(currentHistogramState.getBinFormatter());
            } else {
            // Do nothing
            }
        } else {
            topComponent.setBinFormatter((BinFormatter) binFormatterCombo.getSelectedItem(), null);
        }
    }
}
Also used : PluginParametersSwingDialog(au.gov.asd.tac.constellation.plugins.gui.PluginParametersSwingDialog) BinFormatter(au.gov.asd.tac.constellation.views.histogram.formats.BinFormatter) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters)

Example 9 with PluginParametersSwingDialog

use of au.gov.asd.tac.constellation.plugins.gui.PluginParametersSwingDialog in project constellation by constellation-app.

the class VisualGraphTopComponent method getActions.

@Override
public Action[] getActions() {
    // Add new actions above the default actions.
    final ArrayList<Action> actionList = new ArrayList<>();
    // An action that closes the topcomponent without saving the (possibly modified) graph.
    final Action discard = new AbstractAction(DISCARD) {

        @Override
        public void actionPerformed(final ActionEvent e) {
            savable.setModified(false);
            close();
        }
    };
    actionList.add(discard);
    // If this graph is in a nebula, add some nebula-related actions.
    final NebulaDataObject nebula = getGraphNode().getDataObject().getNebulaDataObject();
    if (nebula != null) {
        // Discard the nebula without saving.
        final Action discardNebula = new AbstractAction("Discard nebula") {

            @Override
            public void actionPerformed(final ActionEvent e) {
                TopComponent.getRegistry().getOpened().stream().filter(tc -> (tc instanceof VisualGraphTopComponent)).map(tc -> (VisualGraphTopComponent) tc).forEach(vtc -> {
                    final NebulaDataObject ndo = vtc.getGraphNode().getDataObject().getNebulaDataObject();
                    if (nebula.equalsPath(ndo)) {
                        vtc.savable.setModified(false);
                        vtc.close();
                    }
                });
            }
        };
        actionList.add(discardNebula);
        // Are there any graphs in this nebula (if it exists) that need saving?
        final List<Savable> savables = getNebulaSavables(nebula);
        if (!savables.isEmpty()) {
            // There's at least one graph in this nebula that needs saving...
            final Action saveNebula = new AbstractAction("Save nebula") {

                @Override
                public void actionPerformed(final ActionEvent e) {
                    try {
                        for (final Savable s : savables) {
                            s.save();
                        }
                    } catch (final IOException ex) {
                        LOGGER.log(Level.SEVERE, ex.getLocalizedMessage(), ex);
                    }
                }
            };
            actionList.add(saveNebula);
        } else {
            // No graphs in this nebula need saving, so offer to close the nebula.
            final Action closeNebula = new AbstractAction("Close nebula") {

                @Override
                public void actionPerformed(final ActionEvent e) {
                    TopComponent.getRegistry().getOpened().stream().filter(tc -> (tc instanceof VisualGraphTopComponent)).map(tc -> (VisualGraphTopComponent) tc).forEach(vtc -> {
                        final NebulaDataObject ndo = vtc.getGraphNode().getDataObject().getNebulaDataObject();
                        if (nebula.equalsPath(ndo)) {
                            vtc.close();
                        }
                    });
                }
            };
            actionList.add(closeNebula);
        }
    }
    // An action that renames the topcomponent without saving the (possibly modified) graph.
    final Action rename = new AbstractAction("Rename") {

        @Override
        public void actionPerformed(final ActionEvent e) {
            final PluginParameters parameters = new PluginParameters();
            final PluginParameter<StringParameterValue> newGraphNameParameter = StringParameterType.build(NEW_GRAPH_NAME_PARAMETER_ID);
            newGraphNameParameter.setName("New Graph Name");
            newGraphNameParameter.setStringValue(graphNode.getDisplayName());
            newGraphNameParameter.storeRecentValue();
            parameters.addParameter(newGraphNameParameter);
            final PluginParametersSwingDialog dialog = new PluginParametersSwingDialog("Rename Graph", parameters);
            dialog.showAndWait();
            if (PluginParametersSwingDialog.OK.equals(dialog.getResult())) {
                final String newGraphName = parameters.getStringValue(NEW_GRAPH_NAME_PARAMETER_ID);
                if (!newGraphName.isEmpty()) {
                    try {
                        // set the graph object name so the name is retained when you Save As
                        graphNode.getDataObject().rename(newGraphName);
                        // set the other graph name properties
                        graphNode.setName(newGraphName);
                        graphNode.setDisplayName(newGraphName);
                        // set the top component
                        setName(newGraphName);
                        setDisplayName(newGraphName);
                        // this changes the text on the tab
                        setHtmlDisplayName(newGraphName);
                    } catch (final IOException ex) {
                        throw new RuntimeException(String.format("The name %s already exists.", newGraphName), ex);
                    }
                    savable.setModified(true);
                }
            }
        }
    };
    actionList.add(rename);
    // Add the default actions.
    for (final Action action : super.getActions()) {
        actionList.add(action);
    }
    return actionList.toArray(new Action[actionList.size()]);
}
Also used : Color(java.awt.Color) DropTarget(java.awt.dnd.DropTarget) GZIPInputStream(java.util.zip.GZIPInputStream) GraphObjectUtilities(au.gov.asd.tac.constellation.graph.file.GraphObjectUtilities) PluginParametersSwingDialog(au.gov.asd.tac.constellation.plugins.gui.PluginParametersSwingDialog) StringParameterType(au.gov.asd.tac.constellation.plugins.parameters.types.StringParameterType) DrawLinksAction(au.gov.asd.tac.constellation.graph.interaction.plugins.display.DrawLinksAction) RecordStore(au.gov.asd.tac.constellation.graph.processing.RecordStore) HandleIoProgress(au.gov.asd.tac.constellation.utilities.gui.HandleIoProgress) DropTargetAdapter(java.awt.dnd.DropTargetAdapter) ActionReference(org.openide.awt.ActionReference) StringUtils(org.apache.commons.lang3.StringUtils) DataObject(org.openide.loaders.DataObject) SchemaFactoryUtilities(au.gov.asd.tac.constellation.graph.schema.SchemaFactoryUtilities) PasteFromClipboardAction(au.gov.asd.tac.constellation.graph.interaction.plugins.clipboard.PasteFromClipboardAction) Map(java.util.Map) DropTargetDropEvent(java.awt.dnd.DropTargetDropEvent) SwingWorker(javax.swing.SwingWorker) UserInterfaceIconProvider(au.gov.asd.tac.constellation.utilities.icon.UserInterfaceIconProvider) GraphManager(au.gov.asd.tac.constellation.graph.manager.GraphManager) KeyStroke(javax.swing.KeyStroke) JToolBar(javax.swing.JToolBar) DropTargetDragEvent(java.awt.dnd.DropTargetDragEvent) Component(java.awt.Component) GraphChangeEvent(au.gov.asd.tac.constellation.graph.monitor.GraphChangeEvent) AutosaveUtilities(au.gov.asd.tac.constellation.graph.file.save.AutosaveUtilities) PluginInfo(au.gov.asd.tac.constellation.plugins.PluginInfo) NotifyDescriptor(org.openide.NotifyDescriptor) GraphUpdateController(au.gov.asd.tac.constellation.plugins.update.GraphUpdateController) ToggleSelectionModeAction(au.gov.asd.tac.constellation.graph.interaction.plugins.draw.ToggleSelectionModeAction) AbstractAction(javax.swing.AbstractAction) GraphJsonWriter(au.gov.asd.tac.constellation.graph.file.io.GraphJsonWriter) UpdateController(au.gov.asd.tac.constellation.plugins.update.UpdateController) NbBundle(org.openide.util.NbBundle) NbPreferences(org.openide.util.NbPreferences) GraphWriteMethods(au.gov.asd.tac.constellation.graph.GraphWriteMethods) ContractAllCompositesAction(au.gov.asd.tac.constellation.graph.interaction.plugins.composite.ContractAllCompositesAction) UndoRedo(org.openide.awt.UndoRedo) DrawBlazesAction(au.gov.asd.tac.constellation.graph.interaction.plugins.display.DrawBlazesAction) DnDConstants(java.awt.dnd.DnDConstants) Action(javax.swing.Action) ImageUtilities(org.openide.util.ImageUtilities) BufferedOutputStream(java.io.BufferedOutputStream) ArrayList(java.util.ArrayList) Graph(au.gov.asd.tac.constellation.graph.Graph) DrawConnectionLabelsAction(au.gov.asd.tac.constellation.graph.interaction.plugins.display.DrawConnectionLabelsAction) AbstractLookup(org.openide.util.lookup.AbstractLookup) GraphReadMethods(au.gov.asd.tac.constellation.graph.GraphReadMethods) Schema(au.gov.asd.tac.constellation.graph.schema.Schema) PluginTags(au.gov.asd.tac.constellation.plugins.templates.PluginTags) DrawFlags(au.gov.asd.tac.constellation.utilities.visual.DrawFlags) GraphUpdateManager(au.gov.asd.tac.constellation.plugins.update.GraphUpdateManager) ToggleDrawDirectedAction(au.gov.asd.tac.constellation.graph.interaction.plugins.draw.ToggleDrawDirectedAction) SaveAsCapable(org.openide.loaders.SaveAsCapable) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters) MemoryManager(au.gov.asd.tac.constellation.utilities.memory.MemoryManager) ButtonGroup(javax.swing.ButtonGroup) GraphDataObject(au.gov.asd.tac.constellation.graph.file.GraphDataObject) Node(org.openide.nodes.Node) IOException(java.io.IOException) FileUtils(org.apache.commons.io.FileUtils) GraphRecordStoreUtilities(au.gov.asd.tac.constellation.graph.processing.GraphRecordStoreUtilities) PluginException(au.gov.asd.tac.constellation.plugins.PluginException) File(java.io.File) FileExtensionConstants(au.gov.asd.tac.constellation.utilities.file.FileExtensionConstants) ActionReferences(org.openide.awt.ActionReferences) SimplePlugin(au.gov.asd.tac.constellation.plugins.templates.SimplePlugin) Savable(org.netbeans.api.actions.Savable) ActionID(org.openide.awt.ActionID) ReadableGraph(au.gov.asd.tac.constellation.graph.ReadableGraph) SimpleEditPlugin(au.gov.asd.tac.constellation.plugins.templates.SimpleEditPlugin) PluginType(au.gov.asd.tac.constellation.plugins.PluginType) CopyToClipboardAction(au.gov.asd.tac.constellation.graph.interaction.plugins.clipboard.CopyToClipboardAction) DrawNodeLabelsAction(au.gov.asd.tac.constellation.graph.interaction.plugins.display.DrawNodeLabelsAction) VisualGraphDefaults(au.gov.asd.tac.constellation.graph.visual.framework.VisualGraphDefaults) CloseAction(au.gov.asd.tac.constellation.graph.interaction.plugins.io.CloseAction) HelpCtx(org.openide.util.HelpCtx) StringParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.StringParameterValue) PluginExecution(au.gov.asd.tac.constellation.plugins.PluginExecution) BorderLayout(java.awt.BorderLayout) InstanceContent(org.openide.util.lookup.InstanceContent) DrawNodesAction(au.gov.asd.tac.constellation.graph.interaction.plugins.display.DrawNodesAction) Lookup(org.openide.util.Lookup) SaveNotification(au.gov.asd.tac.constellation.graph.file.SaveNotification) UnsupportedFlavorException(java.awt.datatransfer.UnsupportedFlavorException) CutToClipboardAction(au.gov.asd.tac.constellation.graph.interaction.plugins.clipboard.CutToClipboardAction) Image(java.awt.Image) BufferedImage(java.awt.image.BufferedImage) Toggle3DAction(au.gov.asd.tac.constellation.graph.interaction.plugins.display.Toggle3DAction) Collection(java.util.Collection) SaveAsAction(au.gov.asd.tac.constellation.graph.interaction.plugins.io.SaveAsAction) Icon(javax.swing.Icon) Logger(java.util.logging.Logger) FileUtil(org.openide.filesystems.FileUtil) DrawConnectionsAction(au.gov.asd.tac.constellation.graph.interaction.plugins.display.DrawConnectionsAction) DrawTransactionsAction(au.gov.asd.tac.constellation.graph.interaction.plugins.display.DrawTransactionsAction) Dimension(java.awt.Dimension) List(java.util.List) RecordStoreUtilities(au.gov.asd.tac.constellation.graph.processing.RecordStoreUtilities) DeveloperPreferenceKeys(au.gov.asd.tac.constellation.preferences.DeveloperPreferenceKeys) Graphics(java.awt.Graphics) ApplicationPreferenceKeys(au.gov.asd.tac.constellation.preferences.ApplicationPreferenceKeys) VisualManager(au.gov.asd.tac.constellation.utilities.visual.VisualManager) CloneableTopComponent(org.openide.windows.CloneableTopComponent) ConnectionMode(au.gov.asd.tac.constellation.graph.schema.visual.attribute.objects.ConnectionMode) AbstractSavable(org.netbeans.spi.actions.AbstractSavable) StatusDisplayer(org.openide.awt.StatusDisplayer) GraphNodeFactory(au.gov.asd.tac.constellation.graph.node.GraphNodeFactory) TopComponent(org.openide.windows.TopComponent) DataFlavor(java.awt.datatransfer.DataFlavor) Transferable(java.awt.datatransfer.Transferable) UpdateComponent(au.gov.asd.tac.constellation.plugins.update.UpdateComponent) HashMap(java.util.HashMap) VisualConcept(au.gov.asd.tac.constellation.graph.schema.visual.concept.VisualConcept) SwingConstants(javax.swing.SwingConstants) Level(java.util.logging.Level) FileObject(org.openide.filesystems.FileObject) GraphChangeListener(au.gov.asd.tac.constellation.graph.monitor.GraphChangeListener) SwingUtilities(javax.swing.SwingUtilities) ToggleGraphVisibilityAction(au.gov.asd.tac.constellation.graph.interaction.plugins.display.ToggleGraphVisibilityAction) Graphics2D(java.awt.Graphics2D) PluginInteraction(au.gov.asd.tac.constellation.plugins.PluginInteraction) PluginParameter(au.gov.asd.tac.constellation.plugins.parameters.PluginParameter) DrawEdgesAction(au.gov.asd.tac.constellation.graph.interaction.plugins.display.DrawEdgesAction) NebulaDataObject(au.gov.asd.tac.constellation.graph.file.nebula.NebulaDataObject) OutputStream(java.io.OutputStream) FileInputStream(java.io.FileInputStream) DialogDisplayer(org.openide.DialogDisplayer) PluginGraphs(au.gov.asd.tac.constellation.plugins.PluginGraphs) ActionEvent(java.awt.event.ActionEvent) DualGraph(au.gov.asd.tac.constellation.graph.locking.DualGraph) GraphVisualManagerFactory(au.gov.asd.tac.constellation.graph.interaction.framework.GraphVisualManagerFactory) ExpandAllCompositesAction(au.gov.asd.tac.constellation.graph.interaction.plugins.composite.ExpandAllCompositesAction) ConstellationLoggerHelper(au.gov.asd.tac.constellation.plugins.logging.ConstellationLoggerHelper) GraphNode(au.gov.asd.tac.constellation.graph.node.GraphNode) InputMap(javax.swing.InputMap) ConstellationIcon(au.gov.asd.tac.constellation.utilities.icon.ConstellationIcon) RecentGraphScreenshotUtilities(au.gov.asd.tac.constellation.graph.interaction.plugins.io.screenshot.RecentGraphScreenshotUtilities) InputStream(java.io.InputStream) DrawLinksAction(au.gov.asd.tac.constellation.graph.interaction.plugins.display.DrawLinksAction) PasteFromClipboardAction(au.gov.asd.tac.constellation.graph.interaction.plugins.clipboard.PasteFromClipboardAction) ToggleSelectionModeAction(au.gov.asd.tac.constellation.graph.interaction.plugins.draw.ToggleSelectionModeAction) AbstractAction(javax.swing.AbstractAction) ContractAllCompositesAction(au.gov.asd.tac.constellation.graph.interaction.plugins.composite.ContractAllCompositesAction) DrawBlazesAction(au.gov.asd.tac.constellation.graph.interaction.plugins.display.DrawBlazesAction) Action(javax.swing.Action) DrawConnectionLabelsAction(au.gov.asd.tac.constellation.graph.interaction.plugins.display.DrawConnectionLabelsAction) ToggleDrawDirectedAction(au.gov.asd.tac.constellation.graph.interaction.plugins.draw.ToggleDrawDirectedAction) CopyToClipboardAction(au.gov.asd.tac.constellation.graph.interaction.plugins.clipboard.CopyToClipboardAction) DrawNodeLabelsAction(au.gov.asd.tac.constellation.graph.interaction.plugins.display.DrawNodeLabelsAction) CloseAction(au.gov.asd.tac.constellation.graph.interaction.plugins.io.CloseAction) DrawNodesAction(au.gov.asd.tac.constellation.graph.interaction.plugins.display.DrawNodesAction) CutToClipboardAction(au.gov.asd.tac.constellation.graph.interaction.plugins.clipboard.CutToClipboardAction) Toggle3DAction(au.gov.asd.tac.constellation.graph.interaction.plugins.display.Toggle3DAction) SaveAsAction(au.gov.asd.tac.constellation.graph.interaction.plugins.io.SaveAsAction) DrawConnectionsAction(au.gov.asd.tac.constellation.graph.interaction.plugins.display.DrawConnectionsAction) DrawTransactionsAction(au.gov.asd.tac.constellation.graph.interaction.plugins.display.DrawTransactionsAction) ToggleGraphVisibilityAction(au.gov.asd.tac.constellation.graph.interaction.plugins.display.ToggleGraphVisibilityAction) DrawEdgesAction(au.gov.asd.tac.constellation.graph.interaction.plugins.display.DrawEdgesAction) ExpandAllCompositesAction(au.gov.asd.tac.constellation.graph.interaction.plugins.composite.ExpandAllCompositesAction) ActionEvent(java.awt.event.ActionEvent) ArrayList(java.util.ArrayList) StringParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.StringParameterValue) IOException(java.io.IOException) PluginParametersSwingDialog(au.gov.asd.tac.constellation.plugins.gui.PluginParametersSwingDialog) Savable(org.netbeans.api.actions.Savable) AbstractSavable(org.netbeans.spi.actions.AbstractSavable) NebulaDataObject(au.gov.asd.tac.constellation.graph.file.nebula.NebulaDataObject) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters) AbstractAction(javax.swing.AbstractAction)

Example 10 with PluginParametersSwingDialog

use of au.gov.asd.tac.constellation.plugins.gui.PluginParametersSwingDialog in project constellation by constellation-app.

the class DefaultPluginInteraction method prompt.

@Override
public boolean prompt(final String promptName, final PluginParameters parameters) {
    if (SwingUtilities.isEventDispatchThread()) {
        throw new IllegalStateException("Plugins should not be run on the EDT!");
    }
    boolean result = false;
    final PluginParametersSwingDialog dialog = new PluginParametersSwingDialog(promptName, parameters);
    if (!parameters.hasMultiLineStringParameter()) {
        dialog.showAndWait();
    } else {
        dialog.showAndWaitNoFocus();
    }
    if (PluginParametersDialog.OK.equals(dialog.getResult())) {
        result = true;
    }
    return result;
}
Also used : PluginParametersSwingDialog(au.gov.asd.tac.constellation.plugins.gui.PluginParametersSwingDialog)

Aggregations

PluginParametersSwingDialog (au.gov.asd.tac.constellation.plugins.gui.PluginParametersSwingDialog)10 PluginParameters (au.gov.asd.tac.constellation.plugins.parameters.PluginParameters)9 Plugin (au.gov.asd.tac.constellation.plugins.Plugin)4 Graph (au.gov.asd.tac.constellation.graph.Graph)2 PluginException (au.gov.asd.tac.constellation.plugins.PluginException)2 PluginGraphs (au.gov.asd.tac.constellation.plugins.PluginGraphs)2 PluginInteraction (au.gov.asd.tac.constellation.plugins.PluginInteraction)2 SimplePlugin (au.gov.asd.tac.constellation.plugins.templates.SimplePlugin)2 File (java.io.File)2 IOException (java.io.IOException)2 GraphReadMethods (au.gov.asd.tac.constellation.graph.GraphReadMethods)1 GraphWriteMethods (au.gov.asd.tac.constellation.graph.GraphWriteMethods)1 ReadableGraph (au.gov.asd.tac.constellation.graph.ReadableGraph)1 GraphDataObject (au.gov.asd.tac.constellation.graph.file.GraphDataObject)1 GraphObjectUtilities (au.gov.asd.tac.constellation.graph.file.GraphObjectUtilities)1 SaveNotification (au.gov.asd.tac.constellation.graph.file.SaveNotification)1 GraphJsonWriter (au.gov.asd.tac.constellation.graph.file.io.GraphJsonWriter)1 NebulaDataObject (au.gov.asd.tac.constellation.graph.file.nebula.NebulaDataObject)1 AutosaveUtilities (au.gov.asd.tac.constellation.graph.file.save.AutosaveUtilities)1 GraphVisualManagerFactory (au.gov.asd.tac.constellation.graph.interaction.framework.GraphVisualManagerFactory)1