Adding new properties to graphic objects

classic Classic list List threaded Threaded
2 messages Options
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

Adding new properties to graphic objects

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.java

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.


--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev
Clément David-3 Clément David-3
Reply | Threaded
Open this post in threaded view
|

Re: Adding new properties to graphic objects

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.
>
>
_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev