mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-15 06:49:56 +00:00
Merge branch 'master' into translation
This commit is contained in:
commit
95497a7017
243 files changed
+5002
-3156
No files matched your search
+1
-1
@@ -6,7 +6,7 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.0.0-beta6'
|
||||
classpath 'com.android.tools.build:gradle:2.1.0-alpha1'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src/main/resources"/>
|
||||
<classpathentry kind="src" path="src/main/java"/>
|
||||
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/gwt-maps-api-3.9.0-build-17.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/gwt-ajaxloader.jar"/>
|
||||
<classpathentry kind="lib" path="WEB-INF/classes"/>
|
||||
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src/main/resources"/>
|
||||
<classpathentry kind="src" path="src/main/java"/>
|
||||
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/gwt-maps-api-3.9.0-build-17.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/gwt-ajaxloader.jar"/>
|
||||
<classpathentry kind="lib" path="WEB-INF/classes"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
@@ -25,10 +25,12 @@ Require-Bundle: com.sap.sailing.domain,
|
||||
com.sap.sse.gwt.adminconsole,
|
||||
org.apache.commons.math;bundle-version="2.1.0"
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Import-Package: com.sap.sse.util,
|
||||
Import-Package: com.google.gwt.core.ext.linker,
|
||||
com.sap.sse.util,
|
||||
javax.servlet;version="3.1.0",
|
||||
javax.servlet.descriptor;version="3.1.0",
|
||||
javax.servlet.http;version="3.1.0",
|
||||
org.apache.commons.io,
|
||||
org.osgi.framework;version="1.5.0",
|
||||
org.osgi.util.tracker
|
||||
Web-ContextPath: /dashboards
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
|
||||
.mgwt-Carousel-Indicator {
|
||||
width: 12.5pt;
|
||||
height: 12.5pt;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background-color: #666666;
|
||||
border-radius: 0pt;
|
||||
margin: 5pt;
|
||||
margin-bottom: 12.5pt;
|
||||
border-radius: 5px;
|
||||
margin: 5px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.mgwt-Carousel-Indicator-active {
|
||||
@@ -25,12 +26,4 @@
|
||||
position: absolute !important;
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
|
||||
.eventLogo {
|
||||
position: absolute;
|
||||
right: 12.5px;
|
||||
bottom: 10px;
|
||||
height: 22.5pt;
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
<!-- with a "Quirks Mode" doctype may lead to some -->
|
||||
<!-- differences in layout. -->
|
||||
|
||||
<html>
|
||||
<html manifest="com.sap.sailing.dashboards.gwt.RibDashboard/appcache.manifest">
|
||||
<head>
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
<?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="false"/>
|
||||
<stringAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT" value="9998"/>
|
||||
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
|
||||
<listEntry value="com.sap.sailing.dashboards.gwt.RibDashboard"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="com.google.gwt.eclipse.core.SUPERDEVMODE_ENABLED" value="true"/>
|
||||
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="/dashboards/RibDashboard.html"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/com.sap.sailing.dashboards.gwt"/>
|
||||
</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>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src/main/java" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.dashboards.gwt/src/main/java" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.dashboards.gwt/src/main/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.server/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.gwt/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.common/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="com.sap.sailing.dashboards.gwt"/> </runtimeClasspathEntry> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.google.gwt.osgi/lib/gwt-servlet.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.google.gwt.osgi/lib/gwt-user.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain.common/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/org.moxieapps.gwt.highcharts/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.gwt.adminconsole/src" path="3" type="2"/> "/>
|
||||
</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="-superDevMode -incremental -war "${project_loc:com.sap.sailing.dashboards.gwt}" -startupUrl /dashboards/RibDashboard.html -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort 9998 com.sap.sailing.dashboards.gwt.RibDashboard"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.dashboards.gwt"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx2048m"/>
|
||||
</launchConfiguration>
|
||||
<?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="false"/>
|
||||
<stringAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT" value="9998"/>
|
||||
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
|
||||
<listEntry value="com.sap.sailing.dashboards.gwt.RibDashboard"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="com.google.gwt.eclipse.core.SUPERDEVMODE_ENABLED" value="true"/>
|
||||
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="/dashboards/RibDashboard.html"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/com.sap.sailing.dashboards.gwt"/>
|
||||
</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>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src/main/java" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.dashboards.gwt/src/main/java" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.dashboards.gwt/src/main/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.server/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.gwt/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.common/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="com.sap.sailing.dashboards.gwt"/> </runtimeClasspathEntry> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.google.gwt.osgi/lib/gwt-servlet.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.google.gwt.osgi/lib/gwt-user.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain.common/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/org.moxieapps.gwt.highcharts/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.gwt.adminconsole/src" path="3" type="2"/> "/>
|
||||
</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="-superDevMode -incremental -war "${project_loc:com.sap.sailing.dashboards.gwt}" -startupUrl /dashboards/RibDashboard.html -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort 9998 com.sap.sailing.dashboards.gwt.RibDashboard"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.dashboards.gwt"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-XstartOnFirstThread -Xmx2048m"/>
|
||||
</launchConfiguration>
|
||||
@@ -1,47 +1,47 @@
|
||||
<?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="false"/>
|
||||
<stringAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT" value="9998"/>
|
||||
<booleanAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT_AUTO" value="true"/>
|
||||
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
|
||||
<listEntry value="com.sap.sailing.dashboards.gwt.RibDashboard"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="/dashboards/RibDashboard.html"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/com.sap.sailing.dashboards.gwt"/>
|
||||
</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>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src/main/java" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.dashboards.gwt/src/main/java" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.dashboards.gwt/src/main/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.server/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.gwt/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.common/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="com.sap.sailing.dashboards.gwt"/> </runtimeClasspathEntry> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.google.gwt.osgi/lib/gwt-servlet.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.google.gwt.osgi/lib/gwt-user.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain.common/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/org.moxieapps.gwt.highcharts/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.gwt.adminconsole/src" path="3" type="2"/> "/>
|
||||
</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 -incremental -war "${project_loc:com.sap.sailing.dashboards.gwt}" -startupUrl /dashboards/RibDashboard.html -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort auto com.sap.sailing.dashboards.gwt.RibDashboard"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.dashboards.gwt"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx2048m"/>
|
||||
</launchConfiguration>
|
||||
<?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="false"/>
|
||||
<stringAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT" value="9998"/>
|
||||
<booleanAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT_AUTO" value="true"/>
|
||||
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
|
||||
<listEntry value="com.sap.sailing.dashboards.gwt.RibDashboard"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="/dashboards/RibDashboard.html"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/com.sap.sailing.dashboards.gwt"/>
|
||||
</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>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src/main/java" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.dashboards.gwt/src/main/java" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.dashboards.gwt/src/main/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.server/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.gwt/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.common/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="com.sap.sailing.dashboards.gwt"/> </runtimeClasspathEntry> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.google.gwt.osgi/lib/gwt-servlet.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.google.gwt.osgi/lib/gwt-user.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain.common/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/org.moxieapps.gwt.highcharts/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.gwt.adminconsole/src" path="3" type="2"/> "/>
|
||||
</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 -incremental -war "${project_loc:com.sap.sailing.dashboards.gwt}" -startupUrl /dashboards/RibDashboard.html -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort auto com.sap.sailing.dashboards.gwt.RibDashboard"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.dashboards.gwt"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-XstartOnFirstThread -Xmx2048m"/>
|
||||
</launchConfiguration>
|
||||
@@ -48,4 +48,9 @@
|
||||
<url-pattern>/com.sap.sailing.dashboards.gwt.RibDashboard/remote_logging</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<mime-mapping>
|
||||
<extension>manifest</extension>
|
||||
<mime-type>text/cache-manifest</mime-type>
|
||||
</mime-mapping>
|
||||
|
||||
</web-app>
|
||||
-4
@@ -3,7 +3,6 @@ package com.sap.sailing.dashboards.gwt.client;
|
||||
import com.google.gwt.user.client.ui.RootLayoutPanel;
|
||||
import com.googlecode.mgwt.ui.client.MGWT;
|
||||
import com.googlecode.mgwt.ui.client.MGWTSettings;
|
||||
import com.googlecode.mgwt.ui.client.MGWTSettings.StatusBarStyle;
|
||||
import com.googlecode.mgwt.ui.client.MGWTSettings.ViewPort;
|
||||
import com.googlecode.mgwt.ui.client.MGWTStyle;
|
||||
import com.sap.sailing.dashboards.gwt.client.dashboardpanel.DashboardPanel;
|
||||
@@ -34,9 +33,6 @@ public class RibDashboardEntryPoint extends AbstractEntryPoint<StringMessages> {
|
||||
viewPort.setUserScaleAble(false).setMinimumScale(1.0).setMinimumScale(1.0).setMaximumScale(1.0);
|
||||
MGWTSettings settings = new MGWTSettings();
|
||||
settings.setViewPort(viewPort);
|
||||
settings.setFullscreen(true);
|
||||
settings.setPreventScrolling(true);
|
||||
settings.setStatusBarStyle(StatusBarStyle.BLACK_TRANSLUCENT);
|
||||
MGWT.applySettings(settings);
|
||||
}
|
||||
|
||||
|
||||
+10
-4
@@ -2,6 +2,8 @@ package com.sap.sailing.dashboards.gwt.client.actions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.google.gwt.core.shared.GwtIncompatible;
|
||||
import com.sap.sailing.dashboards.gwt.server.util.actions.startanalysis.StartAnalysisCreationController;
|
||||
@@ -24,6 +26,8 @@ public class GetStartAnalysesAction implements DashboardAction<StartAnalysesDTO>
|
||||
|
||||
private String leaderboarName;
|
||||
private String competitorIdAsString;
|
||||
|
||||
private static final Logger logger = Logger.getLogger(GetStartAnalysesAction.class.getName());
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private GetStartAnalysesAction() {
|
||||
@@ -39,10 +43,12 @@ public class GetStartAnalysesAction implements DashboardAction<StartAnalysesDTO>
|
||||
public StartAnalysesDTO execute(DashboardDispatchContext dashboardDispatchContext) throws DispatchException {
|
||||
StartAnalysesDTO result = new StartAnalysesDTO();
|
||||
List<StartAnalysisDTO> startanalyses = new ArrayList<StartAnalysisDTO>();
|
||||
if (competitorIdAsString != null && leaderboarName != null) {
|
||||
if (leaderboarName != null) {
|
||||
try {
|
||||
Competitor competitor = dashboardDispatchContext.getRacingEventService().getBaseDomainFactory().getCompetitorStore().getExistingCompetitorByIdAsString(
|
||||
competitorIdAsString);
|
||||
Competitor competitor = null;
|
||||
if(competitorIdAsString != null) {
|
||||
competitor = dashboardDispatchContext.getRacingEventService().getBaseDomainFactory().getCompetitorStore().getExistingCompetitorByIdAsString(competitorIdAsString);
|
||||
}
|
||||
Leaderboard leaderboard = dashboardDispatchContext.getRacingEventService().getLeaderboardByName(this.leaderboarName);
|
||||
if (leaderboard != null) {
|
||||
for (RaceColumn column : leaderboard.getRaceColumns()) {
|
||||
@@ -59,7 +65,7 @@ public class GetStartAnalysesAction implements DashboardAction<StartAnalysesDTO>
|
||||
|
||||
}
|
||||
} catch (NullPointerException e) {
|
||||
// logger.log(Level.INFO, "", e);
|
||||
logger.log(Level.INFO, "", e);
|
||||
}
|
||||
}
|
||||
result.setStartAnalyses(startanalyses);
|
||||
|
||||
+7
-3
@@ -1,5 +1,7 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.actions;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import com.google.gwt.core.shared.GwtIncompatible;
|
||||
import com.sap.sailing.dashboards.gwt.server.util.actions.startlineadvantage.StartlineAdvantageByGeometryCalculator;
|
||||
import com.sap.sailing.dashboards.gwt.shared.StartlineAdvantageType;
|
||||
@@ -20,6 +22,8 @@ public class GetStartlineAdvantageByGeometryAction extends RequiresLiveRaceAndCa
|
||||
public GetStartlineAdvantageByGeometryAction(String leaderboardName) {
|
||||
super(leaderboardName);
|
||||
}
|
||||
|
||||
private static final String MOVING_AVERAGE_CACHE_KEY = UUID.randomUUID().toString();
|
||||
|
||||
@Override
|
||||
@GwtIncompatible
|
||||
@@ -35,14 +39,14 @@ public class GetStartlineAdvantageByGeometryAction extends RequiresLiveRaceAndCa
|
||||
Double average = null;
|
||||
if (startlineAdvantageByGeometry != null) {
|
||||
super.addValueToMovingAverage(startlineAdvantageByGeometry.doubleValue(), dashboardDispatchContext.getMovingAveragesCache());
|
||||
average = dashboardDispatchContext.getMovingAveragesCache().getValueForKey(getKeyForMovingAverage());
|
||||
average = dashboardDispatchContext.getMovingAveragesCache().getValueForKey(uniqueMovingAverageCacheKey());
|
||||
}
|
||||
result.average = average;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getKeyForMovingAverage() {
|
||||
return super.getLeaderboardName();
|
||||
protected String uniqueMovingAverageCacheKey() {
|
||||
return MOVING_AVERAGE_CACHE_KEY;
|
||||
}
|
||||
}
|
||||
+12
-6
@@ -5,16 +5,19 @@ package com.sap.sailing.dashboards.gwt.client.actions;
|
||||
*
|
||||
*/
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import com.google.gwt.core.shared.GwtIncompatible;
|
||||
import com.sap.sailing.dashboards.gwt.server.util.actions.startlineadvantage.StartlineAdvantagesByWindCalculator;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dispatch.DashboardDispatchContext;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dispatch.RequiresLiveRaceAndCachesMovingAverageAction;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.StartlineAdvantagesWithMaxAndAverageDTO;
|
||||
import com.sap.sailing.domain.base.DomainFactory;
|
||||
import com.sap.sailing.domain.tracking.TrackedRace;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException;
|
||||
|
||||
public class GetStartlineAdvantagesByWindAction extends RequiresLiveRaceAndCachesMovingAverageAction<StartlineAdvantagesWithMaxAndAverageDTO> {
|
||||
public class GetStartlineAdvantagesByWindAction extends RequiresLiveRaceAndCachesMovingAverageAction<StartlineAdvantagesWithMaxAndAverageDTO> {
|
||||
|
||||
public GetStartlineAdvantagesByWindAction() {}
|
||||
|
||||
@@ -22,24 +25,27 @@ public class GetStartlineAdvantagesByWindAction extends RequiresLiveRaceAndCach
|
||||
super(leaderboardName);
|
||||
}
|
||||
|
||||
private static final String MOVING_AVERAGE_CACHE_KEY = UUID.randomUUID().toString();
|
||||
|
||||
@Override
|
||||
@GwtIncompatible
|
||||
public StartlineAdvantagesWithMaxAndAverageDTO execute(DashboardDispatchContext dashboardDispatchContext) throws DispatchException {
|
||||
StartlineAdvantagesWithMaxAndAverageDTO result = new StartlineAdvantagesWithMaxAndAverageDTO();
|
||||
TrackedRace liveRace = super.getLiveRace(dashboardDispatchContext);
|
||||
if (liveRace != null) {
|
||||
StartlineAdvantagesByWindCalculator startlineAdvantagesByWindCalculator = new StartlineAdvantagesByWindCalculator(dashboardDispatchContext);
|
||||
final DomainFactory domainFactory = dashboardDispatchContext.getRacingEventService().getBaseDomainFactory();
|
||||
StartlineAdvantagesByWindCalculator startlineAdvantagesByWindCalculator = new StartlineAdvantagesByWindCalculator(dashboardDispatchContext, domainFactory);
|
||||
result = startlineAdvantagesByWindCalculator.getStartLineAdvantagesAccrossLineFromTrackedRaceAtTimePoint(liveRace, MillisecondsTimePoint.now());
|
||||
}
|
||||
if(result != null && result.maximum != null) {
|
||||
super.addValueToMovingAverage(result.maximum, dashboardDispatchContext.getMovingAveragesCache());
|
||||
result.average = dashboardDispatchContext.getMovingAveragesCache().getValueForKey(getKeyForMovingAverage());
|
||||
result.average = dashboardDispatchContext.getMovingAveragesCache().getValueForKey(uniqueMovingAverageCacheKey());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected String getKeyForMovingAverage() {
|
||||
return super.getLeaderboardName();
|
||||
protected String uniqueMovingAverageCacheKey() {
|
||||
return MOVING_AVERAGE_CACHE_KEY;
|
||||
}
|
||||
}
|
||||
+23
-59
@@ -1,18 +1,5 @@
|
||||
@require 'theme';
|
||||
|
||||
.bar {
|
||||
height: 100%;
|
||||
margin-top: 20pt;
|
||||
line-height: 15pt;
|
||||
vertical-align: middle;
|
||||
font-size: 15pt;
|
||||
font-family: DASHBOARD_FONT_FAMILY;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.page {
|
||||
position: absolute;
|
||||
border: none;
|
||||
@@ -22,15 +9,12 @@
|
||||
top: 0;
|
||||
bottom: 30pt;
|
||||
margin: 5pt;
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.logo {
|
||||
position: absolute;
|
||||
width: 48pt;
|
||||
height: 23.5pt;
|
||||
margin-top: 17.5pt;
|
||||
.header {
|
||||
margin-top:20px;
|
||||
margin-left: 10pt;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.collumn {
|
||||
@@ -47,72 +31,52 @@
|
||||
|
||||
.collumnthree {
|
||||
left: 66.8%;
|
||||
right: 0pt;
|
||||
right: 0px;
|
||||
}
|
||||
|
||||
.left {
|
||||
left: 0pt;
|
||||
left: 0px;
|
||||
right: 50%;
|
||||
}
|
||||
|
||||
.right {
|
||||
left: 50%;
|
||||
right: 0pt;
|
||||
right: 0px;
|
||||
}
|
||||
|
||||
.startline_advantage_by_wind_container {
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
top: 27%;
|
||||
right: 0pt;
|
||||
left: 0pt;
|
||||
top: 160px;
|
||||
right: 0px;
|
||||
left: 0px;
|
||||
bottom: 0%;
|
||||
}
|
||||
|
||||
.startline_advantage_by_geometry_container {
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
top: 0%;
|
||||
right: 0pt;
|
||||
left: 0pt;
|
||||
bottom: 73%;
|
||||
margin-bottom: 10pt;
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
left: 0px;
|
||||
height: 145px
|
||||
}
|
||||
|
||||
.windcharthint {
|
||||
position: absolute;
|
||||
bottom: 0pt;
|
||||
height: 15pt;
|
||||
line-height: 15pt;
|
||||
margin-top: 0pt;
|
||||
height: DASHBOARD_FONT_SIZE_SMALL;
|
||||
line-height: DASHBOARD_FONT_SIZE_SMALL;
|
||||
bottom: 3px;
|
||||
vertical-align: middle;
|
||||
font-size: 12pt;
|
||||
font-size: DASHBOARD_FONT_SIZE_MEDIUM;
|
||||
font-family: DASHBOARD_FONT_FAMILY;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.windloadinghint {
|
||||
.event_logo {
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
opacity: 0.4;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.windloadinghinttext {
|
||||
position: absolute;
|
||||
bottom: 0pt;
|
||||
height: 15pt;
|
||||
line-height: 15pt;
|
||||
margin-top: 0pt;
|
||||
vertical-align: middle;
|
||||
font-size: 12pt;
|
||||
font-family: DASHBOARD_FONT_FAMILY;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
top: 50%;
|
||||
height: DASHBOARD_SPACE_MEDIUM;
|
||||
width: auto;
|
||||
right: 10pt;
|
||||
bottom: 10pt;
|
||||
z-index: 1;
|
||||
}
|
||||
+69
-94
@@ -1,16 +1,18 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.dashboardpanel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.DivElement;
|
||||
import com.google.gwt.dom.client.Document;
|
||||
import com.google.gwt.dom.client.Style.Visibility;
|
||||
import com.google.gwt.safehtml.shared.UriUtils;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
@@ -22,17 +24,19 @@ import com.sap.sailing.dashboards.gwt.client.DashboardClientFactory;
|
||||
import com.sap.sailing.dashboards.gwt.client.actions.GetIDFromRaceThatIsLiveAction;
|
||||
import com.sap.sailing.dashboards.gwt.client.dataretriever.NumberOfWindBotsChangeListener;
|
||||
import com.sap.sailing.dashboards.gwt.client.dataretriever.WindBotDataRetrieverProvider;
|
||||
import com.sap.sailing.dashboards.gwt.client.eventlogo.EventLogo;
|
||||
import com.sap.sailing.dashboards.gwt.client.header.DashboardHeader;
|
||||
import com.sap.sailing.dashboards.gwt.client.notifications.orientation.WrongDeviceOrientationNotification;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.PollsLiveDataEvery5Seconds;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.startanalysis.StartAnalysisWidget;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.course.StartLineAdvantageByGeometryWidget;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.course.StartlineAdvantageByGeometryWidget;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.wind.StartlineAdvantagesByWindWidget;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.windbot.WindBotWidget;
|
||||
import com.sap.sailing.dashboards.gwt.shared.DashboardURLParameters;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.RaceIdDTO;
|
||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.shared.EventDTO;
|
||||
import com.sap.sse.gwt.client.media.ImageDTO;
|
||||
|
||||
/**
|
||||
* This class contains all components of the Dashboard and the basic UI Elements of the Dashboard, like top and bottom
|
||||
@@ -49,41 +53,37 @@ public class DashboardPanel extends Composite implements NumberOfWindBotsChangeL
|
||||
|
||||
@UiField
|
||||
LayoutPanel root;
|
||||
|
||||
|
||||
@UiField
|
||||
HTMLPanel header;
|
||||
DashboardHeader header;
|
||||
|
||||
@UiField
|
||||
Carousel carousel;
|
||||
|
||||
@UiField
|
||||
HTMLPanel leftwindbotcontainer;
|
||||
|
||||
@UiField
|
||||
HTMLPanel rightwindbotcontainer;
|
||||
@UiField(provided = true)
|
||||
WindBotWidget leftWindBotWidget;
|
||||
|
||||
@UiField(provided = true)
|
||||
WindBotWidget rightWindBotWidget;
|
||||
|
||||
@UiField(provided = true)
|
||||
StartlineAdvantagesByWindWidget startlineAdvantagesByWindComponent;
|
||||
|
||||
@UiField
|
||||
public DivElement windloadinghintleft;
|
||||
|
||||
@UiField
|
||||
public DivElement windloadinghintright;
|
||||
|
||||
@UiField
|
||||
public HTMLPanel bottombar;
|
||||
|
||||
@UiField
|
||||
public HTMLPanel windcharthint;
|
||||
|
||||
@UiField
|
||||
public Image eventLogo;
|
||||
|
||||
@UiField(provided = true)
|
||||
public StartAnalysisWidget startanalysisComponent;
|
||||
|
||||
@UiField(provided = true)
|
||||
public StartLineAdvantageByGeometryWidget startlineAdvantageByGeometryComponent;
|
||||
public StartlineAdvantageByGeometryWidget startlineAdvantageByGeometryWidget;
|
||||
|
||||
private List<WindBotWidget> windBotComponents;
|
||||
private StringMessages stringConstants;
|
||||
DashboardClientFactory dashboardClientFactory;
|
||||
private static final Logger logger = Logger.getLogger(DashboardPanel.class.getName());
|
||||
@@ -91,34 +91,53 @@ public class DashboardPanel extends Composite implements NumberOfWindBotsChangeL
|
||||
public DashboardPanel(DashboardClientFactory dashboardClientFactory) {
|
||||
DashboardPanelResources.INSTANCE.style().ensureInjected();
|
||||
this.dashboardClientFactory = dashboardClientFactory;
|
||||
windBotComponents = new ArrayList<WindBotWidget>();
|
||||
leftWindBotWidget = new WindBotWidget(dashboardClientFactory);
|
||||
rightWindBotWidget = new WindBotWidget(dashboardClientFactory);
|
||||
startanalysisComponent = new StartAnalysisWidget(this.dashboardClientFactory);
|
||||
startlineAdvantagesByWindComponent = new StartlineAdvantagesByWindWidget(this.dashboardClientFactory);
|
||||
startlineAdvantageByGeometryComponent = new StartLineAdvantageByGeometryWidget(this.dashboardClientFactory);
|
||||
startlineAdvantageByGeometryWidget = new StartlineAdvantageByGeometryWidget(this.dashboardClientFactory);
|
||||
stringConstants = StringMessages.INSTANCE;
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
initLogos();
|
||||
windcharthint.getElement().setInnerText(stringConstants.dashboardWindChartHint());
|
||||
windloadinghintleft.setInnerHTML(stringConstants.dashboardWindBotLoadingText()+"<br>"+stringConstants.dashboardWindBotLoadingMessage());
|
||||
windloadinghintright.setInnerHTML(stringConstants.dashboardWindBotLoadingText()+"<br>"+stringConstants.dashboardWindBotLoadingMessage());
|
||||
loadAndAddEventLogo(dashboardClientFactory.getSailingService());
|
||||
loadEventLogoAndName(dashboardClientFactory.getSailingService());
|
||||
initAndAddWrongOrientationNotification();
|
||||
registerForDashboardFiveSecondsTimer(dashboardClientFactory);
|
||||
}
|
||||
|
||||
private void initLogos() {
|
||||
Image logo = new Image();
|
||||
logo.setResource(DashboardPanelResources.INSTANCE.logo_sap());
|
||||
logo.getElement().addClassName(DashboardPanelResources.INSTANCE.style().logo());
|
||||
Document.get().getBody().appendChild(logo.getElement());
|
||||
}
|
||||
|
||||
private void loadAndAddEventLogo(SailingServiceAsync sailingServiceAsync){
|
||||
private void loadEventLogoAndName(SailingServiceAsync sailingServiceAsync){
|
||||
String eventId = DashboardURLParameters.EVENT_ID.getValue();
|
||||
if (eventId != null) {
|
||||
EventLogo eventLogo = EventLogo.getEventLogoFromEventId(sailingServiceAsync, eventId);
|
||||
if (eventLogo != null) {
|
||||
Document.get().getBody().appendChild(eventLogo.getElement());
|
||||
try {
|
||||
final UUID eventUUID = UUID.fromString(eventId);
|
||||
logger.log(Level.INFO, "Loading EventDTO for id " + eventId);
|
||||
sailingServiceAsync.getEventById(eventUUID, true, new AsyncCallback<EventDTO>() {
|
||||
@Override
|
||||
public void onSuccess(final EventDTO event) {
|
||||
logger.log(Level.INFO, "Received EventDTO");
|
||||
if (event != null) {
|
||||
final ImageDTO logo = event.getLogoImage();
|
||||
if (logo != null) {
|
||||
eventLogo.getElement().setAttribute("src", UriUtils.fromString(logo.getSourceRef()).asString());
|
||||
} else {
|
||||
eventLogo.getElement().getStyle().setVisibility(Visibility.HIDDEN);
|
||||
}
|
||||
if (event.getName() != null) {
|
||||
header.setEventName(event.getName());
|
||||
Window.setTitle("Dashboard - "+event.getName());
|
||||
}
|
||||
} else {
|
||||
logger.log(Level.INFO, "Received EventDTO is null");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
logger.log(Level.INFO, "Failed to received EventDTO, "+caught.getMessage());
|
||||
eventLogo.getElement().getStyle().setVisibility(Visibility.HIDDEN);
|
||||
}
|
||||
});
|
||||
} catch (IllegalArgumentException e) {
|
||||
eventLogo.getElement().getStyle().setVisibility(Visibility.HIDDEN);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -127,52 +146,6 @@ public class DashboardPanel extends Composite implements NumberOfWindBotsChangeL
|
||||
WrongDeviceOrientationNotification wrongDeviceOrientationNotification = new WrongDeviceOrientationNotification();
|
||||
Document.get().getBody().appendChild(wrongDeviceOrientationNotification.getElement());
|
||||
}
|
||||
|
||||
private void initWindBotComponents(List<String> windBotIDs,
|
||||
WindBotDataRetrieverProvider windBotDataRetrieverProvider) {
|
||||
int windBotAddedCounterTOConsiderForPanels = 0;
|
||||
leftwindbotcontainer.clear();
|
||||
removeWindBotComponentsAsDataRetrieverListener(windBotDataRetrieverProvider);
|
||||
windBotComponents.clear();
|
||||
for (String windBotID : windBotIDs) {
|
||||
if (windBotAddedCounterTOConsiderForPanels == 0) {
|
||||
WindBotWidget leftwindBotComponent = new WindBotWidget(windBotID);
|
||||
leftwindbotcontainer.add(leftwindBotComponent);
|
||||
windBotComponents.add(leftwindBotComponent);
|
||||
windloadinghintleft.getStyle().setOpacity(0.0);
|
||||
} else if (windBotAddedCounterTOConsiderForPanels == 1) {
|
||||
WindBotWidget rightwindBotComponent = new WindBotWidget(windBotID);
|
||||
rightwindbotcontainer.add(rightwindBotComponent);
|
||||
windBotComponents.add(rightwindBotComponent);
|
||||
windloadinghintright.getStyle().setOpacity(0.0);
|
||||
}
|
||||
windBotAddedCounterTOConsiderForPanels++;
|
||||
if (windloadinghintleft.getStyle().getOpacity() != "0.0"
|
||||
|| windloadinghintright.getStyle().getOpacity() != "0.0") {
|
||||
windloadinghintleft.setInnerHTML(stringConstants.dashboardWindBotNotAvailable());
|
||||
windloadinghintright.setInnerHTML(stringConstants.dashboardWindBotNotAvailable());
|
||||
}
|
||||
}
|
||||
addWindBotComponentsAsDataRetrieverListener(windBotDataRetrieverProvider);
|
||||
}
|
||||
|
||||
private void addWindBotComponentsAsDataRetrieverListener(WindBotDataRetrieverProvider windBotDataRetrieverProvider) {
|
||||
for (WindBotWidget windBotComponent : windBotComponents) {
|
||||
logger.log(Level.INFO, "Registering WindBotDataRetrieverListener");
|
||||
windBotDataRetrieverProvider.addWindBotDataRetrieverListener(windBotComponent);
|
||||
}
|
||||
}
|
||||
|
||||
private void removeWindBotComponentsAsDataRetrieverListener(
|
||||
WindBotDataRetrieverProvider windBotDataRetrieverProvider) {
|
||||
for (WindBotWidget windBotComponent : windBotComponents) {
|
||||
windBotDataRetrieverProvider.removeWindBotDataRetrieverListener(windBotComponent);
|
||||
}
|
||||
}
|
||||
|
||||
private void setHeaderText(String raceName) {
|
||||
this.header.getElement().setInnerText(raceName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void timeChanged(Date newTime, Date oldTime) {
|
||||
@@ -185,7 +158,7 @@ public class DashboardPanel extends Composite implements NumberOfWindBotsChangeL
|
||||
public void onSuccess(RaceIdDTO result) {
|
||||
if (result != null && result.getRaceId() != null) {
|
||||
logger.log(Level.INFO, "Updating UI with live race id");
|
||||
setHeaderText(result.getRaceId().getRaceName());
|
||||
header.setRaceName(result.getRaceId().getRaceName());
|
||||
} else {
|
||||
logger.log(Level.INFO, "Received null for live race id");
|
||||
}
|
||||
@@ -207,19 +180,21 @@ public class DashboardPanel extends Composite implements NumberOfWindBotsChangeL
|
||||
}
|
||||
|
||||
@Override
|
||||
public void numberOfWindBotsReceivedChanged(List<String> windBotIDs,
|
||||
WindBotDataRetrieverProvider windBotDataRetrieverProvider) {
|
||||
if(windBotIDs != null) {
|
||||
logger.log(Level.INFO, "Number of available windbots changed to "+windBotIDs.size());
|
||||
public void numberOfWindBotsReceivedChanged(List<String> windBotIDs, WindBotDataRetrieverProvider windBotDataRetrieverProvider) {
|
||||
if (windBotIDs != null) {
|
||||
logger.log(Level.INFO, "Number of available windbots changed to " + windBotIDs.size());
|
||||
for (int i = 0; i < windBotIDs.size(); i++) {
|
||||
if (i == 0) {
|
||||
leftWindBotWidget.setWindBotId(windBotIDs.get(i));
|
||||
windBotDataRetrieverProvider.addWindBotDataRetrieverListener(leftWindBotWidget);
|
||||
}
|
||||
if (i == 1) {
|
||||
rightWindBotWidget.setWindBotId(windBotIDs.get(i));
|
||||
windBotDataRetrieverProvider.addWindBotDataRetrieverListener(rightWindBotWidget);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logger.log(Level.INFO, "Number of available windbots changed. WindBots List is null");
|
||||
}
|
||||
initWindBotComponents(windBotIDs, windBotDataRetrieverProvider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void numberOfWindBotsReceivedIsZero() {
|
||||
windloadinghintleft.setInnerText(stringConstants.dashboardWindBotNotAvailable());
|
||||
windloadinghintright.setInnerText(stringConstants.dashboardWindBotNotAvailable());
|
||||
}
|
||||
}
|
||||
+14
-18
@@ -1,6 +1,8 @@
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:client="urn:import:com.sap.sailing.dashboards.gwt.client"
|
||||
xmlns:header="urn:import:com.sap.sailing.dashboards.gwt.client.header"
|
||||
xmlns:windbot="urn:import:com.sap.sailing.dashboards.gwt.client.widgets.windbot"
|
||||
xmlns:startlineadvantagegeometry="urn:import:com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.course"
|
||||
xmlns:startlineadvantagewind="urn:import:com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.wind"
|
||||
xmlns:startanalysis="urn:import:com.sap.sailing.dashboards.gwt.client.widgets.startanalysis"
|
||||
@@ -10,44 +12,38 @@
|
||||
<ui:with field="resources" type="com.sap.sailing.dashboards.gwt.client.dashboardpanel.DashboardPanelResources"/>
|
||||
|
||||
<g:LayoutPanel ui:field="root">
|
||||
<g:layer left="0%" top="0%" right="0%" height="35pt">
|
||||
<g:HTMLPanel ui:field="header" styleName="{resources.style.bar}"></g:HTMLPanel>
|
||||
<g:layer left="0%" top="0%" right="0%" height="55px">
|
||||
<header:DashboardHeader ui:field="header" styleName="{resources.style.header}"></header:DashboardHeader>
|
||||
</g:layer>
|
||||
<g:layer left="0pt" top="35pt" right="0pt" bottom="0pt">
|
||||
<g:layer left="0pt" top="55px" right="0pt" bottom="0pt">
|
||||
<mgwtcarousel:Carousel ui:field="carousel">
|
||||
<mgwtpanel:Panel styleName="{resources.style.page}">
|
||||
<g:HTMLPanel ui:field="leftwindbotcontainer" styleName="{resources.style.collumn} {resources.style.left}">
|
||||
<div class="{resources.style.windloadinghint}">
|
||||
<div ui:field="windloadinghintleft" class="{resources.style.windloadinghinttext}"></div>
|
||||
</div>
|
||||
<windbot:WindBotWidget ui:field="leftWindBotWidget"></windbot:WindBotWidget>
|
||||
</g:HTMLPanel>
|
||||
<g:HTMLPanel ui:field="rightwindbotcontainer"
|
||||
styleName="{resources.style.collumn} {resources.style.right}">
|
||||
<div class="{resources.style.windloadinghint}">
|
||||
<div ui:field="windloadinghintright" class="{resources.style.windloadinghinttext}"></div>
|
||||
</div>
|
||||
<g:HTMLPanel ui:field="rightwindbotcontainer" styleName="{resources.style.collumn} {resources.style.right}">
|
||||
<windbot:WindBotWidget ui:field="rightWindBotWidget"></windbot:WindBotWidget>
|
||||
</g:HTMLPanel>
|
||||
<g:HTMLPanel ui:field="windcharthint" styleName="{resources.style.windcharthint}"></g:HTMLPanel>
|
||||
</mgwtpanel:Panel>
|
||||
<mgwtpanel:Panel styleName="{resources.style.page}">
|
||||
<g:HTMLPanel styleName="{resources.style.collumn} {resources.style.startanalysiscollumn}">
|
||||
<startanalysis:StartAnalysisWidget
|
||||
ui:field="startanalysisComponent"></startanalysis:StartAnalysisWidget>
|
||||
<startanalysis:StartAnalysisWidget ui:field="startanalysisComponent"></startanalysis:StartAnalysisWidget>
|
||||
</g:HTMLPanel>
|
||||
<g:HTMLPanel styleName="{resources.style.collumn} {resources.style.collumnthree}">
|
||||
<g:HTMLPanel styleName="{resources.style.startline_advantage_by_geometry_container}">
|
||||
<startlineadvantagegeometry:StartLineAdvantageByGeometryWidget ui:field="startlineAdvantageByGeometryComponent"></startlineadvantagegeometry:StartLineAdvantageByGeometryWidget>
|
||||
<startlineadvantagegeometry:StartlineAdvantageByGeometryWidget ui:field="startlineAdvantageByGeometryWidget"></startlineadvantagegeometry:StartlineAdvantageByGeometryWidget>
|
||||
</g:HTMLPanel>
|
||||
<g:HTMLPanel styleName="{resources.style.startline_advantage_by_wind_container}">
|
||||
<startlineadvantagewind:StartlineAdvantagesByWindWidget
|
||||
ui:field="startlineAdvantagesByWindComponent"></startlineadvantagewind:StartlineAdvantagesByWindWidget>
|
||||
<startlineadvantagewind:StartlineAdvantagesByWindWidget ui:field="startlineAdvantagesByWindComponent"></startlineadvantagewind:StartlineAdvantagesByWindWidget>
|
||||
</g:HTMLPanel>
|
||||
</g:HTMLPanel>
|
||||
</mgwtpanel:Panel>
|
||||
</mgwtcarousel:Carousel>
|
||||
</g:layer>
|
||||
<g:layer left="0%" bottom="0%" right="0%" height="30pt">
|
||||
<g:HTMLPanel ui:field="bottombar" styleName="{resources.style.bar}">
|
||||
<g:layer left="0%" bottom="0%" right="0%" height="50px">
|
||||
<g:HTMLPanel ui:field="bottombar">
|
||||
<g:Image ui:field="eventLogo" styleName="{resources.style.event_logo}"></g:Image>
|
||||
</g:HTMLPanel>
|
||||
</g:layer>
|
||||
</g:LayoutPanel>
|
||||
|
||||
+2
-11
@@ -7,34 +7,25 @@ package com.sap.sailing.dashboards.gwt.client.dashboardpanel;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.resources.client.ClientBundle;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.resources.client.ImageResource;
|
||||
|
||||
public interface DashboardPanelResources extends ClientBundle {
|
||||
|
||||
public static final DashboardPanelResources INSTANCE = GWT.create(DashboardPanelResources.class);
|
||||
|
||||
@Source("com/sap/sailing/dashboards/gwt/client/images/logo_sap.png")
|
||||
ImageResource logo_sap();
|
||||
|
||||
@Source("com/sap/sailing/dashboards/gwt/client/images/settings.png")
|
||||
ImageResource settings();
|
||||
|
||||
@Source({"com/sap/sailing/dashboards/gwt/client/theme/theme.gss", "DashboardPanel.gss"})
|
||||
DashboardGSS style();
|
||||
|
||||
public interface DashboardGSS extends CssResource {
|
||||
String bar();
|
||||
String page();
|
||||
String header();
|
||||
String collumn();
|
||||
String startanalysiscollumn();
|
||||
String collumnthree();
|
||||
String logo();
|
||||
String right();
|
||||
String left();
|
||||
String startline_advantage_by_wind_container();
|
||||
String startline_advantage_by_geometry_container();
|
||||
String windcharthint();
|
||||
String windloadinghint();
|
||||
String windloadinghinttext();
|
||||
String event_logo();
|
||||
}
|
||||
}
|
||||
-1
@@ -4,5 +4,4 @@ import java.util.List;
|
||||
|
||||
public interface NumberOfWindBotsChangeListener {
|
||||
public void numberOfWindBotsReceivedChanged(List<String> windBotIDs, WindBotDataRetrieverProvider windBotDataRetrieverProvider);
|
||||
public void numberOfWindBotsReceivedIsZero();
|
||||
}
|
||||
-9
@@ -76,7 +76,6 @@ public class WindBotDataRetriever implements PollsLiveDataEvery5Seconds, WindBot
|
||||
}
|
||||
notifyWindBotDataRetrieverListeners(result);
|
||||
} else {
|
||||
notifyListenersAboutNumberOfWindBotsReceivedIsZero();
|
||||
logger.log(Level.INFO, "WindInfoForRaceDTO is not containing wind from windbots");
|
||||
}
|
||||
} else {
|
||||
@@ -115,12 +114,6 @@ public class WindBotDataRetriever implements PollsLiveDataEvery5Seconds, WindBot
|
||||
}
|
||||
}
|
||||
|
||||
private void notifyListenersAboutNumberOfWindBotsReceivedIsZero() {
|
||||
for (NumberOfWindBotsChangeListener numberOfWindBotsChangeListener : numberOfWindBotsChangeListeners) {
|
||||
numberOfWindBotsChangeListener.numberOfWindBotsReceivedIsZero();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addWindBotDataRetrieverListener(WindBotDataRetrieverListener windBotDataRetrieverListener) {
|
||||
windBotDataRetrieverListeners.add(windBotDataRetrieverListener);
|
||||
@@ -156,7 +149,6 @@ public class WindBotDataRetriever implements PollsLiveDataEvery5Seconds, WindBot
|
||||
logger.log(Level.INFO, "Received RegattaAndRaceIdentifier from race that takes wind fixes now");
|
||||
loadWindBotData(finaloldTime, finalNewTime, raceId);
|
||||
} else {
|
||||
notifyListenersAboutNumberOfWindBotsReceivedIsZero();
|
||||
logger.log(Level.INFO, "Can´t load wind data because RegattaAndRaceIdentifier for race which takes wind is null");
|
||||
}
|
||||
}
|
||||
@@ -164,7 +156,6 @@ public class WindBotDataRetriever implements PollsLiveDataEvery5Seconds, WindBot
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
notifyListenersAboutNumberOfWindBotsReceivedIsZero();
|
||||
logger.log(Level.INFO, "Failed to received RegattaAndRaceIdentifier from race that takes wind fixes now");
|
||||
logger.log(Level.INFO, caught.getMessage());
|
||||
}
|
||||
|
||||
-60
@@ -1,60 +0,0 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.eventlogo;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.google.gwt.dom.client.Style.Visibility;
|
||||
import com.google.gwt.safehtml.shared.UriUtils;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.Image;
|
||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||
import com.sap.sailing.gwt.ui.shared.EventDTO;
|
||||
import com.sap.sse.gwt.client.media.ImageDTO;
|
||||
|
||||
public class EventLogo extends Image {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(EventLogo.class.getName());
|
||||
|
||||
protected EventLogo() {
|
||||
super();
|
||||
this.getElement().addClassName("eventLogo");
|
||||
}
|
||||
|
||||
public static EventLogo getEventLogoFromEventId(SailingServiceAsync sailingServiceAsync, String eventId) {
|
||||
final EventLogo eventLogo = new EventLogo();
|
||||
try {
|
||||
final UUID eventUUID = UUID.fromString(eventId);
|
||||
logger.log(Level.INFO, "Loading EventDTO for id " + eventId);
|
||||
sailingServiceAsync.getEventById(eventUUID, true, new AsyncCallback<EventDTO>() {
|
||||
@Override
|
||||
public void onSuccess(final EventDTO event) {
|
||||
logger.log(Level.INFO, "Received EventDTO");
|
||||
if (event != null) {
|
||||
final ImageDTO logo = event.getLogoImage();
|
||||
if (logo != null) {
|
||||
eventLogo.getElement().setAttribute("src", UriUtils.fromString(logo.getSourceRef()).asString());
|
||||
} else {
|
||||
eventLogo.getElement().getStyle().setVisibility(Visibility.HIDDEN);
|
||||
}
|
||||
if (event.getName() != null) {
|
||||
Window.setTitle(event.getName() + " Dashboard");
|
||||
}
|
||||
} else {
|
||||
logger.log(Level.INFO, "Received EventDTO is null");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
logger.log(Level.INFO, "Failed to received EventDTO, "+caught.getMessage());
|
||||
eventLogo.getElement().getStyle().setVisibility(Visibility.HIDDEN);
|
||||
}
|
||||
});
|
||||
} catch (IllegalArgumentException e) {
|
||||
eventLogo.getElement().getStyle().setVisibility(Visibility.HIDDEN);
|
||||
}
|
||||
return eventLogo;
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
@require 'theme';
|
||||
|
||||
.sap_logo {
|
||||
position: absolute;
|
||||
height: DASHBOARD_SPACE_MEDIUM;
|
||||
width: auto;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.event_race_container {
|
||||
position: absolute;
|
||||
height: DASHBOARD_SPACE_MEDIUM;
|
||||
width: 100%;
|
||||
top: 0px;
|
||||
color: LIGHT_TEXT_COLOR;
|
||||
}
|
||||
|
||||
.event {
|
||||
width: 100%;
|
||||
height: DASHBOARD_SPACE_MEDIUM;
|
||||
top: 0px;
|
||||
line-height: DASHBOARD_SPACE_MEDIUM;
|
||||
vertical-align: middle;
|
||||
font-size: DASHBOARD_FONT_SIZE_MEDIUM;
|
||||
font-family: DASHBOARD_FONT_FAMILY;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.event_shared_space {
|
||||
height: DASHBOARD_FONT_SIZE_MEDIUM;
|
||||
top: DASHBOARD_SPACE_VERY_SMALL;
|
||||
line-height: DASHBOARD_FONT_SIZE_MEDIUM;
|
||||
}
|
||||
|
||||
.race {
|
||||
width: 100%;
|
||||
height: DASHBOARD_FONT_SIZE_SMALL;
|
||||
margin-top: 5px;
|
||||
line-height: DASHBOARD_FONT_SIZE_SMALL;
|
||||
vertical-align: middle;
|
||||
font-size: DASHBOARD_FONT_SIZE_SMALL;
|
||||
font-family: DASHBOARD_FONT_FAMILY;
|
||||
text-align: center;
|
||||
overflow: visible;
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.header;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.DivElement;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HasWidgets;
|
||||
import com.google.gwt.user.client.ui.Image;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
|
||||
public class DashboardHeader extends Composite implements HasWidgets {
|
||||
|
||||
private static DashboardHeaderUiBinder uiBinder = GWT.create(DashboardHeaderUiBinder.class);
|
||||
|
||||
interface DashboardHeaderUiBinder extends UiBinder<Widget, DashboardHeader> {
|
||||
}
|
||||
|
||||
interface SettingsButtonWithSelectionIndicationLabelStyle extends CssResource {
|
||||
}
|
||||
|
||||
@UiField
|
||||
Image sapLogo;
|
||||
|
||||
@UiField
|
||||
DivElement event;
|
||||
|
||||
@UiField
|
||||
DivElement race;
|
||||
|
||||
private DashboardHeaderResources dashboardHeaderResources = DashboardHeaderResources.INSTANCE;
|
||||
|
||||
public DashboardHeader() {
|
||||
dashboardHeaderResources.gss().ensureInjected();
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
sapLogo.setResource(DashboardHeaderResources.INSTANCE.sapLogo());
|
||||
event.setInnerHTML(StringMessages.INSTANCE.dashboardHeader());
|
||||
}
|
||||
|
||||
public void setEventName(String eventName) {
|
||||
event.setInnerHTML(eventName);
|
||||
}
|
||||
|
||||
public void setRaceName(String raceName) {
|
||||
this.event.addClassName(dashboardHeaderResources.gss().event_shared_space());
|
||||
race.setInnerHTML(raceName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(Widget w) {
|
||||
throw new UnsupportedOperationException("The method add(Widget w) is not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
throw new UnsupportedOperationException("The method clear() is not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Widget> iterator() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove(Widget w) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:widget="urn:import:com.sap.sailing.dashboards.gwt.client.widgets">
|
||||
|
||||
<ui:with field="resources" type="com.sap.sailing.dashboards.gwt.client.header.DashboardHeaderResources"/>
|
||||
|
||||
<g:HTMLPanel>
|
||||
<g:Image ui:field="sapLogo" styleName="{resources.gss.sap_logo}"></g:Image>
|
||||
<div class="{resources.gss.event_race_container}">
|
||||
<div ui:field="event" class="{resources.gss.event}"></div>
|
||||
<div ui:field="race" class="{resources.gss.race}"></div>
|
||||
</div>
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.header;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.resources.client.ClientBundle;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.resources.client.ImageResource;
|
||||
|
||||
/**
|
||||
* @author Alexander Ries (D062114)
|
||||
*
|
||||
*/
|
||||
public interface DashboardHeaderResources extends ClientBundle {
|
||||
|
||||
public static final DashboardHeaderResources INSTANCE = GWT.create(DashboardHeaderResources.class);
|
||||
|
||||
@Source("com/sap/sailing/dashboards/gwt/client/images/logo_sap.png")
|
||||
ImageResource sapLogo();
|
||||
|
||||
@Source({"com/sap/sailing/dashboards/gwt/client/theme/theme.gss", "DashboardHeader.gss"})
|
||||
DashboardHeaderGSS gss();
|
||||
|
||||
public interface DashboardHeaderGSS extends CssResource {
|
||||
String sap_logo();
|
||||
String event_race_container();
|
||||
String event();
|
||||
String event_shared_space();
|
||||
String race();
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.linker;
|
||||
|
||||
import com.google.gwt.core.ext.linker.Shardable;
|
||||
import com.sap.sse.gwt.client.linker.ManifestLinker;
|
||||
|
||||
/**
|
||||
* @author Alexander Ries (D062114)
|
||||
*
|
||||
*/
|
||||
|
||||
@Shardable
|
||||
public class DashboardManifestLinker extends ManifestLinker {
|
||||
|
||||
@Override
|
||||
protected String[] staticCachedFiles() {
|
||||
return new String[] { "/dashboards/RibDashboard.html",
|
||||
"/dashboards/RibDashboard.css",
|
||||
"/dashboards/images/dashboardicon.png",
|
||||
"/dashboards/js/jquery-1.5.2.min.js",
|
||||
"/sailing-fontface-1.0.cache.css"};
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
CACHE MANIFEST
|
||||
# Unique id #$UNIQUEID$
|
||||
# Build version $BUILDVERSION$
|
||||
# Change this every time for cache to invalidate.
|
||||
# Do not delete the sections, as safari requires this file structure!!!
|
||||
|
||||
NETWORK:
|
||||
*
|
||||
|
||||
CACHE:
|
||||
$STATICAPPFILES$
|
||||
$GENAPPFILES$
|
||||
|
||||
FALLBACK:
|
||||
+8
-8
@@ -4,12 +4,12 @@
|
||||
position: absolute !important;
|
||||
opacity: 0.9;
|
||||
background-color: #F0AB00;
|
||||
height: 0pt;
|
||||
height: 0px;
|
||||
width: 100%;
|
||||
bottom: 0pt;
|
||||
bottom: 0px;
|
||||
text-align: center;
|
||||
font-size: 15pt;
|
||||
line-height: 30pt;
|
||||
font-size: DASHBOARD_FONT_SIZE_LARGE;
|
||||
line-height: DASHBOARD_SPACE_MEDIUM;
|
||||
color: black;
|
||||
font-family: DASHBOARD_FONT_FAMILY;
|
||||
z-index: 2;
|
||||
@@ -20,8 +20,8 @@
|
||||
-moz-transition: all 700ms cubic-bezier(0.480, -0.035, 0.000, 2.650);
|
||||
-o-transition: all 700ms cubic-bezier(0.480, -0.035, 0.000, 2.650);
|
||||
transition: all 700ms cubic-bezier(0.480, -0.035, 0.000, 2.650);
|
||||
height: 30pt;
|
||||
line-height: 30pt;
|
||||
height: DASHBOARD_SPACE_MEDIUM;
|
||||
line-height: DASHBOARD_SPACE_MEDIUM;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
@@ -29,6 +29,6 @@
|
||||
-moz-transition: all 700ms cubic-bezier(0.480, -0.035, 0.000, 1.650);
|
||||
-o-transition: all 700ms cubic-bezier(0.480, -0.035, 0.000, 1.650);
|
||||
transition: all 700ms cubic-bezier(0.480, -0.035, 0.000, 1.650);
|
||||
height: 0pt;
|
||||
line-height: 0pt;
|
||||
height: 0px;
|
||||
line-height: 0px;
|
||||
}
|
||||
+22
-2
@@ -1,11 +1,31 @@
|
||||
@require 'theme';
|
||||
|
||||
.notification_background {
|
||||
position: absolute !important;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
background-color: DARK_GREY;
|
||||
z-index: 7;
|
||||
}
|
||||
|
||||
.notification_background_shown {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 1.0;
|
||||
}
|
||||
|
||||
.notification_background_hidden {
|
||||
width: 0px;
|
||||
height: 0px;
|
||||
opacity: 0.0;
|
||||
}
|
||||
|
||||
.notification {
|
||||
position: absolute !important;
|
||||
top: 50%;
|
||||
right: 50%;
|
||||
background-color: white;
|
||||
z-index: 2;
|
||||
background-color: WHITE;
|
||||
z-index: 8;
|
||||
}
|
||||
|
||||
.shown {
|
||||
|
||||
+18
-12
@@ -3,47 +3,53 @@ package com.sap.sailing.dashboards.gwt.client.notifications.orientation;
|
||||
import com.google.gwt.user.client.ui.AbsolutePanel;
|
||||
import com.google.gwt.user.client.ui.Image;
|
||||
import com.google.gwt.user.client.ui.Label;
|
||||
import com.google.gwt.user.client.ui.RootLayoutPanel;
|
||||
import com.sap.sailing.dashboards.gwt.client.device.Orientation;
|
||||
import com.sap.sailing.dashboards.gwt.client.device.OrientationListener;
|
||||
import com.sap.sailing.dashboards.gwt.client.device.OrientationType;
|
||||
import com.sap.sailing.dashboards.gwt.client.visualeffects.BlurEffect;
|
||||
import com.sap.sse.common.Util.Pair;
|
||||
|
||||
public class WrongDeviceOrientationNotification extends AbsolutePanel implements OrientationListener {
|
||||
|
||||
private Label rotateDeviceLabel;
|
||||
private AbsolutePanel notification;
|
||||
|
||||
public WrongDeviceOrientationNotification() {
|
||||
super();
|
||||
WrongDeviceOrientationNotificationResources.INSTANCE.gss().ensureInjected();
|
||||
this.addStyleName(WrongDeviceOrientationNotificationResources.INSTANCE.gss().notification());
|
||||
this.addStyleName(WrongDeviceOrientationNotificationResources.INSTANCE.gss().hidden());
|
||||
this.addStyleName(WrongDeviceOrientationNotificationResources.INSTANCE.gss().notification_background());
|
||||
this.addStyleName(WrongDeviceOrientationNotificationResources.INSTANCE.gss().notification_background_hidden());
|
||||
notification = new AbsolutePanel();
|
||||
notification.addStyleName(WrongDeviceOrientationNotificationResources.INSTANCE.gss().notification());
|
||||
notification.addStyleName(WrongDeviceOrientationNotificationResources.INSTANCE.gss().hidden());
|
||||
|
||||
Image rotateDeviceIcon = new Image();
|
||||
rotateDeviceIcon.setResource(WrongDeviceOrientationNotificationResources.INSTANCE.rotatedevice());
|
||||
rotateDeviceIcon.getElement().addClassName(WrongDeviceOrientationNotificationResources.INSTANCE.gss().logo());
|
||||
add(rotateDeviceIcon);
|
||||
notification.add(rotateDeviceIcon);
|
||||
|
||||
rotateDeviceLabel = new Label();
|
||||
rotateDeviceLabel.getElement().addClassName(WrongDeviceOrientationNotificationResources.INSTANCE.gss().text());
|
||||
rotateDeviceLabel.setText("Rotate Device");
|
||||
add(rotateDeviceLabel);
|
||||
notification.add(rotateDeviceLabel);
|
||||
|
||||
this.add(notification);
|
||||
|
||||
Orientation.getInstance().addListener(this);
|
||||
Orientation.getInstance().triggerDeviceOrientationRead();
|
||||
}
|
||||
|
||||
public void show() {
|
||||
this.removeStyleName(WrongDeviceOrientationNotificationResources.INSTANCE.gss().hidden());
|
||||
this.addStyleName(WrongDeviceOrientationNotificationResources.INSTANCE.gss().shown());
|
||||
BlurEffect.getInstance().addToView(RootLayoutPanel.get());
|
||||
this.removeStyleName(WrongDeviceOrientationNotificationResources.INSTANCE.gss().notification_background_hidden());
|
||||
this.addStyleName(WrongDeviceOrientationNotificationResources.INSTANCE.gss().notification_background_shown());
|
||||
notification.removeStyleName(WrongDeviceOrientationNotificationResources.INSTANCE.gss().hidden());
|
||||
notification.addStyleName(WrongDeviceOrientationNotificationResources.INSTANCE.gss().shown());
|
||||
}
|
||||
|
||||
public void hide() {
|
||||
this.removeStyleName(WrongDeviceOrientationNotificationResources.INSTANCE.gss().shown());
|
||||
this.addStyleName(WrongDeviceOrientationNotificationResources.INSTANCE.gss().hidden());
|
||||
BlurEffect.getInstance().removeFromView(RootLayoutPanel.get());
|
||||
this.removeStyleName(WrongDeviceOrientationNotificationResources.INSTANCE.gss().notification_background_shown());
|
||||
this.addStyleName(WrongDeviceOrientationNotificationResources.INSTANCE.gss().notification_background_hidden());
|
||||
notification.removeStyleName(WrongDeviceOrientationNotificationResources.INSTANCE.gss().shown());
|
||||
notification.addStyleName(WrongDeviceOrientationNotificationResources.INSTANCE.gss().hidden());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
@@ -20,6 +20,9 @@ public interface WrongDeviceOrientationNotificationResources extends ClientBundl
|
||||
WrongDeviceNotificationGSS gss();
|
||||
|
||||
public interface WrongDeviceNotificationGSS extends CssResource {
|
||||
public String notification_background();
|
||||
public String notification_background_shown();
|
||||
public String notification_background_hidden();
|
||||
public String notification();
|
||||
public String shown();
|
||||
public String hidden();
|
||||
|
||||
-85
@@ -1,85 +0,0 @@
|
||||
@CHARSET "UTF-8";
|
||||
|
||||
.competitorselectionbackground {
|
||||
position: absolute;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.competitorselectionpopup {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
width: 200pt;
|
||||
height: 200pt;
|
||||
margin-top: -600pt;
|
||||
margin-left: -100pt;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
border-radius: 0px;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.header {
|
||||
position: absolute;
|
||||
color: black;
|
||||
font-size: 12pt;
|
||||
background-color: white;
|
||||
height: 30pt;
|
||||
line-height: 30pt;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
|
||||
width: 100%;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.scrollpanel {
|
||||
position: absolute;
|
||||
top: 30pt;
|
||||
width: 100%;
|
||||
bottom: 6pt;
|
||||
overflow: hidden;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.button {
|
||||
position: absolute;
|
||||
background-color: #2AB3E8;
|
||||
box-shadow: none;
|
||||
outline: none;
|
||||
border-width: 0;
|
||||
font-size: 12pt;
|
||||
font-color: white;
|
||||
color: white;
|
||||
height: 0pt;
|
||||
width: 100%;
|
||||
top: 100%;
|
||||
left: 0pt;
|
||||
}
|
||||
|
||||
.button:active {
|
||||
background-color: #4192D9;
|
||||
}
|
||||
|
||||
.buttonshow {
|
||||
transition: all ease-in-out 200ms;
|
||||
height: 30pt;
|
||||
}
|
||||
|
||||
.popuphide {
|
||||
transition: all ease-in-out 500ms;
|
||||
height: 0pt;
|
||||
}
|
||||
|
||||
.popupshow {
|
||||
transition: margin-top ease-in-out 500ms;
|
||||
margin-top: -100pt;
|
||||
}
|
||||
|
||||
.popuphide {
|
||||
transition: margin-top ease-in-out 500ms;
|
||||
margin-top: -600pt;
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
@require 'theme';
|
||||
|
||||
.competitorselectionbackground {
|
||||
position: absolute;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.competitorselectionpopup {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
width: 250px;
|
||||
height: 300px;
|
||||
margin-top: -150px;
|
||||
margin-left: -125px;
|
||||
background-color: WHITE;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
z-index: 7;
|
||||
}
|
||||
|
||||
.header {
|
||||
position: absolute;
|
||||
color: BLACK;
|
||||
font-size: DASHBOARD_FONT_SIZE_MEDIUM;
|
||||
background-color: WHITE;
|
||||
height: DASHBOARD_SPACE_MEDIUM;
|
||||
line-height: DASHBOARD_SPACE_MEDIUM;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
|
||||
width: 100%;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.scrollpanel {
|
||||
position: absolute;
|
||||
top: DASHBOARD_SPACE_MEDIUM;
|
||||
width: 100%;
|
||||
bottom: 42px;
|
||||
overflow: hidden;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.buttonSeparator {
|
||||
position: absolute;
|
||||
height: DASHBOARD_SPACE_MEDIUM;
|
||||
width: 1px;
|
||||
left: 49%;
|
||||
bottom: 0px;
|
||||
background-color: WHITE;
|
||||
}
|
||||
|
||||
.button {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
background-color: BUTTON_BACKGROUND;
|
||||
box-shadow: none;
|
||||
outline: none;
|
||||
border-width: 0;
|
||||
font-size: DASHBOARD_FONT_SIZE_MEDIUM;
|
||||
line-height: DASHBOARD_SPACE_MEDIUM;
|
||||
text-align: center;
|
||||
color: WHITE;
|
||||
height: DASHBOARD_SPACE_MEDIUM;
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.button:active {
|
||||
background-color: BUTTON_BACKGROUND_ACTIVE;
|
||||
}
|
||||
|
||||
.cancelButton {
|
||||
left:0px;
|
||||
}
|
||||
|
||||
.okButton {
|
||||
right: 0px;
|
||||
}
|
||||
|
||||
.popupshow {
|
||||
/* margin-top: -150pt; */
|
||||
}
|
||||
|
||||
.popuphide {
|
||||
/* margin-top: -600pt; */
|
||||
}
|
||||
+56
-39
@@ -5,48 +5,42 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.uibinder.client.UiHandler;
|
||||
import com.google.gwt.user.client.ui.Button;
|
||||
import com.google.gwt.user.client.Event;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.google.gwt.user.client.ui.HasWidgets;
|
||||
import com.google.gwt.user.client.ui.RootLayoutPanel;
|
||||
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.dashboards.gwt.client.popups.competitorselection.table.CompetitorTable;
|
||||
import com.sap.sailing.dashboards.gwt.client.popups.competitorselection.table.CompetitorTableRowSelectionListener;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.ActionPanel;
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
|
||||
public class CompetitorSelectionPopup extends Composite implements HasWidgets, CompetitorTableRowSelectionListener {
|
||||
|
||||
interface CompetitorSelectionPopupStyle extends CssResource {
|
||||
String popupshow();
|
||||
String popuphide();
|
||||
String buttonshow();
|
||||
}
|
||||
@UiField(provided = true)
|
||||
ActionPanel competitorselectionbackground;
|
||||
|
||||
@UiField
|
||||
CompetitorSelectionPopupStyle style;
|
||||
HTMLPanel competitorselectionpopup;
|
||||
|
||||
@UiField
|
||||
HTMLPanel competitorselectionbackground;
|
||||
|
||||
@UiField
|
||||
VerticalPanel competitorselectionpopup;
|
||||
|
||||
@UiField
|
||||
HTMLPanel header;
|
||||
|
||||
@UiField(provided = true)
|
||||
CompetitorTable competitortable;
|
||||
|
||||
@UiField
|
||||
Button button;
|
||||
@UiField(provided = true)
|
||||
ActionPanel cancelButton;
|
||||
|
||||
@UiField(provided = true)
|
||||
ActionPanel okButton;
|
||||
|
||||
private CompetitorDTO currentCompetitorSelected;
|
||||
private boolean isVisible;
|
||||
private CompetitorSelectionPopupResources competitorSelectionPopupResources = CompetitorSelectionPopupResources.INSTANCE;
|
||||
|
||||
private List<CompetitorSelectionListener> competitorSelectionPopupListener;
|
||||
|
||||
@@ -56,28 +50,34 @@ public class CompetitorSelectionPopup extends Composite implements HasWidgets, C
|
||||
}
|
||||
|
||||
public CompetitorSelectionPopup() {
|
||||
competitorSelectionPopupResources.gss().ensureInjected();
|
||||
competitorSelectionPopupListener = new ArrayList<CompetitorSelectionListener>();
|
||||
competitortable = new CompetitorTable(this);
|
||||
isVisible = false;
|
||||
competitorselectionbackground = new ActionPanel(Event.TOUCHEVENTS, Event.ONCLICK);
|
||||
cancelButton = new ActionPanel(Event.TOUCHEVENTS, Event.ONCLICK);
|
||||
okButton = new ActionPanel(Event.TOUCHEVENTS, Event.ONCLICK);
|
||||
addActionListenerToActionPanels();
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
cancelButton.getElement().setInnerText("CANCEL");
|
||||
okButton.getElement().setInnerText("OK");
|
||||
}
|
||||
|
||||
public void show(List<CompetitorDTO> competitorList) {
|
||||
competitortable.setTableContent(competitorList);
|
||||
RootLayoutPanel.get().add(this);
|
||||
this.button.setText("OK");
|
||||
competitorselectionpopup.addStyleName(style.popupshow());
|
||||
competitorselectionpopup.removeStyleName(style.popuphide());
|
||||
competitorselectionpopup.addStyleName(competitorSelectionPopupResources.gss().popupshow());
|
||||
competitorselectionpopup.removeStyleName(competitorSelectionPopupResources.gss().popuphide());
|
||||
isVisible = true;
|
||||
}
|
||||
|
||||
public void hide() {
|
||||
competitorselectionpopup.addStyleName(style.popuphide());
|
||||
competitorselectionpopup.removeStyleName(style.popupshow());
|
||||
competitorselectionpopup.addStyleName(competitorSelectionPopupResources.gss().popuphide());
|
||||
competitorselectionpopup.removeStyleName(competitorSelectionPopupResources.gss().popupshow());
|
||||
RootLayoutPanel.get().remove(this);
|
||||
isVisible = false;
|
||||
}
|
||||
|
||||
|
||||
public void addListener(CompetitorSelectionListener o) {
|
||||
if (o != null && !competitorSelectionPopupListener.contains(o)) {
|
||||
this.competitorSelectionPopupListener.add(o);
|
||||
@@ -94,25 +94,42 @@ public class CompetitorSelectionPopup extends Composite implements HasWidgets, C
|
||||
}
|
||||
hide();
|
||||
}
|
||||
|
||||
public boolean isShown(){
|
||||
|
||||
public boolean isShown() {
|
||||
return isVisible;
|
||||
}
|
||||
|
||||
@UiHandler("button")
|
||||
void handleClick(ClickEvent e) {
|
||||
hide();
|
||||
if (currentCompetitorSelected != null) {
|
||||
notifyListenerAboutOKButtonClickedWithSelectedCompetitorName(currentCompetitorSelected);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void didSelectedRowWithCompetitorName(CompetitorDTO competitor) {
|
||||
button.getElement().addClassName(style.buttonshow());
|
||||
currentCompetitorSelected = competitor;
|
||||
private void addActionListenerToActionPanels() {
|
||||
competitorselectionbackground.addActionPanelListener(new ActionPanel.ActionPanelListener() {
|
||||
|
||||
@Override
|
||||
public void eventTriggered() {
|
||||
hide();
|
||||
}
|
||||
});
|
||||
cancelButton.addActionPanelListener(new ActionPanel.ActionPanelListener() {
|
||||
|
||||
@Override
|
||||
public void eventTriggered() {
|
||||
hide();
|
||||
}
|
||||
});
|
||||
okButton.addActionPanelListener(new ActionPanel.ActionPanelListener() {
|
||||
|
||||
@Override
|
||||
public void eventTriggered() {
|
||||
hide();
|
||||
if (currentCompetitorSelected != null) {
|
||||
notifyListenerAboutOKButtonClickedWithSelectedCompetitorName(currentCompetitorSelected);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void didSelectedRowWithCompetitorName(CompetitorDTO competitor) {
|
||||
currentCompetitorSelected = competitor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(Widget w) {
|
||||
|
||||
+18
-18
@@ -1,25 +1,25 @@
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||
xmlns:popups="urn:import:com.sap.sailing.dashboards.gwt.client.popups.competitorselection"
|
||||
xmlns:mgwts="urn:import:com.googlecode.mgwt.ui.client.widget.panel.scroll">
|
||||
xmlns:table="urn:import:com.sap.sailing.dashboards.gwt.client.popups.competitorselection.table"
|
||||
xmlns:mgwts="urn:import:com.googlecode.mgwt.ui.client.widget.panel.scroll"
|
||||
xmlns:action="urn:import:com.sap.sailing.dashboards.gwt.client.widgets">
|
||||
|
||||
<ui:style
|
||||
type='com.sap.sailing.dashboards.gwt.client.popups.competitorselection.CompetitorSelectionPopup.CompetitorSelectionPopupStyle'
|
||||
src='CompetitorSelectionPopup.css'></ui:style>
|
||||
<g:HTMLPanel ui:field="competitorselectionbackground"
|
||||
styleName="{style.competitorselectionbackground}">
|
||||
<g:VerticalPanel ui:field="competitorselectionpopup"
|
||||
styleName="{style.competitorselectionpopup}">
|
||||
<g:HTMLPanel ui:field="header" styleName="{style.header}">Select your Team</g:HTMLPanel>
|
||||
<mgwts:ScrollPanel styleName="{style.scrollpanel}"
|
||||
scrollingEnabledX="false">
|
||||
<g:FlowPanel>
|
||||
<popups:CompetitorTable ui:field="competitortable"></popups:CompetitorTable>
|
||||
</g:FlowPanel>
|
||||
</mgwts:ScrollPanel>
|
||||
<g:Button ui:field="button" styleName="{style.button}"></g:Button>
|
||||
</g:VerticalPanel>
|
||||
<ui:with field="resources" type="com.sap.sailing.dashboards.gwt.client.popups.competitorselection.CompetitorSelectionPopupResources" />
|
||||
|
||||
<g:HTMLPanel>
|
||||
<action:ActionPanel ui:field="competitorselectionbackground" styleName="{resources.gss.competitorselectionbackground}"></action:ActionPanel>
|
||||
<g:HTMLPanel ui:field="competitorselectionpopup" styleName="{resources.gss.competitorselectionpopup}">
|
||||
<g:HTMLPanel ui:field="header" styleName="{resources.gss.header}">Select your Team</g:HTMLPanel>
|
||||
<mgwts:ScrollPanel styleName="{resources.gss.scrollpanel}" scrollingEnabledX="false">
|
||||
<g:FlowPanel>
|
||||
<table:CompetitorTable ui:field="competitortable"></table:CompetitorTable>
|
||||
</g:FlowPanel>
|
||||
</mgwts:ScrollPanel>
|
||||
<action:ActionPanel ui:field="cancelButton" styleName="{resources.gss.button} {resources.gss.cancelButton}"></action:ActionPanel>
|
||||
<div class="{resources.gss.buttonSeparator}"></div>
|
||||
<action:ActionPanel ui:field="okButton" styleName="{resources.gss.button} {resources.gss.okButton}"></action:ActionPanel>
|
||||
</g:HTMLPanel>
|
||||
</g:HTMLPanel>
|
||||
|
||||
</ui:UiBinder>
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.popups.competitorselection;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.resources.client.ClientBundle;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
|
||||
/**
|
||||
* @author Alexander Ries (D062114)
|
||||
*
|
||||
*/
|
||||
public interface CompetitorSelectionPopupResources extends ClientBundle {
|
||||
|
||||
public static final CompetitorSelectionPopupResources INSTANCE = GWT.create(CompetitorSelectionPopupResources.class);
|
||||
|
||||
@Source({"com/sap/sailing/dashboards/gwt/client/theme/theme.gss", "CompetitorSelectionPopup.gss"})
|
||||
CompetitorSelectionPopupGss gss();
|
||||
|
||||
public interface CompetitorSelectionPopupGss extends CssResource {
|
||||
String competitorselectionbackground();
|
||||
String competitorselectionpopup();
|
||||
String header();
|
||||
String scrollpanel();
|
||||
String buttonSeparator();
|
||||
String button();
|
||||
String cancelButton();
|
||||
String okButton();
|
||||
String popuphide();
|
||||
String popupshow();
|
||||
}
|
||||
}
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
@CHARSET "UTF-8";
|
||||
|
||||
.settings_button {
|
||||
position: absolute !important;
|
||||
height: 23.5pt;
|
||||
width: 23.5pt;
|
||||
right: 10pt;
|
||||
top: 17.5pt;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.settings_button_image {
|
||||
height: 23.5pt;
|
||||
width: 23.5pt;
|
||||
}
|
||||
|
||||
.settings_indication_label {
|
||||
position: absolute;
|
||||
width: 200pt;
|
||||
height: 23.5pt;
|
||||
margin-top: 17.5pt;
|
||||
right: 43.5pt;
|
||||
font-size: 12pt;
|
||||
font-color: black;
|
||||
text-align: right;
|
||||
line-height: 23.5pt;
|
||||
}
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.popups.competitorselection;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.FocusPanel;
|
||||
import com.google.gwt.user.client.ui.Image;
|
||||
import com.google.gwt.user.client.ui.Label;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.dashboards.gwt.client.dashboardpanel.DashboardPanelResources;
|
||||
|
||||
public class SettingsButtonWithSelectionIndicationLabel extends Composite {
|
||||
|
||||
private static SettingsButtonWithSelectionIndicationLabelUiBinder uiBinder = GWT
|
||||
.create(SettingsButtonWithSelectionIndicationLabelUiBinder.class);
|
||||
|
||||
interface SettingsButtonWithSelectionIndicationLabelUiBinder extends
|
||||
UiBinder<Widget, SettingsButtonWithSelectionIndicationLabel> {
|
||||
}
|
||||
|
||||
interface SettingsButtonWithSelectionIndicationLabelStyle extends CssResource {
|
||||
}
|
||||
|
||||
@UiField
|
||||
SettingsButtonWithSelectionIndicationLabelStyle style;
|
||||
|
||||
@UiField
|
||||
FocusPanel settingsButton;
|
||||
|
||||
@UiField
|
||||
Image settingsButtonImage;
|
||||
|
||||
@UiField
|
||||
Label settingsIndicationLabel;
|
||||
|
||||
public SettingsButtonWithSelectionIndicationLabel() {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
settingsButtonImage.setResource(DashboardPanelResources.INSTANCE.settings());
|
||||
}
|
||||
|
||||
public void addClickHandlerToSettingsButton(ClickHandler clickHandler){
|
||||
settingsButton.addClickHandler(clickHandler);
|
||||
}
|
||||
|
||||
public void setSelectionIndicationTextOnLabel(String selectionIndicationText) {
|
||||
settingsIndicationLabel.setText(selectionIndicationText);
|
||||
}
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui">
|
||||
<ui:style
|
||||
type='com.sap.sailing.dashboards.gwt.client.popups.competitorselection.SettingsButtonWithSelectionIndicationLabel.SettingsButtonWithSelectionIndicationLabelStyle'
|
||||
src='SettingsButtonWithSelectionIndicationLabel.css'></ui:style>
|
||||
<g:HTMLPanel>
|
||||
<g:FocusPanel ui:field="settingsButton" styleName="{style.settings_button}">
|
||||
<g:Image ui:field="settingsButtonImage" styleName="{style.settings_button_image}"></g:Image>
|
||||
</g:FocusPanel>
|
||||
<g:Label ui:field="settingsIndicationLabel" styleName="{style.settings_indication_label}"></g:Label>
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.popups.competitorselection;
|
||||
package com.sap.sailing.dashboards.gwt.client.popups.competitorselection.table;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.popups.competitorselection;
|
||||
package com.sap.sailing.dashboards.gwt.client.popups.competitorselection.table;
|
||||
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
|
||||
+9
-10
@@ -1,4 +1,3 @@
|
||||
@CHARSET "UTF-8";
|
||||
|
||||
.cellTableHeader {
|
||||
height: 0pt;
|
||||
@@ -10,25 +9,25 @@
|
||||
.cellTableCell {
|
||||
padding: 10px;
|
||||
overflow: hidden;
|
||||
font-size: 12pt;
|
||||
font-size: 14px;
|
||||
color: black;
|
||||
background-color: #d3d3d3;
|
||||
border-width: 4px 8px 4px 8px;
|
||||
background-color: #E0E0E0;
|
||||
border-width: 0px 8px 8px 8px;
|
||||
border-color: white;
|
||||
}
|
||||
|
||||
.cellTableSelectedRow {
|
||||
background: grey !important;
|
||||
backrgound-color: #d3d3d3 !important;
|
||||
background: #848484 !important;
|
||||
backrgound-color: #848484 !important;
|
||||
color: white !important;
|
||||
border-width: 3pt 6pt 3pt 6pt;
|
||||
border-width: 0px 8px 8px 8px;
|
||||
border-color: white;
|
||||
}
|
||||
|
||||
.cellTableSelectedRowCell {
|
||||
background: grey !important;
|
||||
backrgound-color: #d3d3d3 !important;
|
||||
background: #848484 !important;
|
||||
backrgound-color: #848484 !important;
|
||||
color: white !important;
|
||||
border-width: 3pt 6pt 3pt 6pt;
|
||||
border-width: 0px 8px 8px 8px;
|
||||
border-color: white;
|
||||
}
|
||||
+1
-2
@@ -1,11 +1,10 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.popups.competitorselection;
|
||||
package com.sap.sailing.dashboards.gwt.client.popups.competitorselection.table;
|
||||
|
||||
import com.google.gwt.user.cellview.client.CellTable;
|
||||
|
||||
public interface CompetitorTableStyleResource extends CellTable.Resources {
|
||||
|
||||
@Source({CellTable.Style.DEFAULT_CSS, "CompetitorTableStyle.css"})
|
||||
|
||||
TableStyle cellTableStyle();
|
||||
|
||||
interface TableStyle extends CellTable.Style {
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
@require 'theme';
|
||||
|
||||
.settings_button {
|
||||
position: absolute !important;
|
||||
height: DASHBOARD_SPACE_MEDIUM;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
width: 300px;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.settings_button_image {
|
||||
position: absolute;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
top: 7.5px;
|
||||
right: DASHBOARD_SPACE_VERY_SMALL;
|
||||
}
|
||||
|
||||
.settings_indication_label {
|
||||
position: absolute;
|
||||
width: 300px;
|
||||
height: DASHBOARD_SPACE_MEDIUM;
|
||||
top: 0px;
|
||||
right: DASHBOARD_SPACE_MEDIUM;
|
||||
font-size: DASHBOARD_FONT_SIZE_MEDIUM;
|
||||
color: black;
|
||||
text-align: right;
|
||||
line-height: DASHBOARD_SPACE_MEDIUM;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.settings_indication_label_disabled {
|
||||
color: DARK_GREY;
|
||||
}
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.popups.competitorselection.util;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.Event;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.google.gwt.user.client.ui.HasWidgets;
|
||||
import com.google.gwt.user.client.ui.Image;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.ActionPanel;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.ActionPanel.ActionPanelListener;
|
||||
|
||||
public class SettingsButtonWithSelectionIndicationLabel extends Composite implements HasWidgets {
|
||||
|
||||
private static SettingsButtonWithSelectionIndicationLabelUiBinder uiBinder = GWT
|
||||
.create(SettingsButtonWithSelectionIndicationLabelUiBinder.class);
|
||||
|
||||
interface SettingsButtonWithSelectionIndicationLabelUiBinder extends
|
||||
UiBinder<Widget, SettingsButtonWithSelectionIndicationLabel> {
|
||||
}
|
||||
|
||||
interface SettingsButtonWithSelectionIndicationLabelStyle extends CssResource {
|
||||
}
|
||||
|
||||
@UiField(provided = true)
|
||||
ActionPanel settingsButton;
|
||||
|
||||
@UiField
|
||||
Image settingsButtonImage;
|
||||
|
||||
@UiField
|
||||
HTMLPanel settingsIndicationLabel;
|
||||
|
||||
public SettingsButtonWithSelectionIndicationLabel() {
|
||||
SettingsButtonWithSelectionIndicationLabelResources.INSTANCE.gss().ensureInjected();
|
||||
settingsButton = new ActionPanel(Event.TOUCHEVENTS, Event.ONCLICK);
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
settingsButtonImage.setResource(SettingsButtonWithSelectionIndicationLabelResources.INSTANCE.settings());
|
||||
}
|
||||
|
||||
public void addActionListener(ActionPanelListener actionPanelListener) {
|
||||
settingsButton.addActionPanelListener(actionPanelListener);
|
||||
}
|
||||
|
||||
public void setSelectionIndicationTextOnLabel(String selectionIndicationText) {
|
||||
settingsIndicationLabel.getElement().setInnerHTML("" + selectionIndicationText);
|
||||
}
|
||||
|
||||
public void disable() {
|
||||
settingsButton.disable();
|
||||
settingsButtonImage.setResource(SettingsButtonWithSelectionIndicationLabelResources.INSTANCE.settingsDisabled());
|
||||
settingsIndicationLabel.getElement().addClassName(SettingsButtonWithSelectionIndicationLabelResources.INSTANCE.gss().settings_indication_label_disabled());
|
||||
}
|
||||
|
||||
public void enable() {
|
||||
settingsButton.enable();
|
||||
settingsButtonImage.setResource(SettingsButtonWithSelectionIndicationLabelResources.INSTANCE.settings());
|
||||
settingsIndicationLabel.getElement().removeClassName(SettingsButtonWithSelectionIndicationLabelResources.INSTANCE.gss().settings_indication_label_disabled());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(Widget w) {
|
||||
throw new UnsupportedOperationException("The method add(Widget w) is not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
throw new UnsupportedOperationException("The method clear() is not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Widget> iterator() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove(Widget w) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||
xmlns:widget="urn:import:com.sap.sailing.dashboards.gwt.client.widgets">
|
||||
|
||||
<ui:with field="resources"
|
||||
type="com.sap.sailing.dashboards.gwt.client.popups.competitorselection.util.SettingsButtonWithSelectionIndicationLabelResources" />
|
||||
|
||||
<g:HTMLPanel>
|
||||
<widget:ActionPanel ui:field="settingsButton" styleName="{resources.gss.settings_button}">
|
||||
<g:Image ui:field="settingsButtonImage" styleName="{resources.gss.settings_button_image}"></g:Image>
|
||||
<g:HTMLPanel ui:field="settingsIndicationLabel" styleName="{resources.gss.settings_indication_label}"></g:HTMLPanel>
|
||||
</widget:ActionPanel>
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.popups.competitorselection.util;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.resources.client.ClientBundle;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.resources.client.ImageResource;
|
||||
|
||||
/**
|
||||
* @author Alexander Ries (D062114)
|
||||
*
|
||||
*/
|
||||
public interface SettingsButtonWithSelectionIndicationLabelResources extends ClientBundle {
|
||||
|
||||
public static final SettingsButtonWithSelectionIndicationLabelResources INSTANCE = GWT.create(SettingsButtonWithSelectionIndicationLabelResources.class);
|
||||
|
||||
@Source("com/sap/sailing/dashboards/gwt/client/images/settings.png")
|
||||
ImageResource settings();
|
||||
|
||||
@Source("com/sap/sailing/dashboards/gwt/client/images/settings_disabled.png")
|
||||
ImageResource settingsDisabled();
|
||||
|
||||
@Source({"com/sap/sailing/dashboards/gwt/client/theme/theme.gss", "SettingsButtonWithSelectionIndicationLabel.gss"})
|
||||
StartlineAdvantagesOnLineChartGSS gss();
|
||||
|
||||
public interface StartlineAdvantagesOnLineChartGSS extends CssResource {
|
||||
String settings_button();
|
||||
String settings_button_image();
|
||||
String settings_indication_label();
|
||||
String settings_indication_label_disabled();
|
||||
}
|
||||
}
|
||||
+10
-7
@@ -6,11 +6,14 @@ package com.sap.sailing.dashboards.gwt.client.theme;
|
||||
*/
|
||||
public class Colors {
|
||||
public static final String WHITE = "#FFFFFF";
|
||||
public static final String LIGHT_GREY = "#FFFFFF";
|
||||
public static final String DARK_GREY = "#FFFFFF";
|
||||
public static final String LIGHT_TEXT_COLOR = "#FFFFFF";
|
||||
public static final String DARK_TEXT_COLOR = "#FFFFFF";
|
||||
public static final String DARK_BLUE = "#FFFFFF";
|
||||
public static final String LIGHT_BLUE = "#FFFFFF";
|
||||
public static final String YELLOW = "#FFFFFF";
|
||||
public static final String BLACK = "#000000";
|
||||
public static final String LIGHT_GREY = "#F3F2F4";
|
||||
public static final String DARK_GREY = "#E0E0E0";
|
||||
public static final String LIGHT_TEXT_COLOR = "#848484";
|
||||
public static final String DARK_TEXT_COLOR = "#000000";
|
||||
public static final String BUTTON_BACKGROUND = "#008FFF";
|
||||
public static final String BUTTON_BACKGROUND_ACTIVE = "#4192D9";
|
||||
public static final String DARK_BLUE = "#008FFF";
|
||||
public static final String LIGHT_BLUE = "#6ADBFF";
|
||||
public static final String YELLOW = "#F0AB00";
|
||||
}
|
||||
+13
-5
@@ -1,13 +1,21 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.theme;
|
||||
|
||||
|
||||
/**
|
||||
* @author Alexander Ries (D062114)
|
||||
*
|
||||
*/
|
||||
public class Sizes {
|
||||
public static final String DASHBOARD_FONT_SIZE_VERY_SMALL = "12px";
|
||||
public static final String DASHBOARD_FONT_SIZE_SMALL = "12px";
|
||||
public static final String DASHBOARD_FONT_SIZE_MEDIUM = "12px";
|
||||
public static final String DASHBOARD_FONT_SIZE_BIG = "12px";
|
||||
public static final String DASHBOARD_FONT_SIZE_VERY_BIG = "12px";
|
||||
public static final String DASHBOARD_FONT_SIZE_VERY_SMALL = "10px";
|
||||
public static final String DASHBOARD_FONT_SIZE_SMALL = "13px";
|
||||
public static final String DASHBOARD_FONT_SIZE_MEDIUM = "14px";
|
||||
public static final String DASHBOARD_FONT_SIZE_LARGE = "16px";
|
||||
public static final String DASHBOARD_FONT_SIZE_VERY_LARGE = "33px";
|
||||
public static final String DASHBOARD_SPACE_VERY_SMALL = "10px";
|
||||
public static final String DASHBOARD_SPACE_SMALL = "30px";
|
||||
public static final String DASHBOARD_SPACE_MEDIUM = "35px";
|
||||
public static final String DASHBOARD_SPACE_LARGE = "50px";
|
||||
public static final String DASHBOARD_SPACE_VERY_LARGE = "70px";
|
||||
public static final String DASHBOARD_LINE_HEIGHT = "20px";
|
||||
public static final String DASHBOARD_BORDER_RADIUS = "5px";
|
||||
}
|
||||
+27
@@ -2,6 +2,33 @@
|
||||
|
||||
/*Colors*/
|
||||
@def WHITE eval("com.sap.sailing.dashboards.gwt.client.theme.Colors.WHITE");
|
||||
@def BLACK eval("com.sap.sailing.dashboards.gwt.client.theme.Colors.BLACK");
|
||||
@def LIGHT_GREY eval("com.sap.sailing.dashboards.gwt.client.theme.Colors.LIGHT_GREY");
|
||||
@def DARK_GREY eval("com.sap.sailing.dashboards.gwt.client.theme.Colors.DARK_GREY");
|
||||
@def LIGHT_TEXT_COLOR eval("com.sap.sailing.dashboards.gwt.client.theme.Colors.LIGHT_TEXT_COLOR");
|
||||
@def DARK_TEXT_COLOR eval("com.sap.sailing.dashboards.gwt.client.theme.Colors.DARK_TEXT_COLOR");
|
||||
@def DARK_BLUE eval("com.sap.sailing.dashboards.gwt.client.theme.Colors.DARK_BLUE");
|
||||
@def BUTTON_BACKGROUND eval("com.sap.sailing.dashboards.gwt.client.theme.Colors.BUTTON_BACKGROUND");
|
||||
@def BUTTON_BACKGROUND_ACTIVE eval("com.sap.sailing.dashboards.gwt.client.theme.Colors.BUTTON_BACKGROUND_ACTIVE");
|
||||
@def LIGHT_BLUE eval("com.sap.sailing.dashboards.gwt.client.theme.Colors.LIGHT_GREY");
|
||||
@def YELLOW eval("com.sap.sailing.dashboards.gwt.client.theme.Colors.YELLOW");
|
||||
|
||||
/*Fonts*/
|
||||
@def DASHBOARD_FONT_FAMILY eval("com.sap.sailing.dashboards.gwt.client.theme.Fonts.DASHBOARD_FONT_FAMILY");
|
||||
|
||||
/*Sizes*/
|
||||
@def DASHBOARD_FONT_SIZE_VERY_SMALL eval("com.sap.sailing.dashboards.gwt.client.theme.Sizes.DASHBOARD_FONT_SIZE_VERY_SMALL");
|
||||
@def DASHBOARD_FONT_SIZE_SMALL eval("com.sap.sailing.dashboards.gwt.client.theme.Sizes.DASHBOARD_FONT_SIZE_SMALL");
|
||||
@def DASHBOARD_FONT_SIZE_MEDIUM eval("com.sap.sailing.dashboards.gwt.client.theme.Sizes.DASHBOARD_FONT_SIZE_MEDIUM");
|
||||
@def DASHBOARD_FONT_SIZE_LARGE eval("com.sap.sailing.dashboards.gwt.client.theme.Sizes.DASHBOARD_FONT_SIZE_LARGE");
|
||||
@def DASHBOARD_FONT_SIZE_VERY_LARGE eval("com.sap.sailing.dashboards.gwt.client.theme.Sizes.DASHBOARD_FONT_SIZE_VERY_LARGE");
|
||||
|
||||
@def DASHBOARD_SPACE_VERY_SMALL eval("com.sap.sailing.dashboards.gwt.client.theme.Sizes.DASHBOARD_SPACE_VERY_SMALL");
|
||||
@def DASHBOARD_SPACE_SMALL eval("com.sap.sailing.dashboards.gwt.client.theme.Sizes.DASHBOARD_SPACE_SMALL");
|
||||
@def DASHBOARD_SPACE_MEDIUM eval("com.sap.sailing.dashboards.gwt.client.theme.Sizes.DASHBOARD_SPACE_MEDIUM");
|
||||
@def DASHBOARD_SPACE_LARGE eval("com.sap.sailing.dashboards.gwt.client.theme.Sizes.DASHBOARD_SPACE_LARGE");
|
||||
@def DASHBOARD_SPACE_VERY_LARGE eval("com.sap.sailing.dashboards.gwt.client.theme.Sizes.DASHBOARD_SPACE_VERY_LARGE");
|
||||
|
||||
@def DASHBOARD_LINE_HEIGHT eval("com.sap.sailing.dashboards.gwt.client.theme.Sizes.DASHBOARD_LINE_HEIGHT");
|
||||
|
||||
@def DASHBOARD_BORDER_RADIUS eval("com.sap.sailing.dashboards.gwt.client.theme.Sizes.DASHBOARD_BORDER_RADIUS");
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.visualeffects;
|
||||
|
||||
import com.google.gwt.core.shared.GWT;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
|
||||
public class BlurEffect {
|
||||
|
||||
private static BlurEffect INSTANCE = null;
|
||||
private VisualEffectsResources visualEffectsResources = GWT.create(VisualEffectsResources.class);
|
||||
|
||||
private BlurEffect() {
|
||||
visualEffectsResources.blurEffectStyle().ensureInjected();
|
||||
}
|
||||
|
||||
public static BlurEffect getInstance() {
|
||||
synchronized (BlurEffect.class) {
|
||||
if (INSTANCE == null) {
|
||||
INSTANCE = new BlurEffect();
|
||||
}
|
||||
}
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
public void addToView(Widget widget){
|
||||
widget.removeStyleName(visualEffectsResources.blurEffectStyle().not_blurred());
|
||||
widget.addStyleName(visualEffectsResources.blurEffectStyle().blurred());
|
||||
}
|
||||
|
||||
public void removeFromView(Widget widget){
|
||||
widget.removeStyleName(visualEffectsResources.blurEffectStyle().blurred());
|
||||
widget.addStyleName(visualEffectsResources.blurEffectStyle().not_blurred());
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
@CHARSET "UTF-8";
|
||||
|
||||
.blurred {
|
||||
.darkened {
|
||||
-webkit-filter: brightness(0.7);
|
||||
filter: brightness(0.7);
|
||||
}
|
||||
|
||||
.not_blurred {
|
||||
.not_darkened {
|
||||
-webkit-filter: brightness(1);
|
||||
filter: brightness(1);
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.visualeffects;
|
||||
|
||||
import com.google.gwt.core.shared.GWT;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
|
||||
public class DarkeningEffect {
|
||||
|
||||
private static DarkeningEffect INSTANCE = null;
|
||||
private VisualEffectsResources visualEffectsResources = GWT.create(VisualEffectsResources.class);
|
||||
|
||||
private DarkeningEffect() {
|
||||
visualEffectsResources.darkeningEffectStyle().ensureInjected();
|
||||
}
|
||||
|
||||
public static DarkeningEffect getInstance() {
|
||||
synchronized (DarkeningEffect.class) {
|
||||
if (INSTANCE == null) {
|
||||
INSTANCE = new DarkeningEffect();
|
||||
}
|
||||
}
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
public void addToView(Widget widget){
|
||||
widget.removeStyleName(visualEffectsResources.darkeningEffectStyle().not_darkened());
|
||||
widget.addStyleName(visualEffectsResources.darkeningEffectStyle().darkened());
|
||||
}
|
||||
|
||||
public void removeFromView(Widget widget){
|
||||
widget.removeStyleName(visualEffectsResources.darkeningEffectStyle().darkened());
|
||||
widget.addStyleName(visualEffectsResources.darkeningEffectStyle().not_darkened());
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -4,10 +4,10 @@ import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.resources.client.CssResource.Shared;
|
||||
|
||||
@Shared
|
||||
public interface BlurEffectStyle extends CssResource{
|
||||
public interface DarkeningEffectStyle extends CssResource{
|
||||
|
||||
public String blurred();
|
||||
public String darkened();
|
||||
|
||||
public String not_blurred();
|
||||
public String not_darkened();
|
||||
}
|
||||
|
||||
+2
-2
@@ -4,6 +4,6 @@ import com.google.gwt.resources.client.ClientBundle;
|
||||
|
||||
public interface VisualEffectsResources extends ClientBundle{
|
||||
|
||||
@Source("BlurEffect.css")
|
||||
BlurEffectStyle blurEffectStyle();
|
||||
@Source("DarkeningEffect.css")
|
||||
DarkeningEffectStyle darkeningEffectStyle();
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.widgets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gwt.user.client.Event;
|
||||
import com.google.gwt.user.client.ui.AbsolutePanel;
|
||||
|
||||
/**
|
||||
* @author Alexander Ries (D062114)
|
||||
*
|
||||
*/
|
||||
public class ActionPanel extends AbsolutePanel {
|
||||
|
||||
private List<ActionPanelListener> listeners;
|
||||
private List<Integer> eventsList;
|
||||
|
||||
public ActionPanel(int... events) {
|
||||
super();
|
||||
listeners = new ArrayList<ActionPanelListener>();
|
||||
eventsList = new ArrayList<Integer>();
|
||||
for (int event : events) {
|
||||
sinkEvents(event);
|
||||
eventsList.add(Integer.valueOf(event));
|
||||
}
|
||||
this.getElement().setAttribute("style", "-webkit-tap-highlight-color: rgba(0,0,0,0);");
|
||||
}
|
||||
|
||||
public void enable() {
|
||||
for(Integer eventAsInteger : eventsList) {
|
||||
sinkEvents(eventAsInteger.intValue());
|
||||
}
|
||||
}
|
||||
|
||||
public void disable() {
|
||||
for(Integer eventAsInteger : eventsList) {
|
||||
unsinkEvents(eventAsInteger.intValue());
|
||||
}
|
||||
}
|
||||
|
||||
public void addActionPanelListener(ActionPanelListener actionPanelListener) {
|
||||
listeners.add(actionPanelListener);
|
||||
}
|
||||
|
||||
public void removeActionPanelListener(ActionPanelListener actionPanelListener) {
|
||||
listeners.remove(actionPanelListener);
|
||||
}
|
||||
|
||||
private void notifyActionPanelListenerAboutTriggeredEvent() {
|
||||
for (ActionPanelListener actionPanelListener : listeners) {
|
||||
actionPanelListener.eventTriggered();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBrowserEvent(Event event) {
|
||||
if (this.eventsList.contains(event.getTypeInt())) {
|
||||
notifyActionPanelListenerAboutTriggeredEvent();
|
||||
}
|
||||
}
|
||||
|
||||
public interface ActionPanelListener {
|
||||
public void eventTriggered();
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
@require 'theme';
|
||||
|
||||
.dashboard_widget_header {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: DASHBOARD_SPACE_MEDIUM;
|
||||
top: 0;
|
||||
line-height: DASHBOARD_SPACE_MEDIUM;
|
||||
vertical-align: middle;
|
||||
font-size: DASHBOARD_FONT_SIZE_LARGE;
|
||||
font-family: DASHBOARD_FONT_FAMILY;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
overflow: visible;
|
||||
background-color: WHITE;
|
||||
border-bottom:solid LIGHT_GREY 1px;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.dashboard_widget_no_data_message_container {
|
||||
position: absolute;
|
||||
top: DASHBOARD_SPACE_MEDIUM;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
font-size: DASHBOARD_FONT_SIZE_MEDIUM;
|
||||
font-family: DASHBOARD_FONT_FAMILY;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
line-height: DASHBOARD_LINE_HEIGHT;
|
||||
}
|
||||
|
||||
.dashboard_widget_no_data_message_header {
|
||||
color: DARK_TEXT_COLOR;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.dashboard_widget_no_data_message {
|
||||
color: LIGHT_TEXT_COLOR;
|
||||
font-weight: normal;
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.widgets.header;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.core.client.Scheduler;
|
||||
import com.google.gwt.dom.client.DivElement;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.Command;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.google.gwt.user.client.ui.HasWidgets;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
/**
|
||||
* @author Alexander Ries (D062114)
|
||||
*
|
||||
*/
|
||||
public class DashboardWidgetHeaderAndNoDataMessage extends Composite implements HasWidgets {
|
||||
|
||||
private static DashboardWidgetHeaderAndNoDataMessageUiBinder uiBinder = GWT.create(DashboardWidgetHeaderAndNoDataMessageUiBinder.class);
|
||||
private static final int EXTRA_WIDTH_MESSAGE = 10;
|
||||
|
||||
interface DashboardWidgetHeaderAndNoDataMessageUiBinder extends
|
||||
UiBinder<Widget, DashboardWidgetHeaderAndNoDataMessage> {
|
||||
}
|
||||
|
||||
@UiField
|
||||
HTMLPanel header;
|
||||
|
||||
@UiField
|
||||
DivElement noDataMessageHeader;
|
||||
|
||||
@UiField
|
||||
DivElement noDataMessage;
|
||||
|
||||
public DashboardWidgetHeaderAndNoDataMessage() {
|
||||
DashboardWidgetHeaderAndNoDataMessageResources.INSTANCE.gss().ensureInjected();
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
}
|
||||
|
||||
public void setHeaderText(String headerText) {
|
||||
this.header.getElement().setInnerHTML(headerText);
|
||||
}
|
||||
|
||||
public void showNoDataMessageWithHeaderAndMessage(final String header, final String message) {
|
||||
Scheduler.get().scheduleDeferred(new Command() {
|
||||
public void execute() {
|
||||
noDataMessageHeader.setInnerText(header);
|
||||
noDataMessage.setInnerText(message);
|
||||
noDataMessage.getStyle().setWidth(noDataMessageHeader.getClientWidth() + EXTRA_WIDTH_MESSAGE, Unit.PX);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void hideNoDataMessage() {
|
||||
noDataMessageHeader.setInnerHTML("");
|
||||
noDataMessage.setInnerHTML("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(Widget w) {
|
||||
throw new UnsupportedOperationException("The method add(Widget w) is not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
throw new UnsupportedOperationException("The method clear() is not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Widget> iterator() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove(Widget w) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui">
|
||||
|
||||
<ui:with field="resources" type="com.sap.sailing.dashboards.gwt.client.widgets.header.DashboardWidgetHeaderAndNoDataMessageResources"/>
|
||||
|
||||
<g:HTMLPanel>
|
||||
<g:HTMLPanel ui:field="header" styleName="{resources.gss.dashboard_widget_header}">
|
||||
</g:HTMLPanel>
|
||||
<div class="{resources.gss.dashboard_widget_no_data_message_container}">
|
||||
<div>
|
||||
<div ui:field="noDataMessageHeader" class="{resources.gss.dashboard_widget_no_data_message_header}"></div>
|
||||
<div ui:field="noDataMessage" class="{resources.gss.dashboard_widget_no_data_message}"></div>
|
||||
</div>
|
||||
</div>
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.widgets.header;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.resources.client.ClientBundle;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
|
||||
/**
|
||||
* @author Alexander Ries (D062114)
|
||||
*
|
||||
*/
|
||||
public interface DashboardWidgetHeaderAndNoDataMessageResources extends ClientBundle {
|
||||
|
||||
public static final DashboardWidgetHeaderAndNoDataMessageResources INSTANCE = GWT.create(DashboardWidgetHeaderAndNoDataMessageResources.class);
|
||||
|
||||
@Source({"com/sap/sailing/dashboards/gwt/client/theme/theme.gss", "DashboardWidgetHeaderAndNoDataMessage.gss"})
|
||||
DashboardWidgetHeaderAndNoDataMessageGSS gss();
|
||||
|
||||
public interface DashboardWidgetHeaderAndNoDataMessageGSS extends CssResource {
|
||||
String dashboard_widget_header();
|
||||
String dashboard_widget_no_data_message_container();
|
||||
String dashboard_widget_no_data_message_header();
|
||||
String dashboard_widget_no_data_message();
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.widgets.startanalysis;
|
||||
|
||||
import com.google.gwt.resources.client.ImageResource;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.RaceMapStyle;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.RaceMapResources;
|
||||
|
||||
/**
|
||||
* @author Alexander Ries (D062114)
|
||||
*
|
||||
*/
|
||||
public interface DashboardRaceMapResources extends RaceMapResources {
|
||||
|
||||
@Source("com/sap/sailing/dashboards/gwt/client/images/windarrow.png")
|
||||
ImageResource combinedWindIcon();
|
||||
|
||||
@Source({"com/sap/sailing/dashboards/gwt/client/theme/theme.gss", "StartAnalysisRaceMap.gss"})
|
||||
RaceMapStyle raceMapStyle();
|
||||
}
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
@require 'theme';
|
||||
|
||||
.combinedWindPanel {
|
||||
margin-top: 10pt;
|
||||
margin-left: 10pt;
|
||||
right: 0pt;
|
||||
width: 45pt;
|
||||
height: 45pt;
|
||||
border-radius: 22.5pt;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.combinedWindPanelTextLabel {
|
||||
margin-top: 15pt;
|
||||
width: 45pt;
|
||||
height: 25pt;
|
||||
background-color: white;
|
||||
line-height: 25pt;
|
||||
vertical-align: middle;
|
||||
font-size: 11pt;
|
||||
font-family: DASHBOARD_FONT_FAMILY;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.combinedWindPanelCanvas {
|
||||
width: 35pt;
|
||||
height: 35pt;
|
||||
margin-top: 5pt;
|
||||
margin-left: 5pt;
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
@require 'theme';
|
||||
|
||||
.raceMapIndicatorPanel {
|
||||
margin-top: DASHBOARD_SPACE_VERY_SMALL;
|
||||
margin-left: DASHBOARD_SPACE_VERY_SMALL;
|
||||
right: 0px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 50px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.raceMapIndicatorPanelTextLabel {
|
||||
margin-top: DASHBOARD_SPACE_VERY_SMALL;
|
||||
width: 50px;
|
||||
height: DASHBOARD_SPACE_SMALL;
|
||||
line-height: DASHBOARD_SPACE_SMALL;
|
||||
vertical-align: middle;
|
||||
font-size: DASHBOARD_FONT_SIZE_SMALL;
|
||||
font-weight: bold;
|
||||
font-family: DASHBOARD_FONT_FAMILY;
|
||||
text-align: center;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.raceMapIndicatorPanelCanvas {
|
||||
width: 30px !important;
|
||||
height: 30px !important;
|
||||
margin-top: 10px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.combinedWindPanel {}
|
||||
|
||||
.trueNorthIndicator {
|
||||
opacity: 0.0;
|
||||
}
|
||||
+76
-43
@@ -2,64 +2,102 @@
|
||||
|
||||
.startanalysis {
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
background-color: white;
|
||||
background-color: LIGHT_GREY;
|
||||
left: 0pt;
|
||||
right: 0pt;
|
||||
top: 0pt;
|
||||
bottom: 0pt;
|
||||
border-radius: DASHBOARD_BORDER_RADIUS;
|
||||
overflow: hidden;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.panel_header {
|
||||
height: 100%;
|
||||
margin-top: 0;
|
||||
line-height: 30pt;
|
||||
.current_start_panel {
|
||||
position: absolute;
|
||||
height: DASHBOARD_SPACE_MEDIUM;
|
||||
top: DASHBOARD_SPACE_MEDIUM;
|
||||
line-height: DASHBOARD_SPACE_MEDIUM;
|
||||
vertical-align: middle;
|
||||
font-size: 14pt;
|
||||
font-size: DASHBOARD_FONT_SIZE_MEDIUM;
|
||||
font-family: DASHBOARD_FONT_FAMILY;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
overflow: visible;
|
||||
background-color: white;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.controll_header_button {
|
||||
position: absolute;
|
||||
top: 10pt;
|
||||
height: 17.5pt;
|
||||
width: 17.5pt;
|
||||
height: DASHBOARD_SPACE_VERY_LARGE;
|
||||
width: DASHBOARD_SPACE_VERY_LARGE;
|
||||
top: 50%;
|
||||
background-color: WHITE;
|
||||
z-index: 1;
|
||||
opacity: 0.0;
|
||||
border-radius: DASHBOARD_BORDER_RADIUS;
|
||||
}
|
||||
|
||||
.controll_header_button_visible {
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.controll_header_button:active {
|
||||
background-color: LIGHT_GREY;
|
||||
}
|
||||
|
||||
.controll_header_button_image {
|
||||
position: absolute;
|
||||
width: 18px;
|
||||
height: DASHBOARD_SPACE_SMALL;
|
||||
top: 20px;
|
||||
left: 27px;
|
||||
}
|
||||
|
||||
.controll_header_button_left {
|
||||
left: 10%;
|
||||
left: 31px;
|
||||
}
|
||||
|
||||
.controll_header_button_right {
|
||||
right: 10%;
|
||||
right: 31px;
|
||||
}
|
||||
|
||||
.card_container {
|
||||
position: absolute;
|
||||
overflow: visible;
|
||||
top: 33.5pt;
|
||||
bottom: 10pt;
|
||||
top: DASHBOARD_SPACE_MEDIUM;
|
||||
bottom: 70px;
|
||||
padding-top: DASHBOARD_SPACE_MEDIUM;
|
||||
padding-bottom: DASHBOARD_SPACE_SMALL;
|
||||
width: 100%;
|
||||
left: 0%;
|
||||
background-color: white;
|
||||
-webkit-transition: left 0.7s ease-in-out; /* For Safari 3.1 to 6.0 */
|
||||
transition: left 0.7s ease-in-out;
|
||||
}
|
||||
|
||||
.card {
|
||||
position: absolute;
|
||||
display: inline;
|
||||
width: 80%;
|
||||
width: 75%;
|
||||
height: 100%;
|
||||
/*#4293DB old water color*/
|
||||
border-radius: DASHBOARD_BORDER_RADIUS !important;
|
||||
overflow: hidden !important;
|
||||
/*
|
||||
Chrome and Safari are having problems with border radius and animation.
|
||||
http://stackoverflow.com/questions/14383632/webkit-border-radius-and-overflow-bug-when-using-any-animation-transition
|
||||
Do not remove these 4 lines
|
||||
*/
|
||||
-webkit-backface-visibility: hidden;
|
||||
-moz-backface-visibility: hidden;
|
||||
-webkit-transform: translate3d(0, 0, 0);
|
||||
-moz-transform: translate3d(0, 0, 0)
|
||||
}
|
||||
|
||||
.card_map_container {
|
||||
position: absolute;
|
||||
margin-top: 29px;
|
||||
/*#4293DB old water color*/
|
||||
background-color: #004384;
|
||||
margin-top: 1px; /*Shows otherwise small line at top edge*/
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.card_table {
|
||||
@@ -67,54 +105,49 @@
|
||||
bottom: 0pt;
|
||||
right: 0pt;
|
||||
left: 0pt;
|
||||
padding-left:10pt;
|
||||
padding-right:10pt;
|
||||
padding-bottom: 10pt;
|
||||
background-color: #004384;;
|
||||
background-color: WHITE;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.card_wind_line_data_container {
|
||||
position: absolute;
|
||||
top: 10pt;
|
||||
left: 10pt;
|
||||
width: 45pt;
|
||||
height: 80pt;
|
||||
top: 0pt;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
z-index: 1;
|
||||
background-color: WHITE;
|
||||
color: LIGHT_TEXT_COLOR;
|
||||
}
|
||||
|
||||
.card_data {
|
||||
position: absolute;
|
||||
right: 0pt;
|
||||
width: 45pt;
|
||||
height: 25pt;
|
||||
line-height: 25pt;
|
||||
height: DASHBOARD_SPACE_SMALL;
|
||||
line-height: DASHBOARD_SPACE_SMALL;
|
||||
vertical-align: middle;
|
||||
font-size: 11pt;
|
||||
font-size: DASHBOARD_FONT_SIZE_SMALL;
|
||||
font-family: DASHBOARD_FONT_FAMILY;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.card_line_advantage {
|
||||
top: 0pt;
|
||||
left: 55pt;
|
||||
left: 10px;
|
||||
width: 215pt;
|
||||
text-align: left;
|
||||
padding-left: 7pt;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.card_race_time{
|
||||
position: absolute;
|
||||
top: 10pt;
|
||||
right: 10pt;
|
||||
right: 10px;
|
||||
width: 200px;
|
||||
text-align: right;
|
||||
color: white;
|
||||
line-height: 25pt;
|
||||
font-size: 11pt;
|
||||
line-height: DASHBOARD_SPACE_SMALL;
|
||||
font-size: DASHBOARD_FONT_SIZE_SMALL;
|
||||
font-family: DASHBOARD_FONT_FAMILY;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.card_line_data_geo {
|
||||
@@ -141,4 +174,4 @@
|
||||
width: 50%;
|
||||
height: 100%;
|
||||
z-index: 2;
|
||||
}
|
||||
}
|
||||
+144
-97
@@ -12,7 +12,6 @@ import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.Cookies;
|
||||
@@ -32,21 +31,24 @@ import com.sap.sailing.dashboards.gwt.client.notifications.bottom.BottomNotifica
|
||||
import com.sap.sailing.dashboards.gwt.client.notifications.bottom.BottomNotificationType;
|
||||
import com.sap.sailing.dashboards.gwt.client.popups.competitorselection.CompetitorSelectionListener;
|
||||
import com.sap.sailing.dashboards.gwt.client.popups.competitorselection.CompetitorSelectionPopup;
|
||||
import com.sap.sailing.dashboards.gwt.client.popups.competitorselection.SettingsButtonWithSelectionIndicationLabel;
|
||||
import com.sap.sailing.dashboards.gwt.client.popups.competitorselection.util.SettingsButtonWithSelectionIndicationLabel;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.ActionPanel;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.PollsLiveDataEvery5Seconds;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.header.DashboardWidgetHeaderAndNoDataMessage;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.startanalysis.card.StartAnalysisCard;
|
||||
import com.sap.sailing.dashboards.gwt.shared.DashboardURLParameters;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.LeaderboardCompetitorsDTO;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.StartAnalysesDTO;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.StartAnalysisDTO;
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.RaceMapResources;
|
||||
|
||||
/**
|
||||
* The class contains an collection of {@link StartAnalysisCard}s that are displayed in horizontal aligned pages. It
|
||||
* shows only one {@link StartAnalysisCard} at a time and enables the user to switch between
|
||||
* {@link StartAnalysisCard}s with left and right buttons represented by {@link #left_focus_panel} and
|
||||
* {@link #right_focus_panel}. When a new {@link StartAnalysisCard} gets added to the component it shows a
|
||||
* {@link BottomNotification}.
|
||||
* shows only one {@link StartAnalysisCard} at a time and enables the user to switch between {@link StartAnalysisCard}s
|
||||
* with left and right buttons represented by {@link #left_focus_panel} and {@link #right_focus_panel}. When a new
|
||||
* {@link StartAnalysisCard} gets added to the component it shows a {@link BottomNotification}.
|
||||
*
|
||||
* @author Alexander Ries (D062114)
|
||||
*
|
||||
@@ -61,14 +63,26 @@ public class StartAnalysisWidget extends Composite implements HasWidgets, PollsL
|
||||
interface StartlineAnalysis extends CssResource {
|
||||
}
|
||||
|
||||
@UiField
|
||||
HTMLPanel header;
|
||||
@UiField(provided = true)
|
||||
DashboardWidgetHeaderAndNoDataMessage dashboardWidgetHeaderAndNoDataMessage;
|
||||
|
||||
@UiField(provided = true)
|
||||
SettingsButtonWithSelectionIndicationLabel selectedCompetitorWithSettingsButton;
|
||||
|
||||
@UiField
|
||||
Image rightButton;
|
||||
HTMLPanel currentStartPanel;
|
||||
|
||||
@UiField
|
||||
Image leftButton;
|
||||
HTMLPanel rightButton;
|
||||
|
||||
@UiField
|
||||
HTMLPanel leftButton;
|
||||
|
||||
@UiField
|
||||
Image rightButtonImage;
|
||||
|
||||
@UiField
|
||||
Image leftButtonImage;
|
||||
|
||||
@UiField
|
||||
FocusPanel left_focus_panel;
|
||||
@@ -97,49 +111,71 @@ public class StartAnalysisWidget extends Composite implements HasWidgets, PollsL
|
||||
* Amount of {@link StartAnalysisCard}s in {@link #startanalysis_card_container}.
|
||||
* */
|
||||
private int numberOfStartAnalysisCards = 0;
|
||||
|
||||
private boolean displaysCards;
|
||||
private List<StartAnalysisDTO> starts;
|
||||
private List<StartAnalysisCard> pageChangeListener;
|
||||
private BottomNotification bottomNotification;
|
||||
|
||||
private CompetitorSelectionPopup competitorSelectionPopup;
|
||||
private SettingsButtonWithSelectionIndicationLabel settingsButtonWithSelectionIndicationLabel;
|
||||
|
||||
private DashboardClientFactory dashboardClientFactory;
|
||||
|
||||
private static final String SELECTED_COMPETITOR_ID_COOKIE_KEY = "selectedCompetitorId";
|
||||
private final String cookieKeyForSelectedCompetitorInLeaderboard;
|
||||
|
||||
private static final String SELECTED_COMPETITOR_IN_LEADERBOARD_COOKIE_KEY_FIRST_PART = "competitorId";
|
||||
private static final int SELECTED_COMPETITOR_ID_COOKIE_KEY_EXPIRE_TIME_IN_MILLIS = 60 * 1000 * 60 * 5;
|
||||
private static final int SCROLL_OFFSET_STARTANALYSIS_CARDS = 83;
|
||||
private static final int SCROLL_OFFSET_STARTANALYSIS_CARDS = 80;
|
||||
private static final double MARGIN_LEFT_STARTANALYSIS_CARD = 12.5;
|
||||
private static final Logger logger = Logger.getLogger(StartAnalysisWidget.class.getName());
|
||||
|
||||
private static final RaceMapResources raceMapResources = GWT.create(DashboardRaceMapResources.class);
|
||||
|
||||
/**
|
||||
* Component that contains handles, displays and loads startanalysis cards.
|
||||
* */
|
||||
public StartAnalysisWidget(DashboardClientFactory dashboardClientFactory) {
|
||||
StartAnalysisWidgetResources.INSTANCE.gss().ensureInjected();
|
||||
StartAnalysisWidgetResources.INSTANCE.combinedWindPanelStyle().ensureInjected();
|
||||
dashboardWidgetHeaderAndNoDataMessage = new DashboardWidgetHeaderAndNoDataMessage();
|
||||
selectedCompetitorWithSettingsButton = new SettingsButtonWithSelectionIndicationLabel();
|
||||
selectedCompetitorWithSettingsButton.disable();
|
||||
selectedCompetitorWithSettingsButton.setSelectionIndicationTextOnLabel(StringMessages.INSTANCE.dashboardSelectCompetitor());
|
||||
addClickListenerToSettingsButtonAndLabel();
|
||||
raceMapResources.raceMapStyle().ensureInjected();
|
||||
this.dashboardClientFactory = dashboardClientFactory;
|
||||
pageChangeListener = new ArrayList<StartAnalysisCard>();
|
||||
starts = new ArrayList<StartAnalysisDTO>();
|
||||
cookieKeyForSelectedCompetitorInLeaderboard = computeCookieKeyForSelectedCompetitorInLeaderboard();
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
dashboardWidgetHeaderAndNoDataMessage.setHeaderText(StringMessages.INSTANCE.dashboardStartAnalysesHeader());
|
||||
initCompetitorSelectionPopupAndAddCompetitorSelectionListener();
|
||||
initLeftRightButtons();
|
||||
initAndAddBottomNotification();
|
||||
getCachedSelectedCompetitorOrAskForWithPopup();
|
||||
initAndAddSettingsButtonWithSelectionIndicationLabel();
|
||||
registerForDashboardFiveSecondsTimer(dashboardClientFactory);
|
||||
}
|
||||
|
||||
private String computeCookieKeyForSelectedCompetitorInLeaderboard() {
|
||||
String result = SELECTED_COMPETITOR_IN_LEADERBOARD_COOKIE_KEY_FIRST_PART+DashboardURLParameters.LEADERBOARD_NAME.getValue();
|
||||
return result;
|
||||
}
|
||||
|
||||
private String getCachedSelectedCompetitorId() {
|
||||
String result = null;
|
||||
String selectedCompetitorId = Cookies.getCookie(cookieKeyForSelectedCompetitorInLeaderboard);
|
||||
if (selectedCompetitorId == null || "undefined".equals(selectedCompetitorId)) {
|
||||
result = null;
|
||||
} else {
|
||||
result = selectedCompetitorId;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void initLeftRightButtons() {
|
||||
leftButton.setResource(StartAnalysisWidgetResources.INSTANCE.leftdisabled());
|
||||
leftButtonImage.setResource(StartAnalysisWidgetResources.INSTANCE.leftdisabled());
|
||||
left_focus_panel.addClickHandler(new ClickHandler() {
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
clickedArrowButton(false);
|
||||
}
|
||||
});
|
||||
rightButton.setResource(StartAnalysisWidgetResources.INSTANCE.rightdisabled());
|
||||
rightButtonImage.setResource(StartAnalysisWidgetResources.INSTANCE.rightdisabled());
|
||||
right_focus_panel.addClickHandler(new ClickHandler() {
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
@@ -148,33 +184,43 @@ public class StartAnalysisWidget extends Composite implements HasWidgets, PollsL
|
||||
});
|
||||
}
|
||||
|
||||
private void loadStartAnalysisDTOsForCompetitorID(String competitorIdAsString){
|
||||
private void loadStartAnalysisDTOsForCompetitorID(String competitorIdAsString) {
|
||||
logger.log(Level.INFO, "Loading startanalysis for competitor id " + competitorIdAsString);
|
||||
dashboardClientFactory.getDispatch().execute(new GetStartAnalysesAction(DashboardURLParameters.LEADERBOARD_NAME.getValue(), competitorIdAsString), new AsyncCallback<StartAnalysesDTO>() {
|
||||
dashboardClientFactory.getDispatch().execute(
|
||||
new GetStartAnalysesAction(DashboardURLParameters.LEADERBOARD_NAME.getValue(), competitorIdAsString),
|
||||
new AsyncCallback<StartAnalysesDTO>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
logger.log(Level.INFO, "Failed to received startanalysis list, "+caught.getMessage());
|
||||
}
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
logger.log(Level.INFO, "Failed to received startanalysis list, "+caught.getMessage());
|
||||
dashboardWidgetHeaderAndNoDataMessage.showNoDataMessageWithHeaderAndMessage(StringMessages.INSTANCE.dashboardNoStartAnalysesAvailableHeader(), StringMessages.INSTANCE.dashboardNoStartAnalysesAvailableMessage());
|
||||
selectedCompetitorWithSettingsButton.disable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(StartAnalysesDTO result) {
|
||||
logger.log(Level.INFO, "Received startanalysis list");
|
||||
if (result != null && !result.getStartAnalyses().isEmpty()) {
|
||||
if (displayedStartAnalysisCompetitorDifferentToRequestedOne()) {
|
||||
removeAllStartAnalysisCards();
|
||||
}
|
||||
if (result.getStartAnalyses().size() != starts.size()) {
|
||||
showNotificationForNewStartAnalysis();
|
||||
}
|
||||
logger.log(Level.INFO, "Updating UI with startanalysis list");
|
||||
addNewStartAnalysisCards(result.getStartAnalyses());
|
||||
settingsButtonWithSelectionIndicationLabel.setSelectionIndicationTextOnLabel(result.getStartAnalyses().get(0).competitor.getName());
|
||||
} else {
|
||||
logger.log(Level.INFO, "Received startanalysis list is null or empty");
|
||||
}
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onSuccess(StartAnalysesDTO result) {
|
||||
logger.log(Level.INFO, "Received startanalysis list");
|
||||
if (result != null && !result.getStartAnalyses().isEmpty() && result.getStartAnalyses().size() > 0) {
|
||||
dashboardWidgetHeaderAndNoDataMessage.hideNoDataMessage();
|
||||
if (displayedStartAnalysisForDifferentCompetitorToRequestedOne()) {
|
||||
removeAllStartAnalysisCards();
|
||||
}
|
||||
if (result.getStartAnalyses().size() != starts.size()) {
|
||||
showNotificationForNewStartAnalysis();
|
||||
}
|
||||
logger.log(Level.INFO, "Updating UI with startanalysis list");
|
||||
addNewStartAnalysisCards(result.getStartAnalyses());
|
||||
showControllHeaderButtons();
|
||||
if (result.getStartAnalyses().get(0).competitor != null) {
|
||||
selectedCompetitorWithSettingsButton.setSelectionIndicationTextOnLabel(result.getStartAnalyses().get(0).competitor.getName());
|
||||
}
|
||||
selectedCompetitorWithSettingsButton.enable();
|
||||
} else {
|
||||
logger.log(Level.INFO, "Received startanalysis list is null or empty");
|
||||
dashboardWidgetHeaderAndNoDataMessage.showNoDataMessageWithHeaderAndMessage(StringMessages.INSTANCE.dashboardNoStartAnalysesAvailableHeader(), StringMessages.INSTANCE.dashboardNoStartAnalysesAvailableMessage());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initAndAddBottomNotification() {
|
||||
@@ -196,12 +242,10 @@ public class StartAnalysisWidget extends Composite implements HasWidgets, PollsL
|
||||
@Override
|
||||
public void didClickOKWithSelectedCompetitor(CompetitorDTO competitor) {
|
||||
if (competitor != null) {
|
||||
Cookies.removeCookie(SELECTED_COMPETITOR_ID_COOKIE_KEY);
|
||||
Cookies.setCookie(SELECTED_COMPETITOR_ID_COOKIE_KEY, competitor.getIdAsString(), new Date(
|
||||
new Date().getTime() + SELECTED_COMPETITOR_ID_COOKIE_KEY_EXPIRE_TIME_IN_MILLIS));
|
||||
if (settingsButtonWithSelectionIndicationLabel != null) {
|
||||
settingsButtonWithSelectionIndicationLabel.setSelectionIndicationTextOnLabel(competitor
|
||||
.getName());
|
||||
Cookies.removeCookie(cookieKeyForSelectedCompetitorInLeaderboard);
|
||||
Cookies.setCookie(cookieKeyForSelectedCompetitorInLeaderboard, competitor.getIdAsString(), new Date(new Date().getTime()+SELECTED_COMPETITOR_ID_COOKIE_KEY_EXPIRE_TIME_IN_MILLIS));
|
||||
if (selectedCompetitorWithSettingsButton != null) {
|
||||
selectedCompetitorWithSettingsButton.setSelectionIndicationTextOnLabel(competitor.getName());
|
||||
}
|
||||
loadStartAnalysisDTOsForCompetitorID(competitor.getIdAsString());
|
||||
}
|
||||
@@ -209,21 +253,17 @@ public class StartAnalysisWidget extends Composite implements HasWidgets, PollsL
|
||||
});
|
||||
}
|
||||
|
||||
private void getCachedSelectedCompetitorOrAskForWithPopup() {
|
||||
String selectedCompetitorIdFromCookie = Cookies.getCookie(SELECTED_COMPETITOR_ID_COOKIE_KEY);
|
||||
if (selectedCompetitorIdFromCookie == null) {
|
||||
loadCompetitorsAndShowCompetitorSelectionPopup();
|
||||
}
|
||||
}
|
||||
|
||||
private void loadCompetitorsAndShowCompetitorSelectionPopup() {
|
||||
logger.log(Level.INFO, "Requesting Competitors in Leaderboard");
|
||||
dashboardClientFactory.getDispatch().execute(new GetCompetitorInLeaderboardAction(DashboardURLParameters.LEADERBOARD_NAME.getValue()), new AsyncCallback<LeaderboardCompetitorsDTO>() {
|
||||
dashboardClientFactory.getDispatch().execute(
|
||||
new GetCompetitorInLeaderboardAction(DashboardURLParameters.LEADERBOARD_NAME.getValue()),
|
||||
new AsyncCallback<LeaderboardCompetitorsDTO>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(LeaderboardCompetitorsDTO result) {
|
||||
logger.log(Level.INFO, "Received competitors for leaderboard name");
|
||||
if (result.getCompetitors() != null && result.getCompetitors().size() > 0) {
|
||||
selectedCompetitorWithSettingsButton.enable();
|
||||
if (!competitorSelectionPopup.isShown()) {
|
||||
logger.log(Level.INFO, "Showing CompetitorSelectionPopup with competitors");
|
||||
competitorSelectionPopup.show(result.getCompetitors());
|
||||
@@ -232,26 +272,33 @@ public class StartAnalysisWidget extends Composite implements HasWidgets, PollsL
|
||||
}
|
||||
} else {
|
||||
logger.log(Level.INFO, "Received competitors are null or empty");
|
||||
dashboardWidgetHeaderAndNoDataMessage.showNoDataMessageWithHeaderAndMessage(
|
||||
StringMessages.INSTANCE.dashboardNoStartAnalysesAvailableHeader(),
|
||||
StringMessages.INSTANCE.dashboardNoStartAnalysesAvailableMessage());
|
||||
selectedCompetitorWithSettingsButton.disable();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
logger.log(Level.INFO, "Failed to received competitors for leaderboard name, "+caught.getMessage());
|
||||
logger.log(Level.INFO,
|
||||
"Failed to received competitors for leaderboard name, " + caught.getMessage());
|
||||
dashboardWidgetHeaderAndNoDataMessage.showNoDataMessageWithHeaderAndMessage(
|
||||
StringMessages.INSTANCE.dashboardNoStartAnalysesAvailableHeader(),
|
||||
StringMessages.INSTANCE.dashboardNoStartAnalysesAvailableMessage());
|
||||
selectedCompetitorWithSettingsButton.disable();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initAndAddSettingsButtonWithSelectionIndicationLabel() {
|
||||
settingsButtonWithSelectionIndicationLabel = new SettingsButtonWithSelectionIndicationLabel();
|
||||
settingsButtonWithSelectionIndicationLabel.addClickHandlerToSettingsButton(new ClickHandler() {
|
||||
private void addClickListenerToSettingsButtonAndLabel() {
|
||||
selectedCompetitorWithSettingsButton.addActionListener(new ActionPanel.ActionPanelListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
public void eventTriggered() {
|
||||
loadCompetitorsAndShowCompetitorSelectionPopup();
|
||||
}
|
||||
});
|
||||
RootPanel.get().add(settingsButtonWithSelectionIndicationLabel);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -268,14 +315,14 @@ public class StartAnalysisWidget extends Composite implements HasWidgets, PollsL
|
||||
startanalysis_card_container.getElement().getStyle().setLeft(currentScrollPosition, Unit.PCT);
|
||||
notifyStartAnalysisPageChangeListener(page);
|
||||
int displayPage = page + 1;
|
||||
header.getElement().setInnerHTML("Start " + starts.get(displayPage - 1).raceName);
|
||||
currentStartPanel.getElement().setInnerHTML(starts.get(displayPage - 1).raceName);
|
||||
if (page != numberOfStartAnalysisCards - 1) {
|
||||
rightButton.setResource(StartAnalysisWidgetResources.INSTANCE.right());
|
||||
rightButtonImage.setResource(StartAnalysisWidgetResources.INSTANCE.right());
|
||||
rightButton.getElement().getStyle().setProperty("disabled", "false");
|
||||
}
|
||||
if (page == 0) {
|
||||
leftButton.setResource(StartAnalysisWidgetResources.INSTANCE.leftdisabled());
|
||||
leftButton.getElement().getStyle().setProperty("disabled", "true");
|
||||
leftButtonImage.setResource(StartAnalysisWidgetResources.INSTANCE.leftdisabled());
|
||||
leftButtonImage.getElement().getStyle().setProperty("disabled", "true");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -285,13 +332,13 @@ public class StartAnalysisWidget extends Composite implements HasWidgets, PollsL
|
||||
startanalysis_card_container.getElement().getStyle().setLeft(currentScrollPosition, Unit.PCT);
|
||||
notifyStartAnalysisPageChangeListener(page);
|
||||
int displayPage = page + 1;
|
||||
header.getElement().setInnerHTML("Start " + starts.get(displayPage - 1).raceName);
|
||||
currentStartPanel.getElement().setInnerHTML(starts.get(displayPage - 1).raceName);
|
||||
if (page >= 0) {
|
||||
leftButton.setResource(StartAnalysisWidgetResources.INSTANCE.left());
|
||||
leftButtonImage.setResource(StartAnalysisWidgetResources.INSTANCE.left());
|
||||
leftButton.getElement().getStyle().setProperty("disabled", "false");
|
||||
}
|
||||
if (page == numberOfStartAnalysisCards - 1) {
|
||||
rightButton.setResource(StartAnalysisWidgetResources.INSTANCE.rightdisabled());
|
||||
rightButtonImage.setResource(StartAnalysisWidgetResources.INSTANCE.rightdisabled());
|
||||
rightButton.getElement().getStyle().setProperty("disabled", "true");
|
||||
}
|
||||
}
|
||||
@@ -299,17 +346,24 @@ public class StartAnalysisWidget extends Composite implements HasWidgets, PollsL
|
||||
}
|
||||
}
|
||||
|
||||
private void showControllHeaderButtons() {
|
||||
leftButton.getElement().addClassName(
|
||||
StartAnalysisWidgetResources.INSTANCE.gss().controll_header_button_visible());
|
||||
rightButton.getElement().addClassName(
|
||||
StartAnalysisWidgetResources.INSTANCE.gss().controll_header_button_visible());
|
||||
}
|
||||
|
||||
private void scrollToLast() {
|
||||
if (numberOfStartAnalysisCards > 1) {
|
||||
currentScrollPosition = currentScrollPosition - (numberOfStartAnalysisCards - page - 1)
|
||||
* SCROLL_OFFSET_STARTANALYSIS_CARDS;
|
||||
page = numberOfStartAnalysisCards - 1;
|
||||
startanalysis_card_container.getElement().getStyle().setLeft(currentScrollPosition, Unit.PCT);
|
||||
header.getElement().setInnerHTML("Start " + starts.get(page).raceName);
|
||||
currentStartPanel.getElement().setInnerHTML(starts.get(page).raceName);
|
||||
notifyStartAnalysisPageChangeListener(page);
|
||||
rightButton.setResource(StartAnalysisWidgetResources.INSTANCE.rightdisabled());
|
||||
rightButtonImage.setResource(StartAnalysisWidgetResources.INSTANCE.rightdisabled());
|
||||
rightButton.getElement().getStyle().setProperty("disabled", "true");
|
||||
leftButton.setResource(StartAnalysisWidgetResources.INSTANCE.left());
|
||||
leftButtonImage.setResource(StartAnalysisWidgetResources.INSTANCE.left());
|
||||
leftButton.getElement().getStyle().setProperty("disabled", "false");
|
||||
}
|
||||
}
|
||||
@@ -318,14 +372,14 @@ public class StartAnalysisWidget extends Composite implements HasWidgets, PollsL
|
||||
logger.log(Level.INFO, "Adding Startanalysis Card");
|
||||
if (displaysCards == false) {
|
||||
displaysCards = true;
|
||||
header.getElement().setInnerHTML("Start " + SafeHtmlUtils.fromString(startAnalysisDTO.raceName));
|
||||
currentStartPanel.getElement().setInnerHTML(startAnalysisDTO.raceName);
|
||||
}
|
||||
if (numberOfStartAnalysisCards > 0) {
|
||||
rightButton.setResource(StartAnalysisWidgetResources.INSTANCE.right());
|
||||
rightButtonImage.setResource(StartAnalysisWidgetResources.INSTANCE.right());
|
||||
}
|
||||
final StartAnalysisCard startlineAnalysisCard = new StartAnalysisCard(numberOfStartAnalysisCards
|
||||
* SCROLL_OFFSET_STARTANALYSIS_CARDS + 10, numberOfStartAnalysisCards, startAnalysisDTO,
|
||||
dashboardClientFactory.getSailingService());
|
||||
* SCROLL_OFFSET_STARTANALYSIS_CARDS + MARGIN_LEFT_STARTANALYSIS_CARD, numberOfStartAnalysisCards,
|
||||
startAnalysisDTO, dashboardClientFactory.getSailingService(), raceMapResources);
|
||||
startanalysis_card_container.add(startlineAnalysisCard);
|
||||
startlineAnalysisCard.startAnalysisComponentPageChangedToIndexAndStartAnalysis(page, startAnalysisDTO);
|
||||
registerPageChangeListener(startlineAnalysisCard);
|
||||
@@ -352,8 +406,8 @@ public class StartAnalysisWidget extends Composite implements HasWidgets, PollsL
|
||||
|
||||
public void notifyStartAnalysisPageChangeListener(int newPageIndex) {
|
||||
for (StartAnalysisPageChangeListener sO : pageChangeListener) {
|
||||
if(starts.get(newPageIndex) != null)
|
||||
sO.startAnalysisComponentPageChangedToIndexAndStartAnalysis(newPageIndex, starts.get(newPageIndex));
|
||||
if (starts.get(newPageIndex) != null)
|
||||
sO.startAnalysisComponentPageChangedToIndexAndStartAnalysis(newPageIndex, starts.get(newPageIndex));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,8 +418,8 @@ public class StartAnalysisWidget extends Composite implements HasWidgets, PollsL
|
||||
}
|
||||
}
|
||||
|
||||
private String getCompetitorIdAsStringFromDisplayedStartAnalysisDTOs() {
|
||||
String result = "";
|
||||
private String getCompetitorIdAsStringFromFirstDisplayedStartAnalysis() {
|
||||
String result = null;
|
||||
if (starts != null && starts.size() > 0) {
|
||||
CompetitorDTO competitor = starts.get(0).competitor;
|
||||
if (competitor != null)
|
||||
@@ -374,27 +428,20 @@ public class StartAnalysisWidget extends Composite implements HasWidgets, PollsL
|
||||
return result;
|
||||
}
|
||||
|
||||
private boolean displayedStartAnalysisCompetitorDifferentToRequestedOne() {
|
||||
String competitorIDFromDispalyedStartAnalysisDTOs = getCompetitorIdAsStringFromDisplayedStartAnalysisDTOs();
|
||||
if (competitorIDFromDispalyedStartAnalysisDTOs != null
|
||||
&& !(competitorIDFromDispalyedStartAnalysisDTOs.equals(Cookies
|
||||
.getCookie(SELECTED_COMPETITOR_ID_COOKIE_KEY)))) {
|
||||
private boolean displayedStartAnalysisForDifferentCompetitorToRequestedOne() {
|
||||
String competitorIDFromDispalyedStartAnalysisDTOs = getCompetitorIdAsStringFromFirstDisplayedStartAnalysis();
|
||||
if ((competitorIDFromDispalyedStartAnalysisDTOs != getCachedSelectedCompetitorId()) || (competitorIDFromDispalyedStartAnalysisDTOs == null && getCachedSelectedCompetitorId() != null)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void timeChanged(Date newTime, Date oldTime) {
|
||||
String selectedCompetitorId = Cookies.getCookie(SELECTED_COMPETITOR_ID_COOKIE_KEY);
|
||||
if (selectedCompetitorId != null) {
|
||||
loadStartAnalysisDTOsForCompetitorID(selectedCompetitorId);
|
||||
} else {
|
||||
loadCompetitorsAndShowCompetitorSelectionPopup();
|
||||
}
|
||||
loadStartAnalysisDTOsForCompetitorID(getCachedSelectedCompetitorId());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void registerForDashboardFiveSecondsTimer(DashboardClientFactory dashboardClientFactory) {
|
||||
if (dashboardClientFactory != null) {
|
||||
|
||||
+17
-11
@@ -1,21 +1,27 @@
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui">
|
||||
|
||||
<ui:with field="resources" type="com.sap.sailing.dashboards.gwt.client.widgets.startanalysis.StartAnalysisWidgetResources"/>
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||
xmlns:header="urn:import:com.sap.sailing.dashboards.gwt.client.widgets.header"
|
||||
xmlns:competitorselection="urn:import:com.sap.sailing.dashboards.gwt.client.popups.competitorselection.util">
|
||||
|
||||
<ui:with field="resources" type="com.sap.sailing.dashboards.gwt.client.widgets.startanalysis.StartAnalysisWidgetResources" />
|
||||
|
||||
<g:HTMLPanel styleName="{resources.gss.startanalysis}">
|
||||
<g:HTMLPanel ui:field="header" styleName="{resources.gss.panel_header}">
|
||||
No Starts Available
|
||||
<header:DashboardWidgetHeaderAndNoDataMessage ui:field="dashboardWidgetHeaderAndNoDataMessage">
|
||||
|
||||
</header:DashboardWidgetHeaderAndNoDataMessage>
|
||||
<competitorselection:SettingsButtonWithSelectionIndicationLabel ui:field="selectedCompetitorWithSettingsButton"></competitorselection:SettingsButtonWithSelectionIndicationLabel>
|
||||
<g:HTMLPanel ui:field="currentStartPanel" styleName="{resources.gss.current_start_panel}">
|
||||
</g:HTMLPanel>
|
||||
<g:HTMLPanel ui:field="leftButton" styleName="{resources.gss.controll_header_button} {resources.gss.controll_header_button_left}">
|
||||
<g:Image ui:field="leftButtonImage" styleName="{resources.gss.controll_header_button_image}" resource="{resources.left}"></g:Image>
|
||||
</g:HTMLPanel>
|
||||
<g:HTMLPanel ui:field="rightButton" styleName="{resources.gss.controll_header_button} {resources.gss.controll_header_button_right}">
|
||||
<g:Image ui:field="rightButtonImage" styleName="{resources.gss.controll_header_button_image}" resource="{resources.right}"></g:Image>
|
||||
</g:HTMLPanel>
|
||||
<g:Image resource="{resources.left}" ui:field="leftButton"
|
||||
styleName="{resources.gss.controll_header_button} {resources.gss.controll_header_button_left}"></g:Image>
|
||||
<g:Image resource="{resources.right}" ui:field="rightButton"
|
||||
styleName="{resources.gss.controll_header_button} {resources.gss.controll_header_button_right}"></g:Image>
|
||||
<g:FocusPanel ui:field="left_focus_panel" styleName="{resources.gss.left_focus_panel}"></g:FocusPanel>
|
||||
<g:FocusPanel ui:field="right_focus_panel" styleName="{resources.gss.right_focus_panel}"></g:FocusPanel>
|
||||
<g:HTMLPanel ui:field="startanalysis_card_container"
|
||||
styleName="{resources.gss.card_container}">
|
||||
<g:HTMLPanel ui:field="startanalysis_card_container" styleName="{resources.gss.card_container}">
|
||||
</g:HTMLPanel>
|
||||
</g:HTMLPanel>
|
||||
|
||||
|
||||
+8
-12
@@ -4,41 +4,37 @@ import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.resources.client.ClientBundle;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.resources.client.ImageResource;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.CombinedWindPanelStyle;
|
||||
|
||||
public interface StartAnalysisWidgetResources extends ClientBundle {
|
||||
|
||||
public static final StartAnalysisWidgetResources INSTANCE = GWT.create(StartAnalysisWidgetResources.class);
|
||||
|
||||
@Source("com/sap/sailing/dashboards/gwt/client/images/leftarrow.png")
|
||||
@Source("com/sap/sailing/dashboards/gwt/client/images/left.png")
|
||||
ImageResource left();
|
||||
|
||||
@Source("com/sap/sailing/dashboards/gwt/client/images/rightarrow.png")
|
||||
@Source("com/sap/sailing/dashboards/gwt/client/images/right.png")
|
||||
ImageResource right();
|
||||
|
||||
@Source("com/sap/sailing/dashboards/gwt/client/images/leftarrow_disabled.png")
|
||||
@Source("com/sap/sailing/dashboards/gwt/client/images/left_disabled.png")
|
||||
ImageResource leftdisabled();
|
||||
|
||||
@Source("com/sap/sailing/dashboards/gwt/client/images/rightarrow_disabled.png")
|
||||
@Source("com/sap/sailing/dashboards/gwt/client/images/right_disabled.png")
|
||||
ImageResource rightdisabled();
|
||||
|
||||
@Source("com/sap/sailing/dashboards/gwt/client/images/windarrow.png")
|
||||
ImageResource combinedWindIcon();
|
||||
|
||||
@Source({"com/sap/sailing/dashboards/gwt/client/theme/theme.gss", "StartAnalysisWidget.gss"})
|
||||
StartAnalysisGSS gss();
|
||||
|
||||
@Source({"com/sap/sailing/dashboards/gwt/client/theme/theme.gss", "StartAnalysisCombinedWindPanel.gss"})
|
||||
CombinedWindPanelStyle combinedWindPanelStyle();
|
||||
|
||||
public interface StartAnalysisGSS extends CssResource {
|
||||
String startanalysis();
|
||||
String panel_header();
|
||||
String current_start_panel();
|
||||
String controll_header_button();
|
||||
String controll_header_button_visible();
|
||||
String controll_header_button_image();
|
||||
String controll_header_button_left();
|
||||
String controll_header_button_right();
|
||||
String card_container();
|
||||
String card();
|
||||
String card_map_container();
|
||||
String card_table();
|
||||
String card_wind_line_data_container();
|
||||
String card_data();
|
||||
|
||||
+19
-13
@@ -20,7 +20,6 @@ import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.google.gwt.user.client.ui.HasWidgets;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.startanalysis.StartAnalysisPageChangeListener;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.startanalysis.StartAnalysisWidgetResources;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.startanalysis.rankingtable.StartAnalysisStartRankTable;
|
||||
import com.sap.sailing.dashboards.gwt.shared.StartlineAdvantageType;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.StartAnalysisDTO;
|
||||
@@ -34,6 +33,7 @@ import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.RaceMap;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.RaceMapHelpLinesSettings;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.RaceMapHelpLinesSettings.HelpLineTypes;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.RaceMapResources;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.RaceMapZoomSettings;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.RaceMapZoomSettings.ZoomTypes;
|
||||
import com.sap.sse.gwt.client.async.AsyncActionsExecutor;
|
||||
@@ -52,6 +52,9 @@ public class StartAnalysisCard extends Composite implements HasWidgets, StartAna
|
||||
@UiField
|
||||
HTMLPanel startanalysis_card;
|
||||
|
||||
@UiField
|
||||
HTMLPanel card_map_container;
|
||||
|
||||
@UiField
|
||||
HTMLPanel startanalysis_card_table;
|
||||
|
||||
@@ -72,12 +75,14 @@ public class StartAnalysisCard extends Composite implements HasWidgets, StartAna
|
||||
|
||||
private final double WIND_LINE_ADVANTAGE_DIV_WIDTH_IN_PT = 185;
|
||||
private final double GEOMETRIC_LINE_ADVANTAGE_DIV_WIDTH_IN_PT = 210;
|
||||
private final int TABLE_MARGIN_IN_PT = 10;
|
||||
private final String RACE_TIME_START = "00:00:00";
|
||||
|
||||
public StartAnalysisCard(double leftCSSProperty, int cardId, StartAnalysisDTO startAnalysisDTO, SailingServiceAsync sailingServiceAsync) {
|
||||
private RaceMapResources raceMapResources;
|
||||
|
||||
public StartAnalysisCard(double leftCSSProperty, int cardId, StartAnalysisDTO startAnalysisDTO, SailingServiceAsync sailingServiceAsync, RaceMapResources raceMapResources) {
|
||||
stringMessages = StringMessages.INSTANCE;
|
||||
this.sailingServiceAsync = sailingServiceAsync;
|
||||
this.raceMapResources = raceMapResources;
|
||||
colorProvider = new CompetitorColorProviderImpl();
|
||||
competitorSelectionModel = new CompetitorSelectionModel(/* hasMultiSelection */true, colorProvider);
|
||||
competitorSelectionModel.setCompetitors(startAnalysisDTO.getCompetitorDTOsFromStartAnaylsisCompetitorDTOs(),
|
||||
@@ -96,9 +101,9 @@ public class StartAnalysisCard extends Composite implements HasWidgets, StartAna
|
||||
final String startLineAdvantageType;
|
||||
if (startAnalysisDTO.startAnalysisWindLineInfoDTO.startLineAdvantage.startLineAdvatageType
|
||||
.equals(StartlineAdvantageType.GEOMETRIC)) {
|
||||
startLineAdvantageType = stringMessages.dashboardStartlineAdvantageByGeometry();
|
||||
startLineAdvantageType = stringMessages.dashboardStartlineAdvantageByGeometryHeader();
|
||||
} else {
|
||||
startLineAdvantageType = stringMessages.dashboardStartlineAdvantagesByWind();
|
||||
startLineAdvantageType = stringMessages.dashboardStartlineAdvantagesByWindHeader();
|
||||
}
|
||||
startanalysis_card_line_advantage
|
||||
.setInnerHTML(SafeHtmlUtils.fromString(startLineAdvantageType
|
||||
@@ -133,7 +138,7 @@ public class StartAnalysisCard extends Composite implements HasWidgets, StartAna
|
||||
}
|
||||
}
|
||||
|
||||
private void addMap(final int cardID, final StartAnalysisDTO startAnalysisDTO) {
|
||||
private void addMap(final int cardID, final StartAnalysisDTO startAnalysisDTO, RaceMapResources raceMapResources) {
|
||||
com.sap.sse.gwt.client.player.Timer timer = new com.sap.sse.gwt.client.player.Timer(PlayModes.Live, 1000l);
|
||||
timer.pause();
|
||||
ArrayList<ZoomTypes> zoomTypes = new ArrayList<ZoomTypes>();
|
||||
@@ -149,13 +154,14 @@ public class StartAnalysisCard extends Composite implements HasWidgets, StartAna
|
||||
asyncActionsExecutor, null, Collections.singletonList(startAnalysisDTO.regattaAndRaceIdentifier), 5000l /* requestInterval */);
|
||||
raceMap = new RaceMap(sailingServiceAsync, asyncActionsExecutor, null, timer, competitorSelectionModel,
|
||||
StringMessages.INSTANCE, false, false, false, false, startAnalysisDTO.regattaAndRaceIdentifier,
|
||||
StartAnalysisWidgetResources.INSTANCE.combinedWindPanelStyle(), /* showHeaderPanel */ true);
|
||||
raceMapResources, /* showHeaderPanel */ true);
|
||||
raceMap.getSettings().setZoomSettings(new RaceMapZoomSettings(zoomTypes, false));
|
||||
raceMap.getSettings().setHelpLinesSettings(getHelpLineSettings());
|
||||
raceMap.getSettings().setTailLengthInMilliseconds(startAnalysisDTO.tailLenghtInMilliseconds);
|
||||
raceTimesInfoProvider.addRaceTimesInfoProviderListener(raceMap);
|
||||
raceMap.setSize("100%", getHeightForRaceMapInPixels()+"px");
|
||||
startanalysis_card.add(raceMap);
|
||||
raceMap.setSize("100%", "100%");
|
||||
card_map_container.getElement().getStyle().setHeight(getHeightForRaceMapInPixels(), Unit.PX);
|
||||
card_map_container.add(raceMap);
|
||||
/**
|
||||
* Executes onResize() after the reflow of the DOM. Otherwise it has no effect.
|
||||
* Needs to resize the map because google maps are not shown loaded fully when they are hidden.
|
||||
@@ -169,8 +175,8 @@ public class StartAnalysisCard extends Composite implements HasWidgets, StartAna
|
||||
});
|
||||
}
|
||||
|
||||
private int getHeightForRaceMapInPixels(){
|
||||
return this.getElement().getOffsetHeight() - startanalysis_card_table.getElement().getOffsetHeight() + (TABLE_MARGIN_IN_PT*3);
|
||||
private double getHeightForRaceMapInPixels(){
|
||||
return this.getElement().getOffsetHeight() - startanalysis_card_table.getElement().getOffsetHeight() - 30;
|
||||
}
|
||||
|
||||
private RaceMapHelpLinesSettings getHelpLineSettings() {
|
||||
@@ -184,7 +190,7 @@ public class StartAnalysisCard extends Composite implements HasWidgets, StartAna
|
||||
|
||||
private void removeMap() {
|
||||
if (raceMap != null && raceMap.isAttached() == true) {
|
||||
startanalysis_card.remove(raceMap);
|
||||
card_map_container.remove(raceMap);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,7 +207,7 @@ public class StartAnalysisCard extends Composite implements HasWidgets, StartAna
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
addMap(newPageIndex, startAnalysisDTO);
|
||||
addMap(newPageIndex, startAnalysisDTO, raceMapResources);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+3
-2
@@ -5,11 +5,12 @@
|
||||
<ui:with field="resources" type="com.sap.sailing.dashboards.gwt.client.widgets.startanalysis.StartAnalysisWidgetResources"/>
|
||||
|
||||
<g:HTMLPanel ui:field="startanalysis_card" styleName="{resources.gss.card}">
|
||||
<div class="{resources.gss.card_wind_line_data_container}">
|
||||
<div ui:field="card_wind_line_data_container" class="{resources.gss.card_wind_line_data_container}">
|
||||
<div ui:field="startanalysis_card_line_advantage"
|
||||
class="{resources.gss.card_data} {resources.gss.card_line_advantage}"></div>
|
||||
<div ui:field="startanalysis_card_race_time" class="{resources.gss.card_data} {resources.gss.card_race_time}">Time: 00:05:00</div>
|
||||
</div>
|
||||
<div ui:field="startanalysis_card_race_time" class="{resources.gss.card_race_time}">Time: 00:05:00</div>
|
||||
<g:HTMLPanel ui:field="card_map_container" styleName="{resources.gss.card_map_container}"></g:HTMLPanel>
|
||||
<g:HTMLPanel ui:field="startanalysis_card_table"
|
||||
styleName="{resources.gss.card_table}"></g:HTMLPanel>
|
||||
</g:HTMLPanel>
|
||||
|
||||
+6
-11
@@ -7,7 +7,6 @@ import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.i18n.client.NumberFormat;
|
||||
import com.google.gwt.user.cellview.client.CellTable;
|
||||
import com.google.gwt.user.cellview.client.HasKeyboardSelectionPolicy.KeyboardSelectionPolicy;
|
||||
import com.google.gwt.user.cellview.client.TextColumn;
|
||||
import com.google.gwt.user.client.ui.AbsolutePanel;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.StartAnalysisCompetitorDTO;
|
||||
import com.sap.sailing.gwt.ui.client.CompetitorSelectionModel;
|
||||
@@ -48,31 +47,27 @@ public class StartAnalysisStartRankTable extends AbsolutePanel {
|
||||
}
|
||||
};
|
||||
|
||||
StartAnalysisStartRankTableTeamCollumn<StartAnalysisCompetitorDTO> teamColumn = new StartAnalysisStartRankTableTeamCollumn<StartAnalysisCompetitorDTO>() {
|
||||
StartAnalysisStartRankTableTextColumn<StartAnalysisCompetitorDTO> teamColumn = new StartAnalysisStartRankTableTextColumn<StartAnalysisCompetitorDTO>() {
|
||||
@Override
|
||||
public Pair<String, String> getValue(StartAnalysisCompetitorDTO saCompetitor) {
|
||||
String competitorColorAsHTML = competitorSelectionModel.getColor(saCompetitor.competitorDTO).getAsHtml();
|
||||
if(competitorColorAsHTML == null){
|
||||
competitorColorAsHTML = "#121212";
|
||||
}
|
||||
return new Pair<String, String>(saCompetitor.rankingTableEntryDTO.teamName, competitorColorAsHTML);
|
||||
public String getValue(StartAnalysisCompetitorDTO saCompetitor) {
|
||||
return saCompetitor.rankingTableEntryDTO.teamName;
|
||||
}
|
||||
};
|
||||
|
||||
TextColumn<StartAnalysisCompetitorDTO> speedColumn = new TextColumn<StartAnalysisCompetitorDTO>() {
|
||||
StartAnalysisStartRankTableTextColumn<StartAnalysisCompetitorDTO> speedColumn = new StartAnalysisStartRankTableTextColumn<StartAnalysisCompetitorDTO>() {
|
||||
@Override
|
||||
public String getValue(StartAnalysisCompetitorDTO saCompetitor) {
|
||||
return "" + NumberFormat.getFormat("#0.0").format(saCompetitor.rankingTableEntryDTO.speedAtStartTime);
|
||||
}
|
||||
};
|
||||
|
||||
TextColumn<StartAnalysisCompetitorDTO> distanceColumn = new TextColumn<StartAnalysisCompetitorDTO>() {
|
||||
StartAnalysisStartRankTableTextColumn<StartAnalysisCompetitorDTO> distanceColumn = new StartAnalysisStartRankTableTextColumn<StartAnalysisCompetitorDTO>() {
|
||||
@Override
|
||||
public String getValue(StartAnalysisCompetitorDTO saCompetitor) {
|
||||
return "" + NumberFormat.getFormat("#0.0").format(saCompetitor.rankingTableEntryDTO.distanceToLineAtStartTime);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
table.addColumn(rankColumn, stringConstants.dashboardRankAtFirstMark());
|
||||
table.setColumnWidth(rankColumn, 18.0, Unit.PCT);
|
||||
table.addColumn(teamColumn, stringConstants.dashboardTeam());
|
||||
|
||||
+7
-7
@@ -3,6 +3,7 @@ package com.sap.sailing.dashboards.gwt.client.widgets.startanalysis.rankingtable
|
||||
import com.google.gwt.cell.client.AbstractCell;
|
||||
import com.google.gwt.cell.client.Cell;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.sap.sailing.dashboards.gwt.client.theme.Fonts;
|
||||
import com.sap.sse.common.Util.Pair;
|
||||
|
||||
public class StartAnalysisStartRankTableRankAtFirstMarkCell extends AbstractCell<Pair<String, String>> implements Cell<Pair<String, String>> {
|
||||
@@ -12,19 +13,18 @@ public class StartAnalysisStartRankTableRankAtFirstMarkCell extends AbstractCell
|
||||
|
||||
@Override
|
||||
public void render(com.google.gwt.cell.client.Cell.Context context, Pair<String, String> value, SafeHtmlBuilder sb) {
|
||||
|
||||
String borderColor = "white";
|
||||
String textColor = "white";
|
||||
String width = "20pt";
|
||||
String height = "20pt";
|
||||
String width = "22px";
|
||||
String height = "22px";
|
||||
String fontFamily = Fonts.DASHBOARD_FONT_FAMILY;
|
||||
if(value.getB().equals("#FFFFFF")){
|
||||
borderColor = "black";
|
||||
textColor = "black";
|
||||
width = "19pt";
|
||||
height = "19pt";
|
||||
width = "22px";
|
||||
height = "22px";
|
||||
}
|
||||
|
||||
sb.appendHtmlConstant("<div style=\"background-color:"+value.getB()+"; border-radius: "+width+"; width: "+width+"; height: "+height+"; line-height: 20pt; vertical-align: middle; text-align: center; color:"+textColor+"; border-color:"+borderColor+"; border-style: solid; border-width: 1px;\">");
|
||||
sb.appendHtmlConstant("<div style=\"background-color:"+value.getB()+"; border-radius: "+width+"; width: "+width+"; height: "+height+"; line-height: 22px; vertical-align: middle; text-align: center; color:"+textColor+"; border-color:"+borderColor+"; border-style: solid; border-width: 1px; font-family:"+fontFamily+";\">");
|
||||
if (value != null) {
|
||||
sb.appendHtmlConstant(value.getA());
|
||||
}
|
||||
|
||||
+41
-26
@@ -1,37 +1,52 @@
|
||||
@CHARSET "UTF-8";
|
||||
|
||||
.cellTableHeader {
|
||||
padding-left: 10px;
|
||||
color: black;
|
||||
font-size: 9pt;
|
||||
background-image: none;
|
||||
background-color: white;
|
||||
height: 30px;
|
||||
vertical-align: middle;
|
||||
font-weight: bold;
|
||||
text-shadow: 0 1px 1px rgba(255,255,255,.7);
|
||||
padding: 7px;
|
||||
padding-left: 10px;
|
||||
color: black;
|
||||
background-image: none;
|
||||
background-color: white;
|
||||
font-family: 'Open Sans' !important;
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
text-shadow: 0 1px 1px rgba(255, 255, 255, .7);
|
||||
border-bottom-color: lightgrey !important;
|
||||
border: none !important;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.cellTableCell {
|
||||
padding: 5px;
|
||||
overflow: hidden;
|
||||
font-size: 10pt;
|
||||
height: 20px;
|
||||
color: black;
|
||||
background-color: white;
|
||||
border:none;
|
||||
padding-bottom: 8px;
|
||||
padding-left: 10px;
|
||||
overflow: hidden;
|
||||
font-family: 'Open Sans' !important;
|
||||
font-size: 13px;
|
||||
color: #848484;
|
||||
background-color: white;
|
||||
border: none !important;
|
||||
margin: 100px !important;
|
||||
border-spacing: 0px !important;
|
||||
}
|
||||
|
||||
.cellTableEvenRow {
|
||||
background-color: white;
|
||||
border:none;
|
||||
.cellTableOddRowCell {
|
||||
background-color: white;
|
||||
border: none !important;
|
||||
padding: 0px;
|
||||
padding-left: 10px;
|
||||
padding-bottom: 10px;
|
||||
margin: 0px !important;
|
||||
border-spacing: 0px !important;
|
||||
font-family: 'Open Sans' !important;
|
||||
}
|
||||
.cellTableOddRow {
|
||||
background-color: white;
|
||||
border:none;
|
||||
|
||||
.cellTableEvenRowCell {
|
||||
background-color: white;
|
||||
border: none !important;
|
||||
padding: 0px;
|
||||
padding-left: 10px;
|
||||
padding-bottom: 10px;
|
||||
maring: 0px !important;
|
||||
border-spacing: 0px !important;
|
||||
font-family: 'Open Sans' !important;
|
||||
}
|
||||
|
||||
cellTableOddRowCell{
|
||||
background-color: white;
|
||||
border:none;
|
||||
}
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.widgets.startanalysis.rankingtable;
|
||||
|
||||
import com.google.gwt.cell.client.AbstractCell;
|
||||
import com.google.gwt.cell.client.Cell;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.sap.sse.common.Util.Pair;
|
||||
|
||||
public class StartAnalysisStartRankTableTeamCell extends AbstractCell<Pair<String, String>> implements Cell<Pair<String, String>> {
|
||||
|
||||
public StartAnalysisStartRankTableTeamCell() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(com.google.gwt.cell.client.Cell.Context context, Pair<String, String> value, SafeHtmlBuilder sb) {
|
||||
|
||||
sb.appendHtmlConstant("<div style=\"width: 100%; height: 15pt; line-height: 15pt;\">");
|
||||
if (value != null) {
|
||||
sb.appendHtmlConstant(value.getA());
|
||||
sb.appendHtmlConstant("<div style=\"background-color:"+ value.getB()+"; width: 100%; height: 1.5pt; margin-top: -1.5pt;\"></div>");
|
||||
}
|
||||
sb.appendHtmlConstant("</div>");
|
||||
}
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.widgets.startanalysis.rankingtable;
|
||||
|
||||
import com.google.gwt.user.cellview.client.Column;
|
||||
import com.sap.sse.common.Util.Pair;
|
||||
|
||||
public abstract class StartAnalysisStartRankTableTeamCollumn<T> extends Column<T, Pair<String, String>> {
|
||||
|
||||
public StartAnalysisStartRankTableTeamCollumn() {
|
||||
super(new StartAnalysisStartRankTableTeamCell());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pair<String, String> getValue(T object) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.widgets.startanalysis.rankingtable;
|
||||
|
||||
import com.google.gwt.cell.client.AbstractCell;
|
||||
import com.google.gwt.cell.client.Cell;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.sap.sailing.dashboards.gwt.client.theme.Fonts;
|
||||
|
||||
public class StartAnalysisStartRankTableTextCell extends AbstractCell<String> implements Cell<String> {
|
||||
|
||||
public StartAnalysisStartRankTableTextCell() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(com.google.gwt.cell.client.Cell.Context context, String value, SafeHtmlBuilder sb) {
|
||||
String fontFamily = Fonts.DASHBOARD_FONT_FAMILY;
|
||||
sb.appendHtmlConstant("<div style=\"font-family:"+fontFamily+";\">");
|
||||
if (value != null) {
|
||||
sb.appendHtmlConstant(value);
|
||||
}
|
||||
sb.appendHtmlConstant("</div>");
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.widgets.startanalysis.rankingtable;
|
||||
|
||||
import com.google.gwt.user.cellview.client.Column;
|
||||
|
||||
/**
|
||||
* @author Alexander Ries (D062114)
|
||||
*
|
||||
*/
|
||||
|
||||
public abstract class StartAnalysisStartRankTableTextColumn<T> extends Column<T, String> {
|
||||
|
||||
public StartAnalysisStartRankTableTextColumn() {
|
||||
super(new StartAnalysisStartRankTableTextCell());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue(T object) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
@require 'theme';
|
||||
|
||||
.startLineAdvantageComponent_liveAveragePanel {
|
||||
bottom: 5pt;
|
||||
margin-top: 4pt;
|
||||
}
|
||||
|
||||
.startLineAdvantageComponent_header {
|
||||
font-size: 14pt;
|
||||
}
|
||||
|
||||
.startLineAdvantageComponent_livePanel {
|
||||
top: 35%;
|
||||
bottom: 20%;
|
||||
}
|
||||
|
||||
.startLineAdvantageComponent_averagePanel {
|
||||
top: 35%;
|
||||
bottom: 20%;
|
||||
}
|
||||
|
||||
.startLineAdvantageComponent_middleLine {
|
||||
top: 35%;
|
||||
bottom: 20%;
|
||||
}
|
||||
|
||||
.startLineAdvantageComponent_wrapper {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
-82
@@ -1,82 +0,0 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.course;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.google.gwt.i18n.client.NumberFormat;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.sap.sailing.dashboards.gwt.client.DashboardClientFactory;
|
||||
import com.sap.sailing.dashboards.gwt.client.actions.GetStartlineAdvantageByGeometryAction;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.PollsLiveDataEvery5Seconds;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.util.LiveAverageComponent;
|
||||
import com.sap.sailing.dashboards.gwt.shared.DashboardURLParameters;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.StartLineAdvantageDTO;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
|
||||
/**
|
||||
* The purpose of the class is to display the live and average start line advantage either by wind or by geometry. There
|
||||
* is only one advantage display at once, so the user can switch between these following two
|
||||
* {@link StartLineAdvantageComponentState}s {@link StartLineAdvantageComponentStateShowsAdvantageByWind} and
|
||||
* {@link StartLineAdvantageComponentStateShowsAdvantageByGeometry} by tabing somewhere at the widget. The class extends
|
||||
* from {@link LiveAverageComponent} to get necessary Ui Elements but customizes these with own CSS.
|
||||
*
|
||||
* @author Alexander Ries (D062114)
|
||||
*
|
||||
*/
|
||||
public class StartLineAdvantageByGeometryWidget extends LiveAverageComponent implements PollsLiveDataEvery5Seconds {
|
||||
|
||||
private DashboardClientFactory dashboardClientFactory;
|
||||
|
||||
private static StringMessages stringConstants = StringMessages.INSTANCE;
|
||||
private static final Logger logger = Logger.getLogger(StartLineAdvantageByGeometryWidget.class.getName());
|
||||
|
||||
public StartLineAdvantageByGeometryWidget(DashboardClientFactory dashboardClientFactory) {
|
||||
super(stringConstants.dashboardStartlineAdvantageByGeometry(), "m");
|
||||
this.dashboardClientFactory = dashboardClientFactory;
|
||||
StartLineAdvantageByGeometryWidgetRessources.INSTANCE.gss().ensureInjected();
|
||||
this.header.setInnerText(stringConstants.dashboardStartlineAdvantageByGeometry());
|
||||
this.header.addClassName(StartLineAdvantageByGeometryWidgetRessources.INSTANCE.gss().startLineAdvantageComponent_header());
|
||||
liveAveragePanel.getElement().addClassName(StartLineAdvantageByGeometryWidgetRessources.INSTANCE.gss().startLineAdvantageComponent_liveAveragePanel());
|
||||
livePanel.getElement().addClassName(StartLineAdvantageByGeometryWidgetRessources.INSTANCE.gss().startLineAdvantageComponent_livePanel());
|
||||
middleLine.getElement().addClassName(StartLineAdvantageByGeometryWidgetRessources.INSTANCE.gss().startLineAdvantageComponent_middleLine());
|
||||
averagePanel.getElement().addClassName(StartLineAdvantageByGeometryWidgetRessources.INSTANCE.gss().startLineAdvantageComponent_averagePanel());
|
||||
this.liveLabel.setInnerHTML(stringConstants.dashboardLiveWind());
|
||||
this.averageLabel.setInnerHTML(stringConstants.dashboardAverageWind()+"<br>"+stringConstants.dashboardAverageWindMinutes(15));
|
||||
registerForDashboardFiveSecondsTimer(dashboardClientFactory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void timeChanged(Date newTime, Date oldTime) {
|
||||
String leaderboardNameParameterValue = DashboardURLParameters.LEADERBOARD_NAME.getValue();
|
||||
if (leaderboardNameParameterValue != null) {
|
||||
dashboardClientFactory.getDispatch().execute(
|
||||
new GetStartlineAdvantageByGeometryAction(leaderboardNameParameterValue),
|
||||
new AsyncCallback<StartLineAdvantageDTO>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
logger.log(Level.INFO, "Failed to received startline advantage by geometry");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(StartLineAdvantageDTO result) {
|
||||
if (result.startLineAdvantage != null) {
|
||||
logger.log(Level.INFO, "Updating UI with RibDashboardRaceInfoDTO.startLineAdvantageDTO");
|
||||
setLiveValue(NumberFormat.getFormat("#0.0").format(result.startLineAdvantage.doubleValue()));
|
||||
setAverageValue(NumberFormat.getFormat("#0.0").format(result.average.doubleValue()));
|
||||
} else {
|
||||
logger.log(Level.INFO, "RibDashboardRaceInfoDTO.startLineAdvantageDTO is 0");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerForDashboardFiveSecondsTimer(DashboardClientFactory dashboardClientFactory) {
|
||||
if (dashboardClientFactory != null) {
|
||||
dashboardClientFactory.getDashboardFiveSecondsTimer().addTimeListener(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
@require 'theme';
|
||||
|
||||
.start_line_advantage_by_geometry_widget {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: LIGHT_GREY;
|
||||
border-radius: DASHBOARD_BORDER_RADIUS;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.advantage_maximum_live_average {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
top: DASHBOARD_SPACE_MEDIUM;
|
||||
height: auto;
|
||||
}
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.course;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.i18n.client.NumberFormat;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.google.gwt.user.client.ui.HasWidgets;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.dashboards.gwt.client.DashboardClientFactory;
|
||||
import com.sap.sailing.dashboards.gwt.client.actions.GetStartlineAdvantageByGeometryAction;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.PollsLiveDataEvery5Seconds;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.header.DashboardWidgetHeaderAndNoDataMessage;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.util.LiveAverageComponent;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.wind.StartlineAdvantagesByWindWidget;
|
||||
import com.sap.sailing.dashboards.gwt.shared.DashboardURLParameters;
|
||||
import com.sap.sailing.dashboards.gwt.shared.dto.StartLineAdvantageDTO;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
|
||||
/**
|
||||
* @author Alexander Ries (D062114)
|
||||
*
|
||||
*/
|
||||
public class StartlineAdvantageByGeometryWidget extends Composite implements HasWidgets, PollsLiveDataEvery5Seconds {
|
||||
|
||||
private static StartlineAdvantageByGeometryWidgetUiBinder uiBinder = GWT
|
||||
.create(StartlineAdvantageByGeometryWidgetUiBinder.class);
|
||||
|
||||
interface StartlineAdvantageByGeometryWidgetUiBinder extends UiBinder<Widget, StartlineAdvantageByGeometryWidget> {
|
||||
}
|
||||
|
||||
@UiField(provided = true)
|
||||
DashboardWidgetHeaderAndNoDataMessage dashboardWidgetHeaderAndNoDataMessage;
|
||||
|
||||
@UiField(provided = true)
|
||||
LiveAverageComponent advantageMaximumLiveAverage;
|
||||
|
||||
@UiField
|
||||
HTMLPanel contentContainer;
|
||||
|
||||
private DashboardClientFactory dashboardClientFactory;
|
||||
private GetStartlineAdvantageByGeometryAction getStartlineAdvantageByGeometryAction;
|
||||
private static final Logger logger = Logger.getLogger(StartlineAdvantagesByWindWidget.class.getName());
|
||||
|
||||
public StartlineAdvantageByGeometryWidget(DashboardClientFactory dashboardClientFactory) {
|
||||
StartlineAdvantageByGeometryWidgetRessources.INSTANCE.gss().ensureInjected();
|
||||
String leaderboardNameParameterValue = DashboardURLParameters.LEADERBOARD_NAME.getValue();
|
||||
if (leaderboardNameParameterValue != null) {
|
||||
this.getStartlineAdvantageByGeometryAction = new GetStartlineAdvantageByGeometryAction(leaderboardNameParameterValue);
|
||||
}
|
||||
this.dashboardClientFactory = dashboardClientFactory;
|
||||
dashboardWidgetHeaderAndNoDataMessage = new DashboardWidgetHeaderAndNoDataMessage();
|
||||
advantageMaximumLiveAverage = new LiveAverageComponent(StringMessages.INSTANCE.metersUnit());
|
||||
advantageMaximumLiveAverage.liveLabel.setInnerHTML(StringMessages.INSTANCE.dashboardLiveWind());
|
||||
advantageMaximumLiveAverage.averageLabel.setInnerHTML("<p>" + StringMessages.INSTANCE.dashboardAverageWind()
|
||||
+ "</p><p>" + StringMessages.INSTANCE.dashboardAverageWindMinutes(15) + "</p>");
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
hideDataDisplayContainer();
|
||||
dashboardWidgetHeaderAndNoDataMessage.setHeaderText(StringMessages.INSTANCE
|
||||
.dashboardStartlineAdvantageByGeometryHeader());
|
||||
dashboardWidgetHeaderAndNoDataMessage.showNoDataMessageWithHeaderAndMessage(
|
||||
StringMessages.INSTANCE.dashboardNoStartlineAdvantagesByGeometryAvailableHeader(),
|
||||
StringMessages.INSTANCE.dashboardNoStartlineAdvantagesByGeometryAvailableMessage());
|
||||
registerForDashboardFiveSecondsTimer(dashboardClientFactory);
|
||||
}
|
||||
|
||||
private void showDataDisplayContainer() {
|
||||
contentContainer.getElement().getStyle().setOpacity(1.0);
|
||||
}
|
||||
|
||||
private void hideDataDisplayContainer() {
|
||||
contentContainer.getElement().getStyle().setOpacity(0.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void timeChanged(Date newTime, Date oldTime) {
|
||||
if (getStartlineAdvantageByGeometryAction != null) {
|
||||
dashboardClientFactory.getDispatch().execute(getStartlineAdvantageByGeometryAction,
|
||||
new AsyncCallback<StartLineAdvantageDTO>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
logger.log(Level.INFO, "Failed to received startline advantage by geometry");
|
||||
hideDataDisplayContainer();
|
||||
dashboardWidgetHeaderAndNoDataMessage.showNoDataMessageWithHeaderAndMessage(
|
||||
StringMessages.INSTANCE.dashboardNoStartlineAdvantagesByGeometryAvailableHeader(),
|
||||
StringMessages.INSTANCE.dashboardNoStartlineAdvantagesByGeometryAvailableMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(StartLineAdvantageDTO result) {
|
||||
if (result.startLineAdvantage != null) {
|
||||
logger.log(Level.INFO,
|
||||
"Updating UI with RibDashboardRaceInfoDTO.startLineAdvantageDTO");
|
||||
advantageMaximumLiveAverage.setLiveValue(NumberFormat.getFormat("#0.0").format(
|
||||
result.startLineAdvantage.doubleValue()));
|
||||
advantageMaximumLiveAverage.setAverageValue(NumberFormat.getFormat("#0.0").format(
|
||||
result.average.doubleValue()));
|
||||
showDataDisplayContainer();
|
||||
dashboardWidgetHeaderAndNoDataMessage.hideNoDataMessage();
|
||||
} else {
|
||||
logger.log(Level.INFO, "RibDashboardRaceInfoDTO.startLineAdvantageDTO is 0");
|
||||
hideDataDisplayContainer();
|
||||
dashboardWidgetHeaderAndNoDataMessage.showNoDataMessageWithHeaderAndMessage(
|
||||
StringMessages.INSTANCE
|
||||
.dashboardNoStartlineAdvantagesByGeometryAvailableHeader(),
|
||||
StringMessages.INSTANCE
|
||||
.dashboardNoStartlineAdvantagesByGeometryAvailableMessage());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerForDashboardFiveSecondsTimer(DashboardClientFactory dashboardClientFactory) {
|
||||
if (dashboardClientFactory != null) {
|
||||
dashboardClientFactory.getDashboardFiveSecondsTimer().addTimeListener(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(Widget w) {
|
||||
throw new UnsupportedOperationException("The method add(Widget w) is not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
throw new UnsupportedOperationException("The method clear() is not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Widget> iterator() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove(Widget w) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||
xmlns:util="urn:import:com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.util"
|
||||
xmlns:header="urn:import:com.sap.sailing.dashboards.gwt.client.widgets.header">
|
||||
|
||||
<ui:with field="resources" type="com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.course.StartlineAdvantageByGeometryWidgetRessources" />
|
||||
|
||||
<g:HTMLPanel styleName="{resources.gss.start_line_advantage_by_geometry_widget}">
|
||||
<header:DashboardWidgetHeaderAndNoDataMessage ui:field="dashboardWidgetHeaderAndNoDataMessage"></header:DashboardWidgetHeaderAndNoDataMessage>
|
||||
<g:HTMLPanel ui:field="contentContainer">
|
||||
<g:HTMLPanel styleName="{resources.gss.advantage_maximum_live_average}">
|
||||
<util:LiveAverageComponent ui:field="advantageMaximumLiveAverage"></util:LiveAverageComponent>
|
||||
</g:HTMLPanel>
|
||||
</g:HTMLPanel>
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
||||
+5
-14
@@ -5,25 +5,16 @@ import com.google.gwt.resources.client.ClientBundle;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.resources.client.CssResource.Shared;
|
||||
|
||||
public interface StartLineAdvantageByGeometryWidgetRessources extends ClientBundle {
|
||||
public interface StartlineAdvantageByGeometryWidgetRessources extends ClientBundle {
|
||||
|
||||
public static final StartLineAdvantageByGeometryWidgetRessources INSTANCE = GWT.create(StartLineAdvantageByGeometryWidgetRessources.class);
|
||||
public static final StartlineAdvantageByGeometryWidgetRessources INSTANCE = GWT.create(StartlineAdvantageByGeometryWidgetRessources.class);
|
||||
|
||||
@Source({"com/sap/sailing/dashboards/gwt/client/theme/theme.gss", "StartLineAdvantageByGeometryWidget.gss"})
|
||||
@Source({"com/sap/sailing/dashboards/gwt/client/theme/theme.gss", "StartlineAdvantageByGeometryWidget.gss"})
|
||||
StartLineAdvantageByGeometryGss gss();
|
||||
|
||||
@Shared
|
||||
public interface StartLineAdvantageByGeometryGss extends CssResource {
|
||||
public String startLineAdvantageComponent_liveAveragePanel();
|
||||
|
||||
public String startLineAdvantageComponent_header();
|
||||
|
||||
public String startLineAdvantageComponent_livePanel();
|
||||
|
||||
public String startLineAdvantageComponent_averagePanel();
|
||||
|
||||
public String startLineAdvantageComponent_middleLine();
|
||||
|
||||
public String startLineAdvantageComponent_wrapper();
|
||||
String start_line_advantage_by_geometry_widget();
|
||||
String advantage_maximum_live_average();
|
||||
}
|
||||
}
|
||||
+20
-35
@@ -5,33 +5,14 @@
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
bottom: 0px;
|
||||
}
|
||||
|
||||
.header_container {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
height: 35%;
|
||||
}
|
||||
|
||||
.header {
|
||||
height: 100%;
|
||||
margin-top: 5pt;
|
||||
line-height: 15pt;
|
||||
vertical-align: middle;
|
||||
font-size: 13pt;
|
||||
font-family: DASHBOARD_FONT_FAMILY;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
overflow: visible;
|
||||
font-weight: bold;
|
||||
height: 110px;
|
||||
background-color: WHITE;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.live_container {
|
||||
position: absolute;
|
||||
top: 35%;
|
||||
top: DASHBOARD_SPACE_VERY_SMALL;
|
||||
bottom: 30%;
|
||||
right: 52%;
|
||||
left: 0%;
|
||||
@@ -39,7 +20,7 @@
|
||||
|
||||
.average_container {
|
||||
position: absolute;
|
||||
top: 35%;
|
||||
top: DASHBOARD_SPACE_VERY_SMALL;
|
||||
bottom: 30%;
|
||||
right: 0%;
|
||||
left: 52%;
|
||||
@@ -47,7 +28,7 @@
|
||||
|
||||
.middle_line {
|
||||
position: absolute;
|
||||
top: 35%;
|
||||
top: 13px;
|
||||
height: 30pt;
|
||||
width: 1px;
|
||||
left: 50%;
|
||||
@@ -57,12 +38,13 @@
|
||||
|
||||
.panel_value_number {
|
||||
font-family: DASHBOARD_FONT_FAMILY;
|
||||
font-size: 26pt;
|
||||
font-size: DASHBOARD_FONT_SIZE_VERY_LARGE;
|
||||
height: DASHBOARD_FONT_SIZE_VERY_LARGE;
|
||||
}
|
||||
|
||||
.panel_value_unit {
|
||||
font-family: DASHBOARD_FONT_FAMILY;
|
||||
font-size: 15pt;
|
||||
font-size: DASHBOARD_FONT_SIZE_MEDIUM;
|
||||
}
|
||||
|
||||
.panel_value_unit_degrees {
|
||||
@@ -74,7 +56,6 @@
|
||||
.value_panel {
|
||||
margin: 0px;
|
||||
width: 100%;
|
||||
height: 90%;
|
||||
text-align: center;
|
||||
font-family: DASHBOARD_FONT_FAMILY;
|
||||
font-weight: bolder;
|
||||
@@ -85,23 +66,27 @@
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
font-size: 11pt;
|
||||
color: grey;
|
||||
font-size: DASHBOARD_FONT_SIZE_MEDIUM;
|
||||
color: LIGHT_TEXT_COLOR;
|
||||
font-family: DASHBOARD_FONT_FAMILY;
|
||||
}
|
||||
|
||||
.live_label_container {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
top: 56px;
|
||||
left: 0px;
|
||||
right: 50%;
|
||||
height: 35%;
|
||||
height: 14px;
|
||||
padding-left: DASHBOARD_SPACE_VERY_SMALL;
|
||||
padding-right: DASHBOARD_SPACE_VERY_SMALL;
|
||||
}
|
||||
|
||||
.average_label_container {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
right: 0px;
|
||||
top: 56px;
|
||||
left: 50%;
|
||||
height: 35%;
|
||||
right: 0px;
|
||||
height: 14px;
|
||||
padding-left: DASHBOARD_SPACE_VERY_SMALL;
|
||||
padding-right: DASHBOARD_SPACE_VERY_SMALL;
|
||||
}
|
||||
+1
-6
@@ -11,7 +11,6 @@ import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.google.gwt.user.client.ui.HasWidgets;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.course.StartLineAdvantageByGeometryWidget;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.windbot.WindBotWidget;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.windbot.charts.VerticalWindChartClickListener;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
@@ -34,9 +33,6 @@ public class LiveAverageComponent extends Composite implements HasWidgets, Verti
|
||||
@UiField
|
||||
public HTMLPanel liveAveragePanel;
|
||||
|
||||
@UiField
|
||||
public DivElement header;
|
||||
|
||||
@UiField
|
||||
SpanElement liveNumber;
|
||||
|
||||
@@ -78,12 +74,11 @@ public class LiveAverageComponent extends Composite implements HasWidgets, Verti
|
||||
* sets a special size
|
||||
*
|
||||
* */
|
||||
public LiveAverageComponent(String header, String unit) {
|
||||
public LiveAverageComponent(String unit) {
|
||||
LiveAverageComponentResources.INSTANCE.gss().ensureInjected();
|
||||
stringConstants = StringMessages.INSTANCE;
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
liveAveragePanel.getElement().getStyle().setProperty("backgroundColor", "white");
|
||||
this.header.setInnerText(header);
|
||||
this.liveUnit.setInnerText(unit);
|
||||
this.averageUnit.setInnerText(unit);
|
||||
// Lifts the degrees unit string "°". Otherwise it would be too small.
|
||||
|
||||
+13
-24
@@ -2,40 +2,29 @@
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui">
|
||||
|
||||
<ui:with field="resources" type="com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.util.LiveAverageComponentResources"/>
|
||||
|
||||
<ui:with field="resources"
|
||||
type="com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.util.LiveAverageComponentResources" />
|
||||
|
||||
<g:HTMLPanel ui:field="liveAveragePanel" styleName="{resources.gss.live_average_component}">
|
||||
|
||||
<g:HTMLPanel styleName="{resources.gss.header_container}">
|
||||
<div class="{resources.gss.header}" ui:field="header"></div>
|
||||
</g:HTMLPanel>
|
||||
|
||||
<g:HTMLPanel ui:field="livePanel" styleName="{resources.gss.live_container}">
|
||||
<div class="{resources.gss.value_panel}">
|
||||
<span class="{resources.gss.panel_value_number}" ui:field="liveNumber"></span>
|
||||
<span class="{resources.gss.panel_value_unit}" ui:field="liveUnit"></span>
|
||||
</div>
|
||||
<div class="{resources.gss.value_panel}">
|
||||
<span class="{resources.gss.panel_value_number}" ui:field="liveNumber"></span>
|
||||
<span class="{resources.gss.panel_value_unit}" ui:field="liveUnit"></span>
|
||||
</div>
|
||||
</g:HTMLPanel>
|
||||
|
||||
<g:HTMLPanel ui:field="middleLine" styleName="{resources.gss.middle_line}">
|
||||
|
||||
</g:HTMLPanel>
|
||||
|
||||
<g:HTMLPanel ui:field="averagePanel" styleName="{resources.gss.average_container}">
|
||||
<div class="{resources.gss.value_panel}">
|
||||
<span class="{resources.gss.panel_value_number}" ui:field="averageNumber"></span>
|
||||
<span class="{resources.gss.panel_value_unit}" ui:field="averageUnit"></span>
|
||||
</div>
|
||||
<div class="{resources.gss.value_panel}">
|
||||
<span class="{resources.gss.panel_value_number}" ui:field="averageNumber"></span>
|
||||
<span class="{resources.gss.panel_value_unit}" ui:field="averageUnit"></span>
|
||||
</div>
|
||||
</g:HTMLPanel>
|
||||
|
||||
<g:HTMLPanel styleName="{resources.gss.live_label_container}">
|
||||
<div class="{resources.gss.label_text}" ui:field="liveLabel"></div>
|
||||
<div class="{resources.gss.label_text}" ui:field="liveLabel"></div>
|
||||
</g:HTMLPanel>
|
||||
|
||||
<g:HTMLPanel styleName="{resources.gss.average_label_container}">
|
||||
<div class="{resources.gss.label_text}" ui:field="averageLabel"></div>
|
||||
<div class="{resources.gss.label_text}" ui:field="averageLabel"></div>
|
||||
</g:HTMLPanel>
|
||||
|
||||
</g:HTMLPanel>
|
||||
|
||||
</ui:UiBinder>
|
||||
-2
@@ -17,8 +17,6 @@ public interface LiveAverageComponentResources extends ClientBundle {
|
||||
|
||||
interface LiveAverageComponentGss extends CssResource {
|
||||
String live_average_component();
|
||||
String header();
|
||||
String header_container();
|
||||
String live_container();
|
||||
String average_container();
|
||||
String middle_line();
|
||||
|
||||
+11
-8
@@ -1,21 +1,24 @@
|
||||
@require 'theme';
|
||||
|
||||
.start_line_advantages_by_wind_component{
|
||||
.start_line_advantages_by_wind_component {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: LIGHT_GREY;
|
||||
border-radius: DASHBOARD_BORDER_RADIUS;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.advantage_maximum_live_average{
|
||||
.advantage_maximum_live_average {
|
||||
position: absolute;
|
||||
height: 30%;
|
||||
width: 100%;
|
||||
top: 4pt;
|
||||
top: DASHBOARD_SPACE_MEDIUM;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.advantages_on_line_chart_container{
|
||||
position: absolute;
|
||||
height: 70%;
|
||||
top: 30%;
|
||||
.advantages_on_line_chart_container {
|
||||
position: absolute;
|
||||
top: 145px;
|
||||
width: 100%;
|
||||
bottom: 0px;
|
||||
}
|
||||
+34
-8
@@ -6,18 +6,19 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.i18n.client.NumberFormat;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.google.gwt.user.client.ui.HasWidgets;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.dashboards.gwt.client.DashboardClientFactory;
|
||||
import com.sap.sailing.dashboards.gwt.client.actions.GetStartlineAdvantagesByWindAction;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.PollsLiveDataEvery5Seconds;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.header.DashboardWidgetHeaderAndNoDataMessage;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.util.LiveAverageComponent;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.wind.charts.StartlineAdvantagesOnLineChart;
|
||||
import com.sap.sailing.dashboards.gwt.shared.DashboardURLParameters;
|
||||
@@ -40,47 +41,63 @@ public class StartlineAdvantagesByWindWidget extends Composite implements HasWid
|
||||
|
||||
}
|
||||
|
||||
@UiField(provided = true)
|
||||
DashboardWidgetHeaderAndNoDataMessage dashboardWidgetHeaderAndNoDataMessage;
|
||||
|
||||
@UiField(provided = true)
|
||||
LiveAverageComponent advantageMaximumLiveAverage;
|
||||
|
||||
@UiField(provided = true)
|
||||
StartlineAdvantagesOnLineChart startlineAdvantagesOnLineChart;
|
||||
|
||||
public DashboardClientFactory dashboardClientFactory;
|
||||
@UiField
|
||||
HTMLPanel dataDisplayContainer;
|
||||
|
||||
private GetStartlineAdvantagesByWindAction getStartlineAdvantagesByWindAction;
|
||||
private DashboardClientFactory dashboardClientFactory;
|
||||
private static final Logger logger = Logger.getLogger(StartlineAdvantagesByWindWidget.class.getName());
|
||||
|
||||
public StartlineAdvantagesByWindWidget(DashboardClientFactory dashboardClientFactory) {
|
||||
StartlineAdvantagesByWindWidgetResources.INSTANCE.gss().ensureInjected();
|
||||
String leaderboardNameParameterValue = DashboardURLParameters.LEADERBOARD_NAME.getValue();
|
||||
if (leaderboardNameParameterValue != null) {
|
||||
getStartlineAdvantagesByWindAction = new GetStartlineAdvantagesByWindAction(leaderboardNameParameterValue);
|
||||
}
|
||||
this.dashboardClientFactory = dashboardClientFactory;
|
||||
dashboardWidgetHeaderAndNoDataMessage = new DashboardWidgetHeaderAndNoDataMessage();
|
||||
advantageMaximumLiveAverage = new LiveAverageComponent(StringMessages.INSTANCE.metersUnit());
|
||||
startlineAdvantagesOnLineChart = new StartlineAdvantagesOnLineChart();
|
||||
advantageMaximumLiveAverage = new LiveAverageComponent(StringMessages.INSTANCE.dashboardStartlineAdvantagesByWind(), "m");
|
||||
advantageMaximumLiveAverage.header.getStyle().setFontSize(14, Unit.PT);
|
||||
advantageMaximumLiveAverage.liveLabel.setInnerHTML("advantage max.");
|
||||
advantageMaximumLiveAverage.averageLabel.setInnerHTML("advantage max. average "+StringMessages.INSTANCE.dashboardAverageWindMinutes(15));
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
hideDataDisplayContainer();
|
||||
dashboardWidgetHeaderAndNoDataMessage.setHeaderText(StringMessages.INSTANCE.dashboardStartlineAdvantagesByWindHeader());
|
||||
dashboardWidgetHeaderAndNoDataMessage.showNoDataMessageWithHeaderAndMessage(StringMessages.INSTANCE.dashboardNoStartlineAdvantagesByWindAvailableHeader(), StringMessages.INSTANCE.dashboardNoStartlineAdvantagesByWindAvailableMessage());
|
||||
dataDisplayContainer.getElement().getStyle().setOpacity(0.0);
|
||||
registerForDashboardFiveSecondsTimer(dashboardClientFactory);
|
||||
}
|
||||
|
||||
private void loadData() {
|
||||
logger.log(Level.INFO, "Executing GetStartlineAdvantagesAction");
|
||||
String leaderboardNameParameterValue = DashboardURLParameters.LEADERBOARD_NAME.getValue();
|
||||
if (leaderboardNameParameterValue != null) {
|
||||
dashboardClientFactory.getDispatch().execute(
|
||||
new GetStartlineAdvantagesByWindAction(leaderboardNameParameterValue),
|
||||
if (getStartlineAdvantagesByWindAction != null) {
|
||||
dashboardClientFactory.getDispatch().execute(getStartlineAdvantagesByWindAction,
|
||||
new AsyncCallback<StartlineAdvantagesWithMaxAndAverageDTO>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(StartlineAdvantagesWithMaxAndAverageDTO result) {
|
||||
logger.log(Level.INFO, "Received StartlineAdvantagesWithMaxAndAverageDTO");
|
||||
if (result != null && result.maximum != null && result.average != null) {
|
||||
dashboardWidgetHeaderAndNoDataMessage.hideNoDataMessage();
|
||||
logger.log(Level.INFO, "Updating UI with StartlineAdvantagesWithMaxAndAverageDTO");
|
||||
startlineAdvantagesOnLineChart.setStartlineAdvantagesAndConfidences(result.distanceToRCBoatToStartlineAdvantage, result.distanceToRCBoatToConfidence);
|
||||
advantageMaximumLiveAverage.setLiveValue(NumberFormat.getFormat("#0.0").format(
|
||||
result.maximum.doubleValue()));
|
||||
advantageMaximumLiveAverage.setAverageValue(NumberFormat.getFormat("#0.0").format(
|
||||
result.average.doubleValue()));
|
||||
showDataDisplayContainer();
|
||||
} else {
|
||||
logger.log(Level.INFO, "StartlineAdvantagesWithMaxAndAverageDTO is null");
|
||||
dashboardWidgetHeaderAndNoDataMessage.showNoDataMessageWithHeaderAndMessage(StringMessages.INSTANCE.dashboardNoStartlineAdvantagesByWindAvailableHeader(), StringMessages.INSTANCE.dashboardNoStartlineAdvantagesByWindAvailableMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,11 +105,20 @@ public class StartlineAdvantagesByWindWidget extends Composite implements HasWid
|
||||
public void onFailure(Throwable caught) {
|
||||
logger.log(Level.INFO, "Failed to received StartlineAdvantagesWithMaxAndAverageDTO, "
|
||||
+ caught.getMessage());
|
||||
dashboardWidgetHeaderAndNoDataMessage.showNoDataMessageWithHeaderAndMessage(StringMessages.INSTANCE.dashboardNoStartlineAdvantagesByWindAvailableHeader(), StringMessages.INSTANCE.dashboardNoStartlineAdvantagesByWindAvailableMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void showDataDisplayContainer(){
|
||||
dataDisplayContainer.getElement().getStyle().setOpacity(1.0);
|
||||
}
|
||||
|
||||
private void hideDataDisplayContainer(){
|
||||
dataDisplayContainer.getElement().getStyle().setOpacity(0.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void timeChanged(Date newTime, Date oldTime) {
|
||||
loadData();
|
||||
|
||||
+12
-7
@@ -2,16 +2,21 @@
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||
xmlns:util="urn:import:com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.util"
|
||||
xmlns:chart="urn:import:com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.wind.charts">
|
||||
xmlns:chart="urn:import:com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.wind.charts"
|
||||
xmlns:header="urn:import:com.sap.sailing.dashboards.gwt.client.widgets.header">
|
||||
|
||||
<ui:with field="resources" type="com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.wind.StartlineAdvantagesByWindWidgetResources"/>
|
||||
<ui:with field="resources" type="com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.wind.StartlineAdvantagesByWindWidgetResources" />
|
||||
|
||||
<g:HTMLPanel styleName="{resources.gss.start_line_advantages_by_wind_component}">
|
||||
<g:HTMLPanel styleName="{resources.gss.advantage_maximum_live_average}">
|
||||
<util:LiveAverageComponent ui:field="advantageMaximumLiveAverage"></util:LiveAverageComponent>
|
||||
</g:HTMLPanel>
|
||||
<g:HTMLPanel styleName="{resources.gss.advantages_on_line_chart_container}">
|
||||
<chart:StartlineAdvantagesOnLineChart ui:field="startlineAdvantagesOnLineChart"></chart:StartlineAdvantagesOnLineChart>
|
||||
<header:DashboardWidgetHeaderAndNoDataMessage
|
||||
ui:field="dashboardWidgetHeaderAndNoDataMessage"></header:DashboardWidgetHeaderAndNoDataMessage>
|
||||
<g:HTMLPanel ui:field="dataDisplayContainer">
|
||||
<g:HTMLPanel styleName="{resources.gss.advantage_maximum_live_average}">
|
||||
<util:LiveAverageComponent ui:field="advantageMaximumLiveAverage"></util:LiveAverageComponent>
|
||||
</g:HTMLPanel>
|
||||
<g:HTMLPanel styleName="{resources.gss.advantages_on_line_chart_container}">
|
||||
<chart:StartlineAdvantagesOnLineChart ui:field="startlineAdvantagesOnLineChart"></chart:StartlineAdvantagesOnLineChart>
|
||||
</g:HTMLPanel>
|
||||
</g:HTMLPanel>
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
||||
+24
-27
@@ -1,23 +1,27 @@
|
||||
@require 'theme';
|
||||
|
||||
.wind_bot_component{
|
||||
.wind_bot_widget{
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: LIGHT_GREY;
|
||||
z-index: 5;
|
||||
border-radius: DASHBOARD_BORDER_RADIUS;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.name_panel {
|
||||
height: 45pt;
|
||||
line-height: 45pt;
|
||||
.live_average_header {
|
||||
position: absolute;
|
||||
height: 60px;
|
||||
top: DASHBOARD_SPACE_MEDIUM;
|
||||
line-height: 60px;
|
||||
vertical-align: middle;
|
||||
font-size: 14pt;
|
||||
font-size: DASHBOARD_FONT_SIZE_LARGE;
|
||||
font-family: DASHBOARD_FONT_FAMILY;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
overflow: visible;
|
||||
background-color: white;
|
||||
background-color: WHITE;
|
||||
}
|
||||
|
||||
.live_average_container {
|
||||
@@ -25,41 +29,34 @@
|
||||
border: none;
|
||||
border-radius: 0pt;
|
||||
background-color: white;
|
||||
top: 45pt;
|
||||
bottom: 65%;
|
||||
top: 90px;
|
||||
}
|
||||
|
||||
.left {
|
||||
left: 0pt;
|
||||
left: 0px;
|
||||
right: 50%;
|
||||
}
|
||||
|
||||
.right {
|
||||
left: 50%;
|
||||
right: 0pt;
|
||||
right: 0px;
|
||||
}
|
||||
|
||||
.windchart_container {
|
||||
position: absolute;
|
||||
border: none;
|
||||
border-radius: 0pt;
|
||||
border-radius: 0px;
|
||||
background-color: white;
|
||||
top: 35%;
|
||||
bottom: 0pt;
|
||||
top: 190px;
|
||||
bottom: 0px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.windchart{
|
||||
position: absolute;
|
||||
left: 0pt;
|
||||
right: 0pt;
|
||||
top: 0pt;
|
||||
bottom: 0pt;
|
||||
}
|
||||
|
||||
.compass_container{
|
||||
position: absolute;
|
||||
height: 45pt;
|
||||
width: 45pt;
|
||||
top: 5pt;
|
||||
right: 5pt;
|
||||
}
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
bottom: 0px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
+61
-40
@@ -7,15 +7,17 @@ import java.util.logging.Logger;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
||||
import com.google.gwt.dom.client.DivElement;
|
||||
import com.google.gwt.i18n.client.NumberFormat;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.google.gwt.user.client.ui.HasWidgets;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.dashboards.gwt.client.DashboardClientFactory;
|
||||
import com.sap.sailing.dashboards.gwt.client.dataretriever.WindBotDataRetrieverListener;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.header.DashboardWidgetHeaderAndNoDataMessage;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.util.LiveAverageComponent;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.windbot.charts.VerticalWindChart;
|
||||
import com.sap.sailing.dashboards.gwt.client.widgets.windbot.compass.LocationPointerCompass;
|
||||
@@ -49,18 +51,18 @@ public class WindBotWidget extends Composite implements HasWidgets, WindBotDataR
|
||||
|
||||
interface WindBotWidgetUiBinder extends UiBinder<Widget, WindBotWidget> {
|
||||
}
|
||||
|
||||
interface WindBotComponentStyle extends CssResource {
|
||||
}
|
||||
|
||||
@UiField
|
||||
public HTMLPanel windBotComponent;
|
||||
|
||||
/**
|
||||
* The header of the widget displaying the name of the wind bot.
|
||||
* */
|
||||
HTMLPanel contentContainer;
|
||||
|
||||
@UiField(provided = true)
|
||||
DashboardWidgetHeaderAndNoDataMessage dashboardWidgetHeaderAndNoDataMessage;
|
||||
|
||||
@UiField
|
||||
public HTMLPanel windBotNamePanel;
|
||||
DivElement totalWindSpeedHeader;
|
||||
|
||||
@UiField
|
||||
DivElement totalWindDirectionHeader;
|
||||
|
||||
/**
|
||||
* One of two {@link LiveAverageComponent}s that display in big font the live and the average value of the measured
|
||||
@@ -97,27 +99,45 @@ public class WindBotWidget extends Composite implements HasWidgets, WindBotDataR
|
||||
@UiField
|
||||
public LocationPointerCompass locationPointerCompass;
|
||||
|
||||
public DashboardClientFactory dashboardClientFactory;
|
||||
private String windBotId;
|
||||
private StringMessages stringConstants;
|
||||
private final static String UNIT_WIND_DIRECTION = "°";
|
||||
|
||||
public WindBotWidget(String windBotId) {
|
||||
public WindBotWidget(DashboardClientFactory dashboardClientFactory) {
|
||||
WindBotWidgetResources.INSTANCE.gss().ensureInjected();
|
||||
this.windBotId = windBotId;
|
||||
this.dashboardClientFactory = dashboardClientFactory;
|
||||
dashboardWidgetHeaderAndNoDataMessage = new DashboardWidgetHeaderAndNoDataMessage();
|
||||
stringConstants = StringMessages.INSTANCE;
|
||||
movingAverageSpeed = new MovingAverage(500);
|
||||
movingAverageDirection = new MovingAverage(500);
|
||||
trueWindSpeedLiveAverageComponent = new LiveAverageComponent(stringConstants.dashboardTrueWindSpeed(), stringConstants.dashboardTrueWindSpeedUnit());
|
||||
trueWindDirectionLiveAverageComponent = new LiveAverageComponent(stringConstants.dashboardTrueWindDirection(), UNIT_WIND_DIRECTION);
|
||||
trueWindSpeedLiveAverageComponent = new LiveAverageComponent(stringConstants.dashboardTrueWindSpeedUnit());
|
||||
trueWindDirectionLiveAverageComponent = new LiveAverageComponent(stringConstants.degreesUnit());
|
||||
trueWindSpeedVerticalWindChart = new VerticalWindChart("#008FFF", "#6ADBFF");
|
||||
trueWindDirectionVerticalWindChart = new VerticalWindChart("#008FFF", "#6ADBFF");
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
windBotNamePanel.getElement().setInnerText(stringConstants.dashboardWindBot()+" "+ windBotId);
|
||||
hideContentContainer();
|
||||
dashboardWidgetHeaderAndNoDataMessage.setHeaderText(stringConstants.dashboardWindBot());
|
||||
dashboardWidgetHeaderAndNoDataMessage.showNoDataMessageWithHeaderAndMessage(stringConstants.dashboardNoWindBotAvailableHeader(), stringConstants.dashboardNoWindBotAvailableMessage());
|
||||
totalWindSpeedHeader.setInnerHTML(stringConstants.dashboardTrueWindSpeed());
|
||||
totalWindDirectionHeader.setInnerHTML(stringConstants.dashboardTrueWindDirection());
|
||||
trueWindSpeedVerticalWindChart.addVerticalWindChartClickListener(trueWindSpeedLiveAverageComponent);
|
||||
trueWindDirectionVerticalWindChart.addVerticalWindChartClickListener(trueWindDirectionLiveAverageComponent);
|
||||
}
|
||||
|
||||
public WindTrackInfoDTO getWindTrackInfoDTOFromAndWindBotID(WindInfoForRaceDTO windInfoForRaceDTO, String id) {
|
||||
|
||||
public void setWindBotId(String windBotId) {
|
||||
this.windBotId = windBotId;
|
||||
dashboardWidgetHeaderAndNoDataMessage.setHeaderText(stringConstants.dashboardWindBot() + " " + windBotId);
|
||||
}
|
||||
|
||||
private void showContentContainer(){
|
||||
contentContainer.getElement().getStyle().setOpacity(1.0);
|
||||
}
|
||||
|
||||
private void hideContentContainer(){
|
||||
contentContainer.getElement().getStyle().setOpacity(0.0);
|
||||
}
|
||||
|
||||
private WindTrackInfoDTO getWindTrackInfoDTOFromAndWindBotID(WindInfoForRaceDTO windInfoForRaceDTO, String id) {
|
||||
WindTrackInfoDTO windTrackInfo = null;
|
||||
for (WindSource windSource : windInfoForRaceDTO.windTrackInfoByWindSource.keySet()) {
|
||||
if (windSource.getType().equals(WindSourceType.EXPEDITION) && windSource.getId() != null) {
|
||||
@@ -128,26 +148,6 @@ public class WindBotWidget extends Composite implements HasWidgets, WindBotDataR
|
||||
return windTrackInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(Widget w) {
|
||||
throw new UnsupportedOperationException("The method add(Widget w) is not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
throw new UnsupportedOperationException("The method clear() is not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Widget> iterator() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove(Widget w) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the classes {@link LiveAverageComponent}s and {@link VerticalWindChart}s with data AND updates the
|
||||
* {@link #locationPointerCompass} with a new wind bot position !!!
|
||||
@@ -161,6 +161,7 @@ public class WindBotWidget extends Composite implements HasWidgets, WindBotDataR
|
||||
logger.log(Level.INFO, "WindInfoForRaceDTO contains WindTrackInfoDTO for Windbot id " + windBotId);
|
||||
if (windTrackInfoDTO.windFixes != null) {
|
||||
if (windTrackInfoDTO.windFixes.size() > 0) {
|
||||
dashboardWidgetHeaderAndNoDataMessage.hideNoDataMessage();
|
||||
logger.log(Level.INFO, "Upating UI with Wind Fixes for WindBot id " + windBotId);
|
||||
SplitScheduler.get().schedule(new ScheduledCommand() {
|
||||
|
||||
@@ -190,6 +191,7 @@ public class WindBotWidget extends Composite implements HasWidgets, WindBotDataR
|
||||
updateLocationPointerCompass(windTrackInfoDTO);
|
||||
}
|
||||
});
|
||||
showContentContainer();
|
||||
} else {
|
||||
logger.log(Level.INFO, "WindTrackInfoDTO.windFixes is empty");
|
||||
}
|
||||
@@ -220,8 +222,7 @@ public class WindBotWidget extends Composite implements HasWidgets, WindBotDataR
|
||||
}
|
||||
|
||||
private void updateLocationPointerCompass(final WindTrackInfoDTO windTrackInfoDTO) {
|
||||
locationPointerCompass.windBotPositionChanged(windTrackInfoDTO.windFixes
|
||||
.get(windTrackInfoDTO.windFixes.size() - 1).position);
|
||||
locationPointerCompass.windBotPositionChanged(windTrackInfoDTO.windFixes.get(windTrackInfoDTO.windFixes.size() - 1).position);
|
||||
}
|
||||
|
||||
private void updateMovingAverages(List<WindDTO> windFixes) {
|
||||
@@ -230,4 +231,24 @@ public class WindBotWidget extends Composite implements HasWidgets, WindBotDataR
|
||||
movingAverageDirection.add(windDTO.trueWindFromDeg);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(Widget w) {
|
||||
throw new UnsupportedOperationException("The method add(Widget w) is not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
throw new UnsupportedOperationException("The method clear() is not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Widget> iterator() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove(Widget w) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+8
-6
@@ -3,12 +3,17 @@
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:client="urn:import:com.sap.sailing.dashboards.gwt.client"
|
||||
xmlns:util="urn:import:com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.util"
|
||||
xmlns:windchart="urn:import:com.sap.sailing.dashboards.gwt.client.widgets.windbot.charts"
|
||||
xmlns:compass="urn:import:com.sap.sailing.dashboards.gwt.client.widgets.windbot.compass">
|
||||
xmlns:compass="urn:import:com.sap.sailing.dashboards.gwt.client.widgets.windbot.compass"
|
||||
xmlns:header="urn:import:com.sap.sailing.dashboards.gwt.client.widgets.header">
|
||||
|
||||
<ui:with field="resources" type="com.sap.sailing.dashboards.gwt.client.widgets.windbot.WindBotWidgetResources"/>
|
||||
|
||||
<g:HTMLPanel ui:field="windBotComponent" styleName="{resources.gss.wind_bot_component}">
|
||||
<g:HTMLPanel ui:field="windBotNamePanel" styleName="{resources.gss.name_panel}"></g:HTMLPanel>
|
||||
<g:HTMLPanel styleName="{resources.gss.wind_bot_widget}">
|
||||
<header:DashboardWidgetHeaderAndNoDataMessage ui:field="dashboardWidgetHeaderAndNoDataMessage"></header:DashboardWidgetHeaderAndNoDataMessage>
|
||||
<g:HTMLPanel ui:field="contentContainer">
|
||||
<compass:LocationPointerCompass ui:field="locationPointerCompass"></compass:LocationPointerCompass>
|
||||
<div ui:field="totalWindSpeedHeader" class="{resources.gss.live_average_header} {resources.gss.left}"></div>
|
||||
<div ui:field="totalWindDirectionHeader" class="{resources.gss.live_average_header} {resources.gss.right}"></div>
|
||||
<g:HTMLPanel
|
||||
styleName="{resources.gss.live_average_container} {resources.gss.left}">
|
||||
<util:LiveAverageComponent ui:field="trueWindSpeedLiveAverageComponent"></util:LiveAverageComponent>
|
||||
@@ -27,9 +32,6 @@
|
||||
<windchart:VerticalWindChart ui:field="trueWindDirectionVerticalWindChart"
|
||||
styleName="{resources.gss.windchart}"></windchart:VerticalWindChart>
|
||||
</g:HTMLPanel>
|
||||
<g:HTMLPanel styleName="{resources.gss.compass_container}">
|
||||
<compass:LocationPointerCompass
|
||||
ui:field="locationPointerCompass"></compass:LocationPointerCompass>
|
||||
</g:HTMLPanel>
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
||||
+2
-3
@@ -16,13 +16,12 @@ public interface WindBotWidgetResources extends ClientBundle {
|
||||
WindBotComponentGss gss();
|
||||
|
||||
public interface WindBotComponentGss extends CssResource {
|
||||
String wind_bot_component();
|
||||
String name_panel();
|
||||
String wind_bot_widget();
|
||||
String live_average_header();
|
||||
String live_average_container();
|
||||
String left();
|
||||
String right();
|
||||
String windchart_container();
|
||||
String windchart();
|
||||
String compass_container();
|
||||
}
|
||||
}
|
||||
+17
-13
@@ -37,6 +37,9 @@ import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.FocusPanel;
|
||||
import com.google.gwt.user.client.ui.HasWidgets;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.dashboards.gwt.client.theme.Colors;
|
||||
import com.sap.sailing.dashboards.gwt.client.theme.Fonts;
|
||||
import com.sap.sailing.dashboards.gwt.client.theme.Sizes;
|
||||
import com.sap.sailing.dashboards.gwt.client.util.HighchartsUtil;
|
||||
import com.sap.sailing.dashboards.gwt.shared.WindType;
|
||||
import com.sap.sailing.gwt.ui.client.shared.charts.ChartPointRecalculator;
|
||||
@@ -138,9 +141,8 @@ public class VerticalWindChart extends Composite implements HasWidgets {
|
||||
.setType(Type.DATE_TIME)
|
||||
.setReversed(false)
|
||||
.setLabels(
|
||||
new XAxisLabels().setStyle(new Style().setFontFamily("Arial").setFontSize("12")
|
||||
.setColor("grey"))).setLineColor("grey").setTickWidth(0.5).setLineWidth(1)
|
||||
.setTickWidth(1).setTickColor("grey").setOffset(0).setMinPadding(20).setGridLineColor("white")
|
||||
new XAxisLabels().setStyle(new Style().setFontFamily(Fonts.DASHBOARD_FONT_FAMILY).setFontSize(Sizes.DASHBOARD_FONT_SIZE_SMALL).setColor(Colors.LIGHT_TEXT_COLOR))).setLineColor(Colors.LIGHT_TEXT_COLOR).setTickWidth(0.5).setLineWidth(1)
|
||||
.setTickWidth(1).setTickColor(Colors.LIGHT_TEXT_COLOR).setOffset(0).setMinPadding(20).setGridLineColor(Colors.LIGHT_GREY)
|
||||
.setGridLineWidth(0)
|
||||
.setDateTimeLabelFormats(new DateTimeLabelFormats().setMonth("%e. %b").setYear("%b"));
|
||||
}
|
||||
@@ -148,12 +150,12 @@ public class VerticalWindChart extends Composite implements HasWidgets {
|
||||
private void setYAxisOptions() {
|
||||
verticalWindChart
|
||||
.getYAxis()
|
||||
.setLineColor("grey")
|
||||
.setLineColor(Colors.LIGHT_TEXT_COLOR)
|
||||
.setTickWidth(1)
|
||||
.setTickColor("grey")
|
||||
.setTickColor(Colors.LIGHT_TEXT_COLOR)
|
||||
.setAxisTitleText(null)
|
||||
.setGridLineWidth(0)
|
||||
.setAlternateGridColor("#d4d4d4")
|
||||
.setAlternateGridColor(Colors.LIGHT_GREY)
|
||||
.setLineWidth(1)
|
||||
.setEndOnTick(true)
|
||||
.setStartOnTick(true)
|
||||
@@ -163,7 +165,7 @@ public class VerticalWindChart extends Composite implements HasWidgets {
|
||||
.setMaxPadding(0)
|
||||
.setLabels(
|
||||
new YAxisLabels().setStyle(
|
||||
new Style().setFontFamily("Arial").setFontSize("12").setColor("grey")).setFormatter(
|
||||
new Style().setFontFamily(Fonts.DASHBOARD_FONT_FAMILY).setFontSize(Sizes.DASHBOARD_FONT_SIZE_SMALL).setColor(Colors.LIGHT_TEXT_COLOR)).setFormatter(
|
||||
new AxisLabelsFormatter() {
|
||||
@Override
|
||||
public String format(AxisLabelsData axisLabelsData) {
|
||||
@@ -276,13 +278,15 @@ public class VerticalWindChart extends Composite implements HasWidgets {
|
||||
* */
|
||||
@UiHandler("verticalWindChartClickArea")
|
||||
public void verticalWindChartClickAreaClicked(ClickEvent e) {
|
||||
if (chartIntervallinMinutes == SMALL_DISPLAY_INTERVALL_IN_MINUTES) {
|
||||
chartIntervallinMinutes = LARGE_DISPLAY_INTERVALL_IN_MINUTES;
|
||||
} else {
|
||||
chartIntervallinMinutes = SMALL_DISPLAY_INTERVALL_IN_MINUTES;
|
||||
if (lastPoint != null) {
|
||||
if (chartIntervallinMinutes == SMALL_DISPLAY_INTERVALL_IN_MINUTES) {
|
||||
chartIntervallinMinutes = LARGE_DISPLAY_INTERVALL_IN_MINUTES;
|
||||
} else {
|
||||
chartIntervallinMinutes = SMALL_DISPLAY_INTERVALL_IN_MINUTES;
|
||||
}
|
||||
adaptVerticalWindChartExtemes(lastPoint.getX().longValue());
|
||||
notifyVerticalWindChartClickListeners(chartIntervallinMinutes);
|
||||
}
|
||||
adaptVerticalWindChartExtemes(lastPoint.getX().longValue());
|
||||
notifyVerticalWindChartClickListeners(chartIntervallinMinutes);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+24
-11
@@ -1,5 +1,18 @@
|
||||
@require 'theme';
|
||||
|
||||
.location_pointer_compass {
|
||||
position: absolute;
|
||||
width: 70px;
|
||||
height: 85px;
|
||||
background-color: LIGHT_GREY;
|
||||
top: 0px;
|
||||
right: 13px;
|
||||
z-index: 5;
|
||||
border-bottom-left-radius: DASHBOARD_BORDER_RADIUS;
|
||||
border-bottom-right-radius: DASHBOARD_BORDER_RADIUS;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
.compass{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
@@ -8,13 +21,13 @@
|
||||
|
||||
.needle{
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
top: 0%;
|
||||
left: 0%;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.angleToLocationLabel{
|
||||
.angle_to_location {
|
||||
position: absolute;
|
||||
height: 10pt;
|
||||
width: 100%;
|
||||
@@ -23,22 +36,22 @@
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
font-family: DASHBOARD_FONT_FAMILY;
|
||||
font-size: 9pt;
|
||||
font-size: DASHBOARD_FONT_SIZE_VERY_SMALL;
|
||||
font-weight: bold;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.distanceToLocationLabel{
|
||||
.distance_to_location {
|
||||
position: absolute;
|
||||
height: 15pt;
|
||||
height: DASHBOARD_FONT_SIZE_SMALL;
|
||||
width: 100%;
|
||||
bottom: -17pt;
|
||||
top: 65px;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
font-family: DASHBOARD_FONT_FAMILY;
|
||||
line-height: 10pt;
|
||||
line-height: DASHBOARD_FONT_SIZE_SMALL;
|
||||
font-weight: bold;
|
||||
font-size: 9pt;
|
||||
font-size: DASHBOARD_FONT_SIZE_SMALL;
|
||||
color: black;
|
||||
z-index: 10;
|
||||
}
|
||||
+46
-42
@@ -1,38 +1,45 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.widgets.windbot.compass;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.DivElement;
|
||||
import com.google.gwt.i18n.client.NumberFormat;
|
||||
import com.google.gwt.user.client.ui.AbsolutePanel;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HasWidgets;
|
||||
import com.google.gwt.user.client.ui.Image;
|
||||
import com.google.gwt.user.client.ui.Label;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.domain.common.Position;
|
||||
|
||||
/**
|
||||
* The class is an UI component that should be used to display the direction and the distance from the users device to a
|
||||
* certain pointed GPS location. The class needs an {@link LocationPointerCompassAngleDistance} instance and registers
|
||||
* as an listener to it. It furthermore notifies its {@link LocationPointerCompassAngleDistance} instance about wind bot
|
||||
* GPS location changes.
|
||||
*
|
||||
* @author Alexander Ries (D062114)
|
||||
*
|
||||
*/
|
||||
public class LocationPointerCompass extends AbsolutePanel implements HasWidgets,
|
||||
LocationPointerCompassAngleDistanceListener {
|
||||
public class LocationPointerCompass extends Composite implements HasWidgets, LocationPointerCompassAngleDistanceListener {
|
||||
|
||||
private double angleOffset;
|
||||
private static LocationPointerCompasssUiBinder uiBinder = GWT.create(LocationPointerCompasssUiBinder.class);
|
||||
|
||||
interface LocationPointerCompasssUiBinder extends UiBinder<Widget, LocationPointerCompass> {
|
||||
}
|
||||
|
||||
private Image compassNeedle;
|
||||
@UiField
|
||||
Image compassNeedle;
|
||||
|
||||
/**
|
||||
* The Label shows the distance the users device is away from the location it points to.
|
||||
* */
|
||||
private Label distanceToPointetLocationLabel;
|
||||
@UiField
|
||||
DivElement distanceToPointetLocation;
|
||||
|
||||
/**
|
||||
* The Label shows the direction in degrees from north the users device is away from the location it points to.
|
||||
* */
|
||||
private Label angleToPointetLocationLabel;
|
||||
@UiField
|
||||
DivElement angleToPointetLocation;
|
||||
|
||||
private double angleOffset;
|
||||
/**
|
||||
* The {@link LocationPointerCompassAngleDistance} notifies the class about updates about angle and distance
|
||||
* changes.
|
||||
@@ -41,57 +48,34 @@ public class LocationPointerCompass extends AbsolutePanel implements HasWidgets,
|
||||
|
||||
public LocationPointerCompass() {
|
||||
LocationPointerCompassRessources.INSTANCE.gss().ensureInjected();
|
||||
this.getElement().addClassName(LocationPointerCompassRessources.INSTANCE.gss().compass());
|
||||
initCompassNeedle();
|
||||
initAngleToPointetLocationLabel();
|
||||
initDistanceToPointedLocationLabel();
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
compassNeedle.setResource(LocationPointerCompassRessources.INSTANCE.compass());
|
||||
locationPointerCompassAngleDistance = new LocationPointerCompassAngleDistance();
|
||||
locationPointerCompassAngleDistance.addListener(this);
|
||||
locationPointerCompassAngleDistance.triggerOrientationRead();
|
||||
}
|
||||
|
||||
private void initCompassNeedle() {
|
||||
compassNeedle = new Image();
|
||||
compassNeedle.setResource(LocationPointerCompassRessources.INSTANCE.compass());
|
||||
compassNeedle.getElement().addClassName(LocationPointerCompassRessources.INSTANCE.gss().needle());
|
||||
LocationPointerCompass.this.add(compassNeedle);
|
||||
}
|
||||
|
||||
private void initAngleToPointetLocationLabel() {
|
||||
angleToPointetLocationLabel = new Label();
|
||||
angleToPointetLocationLabel.getElement().addClassName(LocationPointerCompassRessources.INSTANCE.gss().angleToLocationLabel());
|
||||
this.add(angleToPointetLocationLabel);
|
||||
}
|
||||
|
||||
private void initDistanceToPointedLocationLabel() {
|
||||
distanceToPointetLocationLabel = new Label();
|
||||
distanceToPointetLocationLabel.getElement().addClassName(LocationPointerCompassRessources.INSTANCE.gss().distanceToLocationLabel());
|
||||
distanceToPointetLocationLabel.setText("m");
|
||||
this.add(distanceToPointetLocationLabel);
|
||||
}
|
||||
|
||||
private void updateNeedleAngle(double newDirection) {
|
||||
// Adapt degrees to image angle
|
||||
synchronized (this) {
|
||||
double newAngle = newDirection-angleOffset;
|
||||
double newAngle = (newDirection-angleOffset)%360;
|
||||
String winddirectionformatted = NumberFormat.getFormat("#0").format(newAngle);
|
||||
compassNeedle.getElement().getStyle().setProperty("transform", "rotate(" + winddirectionformatted + "deg)");
|
||||
compassNeedle.getElement().getStyle()
|
||||
.setProperty("webkitTransform", "rotate(" + winddirectionformatted + "deg)");
|
||||
String winddirectionFormattedForLabel = NumberFormat.getFormat("#0").format((newAngle < 0) ? 360+newAngle : newAngle);
|
||||
angleToPointetLocationLabel.setText(winddirectionFormattedForLabel+"°");
|
||||
angleToPointetLocation.setInnerHTML(winddirectionFormattedForLabel+"°");
|
||||
}
|
||||
}
|
||||
|
||||
private void updateDistanceToPointedLocationLabel(double distance, double angle) {
|
||||
String distanceFormatted = NumberFormat.getFormat("#0").format(distance);
|
||||
distanceToPointetLocationLabel.setText(distanceFormatted + " m");
|
||||
distanceToPointetLocation.setInnerHTML(distanceFormatted + " m");
|
||||
}
|
||||
|
||||
public void windBotPositionChanged(Position positionDTO) {
|
||||
locationPointerCompassAngleDistance.windBotPositionChanged(positionDTO);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void angleChanged(double angle) {
|
||||
updateNeedleAngle(angle);
|
||||
@@ -107,4 +91,24 @@ public class LocationPointerCompass extends AbsolutePanel implements HasWidgets,
|
||||
public void setAngleOffset(double offset) {
|
||||
angleOffset = offset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(Widget w) {
|
||||
throw new UnsupportedOperationException("The method add(Widget w) is not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
throw new UnsupportedOperationException("The method clear() is not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Widget> iterator() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove(Widget w) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui">
|
||||
|
||||
<ui:with field="resources" type="com.sap.sailing.dashboards.gwt.client.widgets.windbot.compass.LocationPointerCompassRessources"/>
|
||||
|
||||
<g:HTMLPanel styleName="{resources.gss.location_pointer_compass}">
|
||||
<g:Image ui:field="compassNeedle" styleName="{resources.gss.needle}"></g:Image>
|
||||
<div ui:field="angleToPointetLocation" class="{resources.gss.angle_to_location}"></div>
|
||||
<div ui:field="distanceToPointetLocation" class="{resources.gss.distance_to_location}"></div>
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
||||
+2
-3
@@ -55,18 +55,17 @@ public class LocationPointerCompassAngleDistance implements LocationListener, Co
|
||||
Double phi2 = lat2 * degreesToRadiansFactor;
|
||||
Double lam1 = lng1 * degreesToRadiansFactor;
|
||||
Double lam2 = lng2 * degreesToRadiansFactor;
|
||||
|
||||
double angle = Math.atan2(Math.sin(lam2 - lam1) * Math.cos(phi2),
|
||||
Math.cos(phi1) * Math.sin(phi2) - Math.sin(phi1) * Math.cos(phi2) * Math.cos(lam2 - lam1))
|
||||
* 180 / Math.PI;
|
||||
if (angle < 0) {
|
||||
angle = 360 + angle;
|
||||
}
|
||||
return angle;
|
||||
return Math.abs(angle);
|
||||
}
|
||||
|
||||
private float getDistanceBetweenGPSPoints(double lat1, double lng1, double lat2, double lng2) {
|
||||
double earthRadius = 6371000; // kilometers
|
||||
double earthRadius = 6371000; //kilometers
|
||||
double dLat = Math.toRadians(lat2 - lat1);
|
||||
double dLng = Math.toRadians(lng2 - lng1);
|
||||
double a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(Math.toRadians(lat1))
|
||||
|
||||
+3
-2
@@ -18,9 +18,10 @@ public interface LocationPointerCompassRessources extends ClientBundle {
|
||||
|
||||
@Shared
|
||||
public interface LocationPointerCompassGSS extends CssResource {
|
||||
public String location_pointer_compass();
|
||||
public String compass();
|
||||
public String needle();
|
||||
public String angleToLocationLabel();
|
||||
public String distanceToLocationLabel();
|
||||
public String angle_to_location();
|
||||
public String distance_to_location();
|
||||
}
|
||||
}
|
||||
+10
-10
@@ -14,20 +14,20 @@ public final class StartAnalysisCreationController extends AbstractStartAnalysis
|
||||
|
||||
private static final Logger logger = Logger.getLogger(StartAnalysisCreationController.class.getName());
|
||||
|
||||
private StartAnalysisCreationController(DashboardDispatchContext ctx) {
|
||||
|
||||
}
|
||||
|
||||
public static StartAnalysisDTO checkStartAnalysisForCompetitorInTrackedRace(DashboardDispatchContext dashboardDispatchContext, Competitor competitor, TrackedRace trackedRace) {
|
||||
StartAnalysisDTO result = null;
|
||||
if (competitor != null && trackedRace != null) {
|
||||
if (threeCompetitorsPassedSecondWayPoint(trackedRace) && raceProgressedFarEnough(competitor, trackedRace)) {
|
||||
logger.log(Level.INFO, "Creating startanalysis for race " + trackedRace.getRace().getName() + " and competitor: " + competitor.getName());
|
||||
result = StartAnalysisDTOFactory.createStartAnalysisForCompetitorAndTrackedRace(dashboardDispatchContext, competitor, trackedRace);
|
||||
if(trackedRace != null) {
|
||||
if (competitor != null) {
|
||||
if (threeCompetitorsPassedSecondWayPoint(trackedRace) && raceProgressedFarEnough(competitor, trackedRace)) {
|
||||
logger.log(Level.INFO, "Creating startanalysis for race " + trackedRace.getRace().getName() + " and competitor: " + competitor.getName());
|
||||
result = StartAnalysisDTOFactory.createStartAnalysisForCompetitorAndTrackedRace(dashboardDispatchContext, competitor, trackedRace);
|
||||
} else {
|
||||
logger.log(Level.INFO, "Waiting to create startanalysis for race " + trackedRace.getRace().getName() + " and competitor: " + competitor.getName());
|
||||
}
|
||||
} else {
|
||||
logger.log(Level.INFO, "Waiting to create startanalysis for race " + trackedRace.getRace().getName() + " and competitor: " + competitor.getName());
|
||||
result = StartAnalysisDTOFactory.createStartAnalysisForCompetitorAndTrackedRace(dashboardDispatchContext, competitor, trackedRace);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+10
-8
@@ -45,19 +45,22 @@ public final class StartAnalysisDTOFactory extends AbstractStartAnalysisCreation
|
||||
List<StartAnalysisCompetitorDTO> competitors = new ArrayList<StartAnalysisCompetitorDTO>();
|
||||
Waypoint secondWaypoint = trackedRace.getRace().getCourse().getFirstLeg().getTo();
|
||||
List<MarkPassing> markPassingsInOrder = convertMarkpPassingsIteratorToList(trackedRace.getMarkPassingsInOrder(secondWaypoint).iterator());
|
||||
boolean isCompetitorOneOfFirstThree = false;
|
||||
boolean isCompetitorNullOrOneOfFirstThreeCompetitors = false;
|
||||
for (int i = 0; i < MINIMUM_MARKPASSIINGS_AT_FIRST_MARK; i++) {
|
||||
competitors.add(createStartAnalysisCompetitorDTO(dashboardDispatchContext, trackedRace, i + 1, markPassingsInOrder.get(i).getCompetitor()));
|
||||
if (markPassingsInOrder.get(i).getCompetitor().equals(competitor)) {
|
||||
isCompetitorOneOfFirstThree = true;
|
||||
if (competitor == null || markPassingsInOrder.get(i).getCompetitor().equals(competitor)) {
|
||||
isCompetitorNullOrOneOfFirstThreeCompetitors = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isCompetitorOneOfFirstThree) {
|
||||
if (competitor != null && !isCompetitorNullOrOneOfFirstThreeCompetitors) {
|
||||
int rankOfCompetitorWhilePassingSecondWaypoint = getRankOfCompetitorWhilePassingSecondWaypoint(competitor, trackedRace);
|
||||
competitors.add(createStartAnalysisCompetitorDTO(dashboardDispatchContext, trackedRace, rankOfCompetitorWhilePassingSecondWaypoint, competitor));
|
||||
}
|
||||
startAnalysisDTO.competitor = dashboardDispatchContext.getRacingEventService().getBaseDomainFactory().getCompetitorStore().convertToCompetitorDTO(competitor);
|
||||
if (competitor != null) {
|
||||
startAnalysisDTO.competitor = dashboardDispatchContext.getRacingEventService().getBaseDomainFactory().getCompetitorStore().convertToCompetitorDTO(competitor);
|
||||
logger.log(Level.INFO, "Created startanalysis for competitor"+competitor);
|
||||
}
|
||||
startAnalysisDTO.startAnalysisCompetitorDTOs = competitors;
|
||||
final Boolean isGateStart = trackedRace.isGateStart();
|
||||
if(isGateStart == Boolean.TRUE){
|
||||
@@ -77,7 +80,7 @@ public final class StartAnalysisDTOFactory extends AbstractStartAnalysisCreation
|
||||
startAnalysisDTO.tailLenghtInMilliseconds = ONE_MINUTE_INTERVALL_IN_MILLISECONDS;
|
||||
}
|
||||
startAnalysisDTO.regattaAndRaceIdentifier = trackedRace.getRaceIdentifier();
|
||||
logger.log(Level.INFO, "Created startanalysis for competitor " + competitor.getName() + " and "+ trackedRace.getRace().getName());
|
||||
logger.log(Level.INFO, "Created startanalysis for "+ trackedRace.getRace().getName());
|
||||
return startAnalysisDTO;
|
||||
}
|
||||
|
||||
@@ -185,8 +188,7 @@ public final class StartAnalysisDTOFactory extends AbstractStartAnalysisCreation
|
||||
}
|
||||
}
|
||||
|
||||
private static StartAnalysisCompetitorDTO createStartAnalysisCompetitorDTO(DashboardDispatchContext dashboardDispatchContext, TrackedRace trackedRace, int rank,
|
||||
Competitor competitor) {
|
||||
private static StartAnalysisCompetitorDTO createStartAnalysisCompetitorDTO(DashboardDispatchContext dashboardDispatchContext, TrackedRace trackedRace, int rank, Competitor competitor) {
|
||||
StartAnalysisCompetitorDTO startAnalysisCompetitorDTOsForRace = new StartAnalysisCompetitorDTO();
|
||||
startAnalysisCompetitorDTOsForRace.competitorDTO = dashboardDispatchContext.getRacingEventService().getBaseDomainFactory().getCompetitorStore()
|
||||
.convertToCompetitorDTO(competitor);
|
||||
|
||||
+7
-4
@@ -4,6 +4,9 @@ import org.apache.commons.math.ArgumentOutsideDomainException;
|
||||
import org.apache.commons.math.analysis.interpolation.SplineInterpolator;
|
||||
import org.apache.commons.math.analysis.polynomials.PolynomialSplineFunction;
|
||||
|
||||
import com.sap.sailing.domain.base.SpeedWithConfidence;
|
||||
import com.sap.sailing.domain.base.impl.SpeedWithConfidenceImpl;
|
||||
import com.sap.sailing.domain.common.Bearing;
|
||||
import com.sap.sailing.domain.common.Speed;
|
||||
import com.sap.sailing.domain.common.impl.KnotSpeedImpl;
|
||||
|
||||
@@ -27,11 +30,11 @@ public class DefaultPolarWindAngleBoatSpeedFunction {
|
||||
windAngleBoatBearingSpeedFunction = splineInterpolator.interpolate(windAngleXValues, boatBearingYValues);
|
||||
}
|
||||
|
||||
public Speed getBoatSpeedForWindAngleAndSpeed(double angle, double speed) {
|
||||
Speed result = null;
|
||||
public SpeedWithConfidence<Void> getBoatSpeedForWindAngleAndSpeed(Bearing angleToWind, Speed speed) {
|
||||
SpeedWithConfidence<Void> result = null;
|
||||
try {
|
||||
double boatSpeed = windAngleBoatBearingSpeedFunction.value(convert360AngleTo180RangeAngle(angle));
|
||||
result = new KnotSpeedImpl(boatSpeed);
|
||||
KnotSpeedImpl boatSpeed = new KnotSpeedImpl(windAngleBoatBearingSpeedFunction.value(convert360AngleTo180RangeAngle(angleToWind.getDegrees())));
|
||||
result = new SpeedWithConfidenceImpl<Void>(boatSpeed, 0.5 , null);
|
||||
} catch (ArgumentOutsideDomainException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Loaded 100 of 243 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user