use of au.gov.asd.tac.constellation.views.find2.components.advanced.criteriavalues.FindCriteriaValues in project constellation by constellation-app.
the class AdvancedSearchPlugin method searchAsColor.
/**
* This function checks to see if a graph elements color attribute matches
* the criteria specified by the ColourCriteriaValues.
*
* @param values the color criteriaValues
* @param attributeInt the int of the attribute
* @param currElement the currentElement
* @param graph the current graph
* @return
*/
private boolean searchAsColor(final FindCriteriaValues values, final int attributeInt, final int currElement, final GraphWriteMethods graph) {
final ColourCriteriaValues colorValues = (ColourCriteriaValues) values;
final ConstellationColor color = graph.getObjectValue(attributeInt, currElement);
boolean matches = false;
// if the color of the attribute matches the users color matches = true
if (colorValues.getFilter().equals(IS) && colorValues.getColorValue().equals(color)) {
matches = true;
// if the color of the attribute doesnt match the users color matches = true
} else if (colorValues.getFilter().equals(IS_NOT) && !colorValues.getColorValue().equals(color)) {
matches = true;
}
return matches;
}
Aggregations