Commit 0709901c authored by Daniel Felipe  GONZALEZ OBANDO's avatar Daniel Felipe GONZALEZ OBANDO
Browse files

Added normalization code for string color values.

Now colors are converted to lowercase values before being compared.
parent 6ae88226
......@@ -28,6 +28,7 @@ import plugins.adufour.vars.lang.VarSequence;
import plugins.adufour.vars.lang.VarString;
import plugins.adufour.vars.util.VarException;
import plugins.kernel.roi.descriptor.measure.ROIInteriorDescriptor;
import plugins.kernel.roi.descriptor.property.ROIColorDescriptor;
import plugins.stef.roi.bloc.RoiBlocks;
/**
......@@ -270,7 +271,16 @@ public class FilterROI extends Plugin implements ROIBlock, PluginLibrary, Plugin
// try to get the type behind
final Object typedValue = getTypedValue(value);
// get regex from String
final String regexValue = StringUtil.wildcardToRegex(value);
final String regexValue;
if (roiDescriptor instanceof ROIColorDescriptor)
{
regexValue = StringUtil.wildcardToRegex(value.toLowerCase());
value = value.toLowerCase();
}
else
{
regexValue = StringUtil.wildcardToRegex(value);
}
// number comparison
if (typedValue instanceof Number)
......@@ -337,7 +347,7 @@ public class FilterROI extends Plugin implements ROIBlock, PluginLibrary, Plugin
else if (res instanceof String)
stringRes = (String) res;
else if (res instanceof Color)
stringRes = colorToString((Color) res);
stringRes = colorToString((Color) res).toLowerCase();
else if (res != null)
stringRes = res.toString();
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment