diff --git a/observation-manager/deepsky-extension/pom.xml b/observation-manager/deepsky-extension/pom.xml
index c50af2b6..308bacb3 100644
--- a/observation-manager/deepsky-extension/pom.xml
+++ b/observation-manager/deepsky-extension/pom.xml
@@ -4,7 +4,7 @@
observation-manager
de.lehmannet.om
- 1.6.0-RC6
+ 1.6.0-RC7
de.lehmannet.om
diff --git a/observation-manager/imager-extension/pom.xml b/observation-manager/imager-extension/pom.xml
index 5116e8a7..08abbdc3 100644
--- a/observation-manager/imager-extension/pom.xml
+++ b/observation-manager/imager-extension/pom.xml
@@ -4,7 +4,7 @@
observation-manager
de.lehmannet.om
- 1.6.0-RC6
+ 1.6.0-RC7
de.lehmannet.om
diff --git a/observation-manager/observation-manager-api/pom.xml b/observation-manager/observation-manager-api/pom.xml
index d7ec9528..d9114ed9 100644
--- a/observation-manager/observation-manager-api/pom.xml
+++ b/observation-manager/observation-manager-api/pom.xml
@@ -5,7 +5,7 @@
observation-manager
de.lehmannet.om
- 1.6.0-RC6
+ 1.6.0-RC7
de.lehmannet.om
diff --git a/observation-manager/observation-manager-api/src/main/java/de/lehmannet/om/ui/box/SessionBox.java b/observation-manager/observation-manager-api/src/main/java/de/lehmannet/om/ui/box/SessionBox.java
index 15a20f35..92143170 100644
--- a/observation-manager/observation-manager-api/src/main/java/de/lehmannet/om/ui/box/SessionBox.java
+++ b/observation-manager/observation-manager-api/src/main/java/de/lehmannet/om/ui/box/SessionBox.java
@@ -47,8 +47,8 @@ protected String getKey(ISchemaElement element) {
ISession session = (ISession) element;
- return dateManager.zonedDateTimeToStringWithHour(session.getBegin()) + " - "
- + dateManager.zonedDateTimeToStringWithHour(session.getEnd());
+ return dateManager.offsetDateTimeToStringWithHour(session.getBegin()) + " - "
+ + dateManager.offsetDateTimeToStringWithHour(session.getEnd());
}
diff --git a/observation-manager/observation-manager-api/src/main/java/de/lehmannet/om/ui/comparator/ObservationComparator.java b/observation-manager/observation-manager-api/src/main/java/de/lehmannet/om/ui/comparator/ObservationComparator.java
index b1c37652..63c4973b 100644
--- a/observation-manager/observation-manager-api/src/main/java/de/lehmannet/om/ui/comparator/ObservationComparator.java
+++ b/observation-manager/observation-manager-api/src/main/java/de/lehmannet/om/ui/comparator/ObservationComparator.java
@@ -7,7 +7,7 @@
package de.lehmannet.om.ui.comparator;
-import java.time.ZonedDateTime;
+import java.time.OffsetDateTime;
import java.util.Comparator;
import de.lehmannet.om.IObservation;
@@ -42,16 +42,16 @@ public int compare(IObservation o1, IObservation o2) {
ob1 = (IObservation) o2;
}
- ZonedDateTime ob1B = ob1.getBegin();
- ZonedDateTime ob2B = ob2.getBegin();
+ OffsetDateTime ob1B = ob1.getBegin();
+ OffsetDateTime ob2B = ob2.getBegin();
if (ob1B.isBefore(ob2B)) {
return -1;
} else if (ob1B.isAfter(ob2B)) {
return 1;
} else if (ob1B.equals(ob2B)) { // Same start date. Try to check end date
- ZonedDateTime ob1E = ob1.getEnd();
- ZonedDateTime ob2E = ob2.getEnd();
+ OffsetDateTime ob1E = ob1.getEnd();
+ OffsetDateTime ob2E = ob2.getEnd();
if (ob1E != null) {
if (ob2E != null) {
if (ob1E.isBefore(ob2E)) {
diff --git a/observation-manager/observation-manager-api/src/main/java/de/lehmannet/om/ui/comparator/SessionComparator.java b/observation-manager/observation-manager-api/src/main/java/de/lehmannet/om/ui/comparator/SessionComparator.java
index 7987547a..f69f8f9a 100644
--- a/observation-manager/observation-manager-api/src/main/java/de/lehmannet/om/ui/comparator/SessionComparator.java
+++ b/observation-manager/observation-manager-api/src/main/java/de/lehmannet/om/ui/comparator/SessionComparator.java
@@ -7,7 +7,7 @@
package de.lehmannet.om.ui.comparator;
-import java.time.ZonedDateTime;
+import java.time.OffsetDateTime;
import java.util.Comparator;
import de.lehmannet.om.ISession;
@@ -39,8 +39,8 @@ public int compare(ISession o1, ISession o2) {
s1 = (ISession) o2;
}
- ZonedDateTime s1Begin = s1.getBegin();
- ZonedDateTime s2Begin = s2.getBegin();
+ OffsetDateTime s1Begin = s1.getBegin();
+ OffsetDateTime s2Begin = s2.getBegin();
if (s1Begin.isBefore(s2Begin)) {
return -1;
diff --git a/observation-manager/observation-manager-api/src/main/java/de/lehmannet/om/ui/container/MoonDetailContainer.java b/observation-manager/observation-manager-api/src/main/java/de/lehmannet/om/ui/container/MoonDetailContainer.java
index 4a0b2f83..f66e2505 100644
--- a/observation-manager/observation-manager-api/src/main/java/de/lehmannet/om/ui/container/MoonDetailContainer.java
+++ b/observation-manager/observation-manager-api/src/main/java/de/lehmannet/om/ui/container/MoonDetailContainer.java
@@ -9,7 +9,6 @@
import java.awt.Image;
import java.awt.Toolkit;
-import java.io.File;
import java.net.URL;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
@@ -45,8 +44,7 @@ public class MoonDetailContainer extends JLabel {
private IObservation observation = null;
- private transient final ImageResolver moonImages = new ImageClassLoaderResolverImpl(
- "images" + File.separator + "moon");
+ private transient final ImageResolver moonImages = new ImageClassLoaderResolverImpl("images/moon");
public MoonDetailContainer(IObservation obs) {
@@ -70,7 +68,7 @@ private void setImage() {
return;
}
- ZonedDateTime date = this.observation.getBegin();
+ ZonedDateTime date = this.observation.getBegin().toZonedDateTime();
String path = "";
if (Ephemerides.isMoonAboveHorizon(date, site.getLongitude().toDegree(), site.getLatitude().toDegree())) {
diff --git a/observation-manager/observation-manager-api/src/main/java/de/lehmannet/om/ui/util/DatePicker.java b/observation-manager/observation-manager-api/src/main/java/de/lehmannet/om/ui/util/DatePicker.java
index 588bfb32..dab358b7 100644
--- a/observation-manager/observation-manager-api/src/main/java/de/lehmannet/om/ui/util/DatePicker.java
+++ b/observation-manager/observation-manager-api/src/main/java/de/lehmannet/om/ui/util/DatePicker.java
@@ -15,10 +15,10 @@
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.time.LocalDateTime;
-import java.time.ZonedDateTime;
import java.time.YearMonth;
import java.time.ZoneId;
import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
import java.util.Calendar;
import java.util.Locale;
import java.util.ResourceBundle;
@@ -42,7 +42,7 @@ public class DatePicker extends JDialog {
private final ResourceBundle bundle = LocaleToolsFactory.appInstance().getBundle("ObservationManager",
Locale.getDefault());
- private final JButton[] fields = new JButton[37];
+ private final JButton[] fields = new JButton[38];
private final DateManager dateManager;
private JLabel monthYearLabel = null;
@@ -100,6 +100,9 @@ private void createDatePicker(String title, ZonedDateTime date, TimeZone timeZon
this.timeZone = timeZone;
this.date = date;
+ this.day = date.getDayOfMonth();
+ this.month = date.getMonthValue();
+ this.year = date.getYear();
this.initDialog();
this.setDates();
diff --git a/observation-manager/observation-manager-app/pom.xml b/observation-manager/observation-manager-app/pom.xml
index 5042d417..bb0aa6e5 100644
--- a/observation-manager/observation-manager-app/pom.xml
+++ b/observation-manager/observation-manager-app/pom.xml
@@ -8,7 +8,7 @@
observation-manager
de.lehmannet.om
- 1.6.0-RC6
+ 1.6.0-RC7
1.3
diff --git a/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/navigation/TableView.java b/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/navigation/TableView.java
index 9f067d60..6c85a5a1 100644
--- a/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/navigation/TableView.java
+++ b/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/navigation/TableView.java
@@ -17,6 +17,7 @@
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.time.LocalDateTime;
+import java.time.OffsetDateTime;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.Arrays;
@@ -32,6 +33,7 @@
import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;
@@ -153,71 +155,95 @@ public TableView(ObservationManager om, ObservationManagerModel omModel, TextMan
this.scrollTable = new JScrollPane(this.table);
this.add(scrollTable);
- this.table.setDefaultRenderer(Angle.class, (table, value, isSelected, hasFocus, row, column) -> {
+ this.table.setDefaultRenderer(Angle.class, angleRenderer());
+ this.table.setDefaultRenderer(Float.class, floatRenderer());
+ this.table.setDefaultRenderer(Integer.class, integerRenderer());
+ this.table.setDefaultRenderer(LocalDateTime.class, localDateTimeRenderer());
+ this.table.setDefaultRenderer(ZonedDateTime.class, zonedDateTimeRenderer());
+ this.table.setDefaultRenderer(OffsetDateTime.class, offsetDateTimeRenderer());
+ this.table.setDefaultRenderer(SchemaElement.class, schemaElementRenderer());
+ this.table.setDefaultRenderer(Object.class, objectRenderer());
- DefaultTableCellRenderer cr = new DefaultTableCellRenderer();
- if (value != null) {
- String result = null;
- Angle angle = (Angle) value;
- DecimalFormat df = new DecimalFormat("0.00");
- DecimalFormatSymbols dfs = new DecimalFormatSymbols();
- dfs.setDecimalSeparator('.');
- df.setDecimalFormatSymbols(dfs);
- result = df.format(angle.getValue()) + " " + angle.getUnit();
- cr.setText(result);
- }
- if (isSelected) {
- cr.setBackground(Color.LIGHT_GRAY);
+ MouseListener ml = new MouseAdapter() {
+ @Override
+ public void mousePressed(MouseEvent e) {
+ if (e.getButton() == MouseEvent.BUTTON3) {
+ int x = e.getX();
+ int y = e.getY();
+
+ // Convert coordinates
+ MouseEvent c = SwingUtilities.convertMouseEvent(TableView.this.table, e,
+ TableView.this.observationManager);
+ Point p = new Point(c.getX(), c.getY());
+
+ int row = TableView.this.table.getSelectedRow();
+ if (TableView.this.sorter.isSorting()) {
+ row = TableView.this.sorter.modelIndex(row);
+ }
+
+ ISchemaElement element = ((AbstractSchemaTableModel) (TableView.this.table.getModel()))
+ .getSchemaElement(row);
+
+ if (element != null) {
+ byte options = (byte) (PopupMenuHandler.EDIT + PopupMenuHandler.CREATE_HTML
+ + PopupMenuHandler.CREATE_XML + PopupMenuHandler.DELETE
+ + PopupMenuHandler.CREATE_NEW_OBSERVATION + PopupMenuHandler.EXTENSIONS);
+
+ new PopupMenuHandler(TableView.this.observationManager, TableView.this.model,
+ TableView.this.textManager, element, p.x, p.y, options, SchemaElementConstants.NONE,
+ TableView.this.observationManager.getExtensionLoader().getPopupMenus(),
+ TableView.this.cache);
+ }
+ }
}
+ };
+ this.table.addMouseListener(ml);
- return cr;
- });
- this.table.setDefaultRenderer(Float.class, (table, value, isSelected, hasFocus, row, column) -> {
+ // Load table column settings
+ this.loadSettings();
+ }
+
+ private TableCellRenderer objectRenderer() {
+ return (table, value, isSelected, hasFocus, row, column) -> {
DefaultTableCellRenderer cr = new DefaultTableCellRenderer();
if (value != null) {
-
- Float f = (Float) value;
- if (Float.isNaN(f)) {
- cr.setText("");
- } else {
- String result = null;
- DecimalFormat df = new DecimalFormat("0.00");
- DecimalFormatSymbols dfs = new DecimalFormatSymbols();
- dfs.setDecimalSeparator('.');
- df.setDecimalFormatSymbols(dfs);
- result = df.format(f.floatValue());
- cr.setText(result);
- }
+ cr.setText(value.toString());
}
if (isSelected) {
cr.setBackground(Color.LIGHT_GRAY);
}
return cr;
- });
- this.table.setDefaultRenderer(Integer.class, (table, value, isSelected, hasFocus, row, column) -> {
+ };
+ }
+ private TableCellRenderer schemaElementRenderer() {
+ return (table, value, isSelected, hasFocus, row, column) -> {
DefaultTableCellRenderer cr = new DefaultTableCellRenderer();
if (value != null) {
- Integer i = (Integer) value;
- cr.setText("" + i);
+ if (value instanceof ISchemaElement) {
+ ISchemaElement se = (ISchemaElement) value;
+ cr.setText(se.getDisplayName());
+ }
}
if (isSelected) {
cr.setBackground(Color.LIGHT_GRAY);
}
return cr;
- });
+ };
+ }
- this.table.setDefaultRenderer(LocalDateTime.class, (table, value, isSelected, hasFocus, row, column) -> {
+ private TableCellRenderer offsetDateTimeRenderer() {
+ return (table, value, isSelected, hasFocus, row, column) -> {
DefaultTableCellRenderer cr = new DefaultTableCellRenderer();
if (value != null) {
- if (value instanceof LocalDateTime) {
- final LocalDateTime cal = (LocalDateTime) value;
+ if (value instanceof OffsetDateTime) {
+ final OffsetDateTime cal = (OffsetDateTime) value;
cr.setText(this.observationManager.getDateManager()
- .zonedDateTimeToStringWithHour(ZonedDateTime.of(cal, ZonedDateTime.now().getOffset())));
+ .zonedDateTimeToStringWithHour(cal.toZonedDateTime()));
} else {
LOGGER.warn("Bad data {}", value.getClass(), value);
}
@@ -228,9 +254,11 @@ public TableView(ObservationManager om, ObservationManagerModel omModel, TextMan
}
return cr;
- });
+ };
+ }
- this.table.setDefaultRenderer(ZonedDateTime.class, (table, value, isSelected, hasFocus, row, column) -> {
+ private TableCellRenderer zonedDateTimeRenderer() {
+ return (table, value, isSelected, hasFocus, row, column) -> {
DefaultTableCellRenderer cr = new DefaultTableCellRenderer();
if (value != null) {
@@ -247,72 +275,94 @@ public TableView(ObservationManager om, ObservationManagerModel omModel, TextMan
}
return cr;
- });
+ };
+ }
- this.table.setDefaultRenderer(SchemaElement.class, (table, value, isSelected, hasFocus, row, column) -> {
+ private TableCellRenderer localDateTimeRenderer() {
+ return (table, value, isSelected, hasFocus, row, column) -> {
DefaultTableCellRenderer cr = new DefaultTableCellRenderer();
if (value != null) {
- if (value instanceof ISchemaElement) {
- ISchemaElement se = (ISchemaElement) value;
- cr.setText(se.getDisplayName());
+
+ if (value instanceof LocalDateTime) {
+ final LocalDateTime cal = (LocalDateTime) value;
+ cr.setText(this.observationManager.getDateManager()
+ .zonedDateTimeToStringWithHour(ZonedDateTime.of(cal, ZonedDateTime.now().getOffset())));
+ } else {
+ LOGGER.warn("Bad data {}", value.getClass(), value);
}
}
+
if (isSelected) {
cr.setBackground(Color.LIGHT_GRAY);
}
return cr;
- });
- this.table.setDefaultRenderer(Object.class, (table, value, isSelected, hasFocus, row, column) -> {
+ };
+ }
+
+ private TableCellRenderer integerRenderer() {
+ return (table, value, isSelected, hasFocus, row, column) -> {
+
DefaultTableCellRenderer cr = new DefaultTableCellRenderer();
if (value != null) {
- cr.setText(value.toString());
+ Integer i = (Integer) value;
+ cr.setText("" + i);
}
if (isSelected) {
cr.setBackground(Color.LIGHT_GRAY);
}
return cr;
- });
+ };
+ }
- MouseListener ml = new MouseAdapter() {
- @Override
- public void mousePressed(MouseEvent e) {
- if (e.getButton() == MouseEvent.BUTTON3) {
- int x = e.getX();
- int y = e.getY();
+ private TableCellRenderer angleRenderer() {
+ return (table, value, isSelected, hasFocus, row, column) -> {
- // Convert coordinates
- MouseEvent c = SwingUtilities.convertMouseEvent(TableView.this.table, e,
- TableView.this.observationManager);
- Point p = new Point(c.getX(), c.getY());
+ DefaultTableCellRenderer cr = new DefaultTableCellRenderer();
+ if (value != null) {
+ String result = null;
+ Angle angle = (Angle) value;
+ DecimalFormat df = new DecimalFormat("0.00");
+ DecimalFormatSymbols dfs = new DecimalFormatSymbols();
+ dfs.setDecimalSeparator('.');
+ df.setDecimalFormatSymbols(dfs);
+ result = df.format(angle.getValue()) + " " + angle.getUnit();
+ cr.setText(result);
+ }
+ if (isSelected) {
+ cr.setBackground(Color.LIGHT_GRAY);
+ }
- int row = TableView.this.table.getSelectedRow();
- if (TableView.this.sorter.isSorting()) {
- row = TableView.this.sorter.modelIndex(row);
- }
+ return cr;
+ };
+ }
- ISchemaElement element = ((AbstractSchemaTableModel) (TableView.this.table.getModel()))
- .getSchemaElement(row);
+ private TableCellRenderer floatRenderer() {
+ return (table, value, isSelected, hasFocus, row, column) -> {
- if (element != null) {
- byte options = (byte) (PopupMenuHandler.EDIT + PopupMenuHandler.CREATE_HTML
- + PopupMenuHandler.CREATE_XML + PopupMenuHandler.DELETE
- + PopupMenuHandler.CREATE_NEW_OBSERVATION + PopupMenuHandler.EXTENSIONS);
+ DefaultTableCellRenderer cr = new DefaultTableCellRenderer();
+ if (value != null) {
- new PopupMenuHandler(TableView.this.observationManager, TableView.this.model,
- TableView.this.textManager, element, p.x, p.y, options, SchemaElementConstants.NONE,
- TableView.this.observationManager.getExtensionLoader().getPopupMenus(),
- TableView.this.cache);
- }
+ Float f = (Float) value;
+ if (Float.isNaN(f)) {
+ cr.setText("");
+ } else {
+ String result = null;
+ DecimalFormat df = new DecimalFormat("0.00");
+ DecimalFormatSymbols dfs = new DecimalFormatSymbols();
+ dfs.setDecimalSeparator('.');
+ df.setDecimalFormatSymbols(dfs);
+ result = df.format(f.floatValue());
+ cr.setText(result);
}
}
- };
- this.table.addMouseListener(ml);
-
- // Load table column settings
- this.loadSettings();
+ if (isSelected) {
+ cr.setBackground(Color.LIGHT_GRAY);
+ }
+ return cr;
+ };
}
public void showObservations(IObservation selected, ISchemaElement parentElement) {
diff --git a/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/navigation/tableModel/ObservationTableModel.java b/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/navigation/tableModel/ObservationTableModel.java
index a838435b..bfa3922e 100644
--- a/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/navigation/tableModel/ObservationTableModel.java
+++ b/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/navigation/tableModel/ObservationTableModel.java
@@ -7,6 +7,7 @@
package de.lehmannet.om.ui.navigation.tableModel;
+import java.time.OffsetDateTime;
import java.time.ZonedDateTime;
import de.lehmannet.om.IObservation;
@@ -106,7 +107,7 @@ public Class> getColumnClass(int columnIndex) {
switch (columnIndex) {
case 0: {
- c = ZonedDateTime.class;
+ c = OffsetDateTime.class;
break;
}
case 1: {
diff --git a/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/navigation/tableModel/SessionTableModel.java b/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/navigation/tableModel/SessionTableModel.java
index 9350e7bc..df275fe6 100644
--- a/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/navigation/tableModel/SessionTableModel.java
+++ b/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/navigation/tableModel/SessionTableModel.java
@@ -7,6 +7,7 @@
package de.lehmannet.om.ui.navigation.tableModel;
+import java.time.OffsetDateTime;
import java.time.ZonedDateTime;
import java.util.Iterator;
@@ -62,7 +63,7 @@ public Class> getColumnClass(int columnIndex) {
switch (columnIndex) {
case 0:
case 1: {
- c = ZonedDateTime.class;
+ c = OffsetDateTime.class;
break;
}
case 2: {
diff --git a/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/panel/ObservationDialogPanel.java b/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/panel/ObservationDialogPanel.java
index a510439e..9af45f60 100644
--- a/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/panel/ObservationDialogPanel.java
+++ b/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/panel/ObservationDialogPanel.java
@@ -19,16 +19,15 @@
import java.io.File;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
-import java.time.ZonedDateTime;
+import java.time.OffsetDateTime;
import java.time.ZoneId;
-import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
import java.time.temporal.ChronoUnit;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.ResourceBundle;
-import java.util.SimpleTimeZone;
import java.util.TimeZone;
import javax.swing.JButton;
@@ -150,6 +149,7 @@ public class ObservationDialogPanel extends AbstractPanel implements ActionListe
private JTextField begin = null;
private ZonedDateTime beginDate = null;
+ private OffsetDateTime offSetBeginDate = null;
private JButton beginPicker = null;
private TimeContainer beginTime = null;
private JButton beginNow = null;
@@ -170,6 +170,8 @@ public class ObservationDialogPanel extends AbstractPanel implements ActionListe
private final TextManager textManager;
private final UIDataCache cache;
+ private OffsetDateTime offSetEndDate;
+
// Requires ObservationManager for instancating all dialoges
// Receives (non-persistent) cache in order to preset some UI values with recent
// values
@@ -340,14 +342,10 @@ public ISchemaElement updateSchemaElement() {
}
}
- // ZoneOffset offset = this.beginDate.getOffset();
- // @formatter:off
- this.beginDate = ZonedDateTime.of(this.beginDate.getYear(), this.beginDate.getMonthValue(),
- this.beginDate.getDayOfMonth(), this.beginTime.getHour(), this.beginTime.getMinutes(),
- this.beginTime.getSeconds(), 0, ZoneId.systemDefault());
- // @formatter:on
+ this.beginDate = createDateTimeInUTC(this.beginDate, this.beginTime);
+ this.offSetBeginDate = this.beginDate.withZoneSameInstant(ZoneId.of("UTC")).toOffsetDateTime();
- this.observation.setBegin(this.beginDate);
+ this.observation.setBegin(this.offSetBeginDate);
this.cache.putDate(ObservationDialogPanel.CACHEKEY_STARTDATE, this.beginDate); // Fill cache
// Set optional fields
@@ -357,18 +355,15 @@ public ISchemaElement updateSchemaElement() {
this.cache.remove(ObservationDialogPanel.CACHEKEY_ENDDATE); // Reset cache
if (this.endDate != null) {
- // @formatter:off
- this.endDate = ZonedDateTime.of(this.endDate.getYear(), this.endDate.getMonthValue(),
- this.endDate.getDayOfMonth(), this.endTime.getHour(), this.endTime.getMinutes(),
- this.endTime.getSeconds(), 0, ZoneId.systemDefault());
- // @formatter:on
+ this.endDate = createDateTimeInUTC(this.endDate, this.endTime);
+ this.offSetEndDate = this.endDate.withZoneSameInstant(ZoneId.of("UTC")).toOffsetDateTime();
if (this.endDate.isBefore(this.beginDate)) {
this.createWarning(AbstractPanel.bundle.getString("panel.observation.warning.endBeforeStart"));
return null;
}
this.cache.putDate(ObservationDialogPanel.CACHEKEY_ENDDATE, this.endDate);
- this.observation.setEnd(this.endDate);
+ this.observation.setEnd(this.offSetEndDate);
} else {
this.observation.setEnd(null);
}
@@ -524,9 +519,7 @@ public ISchemaElement createSchemaElement() {
}
}
- this.beginDate = ZonedDateTime.of(this.beginDate.getYear(), this.beginDate.getMonthValue(),
- this.beginDate.getDayOfMonth(), this.beginTime.getHour(), this.beginTime.getMinutes(),
- this.beginTime.getSeconds(), 0, ZoneId.systemDefault());
+ this.beginDate = createDateTimeInUTC(this.beginDate, this.beginTime);
this.observation = new Observation(this.beginDate, target, observer, finding);
@@ -542,17 +535,14 @@ public ISchemaElement createSchemaElement() {
this.cache.remove(ObservationDialogPanel.CACHEKEY_ENDDATE); // Reset cache
if (this.endDate != null) {
- final ZonedDateTime newEndDate = ZonedDateTime.of(this.endDate.getYear(), this.endDate.getMonthValue(),
- this.endDate.getDayOfMonth(), this.endTime.getHour(), this.endTime.getMinutes(),
- this.endTime.getSeconds(), 0, ZoneId.systemDefault());
-
+ final ZonedDateTime newEndDate = createDateTimeInUTC(this.endDate, this.endTime);
if (newEndDate.isBefore(this.beginDate)) {
this.createWarning(AbstractPanel.bundle.getString("panel.observation.warning.endBeforeStart"));
return null;
}
this.endDate = newEndDate;
- this.observation.setEnd(this.endDate);
+ this.observation.setEnd(this.endDate.withZoneSameInstant(ZoneId.of("UTC")).toOffsetDateTime());
this.cache.putDate(ObservationDialogPanel.CACHEKEY_ENDDATE, this.endDate);
} else {
this.observation.setEnd(null);
@@ -906,7 +896,7 @@ public void itemStateChanged(ItemEvent e) {
}
}
- this.beginDate = session.getBegin();
+ this.beginDate = session.getBegin().toZonedDateTime();
this.begin.setText(this.observationManager.getDateManager().zonedDateTimeToString(beginDate));
this.beginTime.setTime(beginDate.getHour(), beginDate.getMinute(), beginDate.getSecond());
@@ -1071,7 +1061,7 @@ private void loadSchemaElement() {
// Load mandatory stuff
- this.beginDate = this.observation.getBegin().withZoneSameInstant(ZoneId.systemDefault());
+ this.beginDate = this.observation.getBegin().toZonedDateTime().withZoneSameInstant(ZoneId.systemDefault());
this.begin.setText(this.observationManager.getDateManager().zonedDateTimeToString(this.beginDate));
this.beginPicker.setEnabled(this.isEditable());
@@ -1089,7 +1079,9 @@ private void loadSchemaElement() {
this.setFindingPanel(this.observation.getTarget());
// Load optional stuff
- this.endDate = this.observation.getEnd().withZoneSameInstant(ZoneId.systemDefault());
+ if (this.observation.getEnd() != null) {
+ this.endDate = this.observation.getEnd().toZonedDateTime().withZoneSameInstant(ZoneId.systemDefault());
+ }
if (this.endDate != null) {
this.end.setText(this.observationManager.getDateManager().zonedDateTimeToString(this.endDate));
this.endPicker.setEnabled(this.isEditable());
@@ -1997,6 +1989,16 @@ private void fillSeeingBox() {
}
+ private ZonedDateTime createDateTimeInUTC(ZonedDateTime date, TimeContainer timeContainer) {
+
+ ZonedDateTime currentZoneDateTime = ZonedDateTime.of(date.getYear(), date.getMonthValue(), date.getDayOfMonth(),
+ timeContainer.getHour(), timeContainer.getMinutes(), timeContainer.getSeconds(), 0,
+ ZoneId.systemDefault());
+
+ return ZonedDateTime.ofInstant(currentZoneDateTime.toInstant(), ZoneId.of("UTC"));
+
+ }
+
}
class SeeingBoxEntry {
diff --git a/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/panel/ObservationItemPanel.java b/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/panel/ObservationItemPanel.java
index 4e672f9e..3b03aa5b 100644
--- a/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/panel/ObservationItemPanel.java
+++ b/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/panel/ObservationItemPanel.java
@@ -118,7 +118,7 @@ private void loadSchemaElement() {
df.setDecimalFormatSymbols(dfs);
// Load mandatory stuff
- ZonedDateTime begin = observation.getBegin();
+ ZonedDateTime begin = observation.getBegin().toZonedDateTime();
this.begin.setText(this.om.getDateManager().zonedDateTimeToStringWithSeconds(begin));
this.begin.setCaretPosition(0);
this.begin.setToolTipText("JD: " + DateConverter.toJulianDate(begin));
@@ -136,9 +136,10 @@ private void loadSchemaElement() {
// Load optional stuff
if (observation.getEnd() != null) {
- this.end.setText(this.om.getDateManager().zonedDateTimeToStringWithSeconds(observation.getEnd()));
+ this.end.setText(
+ this.om.getDateManager().zonedDateTimeToStringWithSeconds(observation.getEnd().toZonedDateTime()));
this.end.setCaretPosition(0);
- this.end.setToolTipText("JD: " + DateConverter.toJulianDate(observation.getEnd()));
+ this.end.setToolTipText("JD: " + DateConverter.toJulianDate(observation.getEnd().toZonedDateTime()));
}
float fs = observation.getFaintestStar();
@@ -547,13 +548,13 @@ private void createPanel() {
EquPosition pos = this.observation.getTarget().getPosition();
if (pos == null) { // Try to calculate position
pos = Ephemerides.getPosition(Ephemerides.planetKey(this.observation.getTarget().getName()),
- this.observation.getBegin());
+ this.observation.getBegin().toZonedDateTime());
}
if ((pos != null) && (this.observation.getSite() != null)) {
ConstraintsBuilder.buildConstraints(constraints, 7, 6, 1, 2, 1, 1);
constraints.fill = GridBagConstraints.BOTH;
constraints.anchor = GridBagConstraints.EAST;
- HorizontalSkymap skyMap = new HorizontalSkymap(pos, this.observation.getBegin(),
+ HorizontalSkymap skyMap = new HorizontalSkymap(pos, this.observation.getBegin().toZonedDateTime(),
this.observation.getSite());
skyMap.setHorizontalAlignment(SwingConstants.RIGHT);
gridbag.setConstraints(skyMap, constraints);
diff --git a/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/panel/SessionPanel.java b/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/panel/SessionPanel.java
index cc3a579b..bb1fb397 100644
--- a/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/panel/SessionPanel.java
+++ b/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/panel/SessionPanel.java
@@ -169,76 +169,19 @@ public void actionPerformed(ActionEvent e) {
if (source instanceof JButton) {
JButton sourceButton = (JButton) source;
if (sourceButton.equals(this.selectCoObservers)) {
- this.coObsSelector = new SchemaElementSelectorPopup(this.observationManager, this.model,
- AbstractPanel.bundle.getString("dialog.coObserver.title"), null, this.coObserversList, true,
- SchemaElementConstants.OBSERVER);
- List selected = new ArrayList<>();
- if (this.coObsSelector.getAllSelectedElements() != null) {
- selected = new ArrayList<>(this.coObsSelector.getAllSelectedElements()); // Create new list
- // instance,
- // as
- // otherwise the clear()
- // below, will
- // clear selection
- }
- this.coObserversList.clear(); // Remove entries first
- List result = selected.stream().map(x -> {
- return (IObserver) x;
- }).collect(Collectors.toList());
-
- this.fillCoObserverTextField(result);
+ setCoObservers();
} else if (sourceButton.equals(this.beginPicker)) {
- DatePicker dp = null;
- if (this.beginDate != null) {
- dp = new DatePicker(this.observationManager,
- AbstractPanel.bundle.getString("panel.session.datePicker.start"), this.beginDate,
- this.observationManager.getDateManager());
- } else {
- dp = new DatePicker(this.observationManager,
- AbstractPanel.bundle.getString("panel.session.datePicker.start"),
- this.observationManager.getDateManager());
- }
- this.beginDate = dp.getDate().withHour(this.beginTime.getHour()).withMinute(this.beginTime.getMinutes())
- .withSecond(this.beginTime.getSeconds());
- this.begin.setText(this.observationManager.getDateManager().zonedDateTimeToString(this.beginDate));
+ selectBeginDate();
} else if (sourceButton.equals(this.endPicker)) {
- DatePicker dp = null;
- if (this.endDate != null) {
- dp = new DatePicker(this.observationManager,
- AbstractPanel.bundle.getString("panel.session.datePicker.end"), this.endDate,
- this.observationManager.getDateManager());
- } else if (this.beginDate != null) { // Try to initialize endDate Picker with startdate
- dp = new DatePicker(this.observationManager,
- AbstractPanel.bundle.getString("panel.session.datePicker.end"), this.beginDate,
- this.observationManager.getDateManager());
- } else {
- dp = new DatePicker(this.observationManager,
- AbstractPanel.bundle.getString("panel.session.datePicker.end"),
- this.observationManager.getDateManager());
- }
- this.endDate = dp.getDate().withHour(this.beginTime.getHour()).withMinute(this.beginTime.getMinutes())
- .withSecond(this.beginTime.getSeconds());
- this.end.setText(this.observationManager.getDateManager().zonedDateTimeToString(this.endDate));
-
+ selectEndDate();
} else if (source.equals(this.endNow)) {
-
- this.endDate = ZonedDateTime.now();
- this.endTime.setTime(endDate.getHour(), endDate.getMinute(), endDate.getSecond());
- this.end.setText(this.observationManager.getDateManager().zonedDateTimeToString(this.endDate));
+ setEndDateToNow();
} else if (source.equals(this.beginNow)) {
-
- this.beginDate = ZonedDateTime.now();
- this.beginTime.setTime(beginDate.getHour(), beginDate.getMinute(), beginDate.getSecond());
- this.begin.setText(this.observationManager.getDateManager().zonedDateTimeToString(this.beginDate));
+ setBeginDateToNow();
} else if (sourceButton.equals(this.newSite)) {
- SiteDialog dialog = new SiteDialog(this.observationManager, null);
- this.siteBox.addItem(dialog.getSite());
+ setSite();
} else if (sourceButton.equals(this.newCoObservers)) {
- ObserverDialog dialog = new ObserverDialog(this.observationManager, null);
- if (dialog.getObserver() != null) { // Maybe no observer was created
- this.addCoObserverToTextfield(dialog.getObserver().getDisplayName());
- this.coObserversList.add(dialog.getObserver());
- }
+ setObservers();
} else if (sourceButton.equals(this.newImage)) {
this.addNewImages();
}
@@ -246,6 +189,85 @@ public void actionPerformed(ActionEvent e) {
}
+ private void setSite() {
+ SiteDialog dialog = new SiteDialog(this.observationManager, null);
+ this.siteBox.addItem(dialog.getSite());
+ }
+
+ private void setCoObservers() {
+ this.coObsSelector = new SchemaElementSelectorPopup(this.observationManager, this.model,
+ AbstractPanel.bundle.getString("dialog.coObserver.title"), null, this.coObserversList, true,
+ SchemaElementConstants.OBSERVER);
+ List selected = new ArrayList<>();
+ if (this.coObsSelector.getAllSelectedElements() != null) {
+ selected = new ArrayList<>(this.coObsSelector.getAllSelectedElements()); // Create new list
+ // instance,
+ // as
+ // otherwise the clear()
+ // below, will
+ // clear selection
+ }
+ this.coObserversList.clear(); // Remove entries first
+ List result = selected.stream().map(x -> {
+ return (IObserver) x;
+ }).collect(Collectors.toList());
+
+ this.fillCoObserverTextField(result);
+ }
+
+ private void setObservers() {
+ ObserverDialog dialog = new ObserverDialog(this.observationManager, null);
+ if (dialog.getObserver() != null) { // Maybe no observer was created
+ this.addCoObserverToTextfield(dialog.getObserver().getDisplayName());
+ this.coObserversList.add(dialog.getObserver());
+ }
+ }
+
+ private void setBeginDateToNow() {
+ this.beginDate = ZonedDateTime.now();
+ this.beginTime.setTime(beginDate.getHour(), beginDate.getMinute(), beginDate.getSecond());
+ this.begin.setText(this.observationManager.getDateManager().zonedDateTimeToString(this.beginDate));
+ }
+
+ private void setEndDateToNow() {
+ this.endDate = ZonedDateTime.now();
+ this.endTime.setTime(endDate.getHour(), endDate.getMinute(), endDate.getSecond());
+ this.end.setText(this.observationManager.getDateManager().zonedDateTimeToString(this.endDate));
+ }
+
+ private void selectEndDate() {
+ DatePicker dp = null;
+ if (this.endDate != null) {
+ dp = new DatePicker(this.observationManager, AbstractPanel.bundle.getString("panel.session.datePicker.end"),
+ this.endDate, this.observationManager.getDateManager());
+ } else if (this.beginDate != null) { // Try to initialize endDate Picker with startdate
+ dp = new DatePicker(this.observationManager, AbstractPanel.bundle.getString("panel.session.datePicker.end"),
+ this.beginDate, this.observationManager.getDateManager());
+ } else {
+ dp = new DatePicker(this.observationManager, AbstractPanel.bundle.getString("panel.session.datePicker.end"),
+ this.observationManager.getDateManager());
+ }
+ this.endDate = dp.getDate().withHour(this.beginTime.getHour()).withMinute(this.beginTime.getMinutes())
+ .withSecond(this.beginTime.getSeconds());
+ this.end.setText(this.observationManager.getDateManager().zonedDateTimeToString(this.endDate));
+ }
+
+ private void selectBeginDate() {
+ DatePicker dp = null;
+ if (this.beginDate != null) {
+ dp = new DatePicker(this.observationManager,
+ AbstractPanel.bundle.getString("panel.session.datePicker.start"), this.beginDate,
+ this.observationManager.getDateManager());
+ } else {
+ dp = new DatePicker(this.observationManager,
+ AbstractPanel.bundle.getString("panel.session.datePicker.start"),
+ this.observationManager.getDateManager());
+ }
+ this.beginDate = dp.getDate().withHour(this.beginTime.getHour()).withMinute(this.beginTime.getMinutes())
+ .withSecond(this.beginTime.getSeconds());
+ this.begin.setText(this.observationManager.getDateManager().zonedDateTimeToString(this.beginDate));
+ }
+
@Override
public ISchemaElement getSchemaElement() {
@@ -255,13 +277,13 @@ public ISchemaElement getSchemaElement() {
private void loadSchemaElement() {
- this.beginDate = this.session.getBegin().withZoneSameInstant(ZoneId.systemDefault());
+ this.beginDate = this.session.getBegin().toZonedDateTime().withZoneSameInstant(ZoneId.systemDefault());
this.begin.setText(this.observationManager.getDateManager().zonedDateTimeToString(this.beginDate));
this.beginTime.setTime(this.beginDate.getHour(), this.beginDate.getMinute(), this.beginDate.getSecond());
this.beginTime.setEditable(this.isEditable());
- this.endDate = this.session.getEnd().withZoneSameInstant(ZoneId.systemDefault());
+ this.endDate = this.session.getEnd().toZonedDateTime().withZoneSameInstant(ZoneId.systemDefault());
this.end.setText(this.observationManager.getDateManager().zonedDateTimeToString(this.endDate));
this.end.setEditable(this.isEditable());
@@ -331,15 +353,15 @@ public ISchemaElement updateSchemaElement() {
// Set site's timezone (make sure that timezone is set in ms)
this.session.setSite(site);
- this.endDate = this.createZonedDateTime(this.endDate, this.endTime);
- this.beginDate = this.createZonedDateTime(this.beginDate, this.beginTime);
+ this.endDate = this.createDateTimeInUTC(this.endDate, this.endTime);
+ this.beginDate = this.createDateTimeInUTC(this.beginDate, this.beginTime);
if (this.endDate.isBefore(this.beginDate)) {
this.createWarning(AbstractPanel.bundle.getString("panel.session.warning.endBeforeStart"));
return null;
}
- this.session.setEnd(this.endDate);
- this.session.setBegin(this.beginDate);
+ this.session.setEnd(this.endDate.withZoneSameInstant(ZoneId.of("UTC")).toOffsetDateTime());
+ this.session.setBegin(this.beginDate.withZoneSameInstant(ZoneId.of("UTC")).toOffsetDateTime());
// Set optional elements
String weather = this.weather.getText();
@@ -369,10 +391,13 @@ public ISchemaElement updateSchemaElement() {
}
- private ZonedDateTime createZonedDateTime(ZonedDateTime date, TimeContainer timeContainer) {
+ private ZonedDateTime createDateTimeInUTC(ZonedDateTime date, TimeContainer timeContainer) {
+
+ ZonedDateTime currentZoneDateTime = ZonedDateTime.of(date.getYear(), date.getMonthValue(), date.getDayOfMonth(),
+ timeContainer.getHour(), timeContainer.getMinutes(), timeContainer.getSeconds(), 0,
+ ZoneId.systemDefault());
- return ZonedDateTime.of(date.getYear(), date.getMonthValue(), date.getDayOfMonth(), timeContainer.getHour(),
- timeContainer.getMinutes(), timeContainer.getSeconds(), 0, ZoneId.systemDefault());
+ return ZonedDateTime.ofInstant(currentZoneDateTime.toInstant(), ZoneId.of("UTC"));
}
@@ -406,8 +431,8 @@ public ISchemaElement createSchemaElement() {
ISite site = (ISite) this.siteBox.getSelectedSchemaElement();
- this.endDate = createZonedDateTime(endDate, endTime);
- this.beginDate = createZonedDateTime(beginDate, beginTime);
+ this.endDate = createDateTimeInUTC(endDate, endTime);
+ this.beginDate = createDateTimeInUTC(beginDate, beginTime);
if (this.endDate.isBefore(this.beginDate)) {
this.createWarning(AbstractPanel.bundle.getString("panel.session.warning.endBeforeStart"));
@@ -415,7 +440,9 @@ public ISchemaElement createSchemaElement() {
}
// Create session
- this.session = new Session(this.observationManager.getDateManager(), beginDate, endDate, site);
+ this.session = new Session(this.observationManager.getDateManager(),
+ this.beginDate.withZoneSameInstant(ZoneId.of("UTC")).toOffsetDateTime(),
+ this.endDate.withZoneSameInstant(ZoneId.of("UTC")).toOffsetDateTime(), site);
// Set optional elements
String weather = this.weather.getText();
diff --git a/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/statistics/StatisticsDetailsDialog.java b/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/statistics/StatisticsDetailsDialog.java
index 503693a5..47e846ac 100644
--- a/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/statistics/StatisticsDetailsDialog.java
+++ b/observation-manager/observation-manager-app/src/main/java/de/lehmannet/om/ui/statistics/StatisticsDetailsDialog.java
@@ -522,7 +522,7 @@ public DetailPanel(final ObservationManager om, final AbstractSchemaTableModel m
cr.setHorizontalAlignment(SwingConstants.CENTER);
if (value != null) {
final IObservation o = (IObservation) value;
- cr.setText(this.om.getDateManager().zonedDateTimeToStringWithHour(o.getBegin()));
+ cr.setText(this.om.getDateManager().zonedDateTimeToStringWithHour(o.getBegin().toZonedDateTime()));
}
if (isSelected) {
diff --git a/observation-manager/observation-manager-app/src/main/resources/help/hints/de/daylightsaving b/observation-manager/observation-manager-app/src/main/resources/help/hints/de/daylightsaving
deleted file mode 100644
index ba8e891d..00000000
--- a/observation-manager/observation-manager-app/src/main/resources/help/hints/de/daylightsaving
+++ /dev/null
@@ -1,6 +0,0 @@
-Um Sommer und Winterzeiten richtig erfassen zu k\u00f6nnen, sollten Sie
-entweder immer nur eine Zeit nutzen (z.B. alle Angaben vor der Eingabe
-in Winterzeit umrechnen und diesen Wert als Eingabe verwenden)
-oder Sie legen einen Ort zweimal (mit leicht unterschiedlichem Namen) an.
-Einmal mit einem Zeitzonenwert f\u00fcr die Winterzeit und einmal mit einem Zeitzonenwert
-f\u00fcr die Sommerzeit.
diff --git a/observation-manager/observation-manager-app/src/main/resources/help/hints/de/problems b/observation-manager/observation-manager-app/src/main/resources/help/hints/de/problems
index 90b2d6a7..033942d7 100644
--- a/observation-manager/observation-manager-app/src/main/resources/help/hints/de/problems
+++ b/observation-manager/observation-manager-app/src/main/resources/help/hints/de/problems
@@ -1,4 +1,4 @@
Haben Sie ein Problem im Observation Manager gefunden?
Melden Sie den Fehler auf unserer Projekt Seite unter:
-http://sourceforge.net/projects/observation/
-Bugs (Bug Tracking System) -> Submit New
+https://github.com/capape/observation-manager/issues
+New Issue
diff --git a/observation-manager/observation-manager-app/src/main/resources/help/hints/en/daylightsaving b/observation-manager/observation-manager-app/src/main/resources/help/hints/en/daylightsaving
deleted file mode 100644
index 99ecf444..00000000
--- a/observation-manager/observation-manager-app/src/main/resources/help/hints/en/daylightsaving
+++ /dev/null
@@ -1,4 +0,0 @@
-To enter data in a correct daylight saving time format you've two options:
-Use only one format and correct your current time accordingly before you enter
-it into Observation Manager. Or you create two versions of one site. One version with
-a timezone that includes the DST and another one which doesn't.
\ No newline at end of file
diff --git a/observation-manager/observation-manager-app/src/main/resources/help/hints/en/problems b/observation-manager/observation-manager-app/src/main/resources/help/hints/en/problems
index dbf48392..cdac129a 100644
--- a/observation-manager/observation-manager-app/src/main/resources/help/hints/en/problems
+++ b/observation-manager/observation-manager-app/src/main/resources/help/hints/en/problems
@@ -1,4 +1,4 @@
Did you find a problem in Observation Manager?
Report it on our projects website:
-http://sourceforge.net/projects/observation/
-Bugs (Bug Tracking System) -> Submit New
\ No newline at end of file
+https://github.com/capape/observation-manager/issues
+New Issue
\ No newline at end of file
diff --git a/observation-manager/observation-manager-app/src/main/resources/help/hints/es/daylightsaving b/observation-manager/observation-manager-app/src/main/resources/help/hints/es/daylightsaving
deleted file mode 100644
index 0c8f190a..00000000
--- a/observation-manager/observation-manager-app/src/main/resources/help/hints/es/daylightsaving
+++ /dev/null
@@ -1,4 +0,0 @@
-Para introducir una fecha el formato correcto de horario de verano tiene dos opciones.
-Usar un s\u00f3lo formato y corregir su hora actual consecuentemente antes de introducirlo
-en Observation Manager o crear dos versiones de la misma localizaci\u00f3n: una con la
-correcci\u00f3n de horario de verano y la otra sin ella.
diff --git a/observation-manager/observation-manager-app/src/main/resources/help/hints/es/problems b/observation-manager/observation-manager-app/src/main/resources/help/hints/es/problems
index 2f92dd6f..703eb743 100644
--- a/observation-manager/observation-manager-app/src/main/resources/help/hints/es/problems
+++ b/observation-manager/observation-manager-app/src/main/resources/help/hints/es/problems
@@ -1,4 +1,4 @@
\u00bfHa encontrado un problema en Observation Manager?
Inf\u00f3rmenos sobre \u00e9l en la web del proyecto:
-http://sourceforge.net/projects/observation/
-Bugs (Bug Tracking System) -> Submit New
+https://github.com/capape/observation-manager/issues
+New Issue
diff --git a/observation-manager/observation-manager-app/src/main/resources/help/hints/fi/daylightsaving b/observation-manager/observation-manager-app/src/main/resources/help/hints/fi/daylightsaving
deleted file mode 100644
index 1983d870..00000000
--- a/observation-manager/observation-manager-app/src/main/resources/help/hints/fi/daylightsaving
+++ /dev/null
@@ -1,5 +0,0 @@
-Sinulla on kaksi mahdollisuutta k\u00e4ytt\u00e4\u00e4 kes\u00e4aikaa havainnoissasi:
-K\u00e4yt\u00e4 vain yht\u00e4 (normaali) aikaa havainnoissasi ja tee muutos kes\u00e4ajasta
-normaaliin ennen havainnon kirjaamista. Tai luo jokaisesta havaintopaikasta
-kaksi versiota; Yksi normaaliajan versio ja yksi kes\u00e4aikaa k\u00e4ytt\u00e4v\u00e4.
-
diff --git a/observation-manager/observation-manager-app/src/main/resources/help/hints/fi/problems b/observation-manager/observation-manager-app/src/main/resources/help/hints/fi/problems
index 00a9b0ef..98af9b27 100644
--- a/observation-manager/observation-manager-app/src/main/resources/help/hints/fi/problems
+++ b/observation-manager/observation-manager-app/src/main/resources/help/hints/fi/problems
@@ -1,4 +1,4 @@
L\u00f6ysitk\u00f6 ongelman Observation Managerissa?
Raportoi se (englanniksi) projektin web-sivulla:
-http://sourceforge.net/projects/observation/
-Bugs (Bug Tracking System) -> Submit New
+https://github.com/capape/observation-manager/issues
+New Issue
diff --git a/observation-manager/observation-manager-app/src/main/resources/help/hints/fr/daylightsaving b/observation-manager/observation-manager-app/src/main/resources/help/hints/fr/daylightsaving
deleted file mode 100644
index 3c48cd0d..00000000
--- a/observation-manager/observation-manager-app/src/main/resources/help/hints/fr/daylightsaving
+++ /dev/null
@@ -1,4 +0,0 @@
-Afin de saisir vos donn\u00e9es en tenant compte de l'heure d'\u00e9t\u00e9, vous avez deux options:
-utiliser un seul format horaire et corriger votre heure actuelle en cons\u00e9quence avant saisie
-dans Observation Manager. Ou bien vous pouvez cr\u00e9er deux versions d'un m\u00eame site d'observation: une version avec
-un fuseau horaire incluant l'heure d'\u00e9t\u00e9 et l'autre pas.
diff --git a/observation-manager/observation-manager-app/src/main/resources/help/hints/fr/problems b/observation-manager/observation-manager-app/src/main/resources/help/hints/fr/problems
index 0ff415b7..8b7b99fd 100644
--- a/observation-manager/observation-manager-app/src/main/resources/help/hints/fr/problems
+++ b/observation-manager/observation-manager-app/src/main/resources/help/hints/fr/problems
@@ -1,4 +1,4 @@
Avez-vous remarqu\u00e9 un probl\u00e8me dans Observation Manager?
Signalez-le sur notre site:
-http://sourceforge.net/projects/observation/
--> Bugs (Bug Tracking System) -> Submit New .
+https://github.com/capape/observation-manager/issues
+-> New Issue .
diff --git a/observation-manager/observation-manager-app/src/main/resources/help/hints/it/daylightsaving b/observation-manager/observation-manager-app/src/main/resources/help/hints/it/daylightsaving
deleted file mode 100644
index 8c249740..00000000
--- a/observation-manager/observation-manager-app/src/main/resources/help/hints/it/daylightsaving
+++ /dev/null
@@ -1,3 +0,0 @@
-Per introdurre la data con l'ora estiva, hai due possibilit\u00e0:
-usare solo un formato e correggere la tua ora corrente prima di introdurla in Observation Manager.
-Oppure puoi creare due versioni di un sito. Una con la timezone che include il DST e un'altra senza.
diff --git a/observation-manager/observation-manager-app/src/main/resources/help/hints/it/problems b/observation-manager/observation-manager-app/src/main/resources/help/hints/it/problems
index 9b12c7b2..db6ea830 100644
--- a/observation-manager/observation-manager-app/src/main/resources/help/hints/it/problems
+++ b/observation-manager/observation-manager-app/src/main/resources/help/hints/it/problems
@@ -1,4 +1,4 @@
Hai un problema con Observation Manager?
Riportato sul sito del progetto:
-http://sourceforge.net/projects/observation/
-Bugs (Bug Tracking System) -> Submit New
+https://github.com/capape/observation-manager/issues
+New Issue
diff --git a/observation-manager/observation-manager-app/src/main/resources/help/hints/nl/daylightsaving b/observation-manager/observation-manager-app/src/main/resources/help/hints/nl/daylightsaving
deleted file mode 100644
index bc78be7e..00000000
--- a/observation-manager/observation-manager-app/src/main/resources/help/hints/nl/daylightsaving
+++ /dev/null
@@ -1,6 +0,0 @@
-Om gegevens in te voeren met een tijd die correct rekening houdt met de zomertijd
-heb je twee mogelijkheden:
-Gebruik consequent één formaat en corrigeer je tijd steeds voor je hem ingeeft
-in Observation Manager.
-Of maak twee versies van een locatie: de eerste variant met een tijd die de zomertijd
-in rekening brengt, en een tweede zonder deze correctie.
diff --git a/observation-manager/observation-manager-app/src/main/resources/help/hints/nl/problems b/observation-manager/observation-manager-app/src/main/resources/help/hints/nl/problems
index 1d6142f6..11fd73e0 100644
--- a/observation-manager/observation-manager-app/src/main/resources/help/hints/nl/problems
+++ b/observation-manager/observation-manager-app/src/main/resources/help/hints/nl/problems
@@ -1,4 +1,4 @@
Ben je op een probleem gestoten in Observation Manager?
Rapporteer het op de website van ons project:
-http://sourceforge.net/projects/observation/
-Bugs (Bug Tracking System) -> Submit New
\ No newline at end of file
+https://github.com/capape/observation-manager/issues
+New Issue
\ No newline at end of file
diff --git a/observation-manager/observation-manager-app/src/main/resources/help/hints/pl/daylightsaving b/observation-manager/observation-manager-app/src/main/resources/help/hints/pl/daylightsaving
deleted file mode 100644
index ac5ff74d..00000000
--- a/observation-manager/observation-manager-app/src/main/resources/help/hints/pl/daylightsaving
+++ /dev/null
@@ -1 +0,0 @@
-S\u0161 dwie mo\u017cliwo\u009cci wprowadzenia poprawnego czasu letniego. Po pierwsze mo\u017cesz przeliczy\u0107 czas r\u0119cznie i wprowadzi\u0107 od razu poprawn\u0161 warto\u009c\u0107 do programu. Albo mo\u017cesz utworzy\u0107 dwie wersje miejsca obserwacji. Jedno z poprawk\u0161 na czas letni a drugie bez.
diff --git a/observation-manager/observation-manager-app/src/main/resources/help/hints/pl/problems b/observation-manager/observation-manager-app/src/main/resources/help/hints/pl/problems
index 40940a7d..bff3cca1 100644
--- a/observation-manager/observation-manager-app/src/main/resources/help/hints/pl/problems
+++ b/observation-manager/observation-manager-app/src/main/resources/help/hints/pl/problems
@@ -1 +1 @@
-Znalaz\u0142e\u009c b\u0142\u0161d w programie Observation Manager? Zg\u0142o\u009c go na stronie naszego projektu: http://sourceforge.net/projects/observation/ Bugs (Bug Tracking System) -> Submit New
+Znalaz\u0142e\u009c b\u0142\u0161d w programie Observation Manager? Zg\u0142o\u009c go na stronie naszego projektu: https://github.com/capape/observation-manager/issuesBugs (Bug Tracking System) -> Submit New
diff --git a/observation-manager/observation-manager-app/src/main/resources/help/hints/pt_br/daylightsaving b/observation-manager/observation-manager-app/src/main/resources/help/hints/pt_br/daylightsaving
deleted file mode 100644
index 13519972..00000000
--- a/observation-manager/observation-manager-app/src/main/resources/help/hints/pt_br/daylightsaving
+++ /dev/null
@@ -1,3 +0,0 @@
-Para cadastradar datas no formato correto quando em hor\ufffdrio de ver\ufffdo, voc\ufffd tem duas op\ufffd\ufffdes:
-Use apenas o hor\ufffdrio normal ajustando a hora manualmente quando cadastrar as entradas no Observation Manager.
-Ou crie duas "Localiza\ufffd\ufffdes" do mesmo lugar, uma com o fuso normal e uma com o fuso de hor\ufffdrio de ver\ufffdo.
diff --git a/observation-manager/observation-manager-app/src/main/resources/help/hints/pt_br/problems b/observation-manager/observation-manager-app/src/main/resources/help/hints/pt_br/problems
index 3d8b31a0..87b1c63a 100644
--- a/observation-manager/observation-manager-app/src/main/resources/help/hints/pt_br/problems
+++ b/observation-manager/observation-manager-app/src/main/resources/help/hints/pt_br/problems
@@ -1,4 +1,4 @@
Achou algum problema no Observation Manager?
Fa\ufffda o report no website do nosso projeto:
-http://sourceforge.net/projects/observation/
-Bugs (Bug Tracking System) -> Submit New
+https://github.com/capape/observation-manager/issues
+New Issue
diff --git a/observation-manager/observation-manager-app/src/main/resources/help/hints/ru/daylightsaving b/observation-manager/observation-manager-app/src/main/resources/help/hints/ru/daylightsaving
deleted file mode 100644
index 526683b8..00000000
--- a/observation-manager/observation-manager-app/src/main/resources/help/hints/ru/daylightsaving
+++ /dev/null
@@ -1,4 +0,0 @@
-\u0423 \u0432\u0430\u0441 \u0435\u0441\u0442\u044C \u0434\u0432\u0435 \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E\u0441\u0442\u0438 \u0434\u043B\u044F \u0440\u0430\u0431\u043E\u0442\u044B \u0441 \u043B\u0435\u0442\u043D\u0438\u043C \u0432\u0440\u0435\u043C\u0435\u043D\u0435\u043C:
-\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432\u0440\u0435\u043C\u0435\u043D\u0438 (\u0441 \u0443\u0447\u0435\u0442\u043E\u043C \u043B\u0435\u0442\u043D\u0435\u0433\u043E) \u043F\u0440\u0438 \u0432\u0432\u043E\u0434\u0435 \u0434\u0430\u043D\u043D\u044B\u0445 \u0432 "\u041C\u0435\u043D\u0435\u0434\u0436\u0435\u0440 \u043D\u0430\u0431\u043B\u044E\u0434\u0435\u043D\u0438\u0439" \u0438 \u043F\u043E\u0441\u0442\u043E\u044F\u043D\u043D\u043E \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0431\u044F,
-\u0438\u043B\u0438 \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0430 \u043C\u0435\u0441\u0442\u0430 \u043D\u0430\u0431\u043B\u044E\u0434\u0435\u043D\u0438\u0439 \u0434\u043B\u044F \u043A\u0430\u0436\u0434\u043E\u0439 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u043C\u043E\u0439 \u043D\u0430\u0431\u043B\u044E\u0434\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0439 \u043F\u043B\u043E\u0449\u0430\u0434\u043A\u0438.
-\u041F\u0435\u0440\u0432\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442 - \u043A\u043E\u0433\u0434\u0430 \u043B\u0435\u0442\u043D\u0435\u0435 \u0432\u0440\u0435\u043C\u044F \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442\u0441\u044F \u0438 \u0432\u0442\u043E\u0440\u043E\u0439 - \u043A\u043E\u0433\u0434\u0430 \u043D\u0435\u0442.
diff --git a/observation-manager/observation-manager-app/src/main/resources/help/hints/ru/problems b/observation-manager/observation-manager-app/src/main/resources/help/hints/ru/problems
index 7df04871..7c91e6a3 100644
--- a/observation-manager/observation-manager-app/src/main/resources/help/hints/ru/problems
+++ b/observation-manager/observation-manager-app/src/main/resources/help/hints/ru/problems
@@ -1,4 +1,4 @@
\u0412\u044B \u043D\u0430\u0448\u043B\u0438 \u043E\u0448\u0438\u0431\u043A\u0443 \u0432 "\u041C\u0435\u043D\u0435\u0434\u0436\u0435\u0440\u0435 \u043D\u0430\u0431\u043B\u044E\u0434\u0435\u043D\u0438\u0439"?
\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043F\u0440\u0438\u0432\u0435\u0434\u0435\u043D\u043D\u044B\u043C \u0441\u0430\u0439\u0442\u043E\u043C \u0438 \u0441\u043E\u043E\u0431\u0449\u0438\u0442\u0435 \u043E \u043D\u0435\u0439.
-http://sourceforge.net/projects/observation/
-Bugs (Bug Tracking System) -> Submit New
+https://github.com/capape/observation-manager/issues
+New Issue
diff --git a/observation-manager/observation-manager-app/src/main/resources/help/hints/uk/daylightsaving b/observation-manager/observation-manager-app/src/main/resources/help/hints/uk/daylightsaving
deleted file mode 100644
index f3d884f1..00000000
--- a/observation-manager/observation-manager-app/src/main/resources/help/hints/uk/daylightsaving
+++ /dev/null
@@ -1,4 +0,0 @@
-\u0412\u0438 \u043C\u0430\u0454\u0442\u0435 \u0434\u0432\u0456 \u043C\u043E\u0436\u043B\u0438\u0432\u043E\u0441\u0442\u0456 \u0434\u043B\u044F \u0440\u043E\u0431\u043E\u0442\u0438 \u0456\u0437 \u043B\u0456\u0442\u043D\u0456\u043C \u0447\u0430\u0441\u043E\u043C:
-\u0437\u0430\u0441\u0442\u043E\u0441\u043E\u0432\u0443\u0432\u0430\u0442\u0438 \u0434\u0456\u0439\u0441\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0447\u0430\u0441\u0443 \u0431\u0435\u0437\u043F\u043E\u0441\u0435\u0440\u0435\u0434\u043D\u044C\u043E \u043F\u0440\u0438 \u0432\u0432\u043E\u0434\u0456 \u0434\u0430\u043D\u0438\u0445 \u0434\u043E "\u041C\u0435\u043D\u0435\u0434\u0436\u0435\u0440\u0443 \u0441\u043F\u043E\u0441\u0442\u0435\u0440\u0435\u0436\u0435\u043D\u044C" \u0442\u0430 \u043F\u043E\u0441\u0442\u0456\u0439\u043D\u043E \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044E\u0432\u0430\u0442\u0438 \u0441\u0435\u0431\u0435,
-\u0430\u0431\u043E \u0441\u0442\u0432\u043E\u0440\u0438\u0442\u0438 \u0434\u0432\u0430 \u0432\u0430\u0440\u0456\u0430\u043D\u0442\u0438 \u043C\u0456\u0441\u0446\u044F \u0441\u043F\u043E\u0441\u0442\u0435\u0440\u0435\u0436\u0435\u043D\u044C \u0434\u043B\u044F \u043A\u043E\u0436\u043D\u043E\u0457 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u043D\u043E\u0457 \u043F\u043B\u043E\u0449\u0430\u0434\u043A\u0438.
-\u041F\u0435\u0440\u0448\u0438\u0439 \u0432\u0430\u0440\u0456\u0430\u043D\u0442 - \u043A\u043E\u043B\u0438 \u043B\u0456\u0442\u043D\u0456\u0439 \u0447\u0430\u0441 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0454\u0442\u044C\u0441\u044F, \u0430 \u0434\u0440\u0443\u0433\u0438\u0439 - \u043A\u043E\u043B\u0438 \u043D\u0456.
diff --git a/observation-manager/observation-manager-app/src/main/resources/help/hints/uk/problems b/observation-manager/observation-manager-app/src/main/resources/help/hints/uk/problems
index 82c39743..34b592f4 100644
--- a/observation-manager/observation-manager-app/src/main/resources/help/hints/uk/problems
+++ b/observation-manager/observation-manager-app/src/main/resources/help/hints/uk/problems
@@ -1,4 +1,4 @@
\u0412\u0438 \u0437\u043D\u0430\u0439\u0448\u043B\u0438 \u043F\u043E\u043C\u0438\u043B\u043A\u0443 \u0443 "\u041C\u0435\u043D\u0435\u0434\u0436\u0435\u0440\u0456 \u0441\u043F\u043E\u0441\u0442\u0435\u0440\u0435\u0436\u0435\u043D\u044C"?
\u0411\u0443\u0434\u044C \u043B\u0430\u0441\u043A\u0430, \u0441\u043A\u043E\u0440\u0438\u0441\u0442\u0443\u0439\u0442\u0435\u0441\u044F \u043D\u0430\u0432\u0435\u0434\u0435\u043D\u0438\u043C \u0441\u0430\u0439\u0442\u043E\u043C \u0442\u0430 \u0437\u0432\u0456\u0442\u0443\u0439\u0442\u0435 \u043F\u0440\u043E \u043D\u0435\u0457.
-http://sourceforge.net/projects/observation/
-Bugs (Bug Tracking System) -> Submit New
+https://github.com/capape/observation-manager/issues
+New Issue
diff --git a/observation-manager/observation-manager-app/src/test/java/de/lehmannet/om/ui/util/XMLFileLoaderImplTest.java b/observation-manager/observation-manager-app/src/test/java/de/lehmannet/om/ui/util/XMLFileLoaderImplTest.java
index f1c994b4..50e951e3 100644
--- a/observation-manager/observation-manager-app/src/test/java/de/lehmannet/om/ui/util/XMLFileLoaderImplTest.java
+++ b/observation-manager/observation-manager-app/src/test/java/de/lehmannet/om/ui/util/XMLFileLoaderImplTest.java
@@ -6,7 +6,7 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import java.time.ZonedDateTime;
+import java.time.OffsetDateTime;
import org.junit.Before;
import org.junit.Test;
@@ -162,7 +162,7 @@ public void addSchemaElementSession() {
final Site site = new Site("Moon", longitude, latitude, 60);
- final ISchemaElement element = new Session(new DateManagerImpl(), ZonedDateTime.now(), ZonedDateTime.now(),
+ final ISchemaElement element = new Session(new DateManagerImpl(), OffsetDateTime.now(), OffsetDateTime.now(),
site);
emptyNewFile.addSchemaElement(element);
diff --git a/observation-manager/observation-manager-distribution/pom.xml b/observation-manager/observation-manager-distribution/pom.xml
index c6b8800e..af4fab67 100644
--- a/observation-manager/observation-manager-distribution/pom.xml
+++ b/observation-manager/observation-manager-distribution/pom.xml
@@ -7,7 +7,7 @@
observation-manager
de.lehmannet.om
- 1.6.0-RC6
+ 1.6.0-RC7
de.lehmannet.om
diff --git a/observation-manager/observation-planner-api/pom.xml b/observation-manager/observation-planner-api/pom.xml
index f04fb7bf..94314a49 100644
--- a/observation-manager/observation-planner-api/pom.xml
+++ b/observation-manager/observation-planner-api/pom.xml
@@ -8,7 +8,7 @@
observation-manager
de.lehmannet.om
- 1.6.0-RC6
+ 1.6.0-RC7
diff --git a/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/IObservation.java b/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/IObservation.java
index 3f84071c..f8e3486d 100755
--- a/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/IObservation.java
+++ b/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/IObservation.java
@@ -7,11 +7,11 @@
package de.lehmannet.om;
-import org.w3c.dom.Element;
-
-import java.time.ZonedDateTime;
+import java.time.OffsetDateTime;
import java.util.List;
+import org.w3c.dom.Element;
+
/**
* An IObservation describes an astronomical oberservation of exactly one celestial object (target).
* The observation must have one start date to be correct, but does not have to have an end date (as the end date might
@@ -151,7 +151,7 @@ public interface IObservation extends ISchemaElement {
*
* @return The start date of the observation
*/
- ZonedDateTime getBegin();
+ OffsetDateTime getBegin();
/**
* Returns the end date of the observation.
@@ -159,7 +159,7 @@ public interface IObservation extends ISchemaElement {
*
* @return The end date of the observation or null
if no end date was given
*/
- ZonedDateTime getEnd();
+ OffsetDateTime getEnd();
/**
* Returns the accessories used for this observation.
@@ -418,7 +418,7 @@ public interface IObservation extends ISchemaElement {
* @throws IllegalArgumentException
* if new begin date is null
*/
- void setBegin(ZonedDateTime begin) throws IllegalArgumentException;
+ void setBegin(OffsetDateTime begin) throws IllegalArgumentException;
/**
* Sets the end date of the observation.
@@ -427,7 +427,7 @@ public interface IObservation extends ISchemaElement {
* @param end
* The end date of the observation
*/
- void setEnd(ZonedDateTime end);
+ void setEnd(OffsetDateTime end);
/**
* Sets the eyepiece of the observation.
diff --git a/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/ISession.java b/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/ISession.java
index 0f49aa73..dffd0a06 100755
--- a/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/ISession.java
+++ b/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/ISession.java
@@ -7,10 +7,9 @@
package de.lehmannet.om;
+import java.time.OffsetDateTime;
import java.util.List;
-import java.time.ZonedDateTime;
-
import org.w3c.dom.Element;
/**
@@ -191,7 +190,7 @@ public interface ISession extends ISchemaElement {
*
* @return Returns the start date of the session
*/
- ZonedDateTime getBegin();
+ OffsetDateTime getBegin();
/**
* Returns a List of coobservers who joined this session.
@@ -214,7 +213,7 @@ public interface ISession extends ISchemaElement {
*
* @return Returns the end date of the session
*/
- ZonedDateTime getEnd();
+ OffsetDateTime getEnd();
/**
* Returns the site of the session.
@@ -263,7 +262,7 @@ public interface ISession extends ISchemaElement {
* @throws IllegalArgumentException
* if new start date is null
*/
- void setBegin(ZonedDateTime begin) throws IllegalArgumentException;
+ void setBegin(OffsetDateTime begin) throws IllegalArgumentException;
/**
* Sets the end date of the session.
@@ -274,7 +273,7 @@ public interface ISession extends ISchemaElement {
* @throws IllegalArgumentException
* if new end date is null
*/
- void setEnd(ZonedDateTime end) throws IllegalArgumentException;
+ void setEnd(OffsetDateTime end) throws IllegalArgumentException;
/**
* Sets a site (location) where the session took place.
diff --git a/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/Observation.java b/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/Observation.java
index 449505d5..2a844ba1 100755
--- a/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/Observation.java
+++ b/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/Observation.java
@@ -7,6 +7,8 @@
package de.lehmannet.om;
+import java.time.OffsetDateTime;
+import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.LinkedList;
import java.util.List;
@@ -42,10 +44,10 @@ public class Observation extends SchemaElement implements IObservation {
// ------------------
// Start date of observation
- private ZonedDateTime begin = null;
+ private OffsetDateTime begin = null;
// End date of observation
- private ZonedDateTime end = null;
+ private OffsetDateTime end = null;
// Faintest start that could be seen with the naked eye (in magnitude)
private float faintestStar = Float.NaN;
@@ -225,7 +227,8 @@ public Observation(ZonedDateTime begin, ITarget target, IObserver observer, IFin
LOGGER.error("Result cannot be null. ");
throw new IllegalArgumentException("Result cannot be null. ");
}
- this.begin = begin;
+ this.begin = begin.withZoneSameInstant(ZoneId.of("UTC")).toOffsetDateTime();
+
this.target = target;
this.observer = observer;
this.addResult(result);
@@ -269,7 +272,7 @@ public Observation(ZonedDateTime begin, ITarget target, IObserver observer, List
throw new IllegalArgumentException("Result list cannot be null or empty. ");
}
- this.begin = begin;
+ this.begin = begin.withZoneSameInstant(ZoneId.of("UTC")).toOffsetDateTime();
this.target = target;
this.observer = observer;
@@ -299,7 +302,8 @@ public Observation(ZonedDateTime begin, ZonedDateTime end, ITarget target, IObse
this(begin, target, observer, results);
- this.end = end;
+ this.end = end == null ? null : end.withZoneSameInstant(ZoneId.of("UTC")).toOffsetDateTime();
+ ;
}
@@ -325,7 +329,7 @@ public Observation(ZonedDateTime begin, ZonedDateTime end, ITarget target, IObse
this(begin, target, observer, result);
- this.end = end;
+ this.end = end == null ? null : end.withZoneSameInstant(ZoneId.of("UTC")).toOffsetDateTime();
}
@@ -469,7 +473,8 @@ public Observation(ZonedDateTime begin, ZonedDateTime end, float faintestStar, S
@Override
public String getDisplayName() {
- return this.dateManager.zonedDateTimeToStringWithHour(this.begin) + " - " + this.target.getDisplayName();
+ return this.dateManager.zonedDateTimeToStringWithHour(this.begin.toZonedDateTime()) + " - "
+ + this.target.getDisplayName();
}
@@ -785,7 +790,7 @@ private void addBegin(Document ownerDoc, Element e_Observation) {
* @return The start date of the observation
*/
@Override
- public ZonedDateTime getBegin() {
+ public OffsetDateTime getBegin() {
return begin;
@@ -811,7 +816,7 @@ public String getAccessories() {
* @return The end date of the observation or null
if no end date was given
*/
@Override
- public ZonedDateTime getEnd() {
+ public OffsetDateTime getEnd() {
return end;
}
@@ -1246,7 +1251,7 @@ public ITarget getTarget() {
* if new begin date is null
*/
@Override
- public void setBegin(ZonedDateTime begin) throws IllegalArgumentException {
+ public void setBegin(OffsetDateTime begin) throws IllegalArgumentException {
if (begin == null) {
LOGGER.error("Begin date cannot be null. ");
@@ -1265,7 +1270,7 @@ public void setBegin(ZonedDateTime begin) throws IllegalArgumentException {
* The end date of the observation
*/
@Override
- public void setEnd(ZonedDateTime end) {
+ public void setEnd(OffsetDateTime end) {
this.end = end;
@@ -1448,8 +1453,8 @@ public void setSession(ISession session) throws IllegalArgumentException {
return;
}
- ZonedDateTime sessionStart = session.getBegin();
- ZonedDateTime sessionEnd = session.getEnd();
+ OffsetDateTime sessionStart = session.getBegin();
+ OffsetDateTime sessionEnd = session.getEnd();
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Session from: {} to : {}", toMillisString(sessionStart), toMillisString(sessionEnd));
@@ -1493,11 +1498,11 @@ public void setSite(ISite site) {
}
- private String toMillisString(ZonedDateTime date) {
+ private String toMillisString(OffsetDateTime date) {
if (date == null) {
return "";
}
- return String.valueOf(date.toInstant().toEpochMilli());
+ return String.valueOf(date.toZonedDateTime().toInstant().toEpochMilli());
}
/**
diff --git a/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/Session.java b/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/Session.java
index fdeb7499..ef4716fa 100755
--- a/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/Session.java
+++ b/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/Session.java
@@ -8,6 +8,8 @@
package de.lehmannet.om;
import java.io.File;
+import java.time.OffsetDateTime;
+import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.LinkedList;
import java.util.List;
@@ -39,10 +41,10 @@ public class Session extends SchemaElement implements ISession {
// ------------------
// Start date of session
- private ZonedDateTime begin = ZonedDateTime.now();
+ private OffsetDateTime begin = ZonedDateTime.now().withZoneSameInstant(ZoneId.of("UTC")).toOffsetDateTime();
// End date of session
- private ZonedDateTime end = ZonedDateTime.now();
+ private OffsetDateTime end = ZonedDateTime.now().withZoneSameInstant(ZoneId.of("UTC")).toOffsetDateTime();
// Site where session took place
private ISite site = null;
@@ -307,13 +309,13 @@ private void getEndDate(Element sessionElement) throws SchemaException {
throw new SchemaException("Session must have exact one end date. ");
}
Element child = (Element) children.item(0);
- ZonedDateTime end = null;
+ OffsetDateTime end = null;
if (child == null) {
throw new SchemaException("Session must have end date. ");
} else {
String ISO8601End = child.getFirstChild().getNodeValue();
try {
- end = ZonedDateTime.parse(ISO8601End);
+ end = ZonedDateTime.parse(ISO8601End).withZoneSameInstant(ZoneId.of("UTC")).toOffsetDateTime();
this.setEnd(end);
} catch (NumberFormatException nfe) {
throw new SchemaException("End date is malformed. ", nfe);
@@ -328,7 +330,7 @@ private void getBeginDate(Element sessionElement) throws SchemaException {
throw new SchemaException("Session must have exact one begin date. ");
}
Element child = (Element) children.item(0);
- ZonedDateTime begin = null;
+ OffsetDateTime begin = null;
if (child == null) {
throw new SchemaException("Session must have begin date. ");
} else {
@@ -339,7 +341,7 @@ private void getBeginDate(Element sessionElement) throws SchemaException {
throw new SchemaException("Session cannot have an empty begin date. ");
}
try {
- begin = ZonedDateTime.parse(ISO8601Begin);
+ begin = ZonedDateTime.parse(ISO8601Begin).withZoneSameInstant(ZoneId.of("UTC")).toOffsetDateTime();
this.setBegin(begin);
} catch (NumberFormatException nfe) {
throw new SchemaException("Begin date is malformed. ", nfe);
@@ -360,7 +362,7 @@ private void getBeginDate(Element sessionElement) throws SchemaException {
* @throws IllegalArgumentException
* if site, begin or end date is null
*/
- public Session(DateManager dateManager, ZonedDateTime begin, ZonedDateTime end, ISite site)
+ public Session(DateManager dateManager, OffsetDateTime begin, OffsetDateTime end, ISite site)
throws IllegalArgumentException {
this.dateManager = dateManager;
@@ -387,8 +389,8 @@ public Session(DateManager dateManager, ZonedDateTime begin, ZonedDateTime end,
@Override
public String getDisplayName() {
- return this.dateManager.zonedDateTimeToStringWithHour(this.getBegin()) + " - "
- + this.dateManager.zonedDateTimeToStringWithHour(this.getEnd());
+ return this.dateManager.zonedDateTimeToStringWithHour(this.getBegin().toZonedDateTime()) + " - "
+ + this.dateManager.zonedDateTimeToStringWithHour(this.getEnd().toZonedDateTime());
}
@@ -686,7 +688,7 @@ public Element addAsLinkToXmlElement(Element element) {
* @return Returns the start date of the session
*/
@Override
- public ZonedDateTime getBegin() {
+ public OffsetDateTime getBegin() {
return begin;
@@ -711,7 +713,7 @@ public String getComments() {
* @return Returns the end date of the session
*/
@Override
- public ZonedDateTime getEnd() {
+ public OffsetDateTime getEnd() {
return end;
@@ -802,7 +804,7 @@ public List getImages() {
* if new start date is null
*/
@Override
- public void setBegin(ZonedDateTime begin) throws IllegalArgumentException {
+ public void setBegin(OffsetDateTime begin) throws IllegalArgumentException {
if (begin == null) {
throw new IllegalArgumentException("Start date cannot be null. ");
@@ -841,7 +843,7 @@ public void setComments(String comments) {
* if new end date is null
*/
@Override
- public void setEnd(ZonedDateTime end) throws IllegalArgumentException {
+ public void setEnd(OffsetDateTime end) throws IllegalArgumentException {
if (end == null) {
throw new IllegalArgumentException("End date cannot be null. ");
diff --git a/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/mapper/ObservationMapper.java b/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/mapper/ObservationMapper.java
index 02db277c..0164b083 100644
--- a/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/mapper/ObservationMapper.java
+++ b/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/mapper/ObservationMapper.java
@@ -1,6 +1,8 @@
package de.lehmannet.om.mapper;
import java.io.File;
+import java.time.OffsetDateTime;
+import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.Arrays;
@@ -400,7 +402,7 @@ public static ISite getOptionalSite(ISite[] sites, Element observationElement) t
return null;
}
- public static ZonedDateTime getOptionalEndDate(Element observationElement) throws SchemaException {
+ public static OffsetDateTime getOptionalEndDate(Element observationElement) throws SchemaException {
NodeList children = observationElement.getElementsByTagName(IObservation.XML_ELEMENT_END);
@@ -411,7 +413,7 @@ public static ZonedDateTime getOptionalEndDate(Element observationElement) throw
} else {
String ISO8601End = child.getFirstChild().getNodeValue();
try {
- return ZonedDateTime.parse(ISO8601End);
+ return ZonedDateTime.parse(ISO8601End).withZoneSameInstant(ZoneId.of("UTC")).toOffsetDateTime();
} catch (NumberFormatException nfe) {
throw new SchemaException("End date is malformed. ", nfe);
@@ -499,7 +501,7 @@ public static ITarget getMandatoryTarget(ITarget[] targets, Element observationE
}
}
- public static ZonedDateTime getMandatoryBeginDate(Element observationElement) throws SchemaException {
+ public static OffsetDateTime getMandatoryBeginDate(Element observationElement) throws SchemaException {
// Get mandatory begin date
NodeList children = observationElement.getElementsByTagName(IObservation.XML_ELEMENT_BEGIN);
@@ -517,7 +519,7 @@ public static ZonedDateTime getMandatoryBeginDate(Element observationElement) th
throw new SchemaException("Begin date is empty. ");
}
try {
- return ZonedDateTime.parse(ISO8601Begin);
+ return ZonedDateTime.parse(ISO8601Begin).withZoneSameInstant(ZoneId.of("UTC")).toOffsetDateTime();
} catch (NumberFormatException nfe) {
throw new SchemaException("Begin date is malformed. ", nfe);
diff --git a/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/util/DateManager.java b/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/util/DateManager.java
index bc3b6722..16b2dce3 100644
--- a/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/util/DateManager.java
+++ b/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/util/DateManager.java
@@ -1,5 +1,6 @@
package de.lehmannet.om.util;
+import java.time.OffsetDateTime;
import java.time.ZonedDateTime;
import java.util.Calendar;
import java.util.Date;
@@ -54,6 +55,30 @@ public interface DateManager {
*/
String calendarToStringWithSeconds(Calendar calendar);
+ /**
+ *
+ * @param date
+ *
+ * @return the date formatted or empty string in current zone
+ */
+ String offsetDateTimeToString(OffsetDateTime date);
+
+ /**
+ *
+ * @param date
+ *
+ * @return the date formatted or empty string in current zone
+ */
+ String offsetDateTimeToStringWithHour(OffsetDateTime date);
+
+ /**
+ *
+ * @param date
+ *
+ * @return the date formatted or empty string in current zone
+ */
+ String offsetDateTimeToStringWithSeconds(OffsetDateTime date);
+
/**
*
* @param date
diff --git a/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/util/DateManagerImpl.java b/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/util/DateManagerImpl.java
index b663f43a..b9769c0b 100644
--- a/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/util/DateManagerImpl.java
+++ b/observation-manager/observation-planner-api/src/main/java/de/lehmannet/om/util/DateManagerImpl.java
@@ -1,8 +1,9 @@
package de.lehmannet.om.util;
import java.text.SimpleDateFormat;
-import java.time.ZonedDateTime;
+import java.time.OffsetDateTime;
import java.time.ZoneId;
+import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;
@@ -102,4 +103,31 @@ public String zonedDateTimeToString(ZonedDateTime date) {
return date.format(dtfDateOnly);
}
+ @Override
+ public String offsetDateTimeToString(OffsetDateTime date) {
+ if (date == null) {
+ return StringUtils.EMPTY;
+ }
+
+ return zonedDateTimeToString(date.toZonedDateTime());
+ }
+
+ @Override
+ public String offsetDateTimeToStringWithHour(OffsetDateTime date) {
+ if (date == null) {
+ return StringUtils.EMPTY;
+ }
+
+ return zonedDateTimeToStringWithHour(date.toZonedDateTime());
+ }
+
+ @Override
+ public String offsetDateTimeToStringWithSeconds(OffsetDateTime date) {
+ if (date == null) {
+ return StringUtils.EMPTY;
+ }
+
+ return zonedDateTimeToStringWithSeconds(date.toZonedDateTime());
+ }
+
}
diff --git a/observation-manager/pom.xml b/observation-manager/pom.xml
index 61e33939..371297c0 100644
--- a/observation-manager/pom.xml
+++ b/observation-manager/pom.xml
@@ -6,7 +6,7 @@
pom
observation-manager
de.lehmannet.om
- 1.6.0-RC6
+ 1.6.0-RC7
scm:git:git@github.com:capape/observation-manager.git
@@ -44,7 +44,7 @@
3.4.4
4.13.2
- 2.17.1
+ 2.19.0
3.3.0
diff --git a/observation-manager/skychart-extension/pom.xml b/observation-manager/skychart-extension/pom.xml
index 623381a5..435d1b0a 100644
--- a/observation-manager/skychart-extension/pom.xml
+++ b/observation-manager/skychart-extension/pom.xml
@@ -4,7 +4,7 @@
observation-manager
de.lehmannet.om
- 1.6.0-RC6
+ 1.6.0-RC7
de.lehmannet.om
skychart-extension
diff --git a/observation-manager/skychart-extension/src/main/java/de/lehmannet/om/extension/skychart/SkyChartClient.java b/observation-manager/skychart-extension/src/main/java/de/lehmannet/om/extension/skychart/SkyChartClient.java
index bcd9172c..efa6b8e0 100644
--- a/observation-manager/skychart-extension/src/main/java/de/lehmannet/om/extension/skychart/SkyChartClient.java
+++ b/observation-manager/skychart-extension/src/main/java/de/lehmannet/om/extension/skychart/SkyChartClient.java
@@ -186,7 +186,7 @@ private void moveSkychart(IObservation observation) {
// ---- Set observation date
if (observation.getBegin() != null) {
commands = new String[2];
- commands[0] = this.createDateCommand(observation.getBegin());
+ commands[0] = this.createDateCommand(observation.getBegin().toZonedDateTime());
commands[1] = this.createREFRESHCommand();
for (String command : commands) {
response = this.sendData(socket, command);
diff --git a/observation-manager/solar-system-extension/pom.xml b/observation-manager/solar-system-extension/pom.xml
index 51516e85..0f0971a8 100644
--- a/observation-manager/solar-system-extension/pom.xml
+++ b/observation-manager/solar-system-extension/pom.xml
@@ -4,7 +4,7 @@
observation-manager
de.lehmannet.om
- 1.6.0-RC6
+ 1.6.0-RC7
de.lehmannet.om
diff --git a/observation-manager/solar-system-extension/src/main/java/de/lehmannet/om/ui/extension/solarSystem/panel/SolarSystemTargetMoonPanel.java b/observation-manager/solar-system-extension/src/main/java/de/lehmannet/om/ui/extension/solarSystem/panel/SolarSystemTargetMoonPanel.java
index cb30811a..887b70e4 100644
--- a/observation-manager/solar-system-extension/src/main/java/de/lehmannet/om/ui/extension/solarSystem/panel/SolarSystemTargetMoonPanel.java
+++ b/observation-manager/solar-system-extension/src/main/java/de/lehmannet/om/ui/extension/solarSystem/panel/SolarSystemTargetMoonPanel.java
@@ -125,8 +125,8 @@ private void createPanel() {
if ((!this.isEditable()) && (this.observation != null)) {
ISite site = this.observation.getSite();
if (site != null) {
- this.targetContainer.setPosition(
- Ephemerides.getMoonPosition(this.observation.getBegin(), site.getLongitude().toDegree()));
+ this.targetContainer.setPosition(Ephemerides.getMoonPosition(
+ this.observation.getBegin().toZonedDateTime(), site.getLongitude().toDegree()));
}
}
gridbag.setConstraints(this.targetContainer, constraints);
diff --git a/observation-manager/solar-system-extension/src/main/java/de/lehmannet/om/ui/extension/solarSystem/panel/SolarSystemTargetPlanetPanel.java b/observation-manager/solar-system-extension/src/main/java/de/lehmannet/om/ui/extension/solarSystem/panel/SolarSystemTargetPlanetPanel.java
index 54506567..22c5e9fb 100644
--- a/observation-manager/solar-system-extension/src/main/java/de/lehmannet/om/ui/extension/solarSystem/panel/SolarSystemTargetPlanetPanel.java
+++ b/observation-manager/solar-system-extension/src/main/java/de/lehmannet/om/ui/extension/solarSystem/panel/SolarSystemTargetPlanetPanel.java
@@ -123,8 +123,9 @@ private void createPanel() {
this.targetContainer = new TargetContainer(this.configuration, this.model, this.target, this.isEditable(),
true);
if ((!this.isEditable()) && (this.observation != null)) {
- this.targetContainer.setPosition(Ephemerides
- .getPosition(this.mapPlanetKeysForEphemerides(this.target.getName()), this.observation.getBegin()));
+ this.targetContainer
+ .setPosition(Ephemerides.getPosition(this.mapPlanetKeysForEphemerides(this.target.getName()),
+ this.observation.getBegin().toZonedDateTime()));
}
gridbag.setConstraints(this.targetContainer, constraints);
this.add(this.targetContainer);
diff --git a/observation-manager/solar-system-extension/src/main/java/de/lehmannet/om/ui/extension/solarSystem/panel/SolarSystemTargetSunPanel.java b/observation-manager/solar-system-extension/src/main/java/de/lehmannet/om/ui/extension/solarSystem/panel/SolarSystemTargetSunPanel.java
index f406b359..93ea32d4 100644
--- a/observation-manager/solar-system-extension/src/main/java/de/lehmannet/om/ui/extension/solarSystem/panel/SolarSystemTargetSunPanel.java
+++ b/observation-manager/solar-system-extension/src/main/java/de/lehmannet/om/ui/extension/solarSystem/panel/SolarSystemTargetSunPanel.java
@@ -121,7 +121,7 @@ private void createPanel() {
this.targetContainer = new TargetContainer(this.configuration, this.model, this.target, this.isEditable(),
true);
if ((!this.isEditable()) && (this.observation != null)) {
- this.targetContainer.setPosition(Ephemerides.getSunPosition(this.observation.getBegin()));
+ this.targetContainer.setPosition(Ephemerides.getSunPosition(this.observation.getBegin().toZonedDateTime()));
}
gridbag.setConstraints(this.targetContainer, constraints);
this.add(this.targetContainer);
diff --git a/observation-manager/variable-stars-extension/pom.xml b/observation-manager/variable-stars-extension/pom.xml
index 730cec7d..c3443eb0 100644
--- a/observation-manager/variable-stars-extension/pom.xml
+++ b/observation-manager/variable-stars-extension/pom.xml
@@ -4,7 +4,7 @@
observation-manager
de.lehmannet.om
- 1.6.0-RC6
+ 1.6.0-RC7
de.lehmannet.om
variable-stars-extension
diff --git a/observation-manager/variable-stars-extension/src/main/java/de/lehmannet/om/extension/variableStars/export/AAVSOVisualSerializer.java b/observation-manager/variable-stars-extension/src/main/java/de/lehmannet/om/extension/variableStars/export/AAVSOVisualSerializer.java
index 3d984d88..c17e8e17 100644
--- a/observation-manager/variable-stars-extension/src/main/java/de/lehmannet/om/extension/variableStars/export/AAVSOVisualSerializer.java
+++ b/observation-manager/variable-stars-extension/src/main/java/de/lehmannet/om/extension/variableStars/export/AAVSOVisualSerializer.java
@@ -204,7 +204,7 @@ public int serialize(OutputStream stream) throws Exception {
private String writeObservation(OutputStream stream, IObservation currentObservation) throws IOException {
// Get observation julian date and write it into stream
- String obsDate = "" + DateConverter.toJulianDate(currentObservation.getBegin());
+ String obsDate = "" + DateConverter.toJulianDate(currentObservation.getBegin().toZonedDateTime());
stream.write(obsDate.getBytes("UTF-8"));
stream.write(AAVSOVisualSerializer.DELIMITER);
return obsDate;
diff --git a/observation-manager/variable-stars-extension/src/main/java/de/lehmannet/om/ui/extension/variableStars/VariableStarSelectorPopup.java b/observation-manager/variable-stars-extension/src/main/java/de/lehmannet/om/ui/extension/variableStars/VariableStarSelectorPopup.java
index 83445985..e09735ed 100644
--- a/observation-manager/variable-stars-extension/src/main/java/de/lehmannet/om/ui/extension/variableStars/VariableStarSelectorPopup.java
+++ b/observation-manager/variable-stars-extension/src/main/java/de/lehmannet/om/ui/extension/variableStars/VariableStarSelectorPopup.java
@@ -132,8 +132,8 @@ public void tableChanged(TableModelEvent e) {
TreeSet set = new TreeSet<>(comparator);
set.addAll(Arrays.asList(observations));
- this.beginDate = ((IObservation) set.first()).getBegin();
- this.endDate = ((IObservation) set.last()).getBegin();
+ this.beginDate = ((IObservation) set.first()).getBegin().toZonedDateTime();
+ this.endDate = ((IObservation) set.last()).getBegin().toZonedDateTime();
this.beginField.setText(this.formatDate(this.beginDate));
this.endField.setText(this.formatDate(this.endDate));
@@ -173,8 +173,8 @@ public void actionPerformed(ActionEvent e) {
TreeSet set = new TreeSet<>(comparator);
set.addAll(Arrays.asList(observations));
- ZonedDateTime first = ((IObservation) set.first()).getBegin();
- ZonedDateTime last = ((IObservation) set.last()).getBegin();
+ ZonedDateTime first = ((IObservation) set.first()).getBegin().toZonedDateTime();
+ ZonedDateTime last = ((IObservation) set.last()).getBegin().toZonedDateTime();
if ((dp.getDate().isBefore(first)) || (dp.getDate().isAfter(last))) {
this.uiHelper.showWarning(
@@ -209,8 +209,8 @@ public void actionPerformed(ActionEvent e) {
TreeSet set = new TreeSet<>(comparator);
set.addAll(Arrays.asList(observations));
- ZonedDateTime first = ((IObservation) set.first()).getBegin();
- ZonedDateTime last = ((IObservation) set.last()).getBegin();
+ ZonedDateTime first = ((IObservation) set.first()).getBegin().toZonedDateTime();
+ ZonedDateTime last = ((IObservation) set.last()).getBegin().toZonedDateTime();
if ((dp.getDate().isBefore(first)) || (dp.getDate().isAfter(last))) {
this.uiHelper.showWarning(
@@ -243,7 +243,8 @@ public IObservation[] getAllSelectedObservations() {
// Filter by start/end date
List result = new ArrayList<>();
for (IObservation observation : observations) {
- if ((observation.getBegin().isBefore(this.beginDate)) || (observation.getBegin().isAfter(this.endDate))) {
+ if ((observation.getBegin().toZonedDateTime().isBefore(this.beginDate))
+ || (observation.getBegin().toZonedDateTime().isAfter(this.endDate))) {
// Observation not in selected time period
} else {
result.add(observation);
diff --git a/observation-manager/variable-stars-extension/src/main/java/de/lehmannet/om/ui/extension/variableStars/dialog/VariableStarChartDialog.java b/observation-manager/variable-stars-extension/src/main/java/de/lehmannet/om/ui/extension/variableStars/dialog/VariableStarChartDialog.java
index 4702ba0a..5a37d80c 100644
--- a/observation-manager/variable-stars-extension/src/main/java/de/lehmannet/om/ui/extension/variableStars/dialog/VariableStarChartDialog.java
+++ b/observation-manager/variable-stars-extension/src/main/java/de/lehmannet/om/ui/extension/variableStars/dialog/VariableStarChartDialog.java
@@ -316,12 +316,13 @@ private void paintTitle() {
String fromDateLabel = this.bundle.getString("chart.label.from");
String toDateLabel = this.bundle.getString("chart.label.to");
String fromDateJD = "JD: "
- + DateConverter.toJulianDate(((IObservation) (this.observations.first())).getBegin());
- String fromDate = this.dateManager
- .zonedDateTimeToStringWithSeconds(((IObservation) (this.observations.first())).getBegin());
- String toDateJD = "" + DateConverter.toJulianDate(((IObservation) (this.observations.last())).getBegin());
- String toDate = this.dateManager
- .zonedDateTimeToStringWithSeconds(((IObservation) (this.observations.last())).getBegin());
+ + DateConverter.toJulianDate(((IObservation) (this.observations.first())).getBegin().toZonedDateTime());
+ String fromDate = this.dateManager.zonedDateTimeToStringWithSeconds(
+ ((IObservation) (this.observations.first())).getBegin().toZonedDateTime());
+ String toDateJD = ""
+ + DateConverter.toJulianDate(((IObservation) (this.observations.last())).getBegin().toZonedDateTime());
+ String toDate = this.dateManager.zonedDateTimeToStringWithSeconds(
+ ((IObservation) (this.observations.last())).getBegin().toZonedDateTime());
// ---- Print large box as border
this.g2d.drawRect(0, 0, (int) this.getSize().getWidth(), BORDER_TOP - 10);
@@ -468,9 +469,10 @@ private void paintPopup() {
String sign = dataSpot.getResult().isMagnitudeFainterThan() ? "<" : "";
String[] info = new String[] { (sign + dataSpot.getResult().getMagnitude() + "mag"),
- ("JD: " + DateConverter.toJulianDate(dataSpot.getObservation().getBegin())),
- (this.bundle.getString("chart.popup.date") + ": " + this.dateManager
- .zonedDateTimeToStringWithHour(dataSpot.getObservation().getBegin())) };
+ ("JD: " + DateConverter.toJulianDate(dataSpot.getObservation().getBegin().toZonedDateTime())),
+ (this.bundle.getString("chart.popup.date") + ": "
+ + this.dateManager.zonedDateTimeToStringWithHour(
+ dataSpot.getObservation().getBegin().toZonedDateTime())) };
// Get largest popup text
String maxInfoString = "";
@@ -530,8 +532,8 @@ private void paintData() {
// Set color for painting
g2d.setPaint((Color) this.colorMap.get(current.getObserver()));
- currentValueXPos = (float) (((DateConverter.toJulianDate(current.getBegin()) - this.minXValue)
- / this.xDivisor) * this.xAxisSegmentSize) - (CIRCLE_DIAMETER / 2);
+ currentValueXPos = (float) (((DateConverter.toJulianDate(current.getBegin().toZonedDateTime())
+ - this.minXValue) / this.xDivisor) * this.xAxisSegmentSize) - (CIRCLE_DIAMETER / 2);
currentValueYPos = (((this.maxYValue - ((FindingVariableStar) (current.getResults().get(0))).getMagnitude())
/ this.yDivisor) * -this.yAxisSegmentSize * 10) - (CIRCLE_DIAMETER / 2);
@@ -762,13 +764,15 @@ private void paintAxis() {
private float getMaxX() {
- return (float) Math.ceil(DateConverter.toJulianDate(((IObservation) (this.observations.last())).getBegin()));
+ return (float) Math.ceil(
+ DateConverter.toJulianDate(((IObservation) (this.observations.last())).getBegin().toZonedDateTime()));
}
private float getMinX() {
- return (float) Math.floor(DateConverter.toJulianDate(((IObservation) (this.observations.first())).getBegin()));
+ return (float) Math.floor(
+ DateConverter.toJulianDate(((IObservation) (this.observations.first())).getBegin().toZonedDateTime()));
}