Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
eab2fdac
by Tony Chemit at 2024-09-05T12:48:01+02:00
-
efb846a1
by Tony Chemit at 2024-09-05T12:48:28+02:00
-
0c970bb0
by Tony Chemit at 2024-09-05T12:48:59+02:00
-
c9a055b7
by Tony Chemit at 2024-09-05T12:49:04+02:00
15 changed files:
- client/configuration/src/main/config/Client.ini
- client/configuration/src/main/i18n/getters/config.getter
- client/configuration/src/main/i18n/getters/java.getter
- − client/configuration/src/main/java/fr/ird/observe/client/ObServeSwingSessionConfig.java
- − client/configuration/src/main/java/fr/ird/observe/client/ObserveSwingSession.java
- client/configuration/src/main/java/fr/ird/observe/client/configuration/ClientConfig.java
- client/configuration/src/main/java/fr/ird/observe/client/configuration/ClientResources.java
- client/core/src/main/java/fr/ird/observe/client/ClientUIContext.java
- client/core/src/main/java/fr/ird/observe/client/main/body/ClientConfigUI.java
- client/core/src/main/java/fr/ird/observe/client/util/session/ObserveSwingSessionHelper.java
- − client/core/src/main/resources/observe-swing-preferences.properties
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/ContentUIInitializer.java
- client/runner/src/main/i18n/translations/client-runner_en_GB.properties
- client/runner/src/main/i18n/translations/client-runner_es_ES.properties
- client/runner/src/main/i18n/translations/client-runner_fr_FR.properties
Changes:
| ... | ... | @@ -395,14 +395,6 @@ defaultValue = ${instance.resources.directory}/config/ObserveSwingSession.ui.xml |
| 395 | 395 | final = true
|
| 396 | 396 | transient = true
|
| 397 | 397 | |
| 398 | -[option swingPreferencesFile]
|
|
| 399 | -description = observe.config.swingPreferencesFile.description
|
|
| 400 | -key = instance.swingPreferencesFile
|
|
| 401 | -type = file
|
|
| 402 | -defaultValue = ${instance.resources.directory}/config/observe-swing-preferences.properties
|
|
| 403 | -final = true
|
|
| 404 | -transient = true
|
|
| 405 | - |
|
| 406 | 398 | [option temporaryDirectory]
|
| 407 | 399 | description = observe.config.temporaryDirectory.description
|
| 408 | 400 | key = instance.temporary.directory
|
| ... | ... | @@ -118,7 +118,6 @@ observe.config.speciesList.seine.observation.objectObservedSpecies |
| 118 | 118 | observe.config.speciesList.seine.observation.objectSchoolEstimate
|
| 119 | 119 | observe.config.speciesList.seine.observation.schoolEstimate
|
| 120 | 120 | observe.config.speciesList.seine.sample
|
| 121 | -observe.config.swingPreferencesFile.description
|
|
| 122 | 121 | observe.config.swingSessionFile.description
|
| 123 | 122 | observe.config.temperature.format
|
| 124 | 123 | observe.config.temporaryDirectory.description
|
| ... | ... | @@ -3,7 +3,6 @@ observe.init.no.local.db.detected |
| 3 | 3 | observe.runner.copy.default.dcp.file
|
| 4 | 4 | observe.runner.copy.default.map.file
|
| 5 | 5 | observe.runner.copy.default.report.file
|
| 6 | -observe.runner.copy.default.swing.preferences.file
|
|
| 7 | 6 | observe.runner.copy.default.ui.file
|
| 8 | 7 | observe.runner.copy.embedded.keystore.file
|
| 9 | 8 | observe.runner.loading.ui.configuration
|
| 1 | -package fr.ird.observe.client;
|
|
| 2 | - |
|
| 3 | -/*-
|
|
| 4 | - * #%L
|
|
| 5 | - * ObServe Client :: Configuration
|
|
| 6 | - * %%
|
|
| 7 | - * Copyright (C) 2008 - 2023 IRD, Ultreia.io
|
|
| 8 | - * %%
|
|
| 9 | - * This program is free software: you can redistribute it and/or modify
|
|
| 10 | - * it under the terms of the GNU General Public License as
|
|
| 11 | - * published by the Free Software Foundation, either version 3 of the
|
|
| 12 | - * License, or (at your option) any later version.
|
|
| 13 | - *
|
|
| 14 | - * This program is distributed in the hope that it will be useful,
|
|
| 15 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 | - * GNU General Public License for more details.
|
|
| 18 | - *
|
|
| 19 | - * You should have received a copy of the GNU General Public
|
|
| 20 | - * License along with this program. If not, see
|
|
| 21 | - * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 | - * #L%
|
|
| 23 | - */
|
|
| 24 | - |
|
| 25 | -import java.io.File;
|
|
| 26 | - |
|
| 27 | -public interface ObServeSwingSessionConfig {
|
|
| 28 | - |
|
| 29 | - File getSwingSessionFile();
|
|
| 30 | - File getSwingPreferencesFile();
|
|
| 31 | -} |
| 1 | -package fr.ird.observe.client;
|
|
| 2 | - |
|
| 3 | -/*-
|
|
| 4 | - * #%L
|
|
| 5 | - * ObServe Client :: Configuration
|
|
| 6 | - * %%
|
|
| 7 | - * Copyright (C) 2008 - 2023 IRD, Ultreia.io
|
|
| 8 | - * %%
|
|
| 9 | - * This program is free software: you can redistribute it and/or modify
|
|
| 10 | - * it under the terms of the GNU General Public License as
|
|
| 11 | - * published by the Free Software Foundation, either version 3 of the
|
|
| 12 | - * License, or (at your option) any later version.
|
|
| 13 | - *
|
|
| 14 | - * This program is distributed in the hope that it will be useful,
|
|
| 15 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 | - * GNU General Public License for more details.
|
|
| 18 | - *
|
|
| 19 | - * You should have received a copy of the GNU General Public
|
|
| 20 | - * License along with this program. If not, see
|
|
| 21 | - * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 | - * #L%
|
|
| 23 | - */
|
|
| 24 | - |
|
| 25 | -import io.ultreia.java4all.jaxx.widgets.combobox.FilterableComboBox;
|
|
| 26 | -import io.ultreia.java4all.jaxx.widgets.combobox.session.FilterableComboBoxState;
|
|
| 27 | -import io.ultreia.java4all.jaxx.widgets.length.nautical.NauticalLengthEditor;
|
|
| 28 | -import io.ultreia.java4all.jaxx.widgets.length.nautical.session.NauticalLengthEditorState;
|
|
| 29 | -import io.ultreia.java4all.jaxx.widgets.list.DoubleList;
|
|
| 30 | -import io.ultreia.java4all.jaxx.widgets.list.ListHeader;
|
|
| 31 | -import io.ultreia.java4all.jaxx.widgets.list.session.DoubleListState;
|
|
| 32 | -import io.ultreia.java4all.jaxx.widgets.list.session.ListHeaderState;
|
|
| 33 | -import io.ultreia.java4all.util.SortedProperties;
|
|
| 34 | -import org.nuiton.jaxx.runtime.swing.session.State;
|
|
| 35 | -import org.nuiton.jaxx.runtime.swing.session.SwingSession;
|
|
| 36 | -import org.nuiton.jaxx.widgets.gis.absolute.CoordinatesEditor;
|
|
| 37 | -import org.nuiton.jaxx.widgets.gis.absolute.session.CoordinatesEditorState;
|
|
| 38 | -import org.nuiton.jaxx.widgets.temperature.TemperatureEditor;
|
|
| 39 | -import org.nuiton.jaxx.widgets.temperature.session.TemperatureEditorState;
|
|
| 40 | - |
|
| 41 | -import java.io.BufferedReader;
|
|
| 42 | -import java.io.File;
|
|
| 43 | -import java.io.IOException;
|
|
| 44 | -import java.nio.charset.StandardCharsets;
|
|
| 45 | -import java.nio.file.Files;
|
|
| 46 | -import java.util.Map;
|
|
| 47 | -import java.util.Properties;
|
|
| 48 | - |
|
| 49 | -/**
|
|
| 50 | - * Extends SwingSession with
|
|
| 51 | - * Created on 07/07/2022.
|
|
| 52 | - *
|
|
| 53 | - * @author Tony Chemit - dev@tchemit.fr
|
|
| 54 | - * @since 9.0.7
|
|
| 55 | - */
|
|
| 56 | -public class ObserveSwingSession extends SwingSession {
|
|
| 57 | - |
|
| 58 | - private final File preferencesFile;
|
|
| 59 | - |
|
| 60 | - private final Properties preferences;
|
|
| 61 | - |
|
| 62 | - public ObserveSwingSession(File file, boolean autoSave, File preferencesFile) {
|
|
| 63 | - super(file, autoSave, Map.of(FilterableComboBox.class, new FilterableComboBoxState(),
|
|
| 64 | - DoubleList.class, new DoubleListState(),
|
|
| 65 | - ListHeader.class, new ListHeaderState(),
|
|
| 66 | - TemperatureEditor.class, new TemperatureEditorState(),
|
|
| 67 | - NauticalLengthEditor.class, new NauticalLengthEditorState(),
|
|
| 68 | - CoordinatesEditor.class, new CoordinatesEditorState()
|
|
| 69 | - ));
|
|
| 70 | - this.preferencesFile = preferencesFile;
|
|
| 71 | - this.preferences = new SortedProperties();
|
|
| 72 | - loadPreferences(preferencesFile);
|
|
| 73 | - }
|
|
| 74 | - |
|
| 75 | - public ObserveSwingSession(File file, boolean autoSave, Map<Class, State> additionalStates, File preferencesFile) {
|
|
| 76 | - super(file, autoSave, additionalStates);
|
|
| 77 | - this.preferencesFile = preferencesFile;
|
|
| 78 | - this.preferences = new SortedProperties();
|
|
| 79 | - loadPreferences(preferencesFile);
|
|
| 80 | - }
|
|
| 81 | - |
|
| 82 | - public File getPreferencesFile() {
|
|
| 83 | - return preferencesFile;
|
|
| 84 | - }
|
|
| 85 | - |
|
| 86 | - public Properties getPreferences() {
|
|
| 87 | - return preferences;
|
|
| 88 | - }
|
|
| 89 | - |
|
| 90 | - private void loadPreferences(File preferencesFile) {
|
|
| 91 | - if (preferencesFile.exists()) {
|
|
| 92 | - try (BufferedReader reader = Files.newBufferedReader(preferencesFile.toPath(), StandardCharsets.UTF_8)) {
|
|
| 93 | - preferences.load(reader);
|
|
| 94 | - } catch (IOException e) {
|
|
| 95 | - throw new RuntimeException(String.format("Could not load preferences file at %s", preferencesFile), e);
|
|
| 96 | - }
|
|
| 97 | - }
|
|
| 98 | - }
|
|
| 99 | - |
|
| 100 | -} |
| ... | ... | @@ -24,7 +24,6 @@ package fr.ird.observe.client.configuration; |
| 24 | 24 | import com.google.common.io.MoreFiles;
|
| 25 | 25 | import com.google.common.io.RecursiveDeleteOption;
|
| 26 | 26 | import com.google.gson.Gson;
|
| 27 | -import fr.ird.observe.client.ObServeSwingSessionConfig;
|
|
| 28 | 27 | import fr.ird.observe.consolidation.data.ps.dcp.SimplifiedObjectTypeSpecializedRules;
|
| 29 | 28 | import fr.ird.observe.datasource.configuration.DataSourceConnectMode;
|
| 30 | 29 | import fr.ird.observe.datasource.configuration.DataSourceCreateMode;
|
| ... | ... | @@ -121,10 +120,10 @@ import static org.nuiton.jaxx.runtime.swing.SwingUtil.ICON_PREFIX; |
| 121 | 120 | * @author Tony Chemit - dev@tchemit.fr
|
| 122 | 121 | * @since 1.0
|
| 123 | 122 | */
|
| 124 | -@GenerateApplicationComponent(name = "ObServe client config", hints = {TripMapConfig.class, TemplateGeneratorConfig.class, ObServeSwingSessionConfig.class, CleanTemporaryFilesTaskConfiguration.class}, instantiateStrategy = ApplicationComponentInstantiateStrategy.SUPPLIER, instantiateSupplier = ClientConfigFinder.class)
|
|
| 123 | +@GenerateApplicationComponent(name = "ObServe client config", hints = {TripMapConfig.class, TemplateGeneratorConfig.class, CleanTemporaryFilesTaskConfiguration.class}, instantiateStrategy = ApplicationComponentInstantiateStrategy.SUPPLIER, instantiateSupplier = ClientConfigFinder.class)
|
|
| 125 | 124 | @GenerateTemplate(template = "about.ftl")
|
| 126 | 125 | @GenerateJavaBeanDefinition
|
| 127 | -public class ClientConfig extends GeneratedClientConfig implements TripMapConfig, TemplateGeneratorConfig, JavaBean, ObServeSwingSessionConfig, CleanTemporaryFilesTaskConfiguration {
|
|
| 126 | +public class ClientConfig extends GeneratedClientConfig implements TripMapConfig, TemplateGeneratorConfig, JavaBean, CleanTemporaryFilesTaskConfiguration {
|
|
| 128 | 127 | |
| 129 | 128 | public static final String DB_NAME = "obstuna";
|
| 130 | 129 | public static final List<ClientConfigOption> MAP_LAYERS = List.of(ClientConfigOption.MAP_LAYER1, ClientConfigOption.MAP_LAYER2, ClientConfigOption.MAP_LAYER3, ClientConfigOption.MAP_LAYER4, ClientConfigOption.MAP_LAYER5, ClientConfigOption.MAP_LAYER6, ClientConfigOption.MAP_LAYER7, ClientConfigOption.MAP_LAYER8, ClientConfigOption.MAP_LAYER9, ClientConfigOption.MAP_LAYER10);
|
| ... | ... | @@ -392,7 +391,6 @@ public class ClientConfig extends GeneratedClientConfig implements TripMapConfig |
| 392 | 391 | |
| 393 | 392 | File resourcesDirectory = createDirectory(ClientConfigOption.RESOURCES_DIRECTORY);
|
| 394 | 393 | log.debug("user resource data directory : {}", resourcesDirectory);
|
| 395 | - createParentDirectory(ClientConfigOption.SWING_PREFERENCES_FILE);
|
|
| 396 | 394 | |
| 397 | 395 | // 5 - resources report
|
| 398 | 396 | |
| ... | ... | @@ -452,18 +450,10 @@ public class ClientConfig extends GeneratedClientConfig implements TripMapConfig |
| 452 | 450 | ClientResources.dcp.copyResource(dcpFile);
|
| 453 | 451 | }
|
| 454 | 452 | |
| 455 | - // 10 - swing preferences
|
|
| 456 | - File preferencesFile = getSwingPreferencesFile();
|
|
| 457 | - if (versionSnapshot || !preferencesFile.exists()) {
|
|
| 458 | - String message = t("observe.runner.copy.default.swing.preferences.file", preferencesFile);
|
|
| 459 | - log.info(message);
|
|
| 460 | - ClientResources.ObserveSwingPreferences.copyResource(preferencesFile);
|
|
| 461 | - }
|
|
| 462 | - |
|
| 463 | - // 11 - export directory
|
|
| 453 | + // 10 - export directory
|
|
| 464 | 454 | createDirectory(ClientConfigOption.EXPORT_DIRECTORY);
|
| 465 | 455 | |
| 466 | - // 12 - Add custom keystore (See https://gitlab.com/ultreiaio/ird-observe/-/issues/2791)
|
|
| 456 | + // 11 - Add custom keystore (See https://gitlab.com/ultreiaio/ird-observe/-/issues/2791)
|
|
| 467 | 457 | |
| 468 | 458 | Path keystore = resourcesDirectory.toPath().resolve("observe.jks");
|
| 469 | 459 | if (Files.notExists(keystore)) {
|
| ... | ... | @@ -33,7 +33,6 @@ import io.ultreia.java4all.config.ConfigResource; |
| 33 | 33 | */
|
| 34 | 34 | public final class ClientResources {
|
| 35 | 35 | public static final ConfigResource CONFIG = new ConfigResource("/META-INF/configuration/observe-client.conf");
|
| 36 | - public static final ConfigResource ObserveSwingPreferences = new ConfigResource("/observe-swing-preferences.properties");
|
|
| 37 | 36 | public static final ConfigResource ui = new ConfigResource("/observe-ui.properties");
|
| 38 | 37 | public static final ConfigResource ui_navigation_common = new ConfigResource("/observe-ui-navigation-common.properties");
|
| 39 | 38 | public static final ConfigResource ui_navigation_ps = new ConfigResource("/observe-ui-navigation-ps.properties");
|
| ... | ... | @@ -85,7 +85,7 @@ public class ClientUIContext implements Closeable, ClientUIContextApi { |
| 85 | 85 | public ClientUIContext(ClientConfig clientConfig) {
|
| 86 | 86 | ClientConfig.initDecoratorService(clientConfig.getReferentialLocale());
|
| 87 | 87 | this.clientConfig = clientConfig;
|
| 88 | - this.observeSwingSessionHelper = new ObserveSwingSessionHelper(clientConfig);
|
|
| 88 | + this.observeSwingSessionHelper = new ObserveSwingSessionHelper(clientConfig.getSwingSessionFile());
|
|
| 89 | 89 | this.floatingObjectPresetsManager = clientConfig.newFloatingObjectPresetsManager();
|
| 90 | 90 | this.serviceFactory = new ObserveServiceMainFactory();
|
| 91 | 91 | this.editModel = new Project();
|
| ... | ... | @@ -431,7 +431,6 @@ public class ClientConfigUI extends JXTitledPanel implements WithClientUIContext |
| 431 | 431 | helper.addOption(ClientConfigOption.RESOURCES_DIRECTORY);
|
| 432 | 432 | helper.addOption(ClientConfigOption.AVDTH_DIRECTORY);
|
| 433 | 433 | helper.addOption(ClientConfigOption.SWING_SESSION_FILE);
|
| 434 | - helper.addOption(ClientConfigOption.SWING_PREFERENCES_FILE);
|
|
| 435 | 434 | helper.addOption(ClientConfigOption.SIMPLIFIED_OBJECT_TYPE_SPECIALIZED_RULES_FILE);
|
| 436 | 435 | |
| 437 | 436 | helper.addOption(ClientConfigOption.H2_LOGIN);
|
| ... | ... | @@ -22,21 +22,28 @@ package fr.ird.observe.client.util.session; |
| 22 | 22 | * #L%
|
| 23 | 23 | */
|
| 24 | 24 | |
| 25 | -import fr.ird.observe.client.ObServeSwingSessionConfig;
|
|
| 26 | -import fr.ird.observe.client.ObserveSwingSession;
|
|
| 27 | 25 | import io.ultreia.java4all.jaxx.widgets.combobox.FilterableComboBox;
|
| 26 | +import io.ultreia.java4all.jaxx.widgets.combobox.session.FilterableComboBoxState;
|
|
| 27 | +import io.ultreia.java4all.jaxx.widgets.length.nautical.NauticalLengthEditor;
|
|
| 28 | +import io.ultreia.java4all.jaxx.widgets.length.nautical.session.NauticalLengthEditorState;
|
|
| 28 | 29 | import io.ultreia.java4all.jaxx.widgets.list.DoubleList;
|
| 29 | 30 | import io.ultreia.java4all.jaxx.widgets.list.ListHeader;
|
| 31 | +import io.ultreia.java4all.jaxx.widgets.list.session.DoubleListState;
|
|
| 32 | +import io.ultreia.java4all.jaxx.widgets.list.session.ListHeaderState;
|
|
| 30 | 33 | import org.apache.logging.log4j.LogManager;
|
| 31 | 34 | import org.apache.logging.log4j.Logger;
|
| 32 | -import org.nuiton.jaxx.runtime.JAXXObject;
|
|
| 35 | +import org.nuiton.jaxx.runtime.swing.session.SwingSession;
|
|
| 36 | +import org.nuiton.jaxx.widgets.gis.absolute.CoordinatesEditor;
|
|
| 37 | +import org.nuiton.jaxx.widgets.gis.absolute.session.CoordinatesEditorState;
|
|
| 38 | +import org.nuiton.jaxx.widgets.temperature.TemperatureEditor;
|
|
| 39 | +import org.nuiton.jaxx.widgets.temperature.session.TemperatureEditorState;
|
|
| 33 | 40 | |
| 34 | -import javax.swing.JComponent;
|
|
| 35 | 41 | import java.awt.Component;
|
| 36 | 42 | import java.io.Closeable;
|
| 43 | +import java.io.File;
|
|
| 37 | 44 | import java.io.IOException;
|
| 38 | 45 | import java.nio.file.Files;
|
| 39 | -import java.util.function.Consumer;
|
|
| 46 | +import java.util.Map;
|
|
| 40 | 47 | |
| 41 | 48 | /**
|
| 42 | 49 | * Created on 07/11/16.
|
| ... | ... | @@ -48,16 +55,21 @@ public class ObserveSwingSessionHelper implements Closeable { |
| 48 | 55 | |
| 49 | 56 | private static final Logger log = LogManager.getLogger(ObserveSwingSessionHelper.class);
|
| 50 | 57 | |
| 51 | - private final ObserveSwingSession session;
|
|
| 58 | + private final SwingSession session;
|
|
| 52 | 59 | |
| 53 | - public ObserveSwingSessionHelper(ObServeSwingSessionConfig file) {
|
|
| 60 | + public ObserveSwingSessionHelper(File file) {
|
|
| 54 | 61 | //FIXME Add additional states (auto detect from JaxxUIResourcesProvider ?)
|
| 55 | - session = new ObserveSwingSession(file.getSwingSessionFile(), false, file.getSwingPreferencesFile());/*, Map.of(
|
|
| 56 | - FilterableComboBox.class, new FilterableComboBoxState()
|
|
| 57 | - ));*/
|
|
| 62 | + session = new SwingSession(file,
|
|
| 63 | + false,
|
|
| 64 | + Map.of(FilterableComboBox.class, new FilterableComboBoxState(),
|
|
| 65 | + DoubleList.class, new DoubleListState(),
|
|
| 66 | + ListHeader.class, new ListHeaderState(),
|
|
| 67 | + TemperatureEditor.class, new TemperatureEditorState(),
|
|
| 68 | + NauticalLengthEditor.class, new NauticalLengthEditorState(),
|
|
| 69 | + CoordinatesEditor.class, new CoordinatesEditorState()));
|
|
| 58 | 70 | }
|
| 59 | 71 | |
| 60 | - public ObserveSwingSession getSession() {
|
|
| 72 | + public SwingSession getSession() {
|
|
| 61 | 73 | return session;
|
| 62 | 74 | }
|
| 63 | 75 | |
| ... | ... | @@ -65,10 +77,6 @@ public class ObserveSwingSessionHelper implements Closeable { |
| 65 | 77 | session.add(c, replace);
|
| 66 | 78 | }
|
| 67 | 79 | |
| 68 | - public void removeComponent(Component c) {
|
|
| 69 | - session.remove(c);
|
|
| 70 | - }
|
|
| 71 | - |
|
| 72 | 80 | public void save() {
|
| 73 | 81 | try {
|
| 74 | 82 | if (Files.notExists(session.getFile().toPath())) {
|
| ... | ... | @@ -80,33 +88,8 @@ public class ObserveSwingSessionHelper implements Closeable { |
| 80 | 88 | }
|
| 81 | 89 | }
|
| 82 | 90 | |
| 83 | - public void initComboBox(JAXXObject ui, FilterableComboBox<?> editor) {
|
|
| 84 | - initDecorator(ui, editor, editor::setIndex, editor.getModel()::setReverseSort);
|
|
| 85 | - }
|
|
| 86 | - |
|
| 87 | - public void initListHeader(JAXXObject ui, ListHeader<?> editor) {
|
|
| 88 | - initDecorator(ui, editor, editor::setIndex, editor::setReverseSort);
|
|
| 89 | - }
|
|
| 90 | - |
|
| 91 | - public void initDoubleList(JAXXObject ui, DoubleList<?> editor) {
|
|
| 92 | - initDecorator(ui, editor, editor::setIndex, editor::setReverseSort);
|
|
| 93 | - }
|
|
| 94 | - |
|
| 95 | 91 | @Override
|
| 96 | 92 | public void close() {
|
| 97 | 93 | save();
|
| 98 | 94 | }
|
| 99 | - |
|
| 100 | - |
|
| 101 | - private void initDecorator(JAXXObject ui, JComponent editor, Consumer<Integer> indexSetter, Consumer<Boolean> orderSetter) {
|
|
| 102 | - String key = ui.getClass().getName() + "." + editor.getName() + ".sort.";
|
|
| 103 | - int index = Integer.parseInt(session.getPreferences().getProperty(key + "index", "0"));
|
|
| 104 | - boolean reverseOrder = Boolean.parseBoolean(session.getPreferences().getProperty(key + "order", "false"));
|
|
| 105 | - if (index != 0) {
|
|
| 106 | - indexSetter.accept(index);
|
|
| 107 | - }
|
|
| 108 | - if (reverseOrder) {
|
|
| 109 | - orderSetter.accept(true);
|
|
| 110 | - }
|
|
| 111 | - }
|
|
| 112 | 95 | } |
| 1 | -###
|
|
| 2 | -# #%L
|
|
| 3 | -# ObServe Client :: Core
|
|
| 4 | -# %%
|
|
| 5 | -# Copyright (C) 2008 - 2023 IRD, Ultreia.io
|
|
| 6 | -# %%
|
|
| 7 | -# This program is free software: you can redistribute it and/or modify
|
|
| 8 | -# it under the terms of the GNU General Public License as
|
|
| 9 | -# published by the Free Software Foundation, either version 3 of the
|
|
| 10 | -# License, or (at your option) any later version.
|
|
| 11 | -#
|
|
| 12 | -# This program is distributed in the hope that it will be useful,
|
|
| 13 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 14 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 15 | -# GNU General Public License for more details.
|
|
| 16 | -#
|
|
| 17 | -# You should have received a copy of the GNU General Public
|
|
| 18 | -# License along with this program. If not, see
|
|
| 19 | -# <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 20 | -# #L%
|
|
| 21 | -###
|
|
| 22 | -fr.ird.observe.client.datasource.editor.ll.data.observation.SetCatchUI.section.sort.index=1
|
|
| 23 | -fr.ird.observe.client.datasource.editor.ll.data.observation.SetCatchUI.basket.sort.index=1
|
|
| 24 | -fr.ird.observe.client.datasource.editor.ll.data.observation.SetCatchUI.branchline.sort.index=1
|
|
| 25 | -fr.ird.observe.client.datasource.editor.ps.data.logbook.FloatingObjectUI.vessel1.sort.index=1
|
|
| 26 | -fr.ird.observe.client.datasource.editor.ps.data.logbook.FloatingObjectUI.vessel2.sort.index=1
|
|
| 27 | -fr.ird.observe.client.datasource.editor.ps.data.logbook.FloatingObjectUI.country1.sort.index=1
|
|
| 28 | -fr.ird.observe.client.datasource.editor.ps.data.logbook.FloatingObjectUI.country2.sort.index=1
|
|
| 29 | -fr.ird.observe.client.datasource.editor.ps.data.observation.FloatingObjectUI.vessel1.sort.index=1
|
|
| 30 | -fr.ird.observe.client.datasource.editor.ps.data.observation.FloatingObjectUI.vessel2.sort.index=1
|
|
| 31 | -fr.ird.observe.client.datasource.editor.ps.data.observation.FloatingObjectUI.country1.sort.index=1
|
|
| 32 | -fr.ird.observe.client.datasource.editor.ps.data.observation.FloatingObjectUI.country2.sort.index=1
|
|
| 33 | - |
| ... | ... | @@ -329,7 +329,6 @@ public class ContentUIInitializer<UI extends ContentUI> extends UIInitializerSup |
| 329 | 329 | } else {
|
| 330 | 330 | prepareDataFilterableComboBox(referenceType, editor);
|
| 331 | 331 | }
|
| 332 | - getObserveSwingSessionHelper().initComboBox(ui, editor);
|
|
| 333 | 332 | }
|
| 334 | 333 | |
| 335 | 334 | @SuppressWarnings({"unchecked", "rawtypes"})
|
| ... | ... | @@ -343,7 +342,6 @@ public class ContentUIInitializer<UI extends ContentUI> extends UIInitializerSup |
| 343 | 342 | } else {
|
| 344 | 343 | prepareDataEntityList(referenceType, (ListHeader) editor);
|
| 345 | 344 | }
|
| 346 | - getObserveSwingSessionHelper().initListHeader(ui, editor);
|
|
| 347 | 345 | }
|
| 348 | 346 | |
| 349 | 347 | public void addDecoratorClassifier(ListHeader<?> editor) {
|
| ... | ... | @@ -363,7 +361,6 @@ public class ContentUIInitializer<UI extends ContentUI> extends UIInitializerSup |
| 363 | 361 | } else {
|
| 364 | 362 | prepareDataDoubleList(referenceType, editor);
|
| 365 | 363 | }
|
| 366 | - getObserveSwingSessionHelper().initDoubleList(ui, editor);
|
|
| 367 | 364 | }
|
| 368 | 365 | |
| 369 | 366 | protected void init(TimeEditor editor) {
|
| ... | ... | @@ -135,7 +135,6 @@ observe.config.speciesList.seine.observation.objectObservedSpecies=Species for o |
| 135 | 135 | observe.config.speciesList.seine.observation.objectSchoolEstimate=Species for object school estimates
|
| 136 | 136 | observe.config.speciesList.seine.observation.schoolEstimate=Species for school estimates
|
| 137 | 137 | observe.config.speciesList.seine.sample=Species for sample
|
| 138 | -observe.config.swingPreferencesFile.description=Swing preferences file.
|
|
| 139 | 138 | observe.config.swingSessionFile.description=Swing session file.
|
| 140 | 139 | observe.config.temperature.format=Default temperature unit
|
| 141 | 140 | observe.config.temporaryDirectory.description=Default temporary directory used by application and clean at each launch.
|
| ... | ... | @@ -135,7 +135,6 @@ observe.config.speciesList.seine.observation.objectObservedSpecies=Especies que |
| 135 | 135 | observe.config.speciesList.seine.observation.objectSchoolEstimate=Especies para las estimaciones de banco objeto
|
| 136 | 136 | observe.config.speciesList.seine.observation.schoolEstimate=Especies para las estimaciones
|
| 137 | 137 | observe.config.speciesList.seine.sample=Species for sample \#TODO
|
| 138 | -observe.config.swingPreferencesFile.description=Swing preferences file.
|
|
| 139 | 138 | observe.config.swingSessionFile.description=Copia de seguridad del estado del UI.
|
| 140 | 139 | observe.config.temperature.format=Unidad de temperatura
|
| 141 | 140 | observe.config.temporaryDirectory.description=Directorio temporal por defecto
|
| ... | ... | @@ -135,7 +135,6 @@ observe.config.speciesList.seine.observation.objectObservedSpecies=Espèces pour |
| 135 | 135 | observe.config.speciesList.seine.observation.objectSchoolEstimate=Espèces pour les estimations banc objet
|
| 136 | 136 | observe.config.speciesList.seine.observation.schoolEstimate=Espèces pour les estimations
|
| 137 | 137 | observe.config.speciesList.seine.sample=Espèces pour l'échantillonnage au port
|
| 138 | -observe.config.swingPreferencesFile.description=Fichier de sauvegarde des préférences des UI.
|
|
| 139 | 138 | observe.config.swingSessionFile.description=Fichier de sauvegarde des états des UI.
|
| 140 | 139 | observe.config.temperature.format=Unité de température
|
| 141 | 140 | observe.config.temporaryDirectory.description=Le répertoire temporaire par défaut
|