Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: bc434066 by Tony Chemit at 2021-11-25T10:28:57+01:00 Add SpringLayout support to ContentUIHandler - - - - - 061bb2ef by Tony Chemit at 2021-11-25T10:29:09+01:00 Fix some ui layout - - - - - 0c8efe73 by Tony Chemit at 2021-11-25T10:59:19+01:00 Revoir la couleurs des noeuds non chargés (bleus actuellement) - See #2095 - - - - - 6 changed files: - client/configuration/src/main/config/Client.ini - client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/ContentUIInitializer.java - client/datasource/editor/common/src/main/java/fr/ird/observe/client/datasource/editor/common/referential/common/LengthLengthParameterUI.jaxx - client/datasource/editor/common/src/main/java/fr/ird/observe/client/datasource/editor/common/referential/common/VesselUI.jaxx - client/runner/src/main/resources/META-INF/configuration/ClientConfig.md - client/runner/src/main/resources/META-INF/configuration/ClientConfig.properties Changes: ===================================== client/configuration/src/main/config/Client.ini ===================================== @@ -898,7 +898,7 @@ defaultValue = java.awt.Color[r=255,g=0,b=0] description = observe.config.ui.tree.node.unloaded.color key = ui.tree.node.unloaded.color type = color -defaultValue = java.awt.Color[r=0,g=0,b=255] +defaultValue = java.awt.Color[r=144,g=144,b=241] [option nodeEmptyColor] description = observe.config.ui.tree.node.empty.color ===================================== client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/ContentUIInitializer.java ===================================== @@ -27,6 +27,7 @@ import fr.ird.observe.client.datasource.editor.api.content.actions.GoToTab; import fr.ird.observe.client.datasource.editor.api.content.ui.DataReferenceListCellRenderer; import fr.ird.observe.client.datasource.editor.api.content.ui.ReferentialReferenceListCellRenderer; import fr.ird.observe.client.datasource.validation.ObserveSwingValidator; +import fr.ird.observe.client.util.SpringUtilities; import fr.ird.observe.client.util.init.DefaultUIInitializer; import fr.ird.observe.client.util.init.DefaultUIInitializerContext; import fr.ird.observe.client.util.init.DefaultUIInitializerResult; @@ -70,6 +71,8 @@ import javax.swing.JTabbedPane; import javax.swing.JTable; import javax.swing.JToolBar; import javax.swing.ListCellRenderer; +import javax.swing.SpringLayout; +import java.awt.Container; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -88,6 +91,7 @@ import static io.ultreia.java4all.i18n.I18n.t; public class ContentUIInitializer<UI extends ContentUI> extends UIInitializerSupport<UI, DefaultUIInitializerContext<UI>> implements WithClientUIContextApi { public static final String CLIENT_PROPERTY_FOCUS_COMPONENT = "focusComponent"; + public static final String SPRING_LAYOUT = "SpringLayout"; public static final Class<?>[] MANAGED_TYPES = new Class<?>[]{ JComponent.class, JToolBar.class, @@ -364,6 +368,10 @@ public class ContentUIInitializer<UI extends ContentUI> extends UIInitializerSup protected void init(JComponent editor) { initializerContext.checkFirstPass(); + Object springLayout = editor.getClientProperty(SPRING_LAYOUT); + if (springLayout != null) { + setSpringLayout(editor, 2); + } Object property = editor.getClientProperty(CLIENT_PROPERTY_FOCUS_COMPONENT); if (property == null) { return; @@ -396,7 +404,14 @@ public class ContentUIInitializer<UI extends ContentUI> extends UIInitializerSup editor.getColumnHeader().setFocusable(false); } } - + public static void setSpringLayout(Container container, int columnCount) { + int rowCount = container.getComponentCount() / columnCount; + container.setLayout(new SpringLayout()); + SpringUtilities.makeCompactGrid(container, + rowCount, columnCount, //rows, cols + 3, 3, //initX, initY + 3, 3); //xPad, yPad + } //FIXME Add more methods to use ToolkitIdLabel @SuppressWarnings({"unchecked", "rawtypes"}) private <R extends DataDtoReference> void prepareDataDoubleList(Class<R> dtoClass, DoubleList<R> editor) { ===================================== client/datasource/editor/common/src/main/java/fr/ird/observe/client/datasource/editor/common/referential/common/LengthLengthParameterUI.jaxx ===================================== @@ -105,7 +105,7 @@ </cell> </row> <row> - <cell columns="2" weighty="1"> + <cell columns="2" fill="both" weighty="1"> <BigTextEditor id="source"/> </cell> </row> ===================================== client/datasource/editor/common/src/main/java/fr/ird/observe/client/datasource/editor/common/referential/common/VesselUI.jaxx ===================================== @@ -138,138 +138,48 @@ <tab id='otherTab' i18nProperty=""> <Table fill="both"> <row> - <cell anchor="west"> - <JLabel id='lengthLabel'/> - </cell> - <cell anchor='east' weightx="1" fill="both"> - <NumberEditor id='length' styleClass="float2"/> - </cell> - </row> - <row> - <cell anchor="west"> - <JLabel id='capacityLabel'/> - </cell> - <cell anchor='east' weightx="1" fill="both"> - <NumberEditor id='capacity' styleClass="float2"/> - </cell> - </row> - <row> - <cell anchor="west"> - <JLabel id='powerCvLabel'/> - </cell> - <cell anchor='east' weightx="1" fill="both"> - <NumberEditor id='powerCv' styleClass="int6"/> - </cell> - </row> - <row> - <cell anchor="west"> - <JLabel id='powerKWLabel'/> - </cell> - <cell anchor='east' weightx="1" fill="both"> - <NumberEditor id='powerKW' styleClass="float2"/> + <cell weightx="1"> + <JPanel id="otherTabPanel" _SpringLayout="true"> + <JLabel id='lengthLabel'/> + <NumberEditor id='length' styleClass="float2"/> + <JLabel id='capacityLabel'/> + <NumberEditor id='capacity' styleClass="float2"/> + <JLabel id='powerCvLabel'/> + <NumberEditor id='powerCv' styleClass="int6"/> + <JLabel id='powerKWLabel'/> + <NumberEditor id='powerKW' styleClass="float2"/> + <JLabel id='searchMaximumLabel'/> + <NumberEditor id='searchMaximum' styleClass="float2"/> + <JLabel id='yearServiceLabel'/> + <NumberEditor id='yearService' styleClass="int6"/> + <JLabel id='changeDateLabel'/> + <DateEditor id='changeDate'/> + <JLabel id='iotcIdLabel'/> + <NormalTextEditor id='iotcId'/> + <JLabel id='comIdLabel'/> + <NormalTextEditor id='comId'/> + <JLabel id='iccatLabel'/> + <NormalTextEditor id='iccat'/> + <JLabel id='imoIdLabel'/> + <NormalTextEditor id='imoId'/> + <JLabel id='nationalIdLabel'/> + <NormalTextEditor id='nationalId'/> + <JLabel id='radioCallSignIdLabel'/> + <NormalTextEditor id='radioCallSignId'/> + <JLabel id='tuviIdLabel'/> + <NormalTextEditor id='tuviId'/> + <JLabel id='lloydIdLabel'/> + <NormalTextEditor id='lloydId'/> + <JLabel id='shipOwnerLabel'/> + <FilterableComboBox id='shipOwner' genericType='ShipOwnerReference'/> + </JPanel> </cell> </row> <row> - <cell anchor="west"> - <JLabel id='searchMaximumLabel'/> - </cell> - <cell anchor='east' weightx="1" fill="both"> - <NumberEditor id='searchMaximum' styleClass="float2"/> - </cell> - </row> - <row> - <cell anchor="west"> - <JLabel id='yearServiceLabel'/> - </cell> - <cell anchor='east' weightx="1" fill="both"> - <NumberEditor id='yearService' styleClass="int6"/> - </cell> - </row> - <row> - <cell anchor='west'> - <JLabel id='changeDateLabel'/> - </cell> - <cell anchor='west'> - <DateEditor id='changeDate'/> - </cell> - </row> - <row> - <cell columns="2" weighty="1"> + <cell weighty="1"> <JLabel styleClass="skipI18n"/> </cell> </row> - <row> - <cell anchor="west"> - <JLabel id='iotcIdLabel'/> - </cell> - <cell anchor='east' weightx="1" fill="both"> - <NormalTextEditor id='iotcId'/> - </cell> - </row> - <row> - <cell anchor="west"> - <JLabel id='comIdLabel'/> - </cell> - <cell anchor='east' weightx="1" fill="both"> - <NormalTextEditor id='comId'/> - </cell> - </row> - <row> - <cell anchor="west"> - <JLabel id='iccatLabel'/> - </cell> - <cell anchor='east' weightx="1" fill="both"> - <NormalTextEditor id='iccat'/> - </cell> - </row> - <row> - <cell anchor="west"> - <JLabel id='imoIdLabel'/> - </cell> - <cell anchor='east' weightx="1" fill="both"> - <NormalTextEditor id='imoId'/> - </cell> - </row> - <row> - <cell anchor="west"> - <JLabel id='nationalIdLabel'/> - </cell> - <cell anchor='east' weightx="1" fill="both"> - <NormalTextEditor id='nationalId'/> - </cell> - </row> - <row> - <cell anchor="west"> - <JLabel id='radioCallSignIdLabel'/> - </cell> - <cell anchor='east' weightx="1" fill="both"> - <NormalTextEditor id='radioCallSignId'/> - </cell> - </row> - <row> - <cell anchor="west"> - <JLabel id='tuviIdLabel'/> - </cell> - <cell anchor='east' weightx="1" fill="both"> - <NormalTextEditor id='tuviId'/> - </cell> - </row> - <row> - <cell anchor="west"> - <JLabel id='lloydIdLabel'/> - </cell> - <cell anchor='east' weightx="1" fill="both"> - <NormalTextEditor id='lloydId'/> - </cell> - </row> - <row> - <cell anchor='west'> - <JLabel id='shipOwnerLabel'/> - </cell> - <cell anchor='east' weightx="1" fill="both"> - <FilterableComboBox id='shipOwner' genericType='ShipOwnerReference'/> - </cell> - </row> </Table> </tab> </JTabbedPane> ===================================== client/runner/src/main/resources/META-INF/configuration/ClientConfig.md ===================================== @@ -2165,7 +2165,7 @@ Description : **Configuration d'ObServe** | Modifiable ? | Oui | | Sauvegardable ? | Oui | | Type | ```color``` | -| Valeur par défaut | ```java.awt.Color[r=0,g=0,b=255]``` | +| Valeur par défaut | ```java.awt.Color[r=144,g=144,b=241]``` | ### <a name="detail_option_ui.tree.node.empty.color"></a> ===================================== client/runner/src/main/resources/META-INF/configuration/ClientConfig.properties ===================================== @@ -1480,12 +1480,12 @@ # Clef : ui.tree.node.unloaded.color # Description : Couleur pour un nœud non chargé # Type : color -# Valeur par défaut : java.awt.Color[r=0,g=0,b=255] +# Valeur par défaut : java.awt.Color[r=144,g=144,b=241] # Modifiable ? : Oui # Sauvegardable ? : Oui # # Pour modifier l'option, veuillez décommenter la ligne suivante -# ui.tree.node.unloaded.color=java.awt.Color[r=0,g=0,b=255] +# ui.tree.node.unloaded.color=java.awt.Color[r=144,g=144,b=241] # Option : nodeEmptyColor # Clef : ui.tree.node.empty.color View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/12df740ac4a0b82df47a98617... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/12df740ac4a0b82df47a98617... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT (@tchemit)