use of au.gov.asd.tac.constellation.graph.schema.concept.SchemaConcept in project constellation by constellation-app.
the class SmallWorldGraphBuilderPlugin method updateParameters.
@Override
public void updateParameters(final Graph graph, final PluginParameters parameters) {
final List<String> nAttributes = new ArrayList<>();
final List<String> tAttributes = new ArrayList<>();
final List<String> nChoices = new ArrayList<>();
final List<String> tChoices = new ArrayList<>();
if (graph != null) {
final Set<Class<? extends SchemaConcept>> concepts = graph.getSchema().getFactory().getRegisteredConcepts();
final Collection<SchemaVertexType> nodeTypes = SchemaVertexTypeUtilities.getTypes(concepts);
for (final SchemaVertexType type : nodeTypes) {
nAttributes.add(type.getName());
}
nAttributes.sort(String::compareTo);
final Collection<SchemaTransactionType> transactionTypes = SchemaTransactionTypeUtilities.getTypes(concepts);
for (final SchemaTransactionType type : transactionTypes) {
tAttributes.add(type.getName());
}
tAttributes.sort(String::compareTo);
nChoices.add(nAttributes.get(0));
tChoices.add(tAttributes.get(0));
}
if (parameters != null && parameters.getParameters() != null) {
// NODE_TYPES_PARAMETER will always be of type MultiChoiceParameter
@SuppressWarnings("unchecked") final PluginParameter<MultiChoiceParameterValue> nAttribute = (PluginParameter<MultiChoiceParameterValue>) parameters.getParameters().get(NODE_TYPES_PARAMETER_ID);
// TRANSACTION_TYPES_PARAMETER will always be of type MultiChoiceParameter
@SuppressWarnings("unchecked") final PluginParameter<MultiChoiceParameterValue> tAttribute = (PluginParameter<MultiChoiceParameterValue>) parameters.getParameters().get(TRANSACTION_TYPES_PARAMETER_ID);
MultiChoiceParameterType.setOptions(nAttribute, nAttributes);
MultiChoiceParameterType.setOptions(tAttribute, tAttributes);
MultiChoiceParameterType.setChoices(nAttribute, nChoices);
MultiChoiceParameterType.setChoices(tAttribute, tChoices);
}
}
use of au.gov.asd.tac.constellation.graph.schema.concept.SchemaConcept in project constellation by constellation-app.
the class PreferentialAttachmentGraphBuilderPlugin method updateParameters.
@Override
public void updateParameters(final Graph graph, final PluginParameters parameters) {
final List<String> nAttributes = new ArrayList<>();
final List<String> tAttributes = new ArrayList<>();
final List<String> nChoices = new ArrayList<>();
final List<String> tChoices = new ArrayList<>();
if (graph != null) {
final Set<Class<? extends SchemaConcept>> concepts = graph.getSchema().getFactory().getRegisteredConcepts();
final Collection<SchemaVertexType> nodeTypes = SchemaVertexTypeUtilities.getTypes(concepts);
for (final SchemaVertexType type : nodeTypes) {
nAttributes.add(type.getName());
}
nAttributes.sort(String::compareTo);
final Collection<SchemaTransactionType> transactionTypes = SchemaTransactionTypeUtilities.getTypes(concepts);
for (final SchemaTransactionType type : transactionTypes) {
tAttributes.add(type.getName());
}
tAttributes.sort(String::compareTo);
nChoices.add(nAttributes.get(0));
tChoices.add(tAttributes.get(0));
}
if (parameters != null && parameters.getParameters() != null) {
// NODE_TYPES_PARAMETER will always be of type MultiChoiceParameter
@SuppressWarnings("unchecked") final PluginParameter<MultiChoiceParameterValue> nAttribute = (PluginParameter<MultiChoiceParameterValue>) parameters.getParameters().get(NODE_TYPES_PARAMETER_ID);
// TRANSACTION_TYPES_PARAMETER will always be of type MultiChoiceParameter
@SuppressWarnings("unchecked") final PluginParameter<MultiChoiceParameterValue> tAttribute = (PluginParameter<MultiChoiceParameterValue>) parameters.getParameters().get(TRANSACTION_TYPES_PARAMETER_ID);
MultiChoiceParameterType.setOptions(nAttribute, nAttributes);
MultiChoiceParameterType.setOptions(tAttribute, tAttributes);
MultiChoiceParameterType.setChoices(nAttribute, nChoices);
MultiChoiceParameterType.setChoices(tAttribute, tChoices);
}
}
Aggregations