> RELATE
>
> How to describe the nature of the relationship? Using strings below? Perhaps
> best handled with ENUM.
>
> Parameter<Boolean> SNAPPING = new Parameter<Boolean>("snapping",
> Boolean.class, "Enable Snapping", "True to enable snapping, requires use of
> 'distance' parameter", true, 1, 1, new KVP( RELATED, "distance",
> RELATIONSHIP, "requires" ) );
> Parameter<Double> DISTANCE = new Parameter<Double>("distance", Double.class,
> "Snapping Distance", "Snapping distance used, required when 'snapping'
> parameter is True.", false, 0, 1, new KVP( RELATED, "snapping",
> RELATIONSHIP, "enable") );
Sounds great to me. I guess it's better to use an enum, instead of
string, but the syntax of those examples is perfect from my point of
view
>
> GROUP
>
> Groups seem straight forward, we already have the idea of "level" which has
> been used to group parameters into different wizard pages (or mark them for
> pragmatic use only).
>
> Parameter<File> DEM = new Parameter<File>("dem", File.class, "DEM File",
> "File to import", true, 1, 1, new KVP( GROUP, "elevation") );
> Parameter<File> METADATA = new Parameter<File>("metadata", File.class,
> "Metadata", "DEM Metadata", false, 0, 1, new KVP( GROUP, "elevation",
> RELATED, "dem") );
hmmm, I do not understand this one. The GROUP parameter I was
proposing was to define a group of parameters which are mutually
exclusive, meaning that just one of them can be used at a time to
configure the process. That is really a relation, so it could be put
as another type of relationship and use the syntax of the RELATE hint,
but in this case is a many-to-many relation, so it might be a bit
akward
I would propose something like this (adapted from the idea in the
ContourProcess process):
Parameter<Double> interval= new Parameter<Double>("interval",
Double.class, "Interval ",
"Interval between contour values (ignored if levels parameter is
supplied)", false, 1, 1, new KVP( GROUP, "contours") );
Parameter<Double[]> levels= new Parameter<Double[]>("levels",
Double[].class, "Fixed contour elevations",
"Values of levels at which to generate contours", false, 1, null, new
KVP( GROUP, "contours") );
So by adding this information, the UI might know that at least one of
the params is needed. Notice that this does not match the declaration
of the parameters, whether they are declared as mandatory or not,
since all are really optional, but what is mandatory is to have at
least one from the group they belong to. I do not see clearly how to
manage this, now that I realize it...
Anyway, the first hint seems to me more important now, as there is no
way of getting something similar otherwise. The case where several
parameters form a group of options is easily handled by dividing the
process into several ones with different arguments, which in my
opinion is not a bad thing, and even can be benefitial,since results
in a more atomized set of processes.
Cheers
Victor
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel