mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-30 17:36:40 +00:00
Merge remote-tracking branch 'server/master'
This commit is contained in:
commit
71c7f833fd
4 files changed
+29
-22
No files matched your search
+1
-1
@@ -353,7 +353,7 @@ public class RaceMap extends SimplePanel implements TimeListener, CompetitorSele
|
||||
sailingService.getBoatPositions(race, fromAndToAndOverlap.getA(), fromAndToAndOverlap.getB(), true, getBoatsCallback);
|
||||
sailingService.getMarkPositions(race, date, getMarksCallback);
|
||||
sailingService.getQuickRanks(race, date, getQuickRanksCallback);
|
||||
// sailingService.getWindInfo(race, date, date, null, getWindCallback);
|
||||
// sailingService.getWindInfo(race, date, 0, 0, 0, null, getWindCallback);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+11
-17
@@ -26,6 +26,7 @@ import org.moxieapps.gwt.highcharts.client.plotOptions.Marker;
|
||||
import com.google.gwt.i18n.client.DateTimeFormat;
|
||||
import com.google.gwt.i18n.client.NumberFormat;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.RequiresResize;
|
||||
import com.google.gwt.user.client.ui.SimplePanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.domain.common.RaceIdentifier;
|
||||
@@ -46,7 +47,7 @@ import com.sap.sailing.gwt.ui.shared.WindTrackInfoDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.components.Component;
|
||||
import com.sap.sailing.gwt.ui.shared.components.SettingsDialogComponent;
|
||||
|
||||
public class WindChart implements Component<WindChartSettings>, RaceSelectionChangeListener, TimeListener {
|
||||
public class WindChart extends SimplePanel implements Component<WindChartSettings>, RaceSelectionChangeListener, TimeListener, RequiresResize {
|
||||
private static final int LINE_WIDTH = 1;
|
||||
private final StringMessages stringMessages;
|
||||
private final Set<WindSourceType> windSourceTypesToDisplay;
|
||||
@@ -69,8 +70,6 @@ public class WindChart implements Component<WindChartSettings>, RaceSelectionCha
|
||||
|
||||
private final ColorMap<WindSource> colorMap;
|
||||
|
||||
private final SimplePanel mainPanel;
|
||||
|
||||
/**
|
||||
* @param raceSelectionProvider
|
||||
* if <code>null</code>, this chart won't update its contents automatically upon race selection change;
|
||||
@@ -132,9 +131,8 @@ public class WindChart implements Component<WindChartSettings>, RaceSelectionCha
|
||||
.getXAxis().setAxisTitle(null);
|
||||
}
|
||||
|
||||
mainPanel = new SimplePanel();
|
||||
mainPanel.setWidget(chart);
|
||||
mainPanel.setSize("100%", "100%");
|
||||
setWidget(chart);
|
||||
setSize("100%", "100%");
|
||||
updateSettings(settings);
|
||||
if (raceSelectionProvider != null) {
|
||||
raceSelectionProvider.addRaceSelectionChangeListener(this);
|
||||
@@ -151,17 +149,7 @@ public class WindChart implements Component<WindChartSettings>, RaceSelectionCha
|
||||
|
||||
@Override
|
||||
public Widget getEntryWidget() {
|
||||
return mainPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return mainPanel.isVisible();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisible(boolean visibility) {
|
||||
mainPanel.setVisible(visibility);
|
||||
return this;
|
||||
}
|
||||
|
||||
private void showVisibleSeries() {
|
||||
@@ -407,4 +395,10 @@ public class WindChart implements Component<WindChartSettings>, RaceSelectionCha
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResize() {
|
||||
chart.setSizeToMatchContainer();
|
||||
}
|
||||
|
||||
}
|
||||
+15
-3
@@ -30,6 +30,7 @@ import com.google.gwt.i18n.client.NumberFormat;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.AbsolutePanel;
|
||||
import com.google.gwt.user.client.ui.Label;
|
||||
import com.google.gwt.user.client.ui.RequiresResize;
|
||||
import com.google.gwt.user.client.ui.SimplePanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.domain.common.DetailType;
|
||||
@@ -66,7 +67,7 @@ import com.sap.sailing.gwt.ui.shared.panels.SimpleBusyIndicator;
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractChartPanel<SettingsType extends ChartSettings> extends SimplePanel
|
||||
implements CompetitorSelectionChangeListener, RaceSelectionChangeListener, TimeListener {
|
||||
implements CompetitorSelectionChangeListener, RaceSelectionChangeListener, TimeListener, RequiresResize {
|
||||
protected static final int LINE_WIDTH = 1;
|
||||
protected MultiCompetitorRaceDataDTO chartData;
|
||||
protected final SailingServiceAsync sailingService;
|
||||
@@ -102,6 +103,7 @@ implements CompetitorSelectionChangeListener, RaceSelectionChangeListener, TimeL
|
||||
this.sailingService = sailingService;
|
||||
this.raceSelectionProvider = raceSelectionProvider;
|
||||
raceSelectionProvider.addRaceSelectionChangeListener(this);
|
||||
setSize("100%", "100%");
|
||||
|
||||
noCompetitorsSelectedLabel = new Label(stringMessages.selectAtLeastOneCompetitor() + ".");
|
||||
noCompetitorsSelectedLabel.setStyleName("abstractChartPanel-importantMessageOfChart");
|
||||
@@ -155,7 +157,10 @@ implements CompetitorSelectionChangeListener, RaceSelectionChangeListener, TimeL
|
||||
});
|
||||
|
||||
final String unit = getUnit();
|
||||
chart.getYAxis().setAxisTitleText(DetailTypeFormatter.format(dataToShow, stringMessages) + " ["+unit+"]");
|
||||
if(!compactChart)
|
||||
chart.getYAxis().setAxisTitleText(DetailTypeFormatter.format(dataToShow, stringMessages) + " ["+unit+"]");
|
||||
else
|
||||
chart.getYAxis().setAxisTitleText("["+unit+"]");
|
||||
chart.getYAxis().setStartOnTick(false).setShowFirstLabel(false);
|
||||
chart.getYAxis().setReversed((dataToShow == DetailType.WINDWARD_DISTANCE_TO_OVERALL_LEADER ||
|
||||
dataToShow == DetailType.GAP_TO_LEADER_IN_SECONDS) ? true : false);
|
||||
@@ -184,7 +189,7 @@ implements CompetitorSelectionChangeListener, RaceSelectionChangeListener, TimeL
|
||||
.setLegend(new Legend().setMargin(2))
|
||||
.setOption("title/margin", 5)
|
||||
.setChartSubtitle(null)
|
||||
.getXAxis().setAxisTitle(null);
|
||||
.getXAxis().setAxisTitleText(null);
|
||||
}
|
||||
|
||||
setChartData(null);
|
||||
@@ -558,4 +563,11 @@ implements CompetitorSelectionChangeListener, RaceSelectionChangeListener, TimeL
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResize() {
|
||||
if(getChartData() != null) {
|
||||
chart.setSizeToMatchContainer();
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -75,8 +75,9 @@ public class SideBySideComponentViewer implements ComponentViewer {
|
||||
for(Component<?> component: components) {
|
||||
boolean isComponentInSplitPanel = isWidgetInSplitPanel(component.getEntryWidget());
|
||||
if(component.isVisible()) {
|
||||
if(!isComponentInSplitPanel)
|
||||
if(!isComponentInSplitPanel) {
|
||||
splitLayoutPanel.insertSouth(component.getEntryWidget(), 200, splitLayoutPanel.getWidget(0));
|
||||
}
|
||||
} else {
|
||||
if(isComponentInSplitPanel)
|
||||
splitLayoutPanel.remove(component.getEntryWidget());
|
||||
|
||||
Reference in new issue
Block a user