Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
ce2492d7
by tchemit at 2019-06-08T14:32:55Z
12 changed files:
- client-configuration/src/main/java/fr/ird/observe/client/configuration/NavigationTreeConfigBean.java
- client-core/src/main/java/fr/ird/observe/client/ui/ObserveMainUIInitializer.java
- client-core/src/main/java/fr/ird/observe/client/ui/actions/main/menu/navigation/SelectLonglineLandingAction.java
- client-core/src/main/java/fr/ird/observe/client/ui/actions/main/menu/navigation/SelectLonglineLogbookActivityAction.java
- client-core/src/main/java/fr/ird/observe/client/ui/actions/main/menu/navigation/SelectLonglineLogbookSampleAction.java
- client-core/src/main/java/fr/ird/observe/client/ui/actions/main/menu/navigation/SelectLonglineObsActivityAction.java
- client-core/src/main/java/fr/ird/observe/client/ui/actions/main/menu/navigation/SelectLonglineProgramAction.java
- client-core/src/main/java/fr/ird/observe/client/ui/actions/main/menu/navigation/SelectLonglineTripAction.java
- client-core/src/main/java/fr/ird/observe/client/ui/actions/main/menu/navigation/SelectSeineActivityAction.java
- client-core/src/main/java/fr/ird/observe/client/ui/actions/main/menu/navigation/SelectSeineProgramAction.java
- client-core/src/main/java/fr/ird/observe/client/ui/actions/main/menu/navigation/SelectSeineRouteAction.java
- client-core/src/main/java/fr/ird/observe/client/ui/actions/main/menu/navigation/SelectSeineTripAction.java
Changes:
| ... | ... | @@ -32,6 +32,10 @@ import io.ultreia.java4all.bean.AbstractJavaBean; |
| 32 | 32 |
public class NavigationTreeConfigBean extends AbstractJavaBean implements NavigationTreeConfig {
|
| 33 | 33 |
|
| 34 | 34 |
|
| 35 |
+ public static final String SHOW_SEINE_TRIP = "showSeineTrip";
|
|
| 36 |
+ public static final String SHOW_REFERENTIAL = "showReferential";
|
|
| 37 |
+ public static final String SHOW_LONGLINE_TRIP = "showLonglineTrip";
|
|
| 38 |
+ public static final String SHOW_EMPTY_PROGRAM = "showEmptyProgram";
|
|
| 35 | 39 |
private boolean showSeineTrip = true;
|
| 36 | 40 |
private boolean showLonglineTrip = true;
|
| 37 | 41 |
private boolean showReferential = true;
|
| ... | ... | @@ -46,7 +50,7 @@ public class NavigationTreeConfigBean extends AbstractJavaBean implements Naviga |
| 46 | 50 |
public void setShowSeineTrip(boolean showSeineTrip) {
|
| 47 | 51 |
boolean oldValue = isShowSeineTrip();
|
| 48 | 52 |
this.showSeineTrip = showSeineTrip;
|
| 49 |
- firePropertyChange("showSeineTrip", oldValue, showSeineTrip);
|
|
| 53 |
+ firePropertyChange(SHOW_SEINE_TRIP, oldValue, showSeineTrip);
|
|
| 50 | 54 |
}
|
| 51 | 55 |
|
| 52 | 56 |
@Override
|
| ... | ... | @@ -58,7 +62,7 @@ public class NavigationTreeConfigBean extends AbstractJavaBean implements Naviga |
| 58 | 62 |
public void setShowLonglineTrip(boolean showLonglineTrip) {
|
| 59 | 63 |
boolean oldValue = isShowLonglineTrip();
|
| 60 | 64 |
this.showLonglineTrip = showLonglineTrip;
|
| 61 |
- firePropertyChange("showLonglineTrip", oldValue, showLonglineTrip);
|
|
| 65 |
+ firePropertyChange(SHOW_LONGLINE_TRIP, oldValue, showLonglineTrip);
|
|
| 62 | 66 |
}
|
| 63 | 67 |
|
| 64 | 68 |
@Override
|
| ... | ... | @@ -70,7 +74,7 @@ public class NavigationTreeConfigBean extends AbstractJavaBean implements Naviga |
| 70 | 74 |
public void setShowReferential(boolean showReferential) {
|
| 71 | 75 |
boolean oldValue = isShowReferential();
|
| 72 | 76 |
this.showReferential = showReferential;
|
| 73 |
- firePropertyChange("showReferential", oldValue, showReferential);
|
|
| 77 |
+ firePropertyChange(SHOW_REFERENTIAL, oldValue, showReferential);
|
|
| 74 | 78 |
}
|
| 75 | 79 |
|
| 76 | 80 |
@Override
|
| ... | ... | @@ -82,6 +86,6 @@ public class NavigationTreeConfigBean extends AbstractJavaBean implements Naviga |
| 82 | 86 |
public void setShowEmptyProgram(boolean showEmptyProgram) {
|
| 83 | 87 |
boolean oldValue = isShowEmptyProgram();
|
| 84 | 88 |
this.showEmptyProgram = showEmptyProgram;
|
| 85 |
- firePropertyChange("showEmptyProgram", oldValue, showEmptyProgram);
|
|
| 89 |
+ firePropertyChange(SHOW_EMPTY_PROGRAM, oldValue, showEmptyProgram);
|
|
| 86 | 90 |
}
|
| 87 | 91 |
}
|
| ... | ... | @@ -24,6 +24,7 @@ package fr.ird.observe.client.ui; |
| 24 | 24 |
import fr.ird.observe.client.ObserveRunner;
|
| 25 | 25 |
import fr.ird.observe.client.ObserveSwingApplicationContext;
|
| 26 | 26 |
import fr.ird.observe.client.configuration.ClientConfig;
|
| 27 |
+import fr.ird.observe.client.configuration.NavigationTreeConfigBean;
|
|
| 27 | 28 |
import fr.ird.observe.client.db.ObserveSwingDataSource;
|
| 28 | 29 |
import fr.ird.observe.client.ui.actions.UIActionSupport;
|
| 29 | 30 |
import fr.ird.observe.client.ui.actions.main.ChangeFocusGlobalUIAction;
|
| ... | ... | @@ -428,12 +429,19 @@ public class ObserveMainUIInitializer { |
| 428 | 429 |
ui.getRootPane().getActionMap().put(ChangeFocusGlobalUIAction.ACTION_NAME, action);
|
| 429 | 430 |
ui.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(action.getAcceleratorKey(), ChangeFocusGlobalUIAction.ACTION_NAME);
|
| 430 | 431 |
|
| 432 |
+ NavigationTreeConfigBean config = ui.getNavigationUI().getTreeModel().getConfig();
|
|
| 433 |
+ |
|
| 431 | 434 |
ObserveSeineEditModel seineEditModel = ObserveSwingApplicationContext.get().getNavigationEdit().getSeine();
|
| 432 |
- seineEditModel.addPropertyChangeListener(ObserveSeineEditModel.PROPERTY_ENABLED, e -> updateNavigationSeine((Boolean) e.getNewValue()));
|
|
| 435 |
+ seineEditModel.addPropertyChangeListener(ObserveSeineEditModel.PROPERTY_ENABLED, e -> updateNavigationSeine(config.isShowSeineTrip() && Objects.equals(Boolean.TRUE, e.getNewValue())));
|
|
| 436 |
+ config.addPropertyChangeListener(NavigationTreeConfigBean.SHOW_SEINE_TRIP, e -> updateNavigationSeine(seineEditModel.isEnabled() && Objects.equals(Boolean.TRUE, e.getNewValue())));
|
|
| 437 |
+ |
|
| 433 | 438 |
ObserveLonglineEditModel longlineEditModel = ObserveSwingApplicationContext.get().getNavigationEdit().getLongline();
|
| 434 |
- longlineEditModel.addPropertyChangeListener(ObserveLonglineEditModel.PROPERTY_ENABLED, e -> updateNavigationLongline((Boolean) e.getNewValue()));
|
|
| 435 |
- ui.getNavigationUI().getTreeModel().getConfig().addPropertyChangeListener("showReferential", e -> updateReferentialNavigation((Boolean) e.getNewValue()));
|
|
| 436 |
- updateReferentialNavigation(ui.getNavigationUI().getTreeModel().getConfig().isShowReferential());
|
|
| 439 |
+ longlineEditModel.addPropertyChangeListener(ObserveLonglineEditModel.PROPERTY_ENABLED, e -> updateNavigationLongline(config.isShowLonglineTrip() && Objects.equals(Boolean.TRUE, e.getNewValue())));
|
|
| 440 |
+ config.addPropertyChangeListener(NavigationTreeConfigBean.SHOW_LONGLINE_TRIP, e -> updateNavigationLongline(longlineEditModel.isEnabled() && Objects.equals(Boolean.TRUE, e.getNewValue())));
|
|
| 441 |
+ |
|
| 442 |
+ config.addPropertyChangeListener(NavigationTreeConfigBean.SHOW_REFERENTIAL, e -> updateReferentialNavigation((Boolean) e.getNewValue()));
|
|
| 443 |
+ updateReferentialNavigation(config.isShowReferential());
|
|
| 444 |
+ |
|
| 437 | 445 |
}
|
| 438 | 446 |
|
| 439 | 447 |
private void updateReferentialNavigation(Boolean newValue) {
|
| ... | ... | @@ -41,7 +41,7 @@ public class SelectLonglineLandingAction extends SelectEditDataAction { |
| 41 | 41 |
(int) 'F',
|
| 42 | 42 |
t("observe.common.TripLonglineLandingDto.action.goToOpen.short"),
|
| 43 | 43 |
t("observe.common.TripLonglineLandingDto.action.goToOpen.tip"),
|
| 44 |
- "navigation.data.longline.LandingLongline");
|
|
| 44 |
+ "navigation.data.ll.landing.LandingLongline");
|
|
| 45 | 45 |
}
|
| 46 | 46 |
|
| 47 | 47 |
}
|
| ... | ... | @@ -41,7 +41,7 @@ public class SelectLonglineLogbookActivityAction extends SelectEditDataAction { |
| 41 | 41 |
(int) 'D',
|
| 42 | 42 |
t("observe.common.ActivityLogbookDto.action.goToOpen.short"),
|
| 43 | 43 |
t("observe.common.ActivityLogbookDto.action.goToOpen.tip"),
|
| 44 |
- "navigation.data.longline.ActivityLonglineLogbook");
|
|
| 44 |
+ "navigation.data.ll.logbook.ActivityLonglineLogbook");
|
|
| 45 | 45 |
}
|
| 46 | 46 |
|
| 47 | 47 |
}
|
| ... | ... | @@ -41,7 +41,7 @@ public class SelectLonglineLogbookSampleAction extends SelectEditDataAction { |
| 41 | 41 |
(int) 'E',
|
| 42 | 42 |
t("observe.common.TripLonglineSampleLogbookDto.action.goToOpen.short"),
|
| 43 | 43 |
t("observe.common.TripLonglineSampleLogbookDto.action.goToOpen.tip"),
|
| 44 |
- "navigation.data.longline.SampleLogbook");
|
|
| 44 |
+ "navigation.data.ll.logbook.SampleLogbook");
|
|
| 45 | 45 |
}
|
| 46 | 46 |
|
| 47 | 47 |
}
|
| ... | ... | @@ -41,7 +41,7 @@ public class SelectLonglineObsActivityAction extends SelectEditDataAction { |
| 41 | 41 |
(int) 'C',
|
| 42 | 42 |
t("observe.common.ActivityObsDto.action.goToOpen.short"),
|
| 43 | 43 |
t("observe.common.ActivityObsDto.action.goToOpen.tip"),
|
| 44 |
- "navigation.data.longline.ActivityLonglineObs");
|
|
| 44 |
+ "navigation.data.ll.observation.ActivityLonglineObs");
|
|
| 45 | 45 |
}
|
| 46 | 46 |
|
| 47 | 47 |
}
|
| ... | ... | @@ -39,6 +39,6 @@ public class SelectLonglineProgramAction extends SelectEditDataAction { |
| 39 | 39 |
super(mainUI, ObserveLonglineProgramEditNode.class, (int) 'A',
|
| 40 | 40 |
t("observe.common.ProgramDto.action.goToOpen.short"),
|
| 41 | 41 |
t("observe.common.ProgramDto.action.goToOpen.tip"),
|
| 42 |
- "navigation.referential.Program");
|
|
| 42 |
+ "navigation.referential.common.Program");
|
|
| 43 | 43 |
}
|
| 44 | 44 |
}
|
| ... | ... | @@ -41,7 +41,7 @@ public class SelectLonglineTripAction extends SelectEditDataAction { |
| 41 | 41 |
(int) 'B',
|
| 42 | 42 |
t("observe.common.TripDto.action.goToOpen.short"),
|
| 43 | 43 |
t("observe.common.TripDto.action.goToOpen.tip"),
|
| 44 |
- "navigation.data.longline.TripLongline");
|
|
| 44 |
+ "navigation.data.ll.common.TripLongline");
|
|
| 45 | 45 |
}
|
| 46 | 46 |
|
| 47 | 47 |
}
|
| ... | ... | @@ -41,7 +41,7 @@ public class SelectSeineActivityAction extends SelectEditDataAction { |
| 41 | 41 |
(int) 'D',
|
| 42 | 42 |
t("observe.common.ActivityDto.action.goToOpen.short"),
|
| 43 | 43 |
t("observe.common.ActivityDto.action.goToOpen.tip"),
|
| 44 |
- "navigation.data.seine.ActivitySeine");
|
|
| 44 |
+ "navigation.data.ps.observation.ActivitySeine");
|
|
| 45 | 45 |
}
|
| 46 | 46 |
|
| 47 | 47 |
}
|
| ... | ... | @@ -41,6 +41,6 @@ public class SelectSeineProgramAction extends SelectEditDataAction { |
| 41 | 41 |
(int) 'A',
|
| 42 | 42 |
t("observe.common.ProgramDto.action.goToOpen.short"),
|
| 43 | 43 |
t("observe.common.ProgramDto.action.goToOpen.tip"),
|
| 44 |
- "navigation.referential.Program");
|
|
| 44 |
+ "navigation.referential.common.Program");
|
|
| 45 | 45 |
}
|
| 46 | 46 |
}
|
| ... | ... | @@ -41,6 +41,6 @@ public class SelectSeineRouteAction extends SelectEditDataAction { |
| 41 | 41 |
(int) 'C',
|
| 42 | 42 |
t("observe.common.RouteDto.action.goToOpen.short"),
|
| 43 | 43 |
t("observe.common.RouteDto.action.goToOpen.tip"),
|
| 44 |
- "navigation.data.seine.Route");
|
|
| 44 |
+ "navigation.data.ps.observation.Route");
|
|
| 45 | 45 |
}
|
| 46 | 46 |
}
|
| ... | ... | @@ -41,7 +41,7 @@ public class SelectSeineTripAction extends SelectEditDataAction { |
| 41 | 41 |
(int) 'B',
|
| 42 | 42 |
t("observe.common.TripDto.action.goToOpen.short"),
|
| 43 | 43 |
t("observe.common.TripDto.action.goToOpen.tip"),
|
| 44 |
- "navigation.data.seine.TripSeine");
|
|
| 44 |
+ "navigation.data.ps.common.TripSeine");
|
|
| 45 | 45 |
}
|
| 46 | 46 |
|
| 47 | 47 |
}
|