Search in sources :

Example 1 with NamedSelectionEditorPlugin

use of au.gov.asd.tac.constellation.views.namedselection.utilities.NamedSelectionEditorPlugin in project constellation by constellation-app.

the class NamedSelectionManager method performSave.

/**
 * Requests a new named selection to be created on the graph for the given
 * ID number.
 * <p>
 * Selected graph elements will have their 'named selection' attribute
 * updated to reflect their membership in the new named selection.
 *
 * @param graph The graph that is having the named selection created on.
 * @param id The id of the named selection that is to be included on
 * currently selected graph elements.
 */
private void performSave(final Graph graph, final int id) {
    final Plugin namedSelectionEdit = new NamedSelectionEditorPlugin(id);
    final Future<?> f = PluginExecution.withPlugin(namedSelectionEdit).executeLater(graph);
    try {
        f.get();
    } catch (final InterruptedException ex) {
        LOGGER.log(Level.SEVERE, "Named Selection save was interrupted", ex);
        Thread.currentThread().interrupt();
    } catch (final ExecutionException ex) {
        LOGGER.log(Level.SEVERE, ex.getLocalizedMessage(), ex);
    }
}
Also used : NamedSelectionEditorPlugin(au.gov.asd.tac.constellation.views.namedselection.utilities.NamedSelectionEditorPlugin) ExecutionException(java.util.concurrent.ExecutionException) NamedSelectionEditorPlugin(au.gov.asd.tac.constellation.views.namedselection.utilities.NamedSelectionEditorPlugin) Plugin(au.gov.asd.tac.constellation.plugins.Plugin) NamedSelectionStatePlugin(au.gov.asd.tac.constellation.views.namedselection.state.NamedSelectionStatePlugin)

Example 2 with NamedSelectionEditorPlugin

use of au.gov.asd.tac.constellation.views.namedselection.utilities.NamedSelectionEditorPlugin in project constellation by constellation-app.

the class NamedSelectionManager method performUnion.

/**
 * Requests a union operation to be performed for the named selections that
 * match an array of named selection IDs.
 * <p>
 * This private method takes into account the display settings as per the
 * current named selection state.
 * <p>
 * Member and non-member elements of 'unioned' named selections will be
 * shown as per the display settings (ie, if dim others has been set, then
 * non-member elements will be dimmed on the graph).
 *
 * @param graph The graph that is to have the union operation performed
 * upon.
 * @param useCurrentlySelected <code>true</code> to include the currently
 * selected graph elements in the union operation.
 * @param isSelectResults <code>true</code> to set member elements
 * 'selected' attribute.
 * @param isDimOthers <code>true</code> to dim non-member elements.
 * @param ids The array of ids of the named selections that are to be
 * 'unioned'.
 */
private void performUnion(final Graph graph, final boolean useCurrentlySelected, final boolean isSelectResults, final boolean isDimOthers, final int... ids) {
    final Plugin namedSelectionEdit = new NamedSelectionEditorPlugin(NamedSelectionEditorPlugin.Operation.UNION, useCurrentlySelected, isSelectResults, isDimOthers, ids);
    final Future<?> f = PluginExecution.withPlugin(namedSelectionEdit).executeLater(graph);
    try {
        f.get();
    } catch (final InterruptedException ex) {
        LOGGER.log(Level.SEVERE, "Named Selection Union was interrupted", ex);
        Thread.currentThread().interrupt();
    } catch (final ExecutionException ex) {
        LOGGER.log(Level.SEVERE, ex.getLocalizedMessage(), ex);
    }
}
Also used : NamedSelectionEditorPlugin(au.gov.asd.tac.constellation.views.namedselection.utilities.NamedSelectionEditorPlugin) ExecutionException(java.util.concurrent.ExecutionException) NamedSelectionEditorPlugin(au.gov.asd.tac.constellation.views.namedselection.utilities.NamedSelectionEditorPlugin) Plugin(au.gov.asd.tac.constellation.plugins.Plugin) NamedSelectionStatePlugin(au.gov.asd.tac.constellation.views.namedselection.state.NamedSelectionStatePlugin)

Example 3 with NamedSelectionEditorPlugin

use of au.gov.asd.tac.constellation.views.namedselection.utilities.NamedSelectionEditorPlugin in project constellation by constellation-app.

the class NamedSelectionManager method performCustomSave.

private void performCustomSave(final Graph graph, final int[] nodesToSave, final int[] transactionsToSave, final int id) {
    final Plugin namedSelectionEdit = new NamedSelectionEditorPlugin(nodesToSave, transactionsToSave, id);
    final Future<?> f = PluginExecution.withPlugin(namedSelectionEdit).executeLater(graph);
    try {
        f.get();
    } catch (final InterruptedException ex) {
        LOGGER.log(Level.SEVERE, "Named Selection custom save was interrupted", ex);
        Thread.currentThread().interrupt();
    } catch (final ExecutionException ex) {
        LOGGER.log(Level.SEVERE, ex.getLocalizedMessage(), ex);
    }
}
Also used : NamedSelectionEditorPlugin(au.gov.asd.tac.constellation.views.namedselection.utilities.NamedSelectionEditorPlugin) ExecutionException(java.util.concurrent.ExecutionException) NamedSelectionEditorPlugin(au.gov.asd.tac.constellation.views.namedselection.utilities.NamedSelectionEditorPlugin) Plugin(au.gov.asd.tac.constellation.plugins.Plugin) NamedSelectionStatePlugin(au.gov.asd.tac.constellation.views.namedselection.state.NamedSelectionStatePlugin)

