use of au.gov.asd.tac.constellation.plugins.parameters.types.BooleanParameterType.BooleanParameterValue in project constellation by constellation-app.
the class SphereGraphBuilderPlugin method createParameters.
@Override
public PluginParameters createParameters() {
final PluginParameters params = new PluginParameters();
final PluginParameter<IntegerParameterValue> n = IntegerParameterType.build(N_PARAMETER_ID);
n.setName("Number of nodes");
n.setDescription("The number of nodes on the graph");
n.setIntegerValue(100);
IntegerParameterType.setMinimum(n, 6);
params.addParameter(n);
final PluginParameter<IntegerParameterValue> t = IntegerParameterType.build(T_PARAMETER_ID);
t.setName("Number of transactions");
t.setDescription("The number of transactions on the graph");
t.setIntegerValue(50);
IntegerParameterType.setMinimum(t, 0);
params.addParameter(t);
ArrayList<String> modes = new ArrayList<>();
modes.add("Random vertices");
modes.add("1 path, next neighbour");
modes.add("1 path, random vertices");
final PluginParameter<SingleChoiceParameterType.SingleChoiceParameterValue> option = SingleChoiceParameterType.build(OPTION_PARAMETER_ID);
option.setName("Transaction options");
option.setDescription("How to add transactions to the graph");
SingleChoiceParameterType.setOptions(option, modes);
SingleChoiceParameterType.setChoice(option, modes.get(0));
params.addParameter(option);
final PluginParameter<BooleanParameterValue> randomChars = BooleanParameterType.build(ADD_CHARS_PARAMETER_ID);
randomChars.setName("Add random chars to vertex name");
randomChars.setDescription("Add random chars to vertex name");
randomChars.setBooleanValue(true);
params.addParameter(randomChars);
final PluginParameter<BooleanParameterValue> addLabels = BooleanParameterType.build(USE_LABELS_PARAMETER_ID);
addLabels.setName("Add labels");
addLabels.setDescription("Labels nodes and transactions");
addLabels.setBooleanValue(true);
params.addParameter(addLabels);
final PluginParameter<BooleanParameterValue> allChars = BooleanParameterType.build(USE_ALL_DISPLAYABLE_CHARS_PARAMETER_ID);
allChars.setName("All displayable chars");
allChars.setDescription("Use all displayable chars in labels");
allChars.setBooleanValue(false);
params.addParameter(allChars);
final PluginParameter<BooleanParameterValue> drawManyTx = BooleanParameterType.build(DRAW_MANY_TX_PARAMETER_ID);
drawManyTx.setName("Draw many transactions");
drawManyTx.setDescription("Draw lots of transactions between nodes");
drawManyTx.setBooleanValue(false);
params.addParameter(drawManyTx);
final PluginParameter<BooleanParameterValue> drawManyDeco = BooleanParameterType.build(DRAW_MANY_DECORATORS_PARAMETER_ID);
drawManyDeco.setName("Draw many decorators");
drawManyDeco.setDescription("Draw lots of decorators on nodes");
drawManyDeco.setBooleanValue(false);
params.addParameter(drawManyDeco);
final PluginParameter<BooleanParameterValue> randomIcons = BooleanParameterType.build(USE_RANDOM_ICONS_PARAMETER_ID);
randomIcons.setName("Random icons and decorators");
randomIcons.setDescription("Use random icons and decorators on nodes");
randomIcons.setBooleanValue(true);
params.addParameter(randomIcons);
final PluginParameter<BooleanParameterValue> explicitLoops = BooleanParameterType.build(EXPLICIT_LOOPS);
explicitLoops.setName("Explicit loops");
explicitLoops.setDescription("Add explicit transaction loops");
explicitLoops.setBooleanValue(true);
params.addParameter(explicitLoops);
return params;
}
use of au.gov.asd.tac.constellation.plugins.parameters.types.BooleanParameterType.BooleanParameterValue in project constellation by constellation-app.
the class PermanentMergePlugin method createParameters.
@Override
public PluginParameters createParameters() {
final PluginParameters parameters = new PluginParameters();
final PluginParameter<IntegerParameterValue> primaryNodeParam = IntegerParameterType.build(PRIMARY_NODE_PARAMETER_ID);
primaryNodeParam.setName("Primary Vertex ID");
primaryNodeParam.setDescription("The vertex id of the primary node");
parameters.addParameter(primaryNodeParam);
final PluginParameter<ObjectParameterValue> selectedNodesParam = ObjectParameterType.build(SELECTED_NODES_PARAMETER_ID);
selectedNodesParam.setName("Selected Vertex Ids");
selectedNodesParam.setDescription("A list of the vertex ids to merge");
parameters.addParameter(selectedNodesParam);
final PluginParameter<ObjectParameterValue> attributesParam = ObjectParameterType.build(ATTTRIBUTES_PARAMETER_ID);
attributesParam.setName("Attributes");
attributesParam.setDescription("A Map of the attributes to merge which is the attribute id to the value to replace");
parameters.addParameter(attributesParam);
final PluginParameter<BooleanParameterValue> createNewNodeParam = BooleanParameterType.build(CREATE_NEW_NODE_PARAMETER_ID);
createNewNodeParam.setName("Create New Node");
createNewNodeParam.setDescription("If True, create a new node. The default is True.");
createNewNodeParam.setBooleanValue(true);
parameters.addParameter(createNewNodeParam);
final PluginParameter<BooleanParameterValue> createLoopsParam = BooleanParameterType.build(CREATE_LOOPS_PARAMETER_ID);
createLoopsParam.setName("Create Loops");
createLoopsParam.setDescription("If True, create loops. The default is True.");
createLoopsParam.setBooleanValue(true);
parameters.addParameter(createLoopsParam);
final PluginParameter<BooleanParameterValue> keepSimpleParam = BooleanParameterType.build(KEEP_SIMPLE_PARAMETER_ID);
keepSimpleParam.setName("Keep Simple");
keepSimpleParam.setDescription("If True, only include directed transactions. The default is False.");
keepSimpleParam.setBooleanValue(false);
parameters.addParameter(keepSimpleParam);
return parameters;
}
use of au.gov.asd.tac.constellation.plugins.parameters.types.BooleanParameterType.BooleanParameterValue in project constellation by constellation-app.
the class BlazeUtilities method colorDialog.
/**
* Display a dialog box to select a color. Option to save color as a preset
* is represented by a checkbox. The preset will be saved in the first
* instance of a free position, otherwise the last index of the presets will
* be used and overridden.
*
* @param blazeColor The initial value of the color.
*
* @return a pair containing 1) if the user pressed OK and 2) the selected
* blaze color.
*/
public static Pair<Boolean, ConstellationColor> colorDialog(final ConstellationColor blazeColor) {
final PluginParameters dlgParams = new PluginParameters();
final PluginParameter<ColorParameterValue> colorParam = ColorParameterType.build(COLOR_PARAMETER_ID);
colorParam.setName("Color");
colorParam.setDescription(BLAZE_COLOR_PARAMETER_ID);
dlgParams.addParameter(colorParam);
final PluginParameter<BooleanParameterValue> presetParam = BooleanParameterType.build(PRESET_PARAMETER_ID);
presetParam.setName("Preset");
presetParam.setDescription("Save as Preset");
presetParam.setBooleanValue(false);
dlgParams.addParameter(presetParam);
final PluginParametersSwingDialog dialog = new PluginParametersSwingDialog(BLAZE_COLOR_PARAMETER_ID, dlgParams);
dialog.showAndWait();
final boolean isOk = PluginParametersDialog.OK.equals(dialog.getResult());
ConstellationColor colorResult = blazeColor;
if (isOk) {
colorResult = dlgParams.getColorValue(COLOR_PARAMETER_ID);
if (dlgParams.getBooleanValue(PRESET_PARAMETER_ID)) {
savePreset(colorResult.getJavaColor());
}
}
return new Pair<>(isOk, colorResult);
}
use of au.gov.asd.tac.constellation.plugins.parameters.types.BooleanParameterType.BooleanParameterValue in project constellation by constellation-app.
the class GetRecordStore method createParameters.
@Override
public PluginParameters createParameters() {
final PluginParameters parameters = new PluginParameters();
final PluginParameter<StringParameterValue> graphIdParam = StringParameterType.build(GRAPH_ID_PARAMETER_ID);
graphIdParam.setName("Graph id");
graphIdParam.setDescription("The id of a graph to get data from. (Default is the active graph)");
parameters.addParameter(graphIdParam);
final PluginParameter<BooleanParameterValue> selectedParam = BooleanParameterType.build(SELECTED_PARAMETER_ID);
selectedParam.setName("Selected elements only");
selectedParam.setDescription("If false (the default), return all elements, else return only the selected elements.");
selectedParam.setObjectValue(false);
parameters.addParameter(selectedParam);
final PluginParameter<BooleanParameterValue> vxParam = BooleanParameterType.build(VX_PARAMETER_ID);
vxParam.setName("Vertices only");
vxParam.setDescription("If true, return vertices only (default false).");
vxParam.setObjectValue(false);
parameters.addParameter(vxParam);
final PluginParameter<BooleanParameterValue> txParam = BooleanParameterType.build(TX_PARAMETER_ID);
txParam.setName("Transactions only");
txParam.setDescription("If true, return transactions only (default false).");
txParam.setObjectValue(false);
parameters.addParameter(txParam);
final PluginParameter<StringParameterValue> attrsParam = StringParameterType.build(ATTRS_PARAMETER_ID);
attrsParam.setName("Attribute list");
attrsParam.setDescription("Include only these comma-separated attributes in the recordstore. Use this for much greater efficiency. (optional)");
parameters.addParameter(attrsParam);
return parameters;
}
use of au.gov.asd.tac.constellation.plugins.parameters.types.BooleanParameterType.BooleanParameterValue in project constellation by constellation-app.
the class ListIcons method createParameters.
@Override
public PluginParameters createParameters() {
final PluginParameters parameters = new PluginParameters();
final PluginParameter<BooleanParameterValue> editableParam = BooleanParameterType.build(EDITABLE_PARAMETER_ID);
editableParam.setName("Editable");
editableParam.setDescription("If false (the default), return the built-in icons, else return the editable icons.");
editableParam.setObjectValue(false);
parameters.addParameter(editableParam);
return parameters;
}
Aggregations