use of au.gov.asd.tac.constellation.graph.Attribute in project constellation by constellation-app.
the class ActiveTableReferenceNGTest method updateVisibleColumnsReplace.
@Test
public void updateVisibleColumnsReplace() {
try (MockedStatic<PluginExecution> pluginExecutionMockedStatic = Mockito.mockStatic(PluginExecution.class)) {
final Graph graph = mock(Graph.class);
final Attribute attribute = mock(Attribute.class);
final PluginExecution pluginExecution = mock(PluginExecution.class);
final List<Tuple<String, Attribute>> paramColumnAttributes = List.of(Tuple.create("paramAttr", attribute));
final List<Tuple<String, Attribute>> stateColumnAttributes = List.of(Tuple.create("stateAttr1", attribute), Tuple.create("stateAttr2", attribute));
final TableViewState tableViewState = new TableViewState();
tableViewState.setColumnAttributes(stateColumnAttributes);
pluginExecutionMockedStatic.when(() -> PluginExecution.withPlugin(any(Plugin.class))).thenAnswer(executeUpdateStatePlugin(pluginExecution, tableViewState, List.of(Tuple.create("paramAttr", attribute))));
activeTableReference.updateVisibleColumns(graph, tableViewState, paramColumnAttributes, UpdateMethod.REPLACE);
verify(pluginExecution).executeLater(graph);
}
}
use of au.gov.asd.tac.constellation.graph.Attribute in project constellation by constellation-app.
the class PermanentMergePanel method populateTableRow.
/**
* populate table row with attributes for the specified row
*
* @param vxId node id
*/
private Object[] populateTableRow(final ReadableGraph graph, final int vxId) {
Object[] row = new Object[nodeAttrbiutes.size() + 1];
row[0] = true;
row[1] = Integer.toString(vxId);
for (int i = 2; i < nodeAttrbiutes.size(); i++) {
Attribute attr = nodeAttrbiutes.get(i);
if (!attr.getName().equalsIgnoreCase(SELECTED_COLUMN)) {
row[i] = graph.getStringValue(attr.getId(), vxId);
}
}
return row;
}
use of au.gov.asd.tac.constellation.graph.Attribute in project constellation by constellation-app.
the class AttributeList method createDefinition.
/**
* Create an {@code ImportDefinition} from attributes modified on the
* attribute list
*
* @param importDefinition the {@link ImportDefinition} that will hold the
* new {@link ImportAttributeDefinition}s.
*/
public void createDefinition(final ImportDefinition importDefinition) {
attributeNodes.values().stream().filter(attributeNode -> (attributeNode.getColumn() == null)).forEachOrdered(attributeNode -> {
final String defaultValue = attributeNode.getDefaultValue();
final AttributeTranslator translator = attributeNode.getTranslator();
if (defaultValue != null || (translator != null && !(translator instanceof DefaultAttributeTranslator))) {
final ImportAttributeDefinition attributeDefinition = new ImportAttributeDefinition(defaultValue, attributeNode.getAttribute(), attributeNode.getTranslator(), attributeNode.getTranslatorParameters());
importDefinition.addDefinition(attributeType, attributeDefinition);
}
});
}
use of au.gov.asd.tac.constellation.graph.Attribute in project constellation by constellation-app.
the class ConfigurationPane method getAllocatedAttributes.
/**
* Returns a combined collection of all attributes that have been allocated
* to a column in any run.
*
* @return a combined collection of all attributes that have been allocated
* to a column in any run.
*/
public Collection<Attribute> getAllocatedAttributes() {
final List<Attribute> allocatedAttributes = new ArrayList<>();
for (final Tab tab : tabPane.getTabs()) {
final RunPane runPane = (RunPane) tab.getContent();
allocatedAttributes.addAll(runPane.getAllocatedAttributes());
}
return allocatedAttributes;
}
Aggregations