made strings in chart panel localizable

This commit is contained in:
Axel Uhl committed 2012-01-18 13:18:28 +01:00
1 parent 3308f02ce1
commit 2cb08cc200
6 files changed
+19 -23

No files matched your search

@@ -223,7 +223,7 @@ public class WindPanel extends FormPanel implements EventDisplayer, WindShower,
// add hover listener
plot.addHoverListener(new PlotHoverListener() {
public void onPlotHover(Plot plot, PlotPosition position, PlotItem item) {
/*
/* TODO show some reasonable hover tooltip in wind strip chart
CompetitorDAO competitor = competitorID.get(seriesID.indexOf(item.getSeries()));
if (item != null && competitor != null) {
if (item.getSeries().getLabel().toLowerCase().contains("mark")){
@@ -265,7 +265,6 @@ public class WindPanel extends FormPanel implements EventDisplayer, WindShower,
}
}, true);
plot.addSelectionListener(new SelectionListener() {
public void selected(double x1, double y1, double x2, double y2) {
/* TODO Remove not visible buoys from the series when user is zooming in or add them if he is zooming out.
for (CompetitorDAO competitor : competitorsAndTimePointsDAO.getCompetitor()){
@@ -209,4 +209,7 @@ public interface StringMessages extends Messages {
String numberOfStepsToLoadMustAtLeastBeTwo();
String unknownManeuver();
String tailLengthMustBeNonNegative();
String failedToLoadRaceInformation(String message);
String competitorPassedMarkAtDate(String competitorName, String markName, String dateTime);
String valueForCompetitorAt(String competitorName, String dateTime, String valueWithUnit);
}
@@ -203,4 +203,7 @@ startDateNotAvailable=Start date not available
startDate=Start date
numberOfStepsToLoadMustAtLeastBeTwo=Number of steps to load must at least be two
unknownManeuver=Unknown maneuver
tailLengthMustBeNonNegative=Tail length must be a number greater than or equal to zero
tailLengthMustBeNonNegative=Tail length must be a number greater than or equal to zero
failedToLoadRaceInformation=Failed to load race information: {0}
competitorPassedMarkAtDate={0} passed {1} at {2}
valueForCompetitorAt={0} at {1}: {2}
@@ -204,4 +204,7 @@ startDateNotAvailable=Startdatum nicht verfügbar
startDate=Startdatum
numberOfStepsToLoadMustAtLeastBeTwo=Anzahl zu ladender Schritte muss mindestens zwei sein
unknownManeuver=Unbekanntes Manöver
tailLengthMustBeNonNegative=Schweiflänge muss eine positive Zahl oder 0 sein
tailLengthMustBeNonNegative=Schweiflänge muss eine positive Zahl oder 0 sein
failedToLoadRaceInformation=Daten zur Wettfahrt konnten nicht geladen werden: {0}
competitorPassedMarkAtDate={0} passierte {1} um {2}
valueForCompetitorAt={0} um {1}: {2}
@@ -233,7 +233,7 @@ public abstract class AbstractChartPanel<SettingsType extends ChartSettings> ext
new AsyncCallback<CompetitorsAndTimePointsDAO>() {
@Override
public void onFailure(Throwable caught) {
errorReporter.reportError("Failed to load race information: " + caught.toString());
errorReporter.reportError(stringMessages.failedToLoadRaceInformation(caught.toString()));
}
@Override
@@ -409,9 +409,9 @@ public abstract class AbstractChartPanel<SettingsType extends ChartSettings> ext
CompetitorDAO competitor = competitorID.get(seriesID.indexOf(item.getSeries()));
if (item != null && competitor != null) {
if (item.getSeries().getLabel().toLowerCase().contains("mark")) {
selectedPointLabel.setText(competitor.name + " passed "
+ markPassingBuoyName.get(competitor.id + (long) item.getDataPoint().getX()) + " at "
+ dateFormat.format(new Date((long) item.getDataPoint().getX())));
selectedPointLabel.setText(stringMessages.competitorPassedMarkAtDate(competitor.name,
markPassingBuoyName.get(competitor.id + (long) item.getDataPoint().getX()),
dateFormat.format(new Date((long) item.getDataPoint().getX()))));
} else {
String unit = "";
switch (dataToShow){
@@ -438,8 +438,9 @@ public abstract class AbstractChartPanel<SettingsType extends ChartSettings> ext
decimalPlaces += "0";
}
NumberFormat numberFormat = NumberFormat.getFormat("0" +decimalPlaces);
selectedPointLabel.setText(competitor.name + " at " + dateFormat.format(new Date((long) item.getDataPoint().getX()))
+ ": " + numberFormat.format(item.getDataPoint().getY()) + unit);
selectedPointLabel.setText(stringMessages.valueForCompetitorAt(competitor.name,
dateFormat.format(new Date((long) item.getDataPoint().getX())),
numberFormat.format(item.getDataPoint().getY()) + unit));
}
} else {
selectedPointLabel.setText(getStringMessages().noSelection());
@@ -113,19 +113,6 @@ public abstract class ExpandableSortableColumn<C> extends SortableColumn<Leaderb
return Collections.emptyList();
}
private Collection<SortableColumn<LeaderboardRowDAO, ?>> getAllChildren() {
List<SortableColumn<LeaderboardRowDAO, ?>> transitiveChildren = new ArrayList<SortableColumn<LeaderboardRowDAO,?>>();
for (SortableColumn<LeaderboardRowDAO, ?> childColumn : getDirectChildren()) {
transitiveChildren.add(childColumn);
if (childColumn instanceof ExpandableSortableColumn<?>) {
@SuppressWarnings("unchecked")
ExpandableSortableColumn<C> expandableChild = (ExpandableSortableColumn<C>) childColumn;
transitiveChildren.addAll(expandableChild.getAllChildren());
}
}
return transitiveChildren;
}
/**
* Determines the direct and transitive child columns that due to the current expansion state should be
* visible. Note that for columns not currently visible or currently being expanded (see {@link #toggleExpansion()}),