[Scilab-Dev] Adding new properties to graphic objects

Clément David Clement.David at esi-group.com
Mon Apr 9 10:49:36 CEST 2018


Hello Stéphane,

Yes it is really tedious. Scilab uicontrols / graphics is using a mixture of C++ gateways (1 file)
with C++ stored properties (1 getter and 1 setter) and Java through an MVC (1 file) that could be
stored as XML (1 file) and as hdf5 (1 file) and could be printed into Scilab (1 file) etc...

So currently there is one file per functionality as we started with a known set of properties and an
increasing set of functionality. We could also have implemented the MVC with 1 file per property and
a fixed set of functionality. Doing so today will require a major refactoring effort !

Thanks,

--
Clément

Le vendredi 06 avril 2018 à 16:40 +0200, Stéphane Mottelet a écrit :
> Hello,
> 
> I just want to give my impressions about the tedious task of adding a 
> new property to a graphic object, e.g. here a "SnapToTicks" property to 
> the Slider, directly mapped to the SnapToTicks property of the Java 
> widget: besides two makefile and the modification to the documentation I 
> had to create two and modify  *11* C,C++ and Java sources files (see the 
> CR @ https://codereview.scilab.org/#/c/19937/):
> 
> scilab/modules/graphic_objects/src/scripts/propertiesMap.properties
> scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/uicontrol/Uicontrol.jav
> a 
> 
> scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/xmlloader/XMLDomLoader.
> java 
> 
>          scilab/modules/graphics/macros/%h_p.sci
> scilab/modules/graphics/src/c/getHandleProperty/GetHashTable.c
> scilab/modules/graphics/src/c/getHandleProperty/SetHashTable.c
>          scilab/modules/gui/includes/GetUicontrol.h
>          scilab/modules/gui/includes/SetUicontrol.h
>          scilab/modules/gui/sci_gateway/c/sci_uicontrol.c
>          scilab/modules/gui/src/cpp/GetUicontrolSnapToTicks.cpp (NEW)
>          scilab/modules/gui/src/cpp/SetUicontrolSnapToTicks.cpp (NEW)
> scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/slider/SwingScilabSlider.java
>          scilab/modules/hdf5/src/cpp/handle_properties.hxx
> 
> Frankly, don't you find that it sucks ?
> 
> Many properties could be added at the Scilab level (by using macros) if 
> we had an overloading mechanism e.g when the user types something like 
> h.newprop=stuff. Don't you find that such a mechanism could be useful ?
> 
> S.
> 
> 


More information about the dev mailing list