Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
fe160eca
by Tony CHEMIT at 2017-08-14T17:28:21+02:00
4 changed files:
- client/src/main/java/fr/ird/observe/client/ui/ObserveMainUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/impl/seine/FloatingObjectTransmittingBuoyOperationUI.jaxx
- client/src/main/java/fr/ird/observe/client/ui/content/impl/seine/FloatingObjectTransmittingBuoyOperationUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/storage/StorageUIHandler.java
Changes:
| ... | ... | @@ -54,4 +54,9 @@ public class ObserveMainUIHandler implements UIHandler<ObserveMainUI> { |
| 54 | 54 |
int dividerLocation = Math.min(splitpane2.getMinimumDividerLocation() + plusSize, splitpane2.getMaximumDividerLocation() - 100);
|
| 55 | 55 |
splitpane2.setDividerLocation(dividerLocation);
|
| 56 | 56 |
}
|
| 57 |
+ |
|
| 58 |
+ public void updateContentSizeForce(int plusSize) {
|
|
| 59 |
+ JSplitPane splitpane2 = ui.getSplitpane2();
|
|
| 60 |
+ splitpane2.setDividerLocation(plusSize);
|
|
| 61 |
+ }
|
|
| 57 | 62 |
}
|
| ... | ... | @@ -100,7 +100,7 @@ |
| 100 | 100 |
</row>
|
| 101 | 101 |
</Table>
|
| 102 | 102 |
|
| 103 |
- <JPanel id="transmittingBuoys" constraints="BorderLayout.CENTER"/>
|
|
| 103 |
+ <JPanel id="transmittingBuoys" layout='{new GridLayout(0,1)}'/>
|
|
| 104 | 104 |
|
| 105 | 105 |
<JComment id='comment' constraints="BorderLayout.SOUTH"/>
|
| 106 | 106 |
|
| ... | ... | @@ -122,7 +122,7 @@ |
| 122 | 122 |
|
| 123 | 123 |
<JLabel id='noBaliseEditor'/>
|
| 124 | 124 |
|
| 125 |
- <Table id='transmittingBuoy1Editor' fill="horizontal">
|
|
| 125 |
+ <Table id='transmittingBuoy1Editor' fill="both">
|
|
| 126 | 126 |
<row>
|
| 127 | 127 |
<cell anchor='west'>
|
| 128 | 128 |
<JLabel id='transmittingBuoyOperation1Label'/>
|
| ... | ... | @@ -180,7 +180,7 @@ |
| 180 | 180 |
</row>
|
| 181 | 181 |
</Table>
|
| 182 | 182 |
|
| 183 |
- <Table id='transmittingBuoy2Editor' fill="horizontal">
|
|
| 183 |
+ <Table id='transmittingBuoy2Editor' fill="both">
|
|
| 184 | 184 |
<row>
|
| 185 | 185 |
<cell anchor='west'>
|
| 186 | 186 |
<JLabel id='transmittingBuoyOperation2Label'/>
|
| ... | ... | @@ -22,6 +22,7 @@ |
| 22 | 22 |
package fr.ird.observe.client.ui.content.impl.seine;
|
| 23 | 23 |
|
| 24 | 24 |
import com.google.common.collect.Lists;
|
| 25 |
+import fr.ird.observe.client.ObserveSwingApplicationContext;
|
|
| 25 | 26 |
import fr.ird.observe.client.db.ClientDataContext;
|
| 26 | 27 |
import fr.ird.observe.client.db.ObserveSwingDataSource;
|
| 27 | 28 |
import fr.ird.observe.client.db.constants.DataContextType;
|
| ... | ... | @@ -40,10 +41,10 @@ import fr.ird.observe.services.dto.seine.FloatingObjectTransmittingBuoyDto; |
| 40 | 41 |
import fr.ird.observe.services.dto.seine.FloatingObjectTransmittingBuoyHelper;
|
| 41 | 42 |
import fr.ird.observe.services.dto.seine.TransmittingBuoyDto;
|
| 42 | 43 |
import fr.ird.observe.services.dto.seine.TransmittingBuoyHelper;
|
| 43 |
-import java.awt.GridLayout;
|
|
| 44 | 44 |
import java.util.ArrayList;
|
| 45 | 45 |
import java.util.Collection;
|
| 46 | 46 |
import java.util.List;
|
| 47 |
+import javax.swing.JComponent;
|
|
| 47 | 48 |
import javax.swing.JPanel;
|
| 48 | 49 |
import javax.swing.SwingUtilities;
|
| 49 | 50 |
import org.apache.commons.logging.Log;
|
| ... | ... | @@ -255,15 +256,16 @@ public class FloatingObjectTransmittingBuoyOperationUIHandler extends ContentUIH |
| 255 | 256 |
|
| 256 | 257 |
TransmittingBuoyDto transmittingBuoy;
|
| 257 | 258 |
ReferentialReference<TransmittingBuoyOperationDto> objectOperation;
|
| 259 |
+ JComponent focusOwner = null;
|
|
| 258 | 260 |
switch (nbBalises) {
|
| 259 | 261 |
case 0:
|
| 260 | 262 |
// no balise
|
| 261 |
- editorPanel.setLayout(new GridLayout());
|
|
| 262 | 263 |
editorPanel.add(ui.getNoBaliseEditor());
|
| 263 | 264 |
if (getModel().isEditing()) {
|
| 264 | 265 |
ui.getValidatorBalise1().setBean(null);
|
| 265 | 266 |
ui.getValidatorBalise2().setBean(null);
|
| 266 | 267 |
}
|
| 268 |
+ focusOwner = ui.getComment().getComment2();
|
|
| 267 | 269 |
break;
|
| 268 | 270 |
|
| 269 | 271 |
case 1:
|
| ... | ... | @@ -274,12 +276,13 @@ public class FloatingObjectTransmittingBuoyOperationUIHandler extends ContentUIH |
| 274 | 276 |
|
| 275 | 277 |
bindEditBalise(ui.getTransmittingBuoy1(), objectOperation, transmittingBuoy);
|
| 276 | 278 |
|
| 277 |
- editorPanel.setLayout(new GridLayout(1, 0));
|
|
| 278 | 279 |
editorPanel.add(ui.getTransmittingBuoy1Editor());
|
| 279 | 280 |
if (getModel().isEditing()) {
|
| 280 | 281 |
ui.getValidatorBalise1().setBean(ui.getTransmittingBuoy1());
|
| 281 | 282 |
ui.getValidatorBalise2().setBean(null);
|
| 282 | 283 |
}
|
| 284 |
+ |
|
| 285 |
+ focusOwner = ui.getTransmittingBuoyType1();
|
|
| 283 | 286 |
break;
|
| 284 | 287 |
|
| 285 | 288 |
case 2:
|
| ... | ... | @@ -292,20 +295,24 @@ public class FloatingObjectTransmittingBuoyOperationUIHandler extends ContentUIH |
| 292 | 295 |
objectOperation = reset ? getObjectOperation(operations, codeOperations[1]) : null;
|
| 293 | 296 |
bindEditBalise(ui.getTransmittingBuoy2(), objectOperation, transmittingBuoy);
|
| 294 | 297 |
|
| 295 |
- editorPanel.setLayout(new GridLayout(2, 0));
|
|
| 296 | 298 |
editorPanel.add(ui.getTransmittingBuoy1Editor());
|
| 297 | 299 |
editorPanel.add(ui.getTransmittingBuoy2Editor());
|
| 298 | 300 |
if (getModel().isEditing()) {
|
| 299 | 301 |
ui.getValidatorBalise1().setBean(ui.getTransmittingBuoy1());
|
| 300 | 302 |
ui.getValidatorBalise2().setBean(ui.getTransmittingBuoy2());
|
| 301 | 303 |
}
|
| 304 |
+ focusOwner = ui.getTransmittingBuoyType1();
|
|
| 302 | 305 |
break;
|
| 303 | 306 |
}
|
| 304 | 307 |
|
| 308 |
+ JComponent finalFocusOwner = focusOwner;
|
|
| 305 | 309 |
SwingUtilities.invokeLater(() -> {
|
| 306 | 310 |
|
| 307 |
- // recalcul de la disposition
|
|
| 308 |
- getUi().revalidate();
|
|
| 311 |
+ ObserveSwingApplicationContext.get().getMainUI().getHandler().updateContentSizeForce(600);
|
|
| 312 |
+ |
|
| 313 |
+ if (finalFocusOwner != null) {
|
|
| 314 |
+ UIHelper.askFocus(finalFocusOwner);
|
|
| 315 |
+ }
|
|
| 309 | 316 |
});
|
| 310 | 317 |
|
| 311 | 318 |
}
|
| ... | ... | @@ -28,11 +28,11 @@ import fr.ird.observe.client.ObserveRunner; |
| 28 | 28 |
import fr.ird.observe.client.ObserveSwingApplicationContext;
|
| 29 | 29 |
import fr.ird.observe.client.ObserveTextGenerator;
|
| 30 | 30 |
import fr.ird.observe.client.configuration.ClientConfig;
|
| 31 |
+import fr.ird.observe.client.constants.ConnexionStatus;
|
|
| 31 | 32 |
import fr.ird.observe.client.constants.CreationMode;
|
| 32 | 33 |
import fr.ird.observe.client.constants.DbMode;
|
| 33 | 34 |
import fr.ird.observe.client.db.ObserveDataSourcesManager;
|
| 34 | 35 |
import fr.ird.observe.client.db.ObserveSwingDataSource;
|
| 35 |
-import fr.ird.observe.client.constants.ConnexionStatus;
|
|
| 36 | 36 |
import fr.ird.observe.client.ui.ObserveKeyStrokes;
|
| 37 | 37 |
import fr.ird.observe.client.ui.ObserveMainUI;
|
| 38 | 38 |
import fr.ird.observe.client.ui.UIHelper;
|
| ... | ... | @@ -791,8 +791,10 @@ public class StorageUIHandler implements UIHandler<StorageUI> { |
| 791 | 791 |
}
|
| 792 | 792 |
Boolean apply = (Boolean) abstractButton.getClientProperty("apply");
|
| 793 | 793 |
if (apply != null && apply) {
|
| 794 |
- SwingUtilities.invokeLater(ui.getNextAction()::doClick);
|
|
| 795 |
- SwingUtilities.invokeLater(ui.getApplyAction()::doClick);
|
|
| 794 |
+ SwingUtilities.invokeLater(() -> {
|
|
| 795 |
+ ui.getNextAction().doClick();
|
|
| 796 |
+ ui.getApplyAction().doClick();
|
|
| 797 |
+ });
|
|
| 796 | 798 |
}
|
| 797 | 799 |
}
|
| 798 | 800 |
};
|