Le 07/08/2017 à 18:24, Siddhesh Rane a écrit :
> >What about making it a dialog box instead than part of the CRS pane?
> (...snip...)
>
> CRSEditor can be embedded anywhere, even in dialog box.
>
Yes, this is nice. But the application currently uses tabs, with "About
SIS" information, data files, metadata, Coordinate Reference System
(CRS) all at the same level. I think that for most users, the entry
point will be their data file. Then (s)he can see the metadata of their
file, and one part of the metadata is the CRS. So the CRS dialog box
would be opened by editing the "Reference System" node on the metadata page.
I understand that tabs may be more convenient during development, but at
least the first tab about Apache SIS configuration should move in an
"About Apache SIS" menu item.
> I have changed it to org.apache.sis.desktop, similar to the
> sis-console module. The artifact would be a part of "applications"
> submodule.
>
Thanks for the renaming. Yes, the plan is to port the code to the
"applications" submodule.
> When editing CRS when I have to update certain fields, what pattern
> needs to be followed? Do I
> * call setValue if available
> * create a new object by calling constructor
> * use a factory method like DatumFactory.createPrimeMeridian
>
There is no "setValue" on CRS objects. All CRS are immutable on design,
because (typically) thousands of geometries and other objects will share
a reference to the same CRS. New objects need to be created by calls to
DatumFactory, CSFactory and CRSFactory methods.
As a side note, the current widget leaves the "semi-major" and
"semi-minor" fields to zero. Those values can be fetched by
Datum.getEllipsoid().getSemiMajor() and ...getSemiMinor().
For the prime meridian, we should show the "Greenwich longitude"
somewhere, maybe just on the right side of "Prime Meridian" combo box.
> Also once the CRS is edited where is it supposed to be stored?
>
In the metadata, under "Reference system" node. The proposed action
would be to have no CRS tab, but instead an "edit" button for the
"metadata.referenceSystem" node. This edit button would popup the CRS
editor in a dialog box. The first "name" field could be an editable
combo-box with the list of all CRS, plus a "user defined" choice. If the
user select one of the names in the list, all values in the dialog box
are updated accordingly but are unmodifiable. If the user selects
"user-defined", the values become modifiable.
Martin