Merge branch 'master' into bug3345

Conflicts:
	java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java
	java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/simulator/SimulatorMainPanel.java
This commit is contained in:
Axel Uhl committed 2015-11-21 01:41:55 +01:00
commit fa8cee0381
25 files changed
+1232 -217

No files matched your search

@@ -9,10 +9,12 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.sap.sse.common.Cloner;
import com.sap.sse.common.Util;
import com.sap.sse.common.Util.Pair;
/**
* Reduces the transmission size of a {@link LeaderboardDTO} by comparing this object to a previous version of
@@ -174,16 +176,20 @@ public class IncrementalLeaderboardDTO extends LeaderboardDTO implements Increme
}
/**
* @param previousVersion needed because after serialization/deserialization, the transient {@link #previousLeaderboard} will be <code>null</code>
* @param previousVersion
* needed because after serialization/deserialization, the transient {@link #previousLeaderboard}
* will be <code>null</code>.
* @return a map whose keys are the {@link CompetitorDTO#getIdAsString()} of the competitors for which the value
* tells the set of keys that are unchanged
*/
public Set<com.sap.sse.common.Util.Pair<CompetitorDTO, K>> getAllUnchangedCompetitorsAndKeys(LeaderboardDTO previousVersion) {
Set<com.sap.sse.common.Util.Pair<CompetitorDTO, K>> result = new HashSet<com.sap.sse.common.Util.Pair<CompetitorDTO,K>>();
public Map<String, Set<K>> getAllUnchangedCompetitorIdsAsStringAndKeys(LeaderboardDTO previousVersion) {
Map<String, Set<K>> result = new HashMap<>();
for (Map.Entry<K, long[]> raceColumnNameAndBitSet : unchanged.entrySet()) {
final long[] bitset = raceColumnNameAndBitSet.getValue();
if (bitset == null) {
// this means that all entries for the column are unchanged for all competitors
for (CompetitorDTO competitor : previousVersion.competitors) {
result.add(new com.sap.sse.common.Util.Pair<CompetitorDTO, K>(competitor, raceColumnNameAndBitSet.getKey()));
Util.add(result, competitor.getIdAsString(), raceColumnNameAndBitSet.getKey());
}
} else {
int competitorNumber = 0;
@@ -191,7 +197,7 @@ public class IncrementalLeaderboardDTO extends LeaderboardDTO implements Increme
long bitValue = 1;
for (int bit=0; bit<Long.SIZE; bit++) {
if ((bitset[arrayIndex] & bitValue) != 0) {
result.add(new com.sap.sse.common.Util.Pair<CompetitorDTO, K>(previousVersion.competitors.get(competitorNumber), raceColumnNameAndBitSet.getKey()));
Util.add(result, previousVersion.competitors.get(competitorNumber).getIdAsString(), raceColumnNameAndBitSet.getKey());
}
bitValue <<= 1;
competitorNumber++;
@@ -321,6 +327,14 @@ public class IncrementalLeaderboardDTO extends LeaderboardDTO implements Increme
}
private void applyThisToPreviousVersionByUpdatingThis(LeaderboardDTO previousVersion) {
// As a performance improvement for the GWT-compiled version of this class, try to avoid key types
// other than strings when there is a map or set to be implemented that has a lot of strain on the
// put / add / contains methods. For this, we use the competitor's getIdAsString() result that
// identifies them reasonably well.
final Map<String, CompetitorDTO> competitorsOfPreviousVersionByIdAsString = new HashMap<>();
for (final CompetitorDTO c : previousVersion.competitors) {
competitorsOfPreviousVersionByIdAsString.put(c.getIdAsString(), c);
}
if (this.updatedFromPreviousVersionWithId != null) {
if (!this.updatedFromPreviousVersionWithId.equals(previousVersion.getId())) {
throw new IllegalStateException("This incremental leaderboard DTO was already applied to a different previous version. It cannot be applied multiple times.");
@@ -410,62 +424,66 @@ public class IncrementalLeaderboardDTO extends LeaderboardDTO implements Increme
row.competitor = expandedCompetitor;
rows.put(expandedCompetitor, row);
}
final Set<CompetitorDTO> rowsUnchangedForCompetitors = new HashSet<CompetitorDTO>();
final Set<String> rowsUnchangedForCompetitorsWithIdAsString = new HashSet<>();
if (rowsUnchanged != null) {
for (com.sap.sse.common.Util.Pair<CompetitorDTO, Void> rowUnchanged : rowsUnchanged.getAllUnchangedCompetitorsAndKeys(previousVersion)) {
rowsUnchangedForCompetitors.add(rowUnchanged.getA());
rows.put(rowUnchanged.getA(), previousVersion.rows.get(rowUnchanged.getA()));
for (Entry<String, Set<Void>> rowUnchanged : rowsUnchanged.getAllUnchangedCompetitorIdsAsStringAndKeys(previousVersion).entrySet()) {
rowsUnchangedForCompetitorsWithIdAsString.add(rowUnchanged.getKey());
final CompetitorDTO previousCompetitor = competitorsOfPreviousVersionByIdAsString.get(rowUnchanged.getKey());
rows.put(previousCompetitor, previousVersion.rows.get(previousCompetitor));
}
}
final Set<com.sap.sse.common.Util.Pair<CompetitorDTO, String>> allUnchangedLeaderboardEntriesAsCompetitorsAndColumnNames =
unchangedLeaderboardEntries == null ? new HashSet<com.sap.sse.common.Util.Pair<CompetitorDTO,String>>() :
unchangedLeaderboardEntries.getAllUnchangedCompetitorsAndKeys(previousVersion);
final Map<String, Set<String>> allUnchangedLeaderboardEntriesAsCompetitorIdsAsStringAndColumnNames =
unchangedLeaderboardEntries == null ? new HashMap<String, Set<String>>() :
unchangedLeaderboardEntries.getAllUnchangedCompetitorIdsAsStringAndKeys(previousVersion);
if (unchangedLeaderboardEntries != null) {
for (com.sap.sse.common.Util.Pair<CompetitorDTO, String> competitorAndColumnName : allUnchangedLeaderboardEntriesAsCompetitorsAndColumnNames) {
CompetitorDTO previousCompetitor = competitorAndColumnName.getA();
if (!rowsUnchangedForCompetitors.contains(previousCompetitor)) { // only care if not the entire row was marked unchanged
LeaderboardEntryDTO previousEntry = previousVersion.rows.get(previousCompetitor).fieldsByRaceColumnName.get(
competitorAndColumnName.getB());
final LeaderboardRowDTO row = rows.get(previousCompetitor);
if (row != null) { // may be null if the competitor disappeared, e.g., because of suppression
row.fieldsByRaceColumnName.put(competitorAndColumnName.getB(), previousEntry);
for (Entry<String, Set<String>> competitorAndColumnNames : allUnchangedLeaderboardEntriesAsCompetitorIdsAsStringAndColumnNames.entrySet()) {
CompetitorDTO previousCompetitor = competitorsOfPreviousVersionByIdAsString.get(competitorAndColumnNames.getKey());
for (final String columnName : competitorAndColumnNames.getValue()) {
if (!rowsUnchangedForCompetitorsWithIdAsString.contains(competitorAndColumnNames.getKey())) { // only care if not the entire row was marked unchanged
LeaderboardEntryDTO previousEntry = previousVersion.rows.get(previousCompetitor).fieldsByRaceColumnName.get(columnName);
final LeaderboardRowDTO row = rows.get(previousCompetitor);
if (row != null) { // may be null if the competitor disappeared, e.g., because of suppression
row.fieldsByRaceColumnName.put(columnName, previousEntry);
}
}
}
}
}
if (legDetailsUnchanged != null) {
for (com.sap.sse.common.Util.Pair<CompetitorDTO, com.sap.sse.common.Util.Pair<String, Integer>> competitorInPreviosAndColumnNameAndLegDetailsIndex : legDetailsUnchanged
.getAllUnchangedCompetitorsAndKeys(previousVersion)) {
CompetitorDTO previousCompetitor = competitorInPreviosAndColumnNameAndLegDetailsIndex.getA();
final String raceColumnName = competitorInPreviosAndColumnNameAndLegDetailsIndex.getB().getA();
// if it's already clear that the entire LeaderboardEntryDTO was unchanged, the entry in legDetailsUnchanged was
// merely a hint for column compression within legDetailsUnchanged and doesn't need to be handled here
if (!allUnchangedLeaderboardEntriesAsCompetitorsAndColumnNames
.contains(new com.sap.sse.common.Util.Pair<CompetitorDTO, String>(previousCompetitor, raceColumnName))) {
final LeaderboardRowDTO leaderboardRowDTO = rows.get(previousCompetitor);
LeaderboardEntryDTO leaderboardEntry = leaderboardRowDTO == null ? null
: leaderboardRowDTO.fieldsByRaceColumnName.get(raceColumnName);
if (leaderboardEntry != null) {
final LeaderboardRowDTO previousLeaderboardRowDTO = previousVersion.rows
.get(previousCompetitor);
final LeaderboardEntryDTO previousLeaderboardEntryDTO = previousLeaderboardRowDTO == null ? null
: previousLeaderboardRowDTO.fieldsByRaceColumnName.get(raceColumnName);
final List<LegEntryDTO> previousLegDetails = previousLeaderboardEntryDTO == null ? null
: previousLeaderboardEntryDTO.legDetails;
if (previousLegDetails == null) {
// the leg index can only be null if the previous leg details are null
leaderboardEntry.legDetails = null;
} else {
// here, the leg index cannot be null
if (leaderboardEntry.legDetails == null) {
leaderboardEntry.legDetails = new ArrayList<LegEntryDTO>();
for (Entry<String, Set<Pair<String, Integer>>> competitorInPreviosAndColumnNameAndLegDetailsIndex :
legDetailsUnchanged.getAllUnchangedCompetitorIdsAsStringAndKeys(previousVersion).entrySet()) {
CompetitorDTO previousCompetitor = competitorsOfPreviousVersionByIdAsString.get(competitorInPreviosAndColumnNameAndLegDetailsIndex.getKey());
for (final Pair<String, Integer> columnNameAndLegDetailsIndex : competitorInPreviosAndColumnNameAndLegDetailsIndex.getValue()) {
final String raceColumnName = columnNameAndLegDetailsIndex.getA();
// if it's already clear that the entire LeaderboardEntryDTO was unchanged, the entry in legDetailsUnchanged was
// merely a hint for column compression within legDetailsUnchanged and doesn't need to be handled here
final Set<String> unchangedRaceColumnNamesForCompetitor;
if ((unchangedRaceColumnNamesForCompetitor=allUnchangedLeaderboardEntriesAsCompetitorIdsAsStringAndColumnNames.get(competitorInPreviosAndColumnNameAndLegDetailsIndex.getKey())) == null
|| !unchangedRaceColumnNamesForCompetitor.contains(raceColumnName)) {
final LeaderboardRowDTO leaderboardRowDTO = rows.get(previousCompetitor);
LeaderboardEntryDTO leaderboardEntry = leaderboardRowDTO == null ? null
: leaderboardRowDTO.fieldsByRaceColumnName.get(raceColumnName);
if (leaderboardEntry != null) {
final LeaderboardRowDTO previousLeaderboardRowDTO = previousVersion.rows.get(previousCompetitor);
final LeaderboardEntryDTO previousLeaderboardEntryDTO = previousLeaderboardRowDTO == null ? null
: previousLeaderboardRowDTO.fieldsByRaceColumnName.get(raceColumnName);
final List<LegEntryDTO> previousLegDetails = previousLeaderboardEntryDTO == null ? null
: previousLeaderboardEntryDTO.legDetails;
if (previousLegDetails == null) {
// the leg index can only be null if the previous leg details are null
leaderboardEntry.legDetails = null;
} else {
// here, the leg index cannot be null
if (leaderboardEntry.legDetails == null) {
leaderboardEntry.legDetails = new ArrayList<LegEntryDTO>();
}
final Integer pos = columnNameAndLegDetailsIndex.getB();
ensureSize(leaderboardEntry.legDetails, pos + 1);
leaderboardEntry.legDetails.set(pos, previousLegDetails.get(pos));
}
final Integer pos = competitorInPreviosAndColumnNameAndLegDetailsIndex.getB().getB();
ensureSize(leaderboardEntry.legDetails, pos + 1);
leaderboardEntry.legDetails.set(pos, previousLegDetails.get(pos));
}
}
}
}
}
}
}
@@ -638,11 +638,18 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
// deprecated style: a DBObject whose keys are the escaped competitor names
// new style: a BasicDBList whose entries are DBObjects with COMPETITOR_ID and COMPETITOR_DISPLAY_NAME fields
if (competitorDisplayNames != null) {
for (Object o : (BasicDBList) competitorDisplayNames) {
DBObject competitorDisplayName = (DBObject) o;
final Serializable competitorId = (Serializable) competitorDisplayName.get(FieldNames.COMPETITOR_ID.name());
final String displayName = (String) competitorDisplayName.get(FieldNames.COMPETITOR_DISPLAY_NAME.name());
correctionsToUpdate.setDisplayNameByID(competitorId, displayName);
if (competitorDisplayNames instanceof BasicDBList) {
for (Object o : (BasicDBList) competitorDisplayNames) {
DBObject competitorDisplayName = (DBObject) o;
final Serializable competitorId = (Serializable) competitorDisplayName.get(FieldNames.COMPETITOR_ID.name());
final String displayName = (String) competitorDisplayName.get(FieldNames.COMPETITOR_DISPLAY_NAME.name());
correctionsToUpdate.setDisplayNameByID(competitorId, displayName);
}
} else {
logger.severe("Deprecated, now unreadable format of the "+FieldNames.LEADERBOARD_COMPETITOR_DISPLAY_NAMES.name()
+" field for leaderboard "+dbLeaderboard.get(FieldNames.LEADERBOARD_NAME.name())+
". You will have to update the competitor display names manually: "+
competitorDisplayNames);
}
}
}
@@ -1,60 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="com.google.gdt.eclipse.suite.webapp">
<booleanAttribute key="com.google.gdt.eclipse.core.RUN_SERVER" value="false"/>
<stringAttribute key="com.google.gdt.eclipse.suiteMainTypeProcessor.PREVIOUSLY_SET_MAIN_TYPE_NAME" value="com.google.gwt.dev.GWTShell"/>
<booleanAttribute key="com.google.gdt.eclipse.suiteWarArgumentProcessor.IS_WAR_FROM_PROJECT_PROPERTIES" value="true"/>
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
<listEntry value="com.sap.sailing.gwt.ui.VideoPopup"/>
<listEntry value="com.sap.sailing.gwt.ui.Simulator"/>
</listAttribute>
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="/gwt/Home.html"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.gwt.ui"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6&quot; javaProject=&quot;com.sap.sailing.gwt.ui&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.gwt.ui/src/main/resources&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.gwt.ui/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.googlecode.java-diff-utils/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain.common/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/org.json.simple/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.server/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain.tractracadapter/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.expeditionconnector/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.declination/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.declination/resources&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.udpconnector/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.mongodb/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain.swisstimingadapter/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain.persistence/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain.swisstimingadapter.persistence/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain.tractracadapter.persistence/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/org.moxieapps.gwt.highcharts/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.geocoding/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.datamining.shared/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.common/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.datamining.shared/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.gwt/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.google.gwt.osgi/lib/gwt-user.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;com.sap.sailing.gwt.ui&quot;/&gt;&#10;&lt;/runtimeClasspathEntry&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.gwt.adminconsole/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.operationaltransformation/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.replication/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.security.common/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gwt.eclipse.core.moduleClasspathProvider"/>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-nosuperDevMode -war &quot;${project_loc:com.sap.sailing.gwt.ui}&quot; -noserver -remoteUI &quot;${gwt_remote_ui_server_port}:${unique_id}&quot; -logLevel INFO -codeServerPort 9997 -startupUrl /gwt/Home.html com.sap.sailing.gwt.ui.Search -startupUrl /gwt/Home.html com.sap.sailing.gwt.Home -startupUrl /gwt/AdminConsole.html com.sap.sailing.gwt.ui.AdminConsole -startupUrl /gwt/LeaderboardEditing.html com.sap.sailing.gwt.ui.LeaderboardEditing -startupUrl /gwt/Leaderboard.html com.sap.sailing.gwt.ui.Leaderboard -startupUrl /gwt/Spectator.html com.sap.sailing.gwt.ui.Spectator -startupUrl /gwt/EmbeddedMapAndWindChart.html com.sap.sailing.gwt.ui.EmbeddedMapAndWindChart -startupUrl /gwt/RaceBoard.html com.sap.sailing.gwt.ui.RaceBoard -startupUrl /gwt/PolarSheets.html com.sap.sailing.gwt.ui.PolarSheets -startupUrl /gwt/RegattaOverview.html com.sap.sailing.gwt.ui.RegattaOverview -startupUrl /gwt/DataMining.html com.sap.sailing.gwt.ui.DataMining -startupUrl /gwt/Simulator.html com.sap.sailing.gwt.ui.Simulator com.sap.sailing.gwt.ui.VideoPopup"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.gwt.ui"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx2048m -XX:MaxPermSize=512m -Xdebug -Xrunjdwp:transport=dt_socket,address=7999,server=y"/>
</launchConfiguration>
+713
View File
@@ -396,3 +396,716 @@ input.magnifier {
-moz-border-radius: 5px; border: 1px solid #177980;}
-o-border-radius: 5px; border: 1px solid #177980;}
-ms-border-radius: 5px; border: 1px solid #177980;}
/** Add css rules here for your application. */
/*
body #calendar:after
content: " ";
display: block;
height: 0;
clear: both;
visibility: hidden;
*/
* {
font-family: 'Open Sans', sans-serif;
font-size: 12px;
}
iframe {
display: block;
width: 100%;
height: 100%;
border: none;
overflow-y: auto;
overflow-x: hidden;
}
.clear {
clear: both;
font-size: 1px;
height: 0px;
line-height: 0px;
margin: -1px 0 0;
width: 100%;
}
.cover {
left: -1000px;
overflow: hidden;
position: absolute;
top: -1000px;
}
body {
background: white;
font-family: 'Open Sans', Arial, Verdana, sans-serif;
line-height: 1;
font-size: 14px;
font-weight: 400;
margin: 0;
}
table td, select, button {
font-family: 'Open Sans', Arial, Verdana, sans-serif;
line-height: 1;
font-size: 14px;
}
.contentOuterPanel {
background: #dddcdc;
margin: 0 12px 0 12px;
padding: 12px;
}
/** Example rules used by the template application (remove for your app) */
h1 {
font-size: 2em;
font-family: 'Open Sans', Arial, Verdana, sans-serif;
font-weight: 700;
color: #777777;
margin: 40px 0px 70px;
text-align: center;
}
table {
border-collapse: separate;
}
.CombinedWindPanelParentDiv {
padding-top: 34px;
padding-left: 10px;
}
.TrueNorthIndicatorPanelParentDiv {
padding-top: 10px;
padding-left: 10px;
}
.MapSimulationLegendParentDiv {
padding-bottom: 10px;
padding-right: 10px;
pointer-events: none;
}
.MapSimulationLegend {
pointer-events: all;
}
.RaceMap-HeaderPanel {
height: 60px;
width: 100%;
background-color: #333;
opacity: .5;
}
.leaderboardLabel {
border-bottom: 2px solid #007dc0;
padding: 0 0 6px 0;
font-weight: 700;
}
.refreshAndSettings {
background: #f2f2f2;
border-bottom: 2px solid #fff;
border-top: 2px solid #fff;
height: 30px;
}
.refreshAndSettings table td {
padding: 0 10px 0 0;
}
.refreshAndSettings table table td {
padding: 0 0 0 0;
}
.race-name {
line-height: 1.0;
}
.openColumn {
position: relative;
vertical-align: middle;
}
img.openColumn {
display: block;
margin: 3px auto 3px auto !important;
}
.breadcrumbPanel {
height: 30px;
margin: 0 12px 13px 12px;
}
.mainPanel {
width: 100%;
}
.raceBoardNavigation {
float: left;
margin: 9px 0 0 12px;
font-family: 'Open Sans', Arial, Verdana, sans-serif;
font-weight: 300;
}
.raceBoardControls {
float: right;
margin: 9px 0 0 12px;
font-family: 'Open Sans', Arial, Verdana, sans-serif;
font-weight: 300;
}
.raceBoardNavigation-navigationitem {
color: #dddcdc;
text-transform: uppercase;
font-weight: 500;
margin: 0 12px 0 0;
padding: 0 0 5px 0;
}
.raceBoardNavigation-navigationitem:hover {
border-bottom: 4px solid #f0ab00;
color: #dddcdc;
text-decoration: none;
}
.raceBoardNavigation-navigationitem:active {
border-bottom: 4px solid #f0ab00;
color: #dddcdc;
text-decoration: none;
}
.competitorInfo-Canvas {
pointer-events: none;
}
.gwt-DialogBox {
z-index: 20;
}
.abstractChartPanel-importantMessageOfChart {
font-family: 'Open Sans', Arial, Verdana, sans-serif;
font-weight: 600;
font-size: 20px;
height: 70px;
margin: 0 auto;
padding: 49px 0 0 80px;
width: 300px;
color: #7c7c7c;
background: url(images/important-message.png) left center no-repeat;
}
.breadcrumbPanel-NextArrow {
display: none;
}
.errorLabel {
color: #FF0000;
}
.raceBoardNavigation-settingsButtonPanel {
float: right;
margin: 9px 12px 0 0;
}
.raceBoardNavigation-settingsButton {
background: url(images/settings_white.png),
url(images/btn-cta-orangeleft.png);
background-position: center, center 0;
background-repeat: no-repeat, repeat-x;
width: 27px;
height: 23px;
margin: 0 12px 0 1px;
-webkit-border-radius: 0px 3px 3px 0px;
-moz-border-radius: 0px 3px 3px 0px;
-o-border-radius: 0px 3px 3px 0px;
-ms-border-radius: 0px 3px 3px 0px;
border-radius: 0px 3px 3px 0px;
}
.raceBoardNavigation-settingsButton:hover {
background-image: url(images/settings_white.png),
url(images/btn-cta-orangeleft.png);
background-position: center, center -30px;
background-repeat: no-repeat, repeat-x;
cursor: pointer;
}
.raceBoardNavigation-filterButton:hover {
background-image: url(images/filter_white.png),
url(images/btn-cta-orangeleft.png);
background-position: center, center -30px;
background-repeat: no-repeat, repeat-x;
cursor: pointer;
}
.raceBoardNavigation-innerElement {
background: url("images/btn-cta-orangeleft.png") repeat-x scroll center
0 transparent;
color: #FFFFFF;
cursor: pointer;
font-family: 'Open Sans', Verdana, Arial, sans-serif;
font-weight: 600;
font-size: 14px;
margin: 0 0 0 0;
padding: 2px 7px 2px 3px;
height: 18px;
display: inline-block;
text-decoration: none;
border-radius: 5px 0 0 5px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.25);
border-bottom: 1px solid rgba(0, 0, 0, 0.25);
}
.raceBoardNavigation-innerElement:active {
top: 1px;
position: relative;
}
.raceBoardNavigation-innerElement:hover {
background: url("images/btn-cta-orangeleft.png") repeat-x scroll center
-30px transparent;
cursor: pointer;
}
.raceBoardNavigation-innerElement label {
cursor: pointer;
}
.raceBoardNavigation-standaloneElement {
background: url("images/btn-cta-orangeleft.png") repeat-x scroll center
0 transparent;
color: #FFFFFF;
cursor: pointer;
font-family: 'Open Sans', Verdana, Arial, sans-serif;
font-weight: 600;
font-size: 14px;
margin: 0 0 0 0;
padding: 2px 7px 2px 3px;
height: 23px;
display: inline-block;
text-decoration: none;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.25);
border-bottom: 1px solid rgba(0, 0, 0, 0.25);
border-radius: 5px 5px 5px 5px;
}
.raceBoardNavigation-standaloneElement:active {
top: 1px;
position: relative;
}
.raceBoardNavigation-standaloneElement:hover {
background: url("images/btn-cta-orangeleft.png") repeat-x scroll center
-30px transparent;
cursor: pointer;
}
.raceBoardNavigation-standaloneElement label {
cursor: pointer;
}
.timePanelButton {
float: left;
margin: 0 0 0 5px;
}
.timePanelButton-SlowDown {
background-color: red !important;
}
.timePanelButton-SpeedUp {
background-color: green !important;
}
.playPauseButton {
padding: 0;
float: left;
width: 32px;
height: 28px;
background: url(images/viewicons/@1x/img/SAP_RV_Play_INACTIVE.png)
center no-repeat;
cursor: pointer;
border: 1px solid #cecece;
border-radius: 4px;
outline: 0;
}
.playPauseButton:hover {
cursor: pointer;
background-color: #cecece;
}
.playPauseButtonPause {
background: url(images/viewicons/@2x/img/SAP_RV_Pause_INACTIVE.png) 2px
0 no-repeat;
outline: 0;
background-size: contain;
}
.playPauseButtonPause:hover {
cursor: pointer;
}
.backToLivePlayButton {
width: 42px;
height: 38px;
font-size: 8px;
white-space: normal;
border-radius: 4px;
border: none;
margin-right: 23px;
margin-top: 5px;
margin-bottom: 5px;
z-index: 1;
}
.backToLivePlayButton-Inactive {
color: #6dc021;
background-color: white;
font-weight: bold;
}
.backToLivePlayButton-Active {
background-color: #6dc021;
color: white;
font-weight: normal;
}
.backToLivePlayButton:hover {
border: 2px solid gray;
}
.backToLivePlayButton:focus {
outline: 0 !important;
}
.dockLayoutPanel div[style="position: absolute; overflow: hidden; left: 0px; right: 0px; bottom: 0px; height: 90px;"]
{
z-index: 10;
}
.browserOptimizedMessage {
padding: 15px 0px;
}
.trackingQuality-circle {
width: 8px;
height: 8px;
border-radius: 50%;
float: left;
}
.circleYellow {
background: #fbba00;
}
.circleGreen {
background: #8ab54e;
}
.circleRed {
background: #f01010;
}
.busyIndicator-Simple {
position: absolute;
top: 0.7em;
right: 7.4em;
}
.busyIndicator-Circle {
}
.raceBoard-TitlePanel {
position: relative;
top: 10px;
z-index: 10;
color: #fff;
margin-left: auto;
margin-right: auto;
}
.raceBoard-TitlePanel-RaceNameLabel {
font-size: 32px;
font-weight: bold;
padding: 7px;
}
.raceBoard-Logo {
position: absolute;
top: 6px;
left: 10px;
z-index: 10;
cursor: pointer;
}
.SideBySideComponentViewer-MainPanel {
top: 12px;
}
.TimePanel-ShowExtended-Button {
width: 29px;
height: 28px;
float: left;
cursor: pointer;
border-radius: 4px;
border: 1px solid #ececec;
}
.TimePanel-ShowExtended-Button-Open {
background: white url(images/arrows_bottom_black.png) center no-repeat;
}
.TimePanel-ShowExtended-Button-Closed {
background: white url(images/arrows_top_black.png) center no-repeat;
}
.TimePanel-ShowExtended-Button:hover {
background-color: #cecece;
}
.TimePanel-ShowExtended-Button:focus {
outline: 0 !important;
}
.RaceBoard-globalNavigation-Link {
display: inline;
margin-right: 3px;
}
.RaceBoard-globalNavigation-Link a {
color: #fff;
cursor: pointer;
}
.RaceBoard-globalNavigation-Link+.RaceBoard-globalNavigation-Link:before
{
content: ' \00bb\00a0';
}
.TimePanel-settingsButtonStyle {
position: absolute;
right: 0px;
z-index: 1;
border: none;
}
.TimePanel-settingsButtonStyle:focus {
outline: 0 !important;
}
.TimePanel-settingsButtonStyle:hover {
border: 1px solid gray;
}
.gwt-SplitLayoutPanel-NorthSouthToggleButton-Closed-multiCompetitorRaceChart
{
background-color: white;
background-image:
url(images/viewicons/@1x/img/SAP_RV_CompetitorCharts_INACTIVE.png),
url(images/arrows_top_black_small.png);
background-repeat: no-repeat, no-repeat;
background-position: 5% 50%, 95% 50%
}
.gwt-SplitLayoutPanel-NorthSouthToggleButton-Open-multiCompetitorRaceChart
{
background-color: white;
background-image:
url(images/viewicons/@1x/img/SAP_RV_CompetitorCharts_GHOSTED.png),
url(images/arrows_bottom_black_small.png);
background-repeat: no-repeat, no-repeat;
background-position: 5% 50%, 95% 50%
}
.gwt-SplitLayoutPanel-NorthSouthToggleButton-Closed-windChart {
background-color: white;
background-image:
url(images/viewicons/@1x/img/SAP_RV_CompetitorCharts_INACTIVE.png),
url(images/arrows_top_black_small.png);
background-repeat: no-repeat, no-repeat;
background-position: 5% 50%, 95% 50%
}
.gwt-SplitLayoutPanel-NorthSouthToggleButton-Open-windChart {
background-color: white;
background-image:
url(images/viewicons/@1x/img/SAP_RV_CompetitorCharts_GHOSTED.png),
url(images/arrows_bottom_black_small.png);
background-repeat: no-repeat, no-repeat;
background-position: 5% 50%, 95% 50%
}
.gwt-SplitLayoutPanel-EastToggleButton-Open-leaderboard {
background-color: white;
background-image:
url(images/viewicons/@1x/img/SAP_RV_Leaderboard_GHOSTED.png),
url(images/arrows_top_black_small.png);
background-repeat: no-repeat, no-repeat;
background-position: 4% 50%, 96% 50%
}
.gwt-SplitLayoutPanel-EastToggleButton-Closed-leaderboard {
background-color: white;
background-image:
url(images/viewicons/@1x/img/SAP_RV_Leaderboard_INACTIVE.png),
url(images/arrows_bottom_black_small.png);
background-repeat: no-repeat, no-repeat;
background-position: 4% 50%, 96% 50%
}
.gwt-SplitLayoutPanel-NorthSouthToggleButton-Closed-media,
.gwt-SplitLayoutPanel-NorthSouthToggleButton-Open-media {
background-color: white;
background-image:
url(images/viewicons/@1x/img/SAP_RV_AudioVideo_INACTIVE.png);
background-repeat: no-repeat, no-repeat;
background-position: 10% 50%, 90% 50%
}
.gwt-SplitLayoutPanel-NorthSouthToggleButton-mediaplaying {
background-image:
url(images/viewicons/@1x/img/SAP_RV_AudioVideo_GHOSTED.png);
}
.gwt-SplitLayoutPanel-NorthSouthToggleButton-Small-media {
background-position: 5% 50%, 100% 50% !important;
margin-left: 0px !important;
padding: 2px 35px !important;
}
@external gwt-ToggleButton-up, gwt-ToggleButton-down, gwt-ToggleButton-up-hovering, gwt-ToggleButton-down-hovering;
.gwt-ToggleButton-up, .gwt-ToggleButton-up-hovering {
background: url(images/unlock.png) center no-repeat;
margin-left: 5px;
}
.gwt-ToggleButton-down, .gwt-ToggleButton-down-hovering {
background: url(images/lock.png) center no-repeat;
margin-left: 5px;
}
.RegattaRaceInformation-Header {
font-family: 'Open Sans', Arial, Verdana, sans-serif;
position: relative;
left: 140px;
top: 11px;
}
.RegattaRaceInformation-Header .RaceName-Label {
display: inline;
color: white;
margin-right: 10px;
font-size: 36px;
}
.RegattaRaceInformation-Header .RaceSeriesAndFleet-Label {
display: inline;
color: white;
font-size: 15px;
}
.RegattaAndRaceTime-Header {
position: absolute;
right: 10px;
top: 13px;
text-align: right;
color: white;
}
.RegattaAndRaceTime-Header .RegattaName-Anchor {
font-size: 15px;
color: white;
text-decoration: none;
padding-left: 25px;
background-image: url(images/home.png);
background-repeat: no-repeat;
background-size: 17px;
background-position: 4px 1px;
}
.RegattaAndRaceTime-Header .RegattaName-Anchor:hover {
text-decoration: underline;
}
.RegattaAndRaceTime-Header .RaceTime-Label {
font-size: 15px;
margin-top: 5px;
}
.VideoPopup-Close-Button {
border: none;
}
.Media-Select-Button {
font-size: 15px;
font-size: 1rem;
display: inline-block;
font-weight: 400;
color: #111;
border: none;
padding: 0.5em 0.3em 0.5em 0.8em;
background-color: #fff;
-webkit-transition: background-color 0.2s;
-moz-transition: background-color 0.2s;
-o-transition: background-color 0.2s;
-ms-transition: background-color 0.2s;
transition: background-color 0.2s;
width: 100%;
max-width: 25em;
text-align: left;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.Media-Select-Button:hover, .Media-Select-Button:focus {
background-color: #f0ab00;
}
.Media-Select-Button-playing {
color: #999;
}
.Media-Select-Button-playing:hover, .Media-Select-Button-playing:focus {
color: #fff;
background-color: #ccc;
}
.Media-Select-Popup .dialogMiddleCenterInner {
padding: 0;
}
.Media-Select-Popup .Caption {
padding: 4px 10px;
}
@@ -16,6 +16,7 @@
<link rel="stylesheet" type="text/css" href="/sailing-normalize-3.0.2.cache.css">
<link rel="stylesheet" type="text/css" href="/sailing-fontface-1.0.cache.css">
<link rel="stylesheet" type="text/css" href="Simulator.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
@@ -113,6 +113,7 @@ public class AdminConsoleEntryPoint extends AbstractSailingEntryPoint implements
/* RACES */
final TabLayoutPanel racesTabPanel = panel.addVerticalTab(getStringMessages().trackedRaces(), "RacesPanel");
racesTabPanel.ensureDebugId("RacesPanel");
TrackedRacesManagementPanel trackedRacesManagementPanel = new TrackedRacesManagementPanel(sailingService, this,
this, getStringMessages());
trackedRacesManagementPanel.ensureDebugId("TrackedRacesManagement");
@@ -121,6 +122,7 @@ public class AdminConsoleEntryPoint extends AbstractSailingEntryPoint implements
regattasDisplayers.add(trackedRacesManagementPanel);
final CompetitorPanel competitorPanel = new CompetitorPanel(sailingService, getStringMessages(), this);
competitorPanel.ensureDebugId("CompetitorPanel");
panel.addToTabPanel(racesTabPanel, new DefaultRefreshableAdminConsolePanel<CompetitorPanel>(competitorPanel) {
@Override
public void refreshAfterBecomingVisible() {
@@ -81,10 +81,12 @@ public class CompetitorEditDialog extends DataEntryDialog<CompetitorDTO> {
return result;
}
}, /* animationEnabled */true, callback);
this.ensureDebugId("CompetitorEditDialog");
this.stringMessages = stringMessages;
this.competitorToEdit = competitorToEdit;
this.boatClassName = createSuggestBox(BoatClassMasterdata.getAllBoatClassNames(/* includeAlternativeNames */ true));
boatClassName.ensureDebugId("BoatClassNameSuggestBox");
int i=0;
List<String> boatClassNamesList = new ArrayList<String>();
for (BoatClassMasterdata t : BoatClassMasterdata.values()) {
@@ -97,6 +99,7 @@ public class CompetitorEditDialog extends DataEntryDialog<CompetitorDTO> {
boatClassName.setValue(boatClass); // widgets have to accept null values here
}
this.name = createTextBox(competitorToEdit.getName());
name.ensureDebugId("NameTextBox");
this.email = createTextBox(competitorToEdit.getEmail());
this.displayColorTextBox = createTextBox(competitorToEdit.getColor() == null ? "" : competitorToEdit.getColor().getAsHtml());
this.threeLetterIocCountryCode = createListBox(/* isMultipleSelect */ false);
@@ -127,6 +130,7 @@ public class CompetitorEditDialog extends DataEntryDialog<CompetitorDTO> {
}
}
this.sailId = createTextBox(competitorToEdit.getSailID());
sailId.ensureDebugId("SailIdTextBox");
this.flagImageURL = new URLFieldWithFileUpload(stringMessages);
this.flagImageURL.setURL(competitorToEdit.getFlagImageURL());
this.imageUrlAndUploadComposite = new URLFieldWithFileUpload(stringMessages);
@@ -81,6 +81,7 @@ public class CompetitorPanel extends SimplePanel {
});
buttonPanel.add(allowReloadButton);
Button addCompetitorButton = new Button(stringMessages.add());
addCompetitorButton.ensureDebugId("AddCompetitorButton");
addCompetitorButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
@@ -188,7 +189,7 @@ public class CompetitorPanel extends SimplePanel {
}
private void openEditCompetitorDialog(CompetitorDTO competitor) {
new CompetitorEditDialog(stringMessages, competitor, new DialogCallback<CompetitorDTO>() {
final CompetitorEditDialog dialog = new CompetitorEditDialog(stringMessages, competitor, new DialogCallback<CompetitorDTO>() {
@Override
public void ok(CompetitorDTO competitor) {
sailingService.addOrUpdateCompetitor(competitor, new AsyncCallback<CompetitorDTO>() {
@@ -207,7 +208,9 @@ public class CompetitorPanel extends SimplePanel {
@Override
public void cancel() {
}
}, /* boat class to be used from CompetitorDTO */ null).show();
}, /* boat class to be used from CompetitorDTO */ null);
dialog.ensureDebugId("CompetitorEditDialog");
dialog.show();
}
private String getLocaleInfo() {
@@ -209,6 +209,7 @@ public class CompetitorTableWrapper<S extends SelectionModel<CompetitorDTO>> ext
table.addColumn(imageColumn, stringMessages.image());
table.addColumn(competitorEMailColumn, stringMessages.email());
table.addColumn(competitorIdColumn, stringMessages.id());
table.ensureDebugId("CompetitorsTable");
}
public Iterable<CompetitorDTO> getAllCompetitors() {
@@ -464,7 +464,6 @@ actionAddEvent=Add Event
publicationUrl=Publication URL
suppress=Suppress
isPublic=Is public
suppress=Suppress
unsuppress=Unsuppress
suppressedCompetitors=Suppressed Competitors
mediaPanel=Audio & Video
@@ -533,7 +532,6 @@ knotsValue={0,number,#0.0} kts
knotsRange={0,number,#0.0} - {1,number,#0.0} kts
scoringSchemeHighPointFirstGetsOne=High Point, winner gets 1 point
scoringSchemeHighPointFirstGetsTen=High Point, winner gets 10 points
knotsUnit=kts
generatePolarSheet=Generate Polar Sheet
polars=Polar Diagrams
polarSheetChart=Polar Sheet
@@ -587,7 +585,6 @@ courseAreas=Course areas
courseArea=Course area
pleaseEnterNonEmptyCourseArea=Please enter a course area.
pleaseSelectACourseArea=Please select a course area.
radiusInMeters=Radius (m)
lastUpperFlag=Upper flag
lastLowerFlag=Lower flag
cannotAddRacesToRegattaLeaderboardButOnlyToRegatta=This is a regatta leaderboard. You can only add races to this leaderboard directly in the regatta definition.
@@ -767,7 +764,6 @@ startAt=Start at
finishAt=Finish at
protestEndsAt=Protest ends at
unknown=Unknown
earlyStarters=Early starters
raceLog=Race log
regattaLog=Regatta log
refreshRaceLog=Refresh race log
@@ -465,7 +465,6 @@ actionAddEvent=Veranstaltung hinzufügen
publicationUrl=URL für die Veröffentlichung
suppress=Entfernen
isPublic=Öffentlich zugänglich
suppress=Entfernen
unsuppress=Wieder hinzufügen
suppressedCompetitors=Unterdrückte Wettkampfteilnehmer
mediaPanel=Audio & Video
@@ -763,7 +762,6 @@ startAt=Start
finishAt=Rennende
protestEndsAt=Protestzeit endet
unknown=Unbekannt
earlyStarters=Frühstarter
raceLog=RaceLog
regattaLog=RegattaLog
refreshRaceLog=RaceLog neu laden
@@ -448,7 +448,6 @@ actionAddEvent=Добавить событие
publicationUrl=URL-адрес для публикации
suppress=скрыть
isPublic=является открытым
suppress=скрыть
unsuppress=Отобразить
suppressedCompetitors=Скрытые участники
mediaPanel=Аудио и Видео
@@ -567,7 +566,6 @@ courseAreas=Зоны курса
courseArea=Зона курса
pleaseEnterNonEmptyCourseArea=Пожалуйста, выведите зону курса.
pleaseSelectACourseArea=Пожалуйста, выберите зону курса.
radiusInMeters=Радиус (м)
lastUpperFlag=Верхний флажок
lastLowerFlag=Нижний флажок
cannotAddRacesToRegattaLeaderboardButOnlyToRegatta=Это таблица лидеров регаты. Вы можете добавлять гонки в эту таблицу лидеров только непосредственно в определении регаты.
@@ -748,7 +746,6 @@ startAt=Старт в
finishAt=Финиш в
protestEndsAt=Срок подачи протеста завершается в
unknown=Неизвестно
earlyStarters=Совершивших фальшстарт
raceLog=Запись о гонке
regattaLog=Regatta log
refreshRaceLog=Обновить запись о гонке
@@ -61,8 +61,7 @@ public class EditMarkPassingsPanel extends AbsolutePanel implements Component<Ab
private final ErrorReporter errorReporter;
private final StringMessages stringMessages;
private final CompetitorSelectionProvider competitorSelectionModel;
private String leaderboardName;
private RaceColumnDTO column;
private LeaderboardDTO leaderboard;
private CompetitorDTO competitor;
@@ -166,7 +165,8 @@ public class EditMarkPassingsPanel extends AbsolutePanel implements Component<Ab
removeFixedMarkPassingsButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
sailingService.updateFixedMarkPassing(leaderboardName, column, column.getFleet(raceIdentifier),
final RaceColumnDTO column = getColumn();
sailingService.updateFixedMarkPassing(getLeaderboardName(), column, column.getFleet(raceIdentifier),
waypointSelectionModel.getSelectedObject().getA(), null, competitor, new AsyncCallback<Void>() {
@Override
public void onFailure(Throwable caught) {
@@ -184,7 +184,8 @@ public class EditMarkPassingsPanel extends AbsolutePanel implements Component<Ab
setTimeAsMarkPassingsButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
sailingService.updateFixedMarkPassing(leaderboardName, column, column.getFleet(raceIdentifier),
final RaceColumnDTO column = getColumn();
sailingService.updateFixedMarkPassing(getLeaderboardName(), column, column.getFleet(raceIdentifier),
waypointSelectionModel.getSelectedObject().getA(), timer.getTime(), competitor,
new AsyncCallback<Void>() {
@Override
@@ -205,7 +206,8 @@ public class EditMarkPassingsPanel extends AbsolutePanel implements Component<Ab
suppressPassingsButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
sailingService.updateSuppressedMarkPassings(leaderboardName, column,
final RaceColumnDTO column = getColumn();
sailingService.updateSuppressedMarkPassings(getLeaderboardName(), column,
column.getFleet(raceIdentifier), waypointSelectionModel.getSelectedObject().getA(),
competitor, new AsyncCallback<Void>() {
@Override
@@ -225,7 +227,8 @@ public class EditMarkPassingsPanel extends AbsolutePanel implements Component<Ab
removeSuppressedPassingButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
sailingService.updateSuppressedMarkPassings(leaderboardName, column,
final RaceColumnDTO column = getColumn();
sailingService.updateSuppressedMarkPassings(getLeaderboardName(), column,
column.getFleet(raceIdentifier), null, competitor,
new AsyncCallback<Void>() {
@Override
@@ -311,7 +314,8 @@ public class EditMarkPassingsPanel extends AbsolutePanel implements Component<Ab
waypointList.getList().clear();
waypointList.getList().addAll(newMarkPassings);
// Get current edits
sailingService.getCompetitorRaceLogMarkPassingData(leaderboardName, column,
final RaceColumnDTO column = getColumn();
sailingService.getCompetitorRaceLogMarkPassingData(getLeaderboardName(), column,
column.getFleet(raceIdentifier), competitor, new AsyncCallback<Map<Integer, Date>>() {
@Override
public void onFailure(Throwable caught) {
@@ -385,15 +389,8 @@ public class EditMarkPassingsPanel extends AbsolutePanel implements Component<Ab
refreshWaypoints();
}
public void setLeaderboardNameAndColumn(LeaderboardDTO leaderboard) {
if (leaderboard != null) {
leaderboardName = leaderboard.name;
for (RaceColumnDTO columnDTO : leaderboard.getRaceList()) {
if (columnDTO.containsRace(raceIdentifier)) {
column = columnDTO;
}
}
}
public void setLeaderboard(LeaderboardDTO leaderboard) {
this.leaderboard = leaderboard;
}
@Override
@@ -438,4 +435,20 @@ public class EditMarkPassingsPanel extends AbsolutePanel implements Component<Ab
public void filteredCompetitorsListChanged(Iterable<CompetitorDTO> filteredCompetitors) {
}
private String getLeaderboardName() {
return leaderboard.name;
}
private RaceColumnDTO getColumn() {
RaceColumnDTO result = null;
if (leaderboard != null) {
for (RaceColumnDTO columnDTO : leaderboard.getRaceList()) {
if (columnDTO.containsRace(raceIdentifier)) {
result = columnDTO;
break;
}
}
}
return result;
}
}
@@ -233,7 +233,7 @@ public class RaceBoardPanel extends SimplePanel implements RaceSelectionChangeLi
components.add(windChart);
editMarkPassingPanel = new EditMarkPassingsPanel(sailingService, selectedRaceIdentifier,
stringMessages, competitorSelectionProvider, errorReporter, timer);
editMarkPassingPanel.setLeaderboardNameAndColumn(leaderboardPanel.getLeaderboard());
editMarkPassingPanel.setLeaderboardN(aderboardPanel.getLeaderboard());
editMarkPassingPanel.getEntryWidget().setTitle(stringMessages.editMarkPassings());
components.add(editMarkPassingPanel);
}
@@ -361,7 +361,7 @@ public class RaceBoardPanel extends SimplePanel implements RaceSelectionChangeLi
public void updatedLeaderboard(LeaderboardDTO leaderboard) {
leaderboardAndMapViewer.setLeftComponentWidth(leaderboardPanel.getContentPanel().getOffsetWidth());
if (editMarkPassingPanel != null) {
editMarkPassingPanel.setLeaderboardNameAndColumn(leaderboard);
editMarkPassingPanel.setLeaderboardNameaderboard);
}
}
@@ -312,25 +312,38 @@ public class SimulatorMainPanel extends SimplePanel {
timePanel = new TimePanel<TimePanelSettings>(timer, timeRangeProvider, stringMessages, false,
/* isScreenLargeEnoughToOfferChartSupport: no wind or competitor chart is shown; use full horizontal
* extension of time panel */ false);
busyIndicator = new SimpleBusyIndicator(false, 0.8f);
simulatorMap = new SimulatorMap(simulatorSvc, stringMessages, errorReporter, xRes, yRes, border, streamletPars, timer, timePanel,
windParams, busyIndicator, mode, this, showMapControls, new IdentityCoordinateSystem());
simulatorMap = new SimulatorMap(simulatorSvc, stringMessages, errorReporter, xRes, yRes, border, streamletPars,
timer, timePanel, windParams, busyIndicator, mode, this, showMapControls,
new IdentityCoordinateSystem());
simulatorMap.setSize("100%", "100%");
this.rightPanel.add(this.simulatorMap);
createOptionsPanelTop();
createOptionsPanel();
fullTimePanel = this.createTimePanel();
final Button toggleButton = timePanel.getAdvancedToggleButton();
toggleButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
boolean advancedModeShown = timePanel.toggleAdvancedMode();
if (advancedModeShown) {
mainPanel.setWidgetSize(fullTimePanel, 96);
toggleButton.removeStyleDependentName("Closed");
toggleButton.addStyleDependentName("Open");
} else {
mainPanel.setWidgetSize(fullTimePanel, 67);
toggleButton.addStyleDependentName("Closed");
toggleButton.removeStyleDependentName("Open");
}
}
});
mainPanel = new DockLayoutPanel(Unit.PX);
mainPanel.setSize("100%", "100%");
mainPanel.addWest(leftPanel, 470);
mainPanel.addSouth(fullTimePanel, 90);
mainPanel.addSouth(fullTimePanel, 67);
mainPanel.setWidgetHidden(fullTimePanel, true);
createMapOptionsPanel(); // add map-options to mainPanel-North
@@ -342,21 +355,21 @@ public class SimulatorMainPanel extends SimplePanel {
}
public native void setMapInstance(Object mapInstance) /*-{
$wnd.swarmMap = mapInstance;
$wnd.swarmMap = mapInstance;
}-*/;
public native void setCanvasProjectionInstance(Object instance) /*-{
$wnd.swarmCanvasProjection = instance;
}-*/;
$wnd.swarmCanvasProjection = instance;
}-*/;
public native void startStreamlets() /*-{
if ($wnd.swarmAnimator) {
$wnd.swarmUpdData = true;
$wnd.updateStreamlets($wnd.swarmUpdData);
} else {
$wnd.initStreamlets($wnd.swarmMap);
}
}-*/;
if ($wnd.swarmAnimator) {
$wnd.swarmUpdData = true;
$wnd.updateStreamlets($wnd.swarmUpdData);
} else {
$wnd.initStreamlets($wnd.swarmMap);
}
}-*/;
public void setDefaultTimeSettings() {
Date defaultNow = new Date();
@@ -18,6 +18,7 @@ import com.sap.sailing.selenium.pages.HostPage;
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.LeaderboardConfigurationPanelPO;
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.LeaderboardGroupConfigurationPanelPO;
import com.sap.sailing.selenium.pages.adminconsole.regatta.RegattaStructureManagementPanelPO;
import com.sap.sailing.selenium.pages.adminconsole.tracking.TrackedRacesCompetitorsPanelPO;
import com.sap.sailing.selenium.pages.adminconsole.tracking.TrackedRacesManagementPanelPO;
import com.sap.sailing.selenium.pages.adminconsole.tractrac.TracTracEventManagementPanelPO;
@@ -47,7 +48,7 @@ public class AdminConsolePage extends HostPage {
private static final String TRACTRAC_EVENTS_TAB_LABEL = "TracTrac Events"; //$NON-NLS-1$
private static final String TRACTRAC_EVENTS_TAB_IDENTIFIER = "TracTracEventManagement"; //$NON-NLS-1$
private static final String TRACKED_RACES_TAB_PARENT_LABEL = "Races"; //$NON-NLS-1$
private static final String TRACKED_RACES_TAB_PARENT_LABEL = "Tracked races"; //$NON-NLS-1$
private static final String TRACKED_RACES_TAB_PARENT_IDENTIFIER = "RacesPanel"; //$NON-NLS-1$
private static final String TRACKED_RACES_TAB_LABEL = "Tracked races"; //$NON-NLS-1$
@@ -62,6 +63,9 @@ public class AdminConsolePage extends HostPage {
private static final String LEADERBOARD_GROUP_CONFIGURATION_TAB_LABEL = "Leaderboard groups"; //$NON-NLS-1$
private static final String LEADERBOARD_GROUP_CONFIGURATION_TAB_IDENTIFIER = "LeaderboardGroupConfiguration"; //$NON-NLS-1$
private static final String COMPETITOR_PANEL_TAB_LABEL = "Competitors"; //$NON-NLS-1$
private static final String COMPETITOR_PANEL_TAB_IDENTIFIER = "CompetitorPanel"; //$NON-NLS-1$
/**
* <p>Goes to the administration console and returns the representing page object.</p>
*
@@ -120,6 +124,12 @@ public class AdminConsolePage extends HostPage {
LEADERBOARD_GROUP_CONFIGURATION_TAB_IDENTIFIER, false));
}
public TrackedRacesCompetitorsPanelPO goToTrackedRacesCompetitors() {
goToTab(TRACKED_RACES_TAB_PARENT_LABEL, TRACKED_RACES_TAB_PARENT_IDENTIFIER, true);
return new TrackedRacesCompetitorsPanelPO(this.driver, goToTab(COMPETITOR_PANEL_TAB_LABEL,
COMPETITOR_PANEL_TAB_IDENTIFIER, false));
}
/**
* <p>Verifies that the current page is the administration console by checking the title of the page.</p>
*/
@@ -0,0 +1,41 @@
package com.sap.sailing.selenium.pages.adminconsole.tracking;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import com.sap.sailing.selenium.core.BySeleniumId;
import com.sap.sailing.selenium.core.FindBy;
import com.sap.sailing.selenium.pages.common.DataEntryDialogPO;
public class TrackedRacesCompetitorCreateDialogPO extends DataEntryDialogPO {
@FindBy(how = BySeleniumId.class, using = "NameTextBox")
private WebElement nameTextBox;
@FindBy(how = BySeleniumId.class, using = "SailIdTextBox")
private WebElement sailIdTextBox;
@FindBy(how = BySeleniumId.class, using = "BoatClassNameSuggestBox")
private WebElement boatClassNameSuggestBox;
@FindBy(how = BySeleniumId.class, using = "OkButton")
private WebElement okButton;
public TrackedRacesCompetitorCreateDialogPO(WebDriver driver, WebElement element) {
super(driver, element);
}
public void setNameTextBox(String name) {
this.nameTextBox.clear();
this.nameTextBox.sendKeys(name);
}
public void setSailIdTextBox(String sailId) {
this.sailIdTextBox.clear();
this.sailIdTextBox.sendKeys(sailId);
}
public void setBoatClassNameSuggestBox(String boatClassName) {
this.boatClassNameSuggestBox.clear();
this.boatClassNameSuggestBox.sendKeys(boatClassName);
}
}
@@ -0,0 +1,51 @@
package com.sap.sailing.selenium.pages.adminconsole.tracking;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import com.sap.sailing.selenium.pages.gwt.CellTablePO;
import com.sap.sailing.selenium.pages.gwt.DataEntryPO;
import com.sap.sailing.selenium.pages.adminconsole.tracking.TrackedRacesCompetitorTablePO.CompetitorEntry;
public class TrackedRacesCompetitorTablePO extends CellTablePO<CompetitorEntry> {
public static class CompetitorEntry extends DataEntryPO {
private static final String NAME_COLUMN = "Name";
private static final String SAILID_COLUMN = "Sail number";
private static final String BOATCLASSNAME_COLUMN = "Boat Class";
private static final String ID_COLUMN = "ID";
protected CompetitorEntry(TrackedRacesCompetitorTablePO table, WebElement element) {
super(table, element);
}
@Override
public String getIdentifier() {
return getId();
}
public String getId() {
return getColumnContent(ID_COLUMN);
}
public String getName() {
return getColumnContent(NAME_COLUMN);
}
public String getSailId() {
return getColumnContent(SAILID_COLUMN);
}
public String getBoatClassName() {
return getColumnContent(BOATCLASSNAME_COLUMN);
}
}
public TrackedRacesCompetitorTablePO(WebDriver driver, WebElement element) {
super(driver,element);
}
@Override
protected CompetitorEntry createDataEntry(WebElement element) {
return new CompetitorEntry(this, element);
}
}
@@ -0,0 +1,31 @@
package com.sap.sailing.selenium.pages.adminconsole.tracking;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import com.sap.sailing.selenium.core.BySeleniumId;
import com.sap.sailing.selenium.core.FindBy;
import com.sap.sailing.selenium.pages.PageArea;
public class TrackedRacesCompetitorsPanelPO extends PageArea {
@FindBy(how = BySeleniumId.class, using = "AddCompetitorButton")
private WebElement addButton;
@FindBy(how = BySeleniumId.class, using = "CompetitorsTable")
private WebElement competitorsTable;
public TrackedRacesCompetitorsPanelPO(WebDriver driver, WebElement element) {
super(driver, element);
}
public TrackedRacesCompetitorCreateDialogPO pushAddButton() {
this.addButton.click();
waitForAjaxRequests();
WebElement dialog = findElementBySeleniumId(this.driver, "CompetitorEditDialog");
return new TrackedRacesCompetitorCreateDialogPO(this.driver, dialog);
}
public TrackedRacesCompetitorTablePO getCompetitorTable() {
return new TrackedRacesCompetitorTablePO(this.driver, this.competitorsTable);
}
}
@@ -0,0 +1,60 @@
package com.sap.sailing.selenium.test.adminconsole;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import com.sap.sailing.selenium.pages.adminconsole.AdminConsolePage;
import com.sap.sailing.selenium.pages.adminconsole.tracking.TrackedRacesCompetitorCreateDialogPO;
import com.sap.sailing.selenium.pages.adminconsole.tracking.TrackedRacesCompetitorTablePO.CompetitorEntry;
import com.sap.sailing.selenium.pages.adminconsole.tracking.TrackedRacesCompetitorsPanelPO;
import com.sap.sailing.selenium.test.AbstractSeleniumTest;
public class TestCompetitorCreation extends AbstractSeleniumTest {
@Override
@Before
public void setUp() {
clearState(getContextRoot());
super.setUp();
}
@Test
public void testOpenCreateCompetitorDialog() {
final TrackedRacesCompetitorsPanelPO competitorsPanel = goToCompetitorsPanel();
final TrackedRacesCompetitorCreateDialogPO dialog = competitorsPanel.pushAddButton(); // fails with an exception if the dialog is not found
assertNotNull(dialog);
}
private TrackedRacesCompetitorsPanelPO goToCompetitorsPanel() {
final AdminConsolePage adminConsole = AdminConsolePage.goToPage(getWebDriver(), getContextRoot());
final TrackedRacesCompetitorsPanelPO competitorsPanel = adminConsole.goToTrackedRacesCompetitors();
return competitorsPanel;
}
@Test
public void testCompetitorCreation() {
final TrackedRacesCompetitorsPanelPO competitorsPanel = goToCompetitorsPanel();
final TrackedRacesCompetitorCreateDialogPO dialog = competitorsPanel.pushAddButton();
final String name = ""+System.currentTimeMillis();
dialog.setNameTextBox(name);
String sailId = ""+System.currentTimeMillis();
dialog.setSailIdTextBox(sailId);
final String boatClassName = "Laser Int.";
dialog.setBoatClassNameSuggestBox(boatClassName);
dialog.pressOk();
boolean found = false;
for (final CompetitorEntry it : competitorsPanel.getCompetitorTable().getEntries()) {
String itName = it.getName();
if (itName.equals(name)) {
found = true;
// found a candidate:
assertEquals(sailId, it.getSailId());
assertEquals(boatClassName, it.getBoatClassName());
}
}
assertTrue(found);
}
}
@@ -22,114 +22,120 @@ public class Util {
private transient int hashCode;
@SuppressWarnings("unused") // required for some serialization frameworks such as GWT RPC
private Pair() {}
public Pair( A a, B b ) {
@SuppressWarnings("unused")
// required for some serialization frameworks such as GWT RPC
private Pair() {
}
public Pair(A a, B b) {
this.a = a;
this.b = b;
hashCode = 0;
}
public A getA( ) {
public A getA() {
return a;
}
public B getB( ) {
public B getB() {
return b;
}
@Override
public int hashCode( ) {
if ( hashCode == 0 ) {
public int hashCode() {
if (hashCode == 0) {
hashCode = 17;
hashCode = 37 * hashCode + ( a != null ? a.hashCode( ) : 0 );
hashCode = 37 * hashCode + ( b != null ? b.hashCode( ) : 0 );
hashCode = 37 * hashCode + (a != null ? a.hashCode() : 0);
hashCode = 37 * hashCode + (b != null ? b.hashCode() : 0);
}
return hashCode;
}
@Override
public boolean equals( Object obj ) {
public boolean equals(Object obj) {
boolean result;
if ( this == obj ) {
if (this == obj) {
result = true;
} else if ( obj instanceof Pair<?, ?> ) {
} else if (obj instanceof Pair<?, ?>) {
Pair<?, ?> pair = (Pair<?, ?>) obj;
result = ( this.a != null && this.a.equals( pair.a ) || this.a == null && pair.a == null ) && ( this.b != null && this.b.equals( pair.b ) || this.b == null && pair.b == null );
result = (this.a != null && this.a.equals(pair.a) || this.a == null && pair.a == null)
&& (this.b != null && this.b.equals(pair.b) || this.b == null && pair.b == null);
} else {
result = false;
}
return result;
}
@Override
public String toString( ) {
return "[" + (a==null?"null":a.toString( )) + ", " +
(b==null?"null":b.toString( )) + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
public String toString() {
return "[" + (a == null ? "null" : a.toString()) + ", " + (b == null ? "null" : b.toString()) + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
public static class Triple<A, B, C> implements Serializable {
private static final long serialVersionUID = 6806146864367514601L;
private A a;
private B b;
private C c;
private transient int hashCode;
@SuppressWarnings("unused") // required for some serialization frameworks such as GWT RPC
private Triple() {}
public Triple( A a, B b, C c ) {
@SuppressWarnings("unused")
// required for some serialization frameworks such as GWT RPC
private Triple() {
}
public Triple(A a, B b, C c) {
this.a = a;
this.b = b;
this.c = c;
hashCode = 0;
}
public A getA( ) {
public A getA() {
return a;
}
public B getB( ) {
public B getB() {
return b;
}
public C getC( ) {
public C getC() {
return c;
}
@Override
public int hashCode( ) {
if ( hashCode == 0 ) {
public int hashCode() {
if (hashCode == 0) {
hashCode = 17;
hashCode = 37 * hashCode + ( a != null ? a.hashCode( ) : 0 );
hashCode = 37 * hashCode + ( b != null ? b.hashCode( ) : 0 );
hashCode = 37 * hashCode + ( c != null ? c.hashCode( ) : 0 );
hashCode = 37 * hashCode + (a != null ? a.hashCode() : 0);
hashCode = 37 * hashCode + (b != null ? b.hashCode() : 0);
hashCode = 37 * hashCode + (c != null ? c.hashCode() : 0);
}
return hashCode;
}
@Override
public boolean equals( Object obj ) {
public boolean equals(Object obj) {
boolean result;
if ( this == obj ) {
if (this == obj) {
result = true;
} else if ( obj instanceof Triple<?, ?, ?> ) {
} else if (obj instanceof Triple<?, ?, ?>) {
Triple<?, ?, ?> thrice = (Triple<?, ?, ?>) obj;
result = ( this.a != null && this.a.equals( thrice.a ) || this.a == null && thrice.a == null ) && ( this.b != null && this.b.equals( thrice.b ) || this.b == null && thrice.b == null ) && ( this.c != null && this.c.equals( thrice.c ) || this.c == null && thrice.c == null );
result = (this.a != null && this.a.equals(thrice.a) || this.a == null && thrice.a == null)
&& (this.b != null && this.b.equals(thrice.b) || this.b == null && thrice.b == null)
&& (this.c != null && this.c.equals(thrice.c) || this.c == null && thrice.c == null);
} else {
result = false;
}
return result;
}
@Override
public String toString( ) {
public String toString() {
return "[" + a + ", " + b + ", " + c + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
}