mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-15 10:18:45 +00:00
bug5960: added DTOs for CourseConfiguration
This commit is contained in:
+5
-3
@@ -11,7 +11,8 @@ import com.sap.sse.common.Named;
|
||||
* A course that does not necessarily consist of {@link Mark}s existing in a regatta but instead is defined by
|
||||
* {@link MarkConfiguration}s. This means changes to the model are easily possible without requiring to pollute the
|
||||
* {@link RegattaLog}. The effective Marks will then be created upon Course creation based on the
|
||||
* {@link MarkConfiguration}s.
|
||||
* {@link MarkConfiguration}s. See, e.g.,
|
||||
* {@link CourseAndMarkConfigurationFactory#createCourseFromConfigurationAndDefineMarksAsNeeded}.
|
||||
* <p>
|
||||
*
|
||||
* This is the model represented in a course editor which deals with editing the waypoint sequence as well as changing
|
||||
@@ -25,8 +26,9 @@ import com.sap.sse.common.Named;
|
||||
* that the number of laps requested is reflected in the waypoint sequence consistently.
|
||||
* <p>
|
||||
*
|
||||
* When used in a request to create a course template, the {@link #getRepeatablePart()} will be used as the
|
||||
* new course template's {@link CourseTemplate#getRepeatablePart() repeatable part}.<p>
|
||||
* When used in a request to create a course template, the {@link #getRepeatablePart()} will be used as the new course
|
||||
* template's {@link CourseTemplate#getRepeatablePart() repeatable part}.
|
||||
* <p>
|
||||
*
|
||||
* In particular, the base {@link #getWaypoints() waypoints sequence}, when returned by a request, has at least one
|
||||
* occurrence of a repeatable part, should the configuration specify a course template, be consistent with it, and
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.sap.sailing.gwt.ui.shared.courseCreation;
|
||||
|
||||
import com.sap.sse.common.Named;
|
||||
|
||||
public abstract class ControlPointWithMarkConfigurationDTO implements Named {
|
||||
private static final long serialVersionUID = -5408248989419043559L;
|
||||
|
||||
public abstract Iterable<MarkConfigurationDTO> getMarkConfigurations();
|
||||
|
||||
public abstract String getShortName();
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package com.sap.sailing.gwt.ui.shared.courseCreation;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
public class CourseConfigurationDTO implements IsSerializable {
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.sap.sailing.gwt.ui.shared.courseCreation;
|
||||
|
||||
public class FreestyleMarkConfigurationDTO extends MarkConfigurationDTO {
|
||||
private static final long serialVersionUID = -752631017462284881L;
|
||||
private CommonMarkPropertiesDTO freestyleProperties;
|
||||
private MarkPropertiesDTO optionalMarkProperties;
|
||||
|
||||
@Override
|
||||
public CommonMarkPropertiesDTO getEffectiveProperties() {
|
||||
return freestyleProperties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return freestyleProperties.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getShortName() {
|
||||
return freestyleProperties.getShortName();
|
||||
}
|
||||
|
||||
public MarkPropertiesDTO getOptionalMarkProperties() {
|
||||
return optionalMarkProperties;
|
||||
}
|
||||
|
||||
public void setOptionalMarkProperties(MarkPropertiesDTO optionalMarkProperties) {
|
||||
this.optionalMarkProperties = optionalMarkProperties;
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.sap.sailing.gwt.ui.shared.courseCreation;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public abstract class MarkConfigurationDTO extends ControlPointWithMarkConfigurationDTO {
|
||||
private static final long serialVersionUID = -6944495722826431655L;
|
||||
private MarkTemplateDTO optionalMarkTemplate;
|
||||
|
||||
public MarkTemplateDTO getOptionalMarkTemplate() {
|
||||
return optionalMarkTemplate;
|
||||
}
|
||||
|
||||
public void setOptionalMarkTemplate(MarkTemplateDTO optionalMarkTemplate) {
|
||||
this.optionalMarkTemplate = optionalMarkTemplate;
|
||||
}
|
||||
|
||||
public abstract MarkPropertiesDTO getOptionalMarkProperties();
|
||||
|
||||
public abstract CommonMarkPropertiesDTO getEffectiveProperties();
|
||||
|
||||
@Override
|
||||
public Iterable<MarkConfigurationDTO> getMarkConfigurations() {
|
||||
return Arrays.asList(this);
|
||||
}
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
package com.sap.sailing.gwt.ui.shared.courseCreation;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class MarkPairWithConfigurationDTO extends ControlPointWithMarkConfigurationDTO {
|
||||
private static final long serialVersionUID = -6712123101182399453L;
|
||||
private MarkConfigurationDTO left;
|
||||
private MarkConfigurationDTO right;
|
||||
private String shortName;
|
||||
private String name;
|
||||
|
||||
@Override
|
||||
public Iterable<MarkConfigurationDTO> getMarkConfigurations() {
|
||||
return Arrays.asList(left, right);
|
||||
}
|
||||
|
||||
public MarkConfigurationDTO getLeft() {
|
||||
return left;
|
||||
}
|
||||
|
||||
public void setLeft(MarkConfigurationDTO left) {
|
||||
this.left = left;
|
||||
}
|
||||
|
||||
public MarkConfigurationDTO getRight() {
|
||||
return right;
|
||||
}
|
||||
|
||||
public void setRight(MarkConfigurationDTO right) {
|
||||
this.right = right;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getShortName() {
|
||||
return shortName;
|
||||
}
|
||||
|
||||
public void setShortName(String shortName) {
|
||||
this.shortName = shortName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.sap.sailing.gwt.ui.shared.courseCreation;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class MarkPropertiesBasedMarkConfigurationDTO extends MarkConfigurationDTO {
|
||||
|
||||
private static final long serialVersionUID = 2204116830344315567L;
|
||||
private MarkPropertiesDTO markProperties;
|
||||
|
||||
@Override
|
||||
public MarkPropertiesDTO getOptionalMarkProperties() {
|
||||
return markProperties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonMarkPropertiesDTO getEffectiveProperties() {
|
||||
return markProperties.getCommonMarkProperties();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<MarkConfigurationDTO> getMarkConfigurations() {
|
||||
return Arrays.asList(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return markProperties.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getShortName() {
|
||||
return markProperties.getCommonMarkProperties().getShortName();
|
||||
}
|
||||
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.sap.sailing.gwt.ui.shared.courseCreation;
|
||||
|
||||
public class MarkTemplateBasedMarkConfigurationDTO extends MarkConfigurationDTO {
|
||||
|
||||
private static final long serialVersionUID = 4766727754528156938L;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return getOptionalMarkTemplate().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public MarkPropertiesDTO getOptionalMarkProperties() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonMarkPropertiesDTO getEffectiveProperties() {
|
||||
return getOptionalMarkTemplate().getCommonMarkProperties();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getShortName() {
|
||||
// TODO Auto-generated method stub
|
||||
return getOptionalMarkTemplate().getCommonMarkProperties().getShortName();
|
||||
}
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.sap.sailing.gwt.ui.shared.courseCreation;
|
||||
|
||||
import com.sap.sailing.gwt.ui.shared.MarkDTO;
|
||||
|
||||
public class RegattaMarkConfigurationDTO extends MarkConfigurationDTO {
|
||||
|
||||
private static final long serialVersionUID = -9209811588621240132L;
|
||||
private MarkDTO mark;
|
||||
private MarkPropertiesDTO optionalMarkProperties;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return mark.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public MarkPropertiesDTO getOptionalMarkProperties() {
|
||||
return optionalMarkProperties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOptionalMarkTemplate(MarkTemplateDTO optionalMarkTemplate) {
|
||||
super.setOptionalMarkTemplate(optionalMarkTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonMarkPropertiesDTO getEffectiveProperties() {
|
||||
return new CommonMarkPropertiesDTO(mark.getName(), mark.getShortName(), mark.color, mark.shape, mark.pattern, mark.type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getShortName() {
|
||||
return mark.getShortName();
|
||||
}
|
||||
|
||||
public MarkDTO getMark() {
|
||||
return mark;
|
||||
}
|
||||
|
||||
public void setMark(MarkDTO mark) {
|
||||
this.mark = mark;
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package com.sap.sailing.gwt.ui.shared.courseCreation;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
public class WaypointWithMarkConfigurationDTO implements IsSerializable {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user