« Links with Swing » : différence entre les versions

De GENIUS
Aller à la navigation Aller à la recherche
Aucun résumé des modifications
Aucun résumé des modifications
Ligne 1 : Ligne 1 :
<font color=#556B2F>'''GENIUS'''</font> classes use <font color=#FF8C00>swing</font> classes but are not directly inherited from them: strictly speaking, it is not recommended to directly use <font color=#FF8C00>swing</font> classes. For example, it will be recommanded to use [[javadoc>fr/cnes/genius/current/fr/cnes/genius/lowLevel/GPanel.html|GPanel]] rather than <font color=#4169E1>JPanel</font> because, in that case, the « display » mechanism will not be effective.
<font color=#556B2F>'''GENIUS'''</font> classes use <font color=#FF8C00>swing</font> classes but are not directly inherited from them: strictly speaking, it is not recommended to directly use <font color=#FF8C00>swing</font> classes. For example, it will be recommanded to use [{{PathCurrentJavaDoc}}/fr/cnes/genius/lowLevel/GPanel.html GPanel] rather than <font color=#4169E1>JPanel</font> because, in that case, the « display » mechanism will not be effective.


Moreover, for certain methods, an over layer is proposed by <font color=#556B2F>'''GENIUS'''</font>. For example, <font color =#4169E1>setEnabled(true/false)</font> method is applicable for a [http://tu-dctsb-p02.cst.cnes.fr/javadoc/fr/cnes/genius/current/fr/cnes/genius/lowLevel/GButton.html GButton] object.
Moreover, for certain methods, an over layer is proposed by <font color=#556B2F>'''GENIUS'''</font>. For example, <font color =#4169E1>setEnabled(true/false)</font> method is applicable for a [{{PathCurrentJavaDoc}}/fr/cnes/genius/lowLevel/GButton.html GButton] object.


But, in order not to be blocked, one can have <u>direct calls</u> to <font color=#FF8C00>swing</font> methods:
But, in order not to be blocked, one can have <u>direct calls</u> to <font color=#FF8C00>swing</font> methods:


* By a call to the <font color=#FF8C00>swing</font> object included in the <font color=#556B2F>**GENIUS**</font> one as for example, with the <font color=#4169E1>getJButton()</font> method which refer to the <font color=#FF8C00>swing</font> <font color=#FF8C00>JButton</font> object using by [http://tu-dctsb-p02.cst.cnes.fr/javadoc/fr/cnes/genius/current/fr/cnes/genius/lowLevel/GButton.html GButton];
* By a call to the <font color=#FF8C00>swing</font> object included in the <font color=#556B2F>**GENIUS**</font> one as for example, with the <font color=#4169E1>getJButton()</font> method which refer to the <font color=#FF8C00>swing</font> <font color=#FF8C00>JButton</font> object using by [{{PathCurrentJavaDoc}}/fr/cnes/genius/lowLevel/GButton.html GButton];


<syntaxhighlight lang="java">
<syntaxhighlight lang="java">

Version du 5 mai 2017 à 08:05

GENIUS classes use swing classes but are not directly inherited from them: strictly speaking, it is not recommended to directly use swing classes. For example, it will be recommanded to use GPanel rather than JPanel because, in that case, the « display » mechanism will not be effective.

Moreover, for certain methods, an over layer is proposed by GENIUS. For example, setEnabled(true/false) method is applicable for a GButton object.

But, in order not to be blocked, one can have direct calls to swing methods:

  • By a call to the swing object included in the **GENIUS** one as for example, with the getJButton() method which refer to the swing JButton object using by GButton;
GButton but = new GButton("button");
but.getJButton().setForeground(Color.BLUE);
  • By a call to swing widgets which do not need **GENIUS** mechanism as JOptionPane or JFileChooser.

Return to the introduction ↑ Go to the next page →