Example 4 with NamedSelectionEditorPlugin

use of au.gov.asd.tac.constellation.views.namedselection.utilities.NamedSelectionEditorPlugin in project constellation by constellation-app.

the class NamedSelectionManager method performIntersection.

/**
 * Requests a intersection operation to be performed for the named
 * selections that match an array of named selection IDs.
 * <p>
 * This private method takes into account the display settings as per the
 * current named selection state.
 * <p>
 * Member and non-member elements of 'intersected' named selections will be
 * shown as per the display settings (ie, if dim others has been set, then
 * non-member elements will be dimmed on the graph).
 *
 * @param graph The graph that is to have the intersection operation
 * performed upon.
 * @param useCurrentlySelected <code>true</code> to include the currently
 * selected graph elements in the intersection operation.
 * @param isSelectResults <code>true</code> to set member elements
 * 'selected' attribute.
 * @param isDimOthers <code>true</code> to dim non-member elements.
 * @param ids The array of ids of the named selections that are to be
 * 'intersected'.
 */
private void performIntersection(final Graph graph, final boolean useCurrentlySelected, final boolean isSelectResults, final boolean isDimOthers, final int... ids) {
    final Plugin namedSelectionEdit = new NamedSelectionEditorPlugin(NamedSelectionEditorPlugin.Operation.INTERSECTION, useCurrentlySelected, isSelectResults, isDimOthers, ids);
    final Future<?> f = PluginExecution.withPlugin(namedSelectionEdit).executeLater(graph);
    try {
        f.get();
    } catch (final InterruptedException ex) {
        LOGGER.log(Level.SEVERE, "Named Selection Intersection was interrupted", ex);
        Thread.currentThread().interrupt();
    } catch (final ExecutionException ex) {
        LOGGER.log(Level.SEVERE, ex.getLocalizedMessage(), ex);
    }
}
Also used : NamedSelectionEditorPlugin(au.gov.asd.tac.constellation.views.namedselection.utilities.NamedSelectionEditorPlugin) ExecutionException(java.util.concurrent.ExecutionException) NamedSelectionEditorPlugin(au.gov.asd.tac.constellation.views.namedselection.utilities.NamedSelectionEditorPlugin) Plugin(au.gov.asd.tac.constellation.plugins.Plugin) NamedSelectionStatePlugin(au.gov.asd.tac.constellation.views.namedselection.state.NamedSelectionStatePlugin)

Example 5 with NamedSelectionEditorPlugin

use of au.gov.asd.tac.constellation.views.namedselection.utilities.NamedSelectionEditorPlugin in project constellation by constellation-app.

the class NamedSelectionManager method performRecall.

/**
 * Requests the recall of a named selection on the graph for the given ID
 * number.
 * <p>
 * This private method takes into account the display settings as per the
 * current named selection state.
 * <p>
 * Member and non-member elements of the named selection will be shown as
 * per the display settings (ie, if dim others has been set, then non-member
 * elements will be dimmed on the graph).
 *
 * @param graph The graph that is to have the named selection retrieved for.
 * @param isSelectResults <code>true</code> to set member elements
 * 'selected' attribute.
 * @param isDimOthers <code>true</code> to dim non-member elements.
 * @param id The id of the named selection that is to be retrieved.
 */
private void performRecall(final Graph graph, final boolean isSelectResults, final boolean isDimOthers, final int id) {
    final Plugin namedSelectionEdit = new NamedSelectionEditorPlugin(isSelectResults, isDimOthers, id);
    final Future<?> f = PluginExecution.withPlugin(namedSelectionEdit).executeLater(graph);
    try {
        f.get();
    } catch (final InterruptedException ex) {
        LOGGER.log(Level.SEVERE, "Named Selections recall was interrupted", ex);
        Thread.currentThread().interrupt();
    } catch (final ExecutionException ex) {
        LOGGER.log(Level.SEVERE, ex.getLocalizedMessage(), ex);
    }
}
Also used : NamedSelectionEditorPlugin(au.gov.asd.tac.constellation.views.namedselection.utilities.NamedSelectionEditorPlugin) ExecutionException(java.util.concurrent.ExecutionException) NamedSelectionEditorPlugin(au.gov.asd.tac.constellation.views.namedselection.utilities.NamedSelectionEditorPlugin) Plugin(au.gov.asd.tac.constellation.plugins.Plugin) NamedSelectionStatePlugin(au.gov.asd.tac.constellation.views.namedselection.state.NamedSelectionStatePlugin)

Aggregations

Plugin (au.gov.asd.tac.constellation.plugins.Plugin)5 NamedSelectionStatePlugin (au.gov.asd.tac.constellation.views.namedselection.state.NamedSelectionStatePlugin)5 NamedSelectionEditorPlugin (au.gov.asd.tac.constellation.views.namedselection.utilities.NamedSelectionEditorPlugin)5 ExecutionException (java.util.concurrent.ExecutionException)5