if (flavors.contains(ModelerFlavors.COLOR))
{
// Use the whole section as target
Rectangle r = presentationFigure.displayBox();
r = view.applyScale(r, false);
return Collections.singletonList(new ViewDropRegion(REGION_COLOR, this, r, view));
}
String regionId = null;
if (flavors.contains(ClientFlavors.TYPE_ITEM))
{
regionId = REGION_PARAM_BY_TYPE;
}
else if (flavors.contains(ClientFlavors.PROCESS_VARIABLE))
{
regionId = REGION_PARAM_BY_VARIABLE;
}
if (regionId != null)
{
if (mouseEvent == null || ! mouseEvent.isControlDown())
{
// Accept type items only if the CTRL button is not pressed to prevent overlaying the region
// exposed by the ParamFigure in this case.
Rectangle[] bounds = getParamRegions();
if (bounds.length > 1)
{
List result = new ArrayList();
for (int i = 0; i < bounds.length; i++)
{
// Add a green drop region with a small black border around each parameter
Rectangle r = view.applyScale(bounds[i], false);
ViewDropRegion region = new ViewDropRegion(regionId + ":" + i, this, r, view);
region.setPaint(ModelerColors.DROP_REGION);
region.setFrameColor(Color.BLACK);
result.add(region);
}
return result;
}
// Params are not shown, so we need only a single region.
// Use the whole section as target
Rectangle r = presentationFigure.displayBox();
r = view.applyScale(r, false);
ViewDropRegion region = new ViewDropRegion(regionId, this, r, view);
region.setPaint(ModelerColors.DROP_REGION);
return Collections.singletonList(region);
}
}
return null;