« GClear interface » : différence entre les versions
Aller à la navigation
Aller à la recherche
Aucun résumé des modifications |
Aucun résumé des modifications |
||
Ligne 1 : | Ligne 1 : | ||
As for the [{{PathCurrentJavaDoc}}/fr/cnes/genius/main/GReadWrite.html GReadWrite] interface, <font color=#556B2F>'''GENIUS'''</font> proposes a [{{PathCurrentJavaDoc}}/fr/cnes/genius/main/GClear.html GClear] interface in order to <font color=#FF0000>reinitialize</font> data: | |||
* The data are then reinitialized to the default value given when the widget has been instantiated | |||
* There is the possibility to change this default value by using the <font color=#4169E1>setDefaultValue()</font> method | |||
<syntaxhighlight lang="java"> | |||
public class GManoeuvre extends GContainer implements GDisplay, GReadWrite, GClear { | |||
… | |||
public void clear() throws GException { generic(); } | |||
… | |||
</syntaxhighlight> | |||
At last, you will just have to call the <font color=#4169E1>mainClear()</font> method of the high level object you want to clear (it will correctly call the put methods of the lower level objects, as for <font color=#4169E1>display()</font>) … | |||
<syntaxhighlight lang="java"> | |||
public void after(GEvent e) throws GException { | |||
if ( e.contains(butClear) ){ obj.mainClear(); } | |||
} | |||
</syntaxhighlight> | |||
[[WELCOME_TO_THE_GENIUS_WIKI|Return to the introduction ↑]] | [[WELCOME_TO_THE_GENIUS_WIKI|Return to the introduction ↑]] | ||
[[Tooltips|Go to the next page →]] | [[Tooltips|Go to the next page →]] |
Dernière version du 5 mai 2017 à 11:58
As for the GReadWrite interface, GENIUS proposes a GClear interface in order to reinitialize data:
- The data are then reinitialized to the default value given when the widget has been instantiated
- There is the possibility to change this default value by using the setDefaultValue() method
public class GManoeuvre extends GContainer implements GDisplay, GReadWrite, GClear {
…
public void clear() throws GException { generic(); }
…
At last, you will just have to call the mainClear() method of the high level object you want to clear (it will correctly call the put methods of the lower level objects, as for display()) …
public void after(GEvent e) throws GException {
if ( e.contains(butClear) ){ obj.mainClear(); }
}