mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-27 14:27:15 +00:00
Merge branch 'bug3122' into tw2015
This commit is contained in:
commit
cd90466cbb
4 files changed
+40
-15
No files matched your search
+23
-3
@@ -21,6 +21,13 @@ public class RaceTimePanel extends TimePanel<RaceTimePanelSettings> implements R
|
||||
private RegattaAndRaceIdentifier selectedRace;
|
||||
private boolean autoAdjustPlayMode;
|
||||
private RaceTimesInfoDTO lastRaceTimesInfo;
|
||||
|
||||
/**
|
||||
* When a marker update is required but min/max are not yet initialized, this flag is set. If later
|
||||
* {@link #setMinMax(Date, Date, boolean)} is invoked and this flag is set, a {@link #redrawAllMarkers(RaceTimesInfoDTO)}
|
||||
* will be issued and the flag is cleared.
|
||||
*/
|
||||
private boolean redrawAllMarkersPendingForMinMaxBeingInitialized;
|
||||
|
||||
public RaceTimePanel(Timer timer, TimeRangeWithZoomProvider timeRangeProvider, StringMessages stringMessages,
|
||||
RaceTimesInfoProvider raceTimesInfoProvider, boolean canReplayWhileLiveIsPossible) {
|
||||
@@ -105,7 +112,7 @@ public class RaceTimePanel extends TimePanel<RaceTimePanelSettings> implements R
|
||||
// maybe show a special state for this like "Race did not start yet"
|
||||
}
|
||||
}
|
||||
lastRaceTimesInfo = raceTimesInfo;
|
||||
lastRaceTimesInfo = raceTimesInfo; // TODO bug 3122: when not redrawn yet because min/max not initialized yet, further redraw is disabled by this.
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -181,6 +188,15 @@ public class RaceTimePanel extends TimePanel<RaceTimePanelSettings> implements R
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMinMax(Date min, Date max, boolean fireEvent) {
|
||||
super.setMinMax(min, max, fireEvent);
|
||||
if (redrawAllMarkersPendingForMinMaxBeingInitialized && timeSlider.isMinMaxInitialized()) {
|
||||
redrawAllMarkers(lastRaceTimesInfo);
|
||||
redrawAllMarkersPendingForMinMaxBeingInitialized = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* When in {@link PlayModes#Replay} mode, tries to put the {@link #timer} to the time point when the last leg was
|
||||
* finished first. If this time point is not (yet?) known, tries to put the {@link #timer} to the
|
||||
@@ -239,8 +255,12 @@ public class RaceTimePanel extends TimePanel<RaceTimePanelSettings> implements R
|
||||
requiresMarkerUpdate = true;
|
||||
}
|
||||
}
|
||||
if (requiresMarkerUpdate && timeSlider.isMinMaxInitialized()) {
|
||||
redrawAllMarkers(newRaceTimesInfo);
|
||||
if (requiresMarkerUpdate) {
|
||||
if (timeSlider.isMinMaxInitialized()) { // TODO bug 3122 later, the lastRaceTimesInfo will be updated even if not redrawn because min/max not initialized
|
||||
redrawAllMarkers(newRaceTimesInfo);
|
||||
} else {
|
||||
redrawAllMarkersPendingForMinMaxBeingInitialized = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -429,7 +429,7 @@ public class TimePanel<T extends TimePanelSettings> extends SimplePanel implemen
|
||||
timeSlider.setMinValue(new Double(min.getTime()), fireEvent);
|
||||
}
|
||||
if (changed) {
|
||||
if(!timeRangeProvider.isZoomed()) {
|
||||
if (!timeRangeProvider.isZoomed()) {
|
||||
timeRangeProvider.setTimeRange(min, max, this);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ import com.google.gwt.user.client.ui.FocusPanel;
|
||||
import com.google.gwt.user.client.ui.HasValue;
|
||||
import com.google.gwt.user.client.ui.Image;
|
||||
import com.google.gwt.user.client.ui.RequiresResize;
|
||||
import com.sap.sse.common.Util;
|
||||
|
||||
/**
|
||||
* A widget that allows the user to select a value within a range of possible values using a sliding bar that responds
|
||||
@@ -704,9 +705,11 @@ public class SliderBar extends FocusPanel implements RequiresResize, HasValue<Do
|
||||
* the current value
|
||||
*/
|
||||
public void setMaxValue(Double maxValue, boolean fireEvent) {
|
||||
this.maxValue = maxValue;
|
||||
drawTickLabels();
|
||||
resetCurrentValue(fireEvent);
|
||||
if (!Util.equalsWithNull(maxValue, this.maxValue)) {
|
||||
this.maxValue = maxValue;
|
||||
redraw();
|
||||
resetCurrentValue(fireEvent);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -716,9 +719,11 @@ public class SliderBar extends FocusPanel implements RequiresResize, HasValue<Do
|
||||
* the current value
|
||||
*/
|
||||
public void setMinValue(Double minValue, boolean fireEvent) {
|
||||
this.minValue = minValue;
|
||||
drawTickLabels();
|
||||
resetCurrentValue(fireEvent);
|
||||
if (!Util.equalsWithNull(minValue, this.minValue)) {
|
||||
this.minValue = minValue;
|
||||
redraw();
|
||||
resetCurrentValue(fireEvent);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -182,7 +182,7 @@ public class TimeSlider extends SliderBar {
|
||||
return;
|
||||
|
||||
Element knobElement = knobImage.getElement();
|
||||
if(curValue >= minValue && curValue <= maxValue) {
|
||||
if (curValue != null && minValue != null && maxValue != null && curValue >= minValue && curValue <= maxValue) {
|
||||
// Move the knob to the correct position
|
||||
int lineWidth = lineElement.getOffsetWidth();
|
||||
int knobWidth = knobElement.getOffsetWidth();
|
||||
@@ -199,21 +199,21 @@ public class TimeSlider extends SliderBar {
|
||||
}
|
||||
|
||||
public void setMaxValue(Double maxValue, boolean fireEvent) {
|
||||
if(!isZoomed) {
|
||||
calculateTicks();
|
||||
if (!isZoomed) {
|
||||
super.setMaxValue(maxValue, fireEvent);
|
||||
} else {
|
||||
this.maxValue = maxValue;
|
||||
}
|
||||
calculateTicks();
|
||||
}
|
||||
|
||||
public void setMinValue(Double minValue, boolean fireEvent) {
|
||||
if(!isZoomed) {
|
||||
calculateTicks();
|
||||
if (!isZoomed) {
|
||||
super.setMinValue(minValue, fireEvent);
|
||||
} else {
|
||||
this.minValue = minValue;
|
||||
}
|
||||
calculateTicks();
|
||||
}
|
||||
|
||||
public void setStepSize(double stepSize, boolean fireEvent) {
|
||||
|
||||
Reference in new issue
Block a user