Added javadoc to RaceMapStyle and changed style names

This commit is contained in:
Alexander Ries
2016-03-15 11:41:34 +01:00
parent 1ee0150e13
commit 3bf7e03764
5 changed files with 38 additions and 27 deletions
@@ -1,6 +1,6 @@
@require 'theme';
.combinedWindPanel {
.raceMapIndicatorPanel {
margin-top: DASHBOARD_SPACE_VERY_SMALL;
margin-left: DASHBOARD_SPACE_VERY_SMALL;
right: 0px;
@@ -10,26 +10,28 @@
background-color: white;
}
.combinedWindPanelTextLabel {
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;
.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;
}
.combinedWindPanelCanvas {
.raceMapIndicatorPanelCanvas {
width: 30px !important;
height: 30px !important;
margin-top: 10px;
margin-left: 10px;
}
.combinedWindPanel {}
.trueNorthIndicator {
opacity: 0.0;
}
@@ -33,13 +33,13 @@ public class CombinedWindPanel extends FlowPanel {
this.coordinateSystem = coordinateSystem;
this.raceMapResources = theRaceMapResources;
this.raceMapStyle = raceMapStyle;
addStyleName(raceMapStyle.combinedWindPanel());
addStyleName(raceMapStyle.raceMapIndicatorPanel());
transformer = raceMapResources.getCombinedWindIconTransformer();
canvas = transformer.getCanvas();
canvas.addStyleName(this.raceMapStyle.combinedWindPanelCanvas());
canvas.addStyleName(this.raceMapStyle.raceMapIndicatorPanelCanvas());
add(canvas);
textLabel = new Label("");
textLabel.addStyleName(this.raceMapStyle.combinedWindPanelTextLabel());
textLabel.addStyleName(this.raceMapStyle.raceMapIndicatorPanelTextLabel());
add(textLabel);
}
@@ -1,6 +1,6 @@
@CHARSET "UTF-8";
.combinedWindPanel {
.raceMapIndicatorPanel {
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
-o-border-radius: 4px;
@@ -10,7 +10,7 @@
border: 1px solid #C9CACA;
}
.combinedWindPanelTextLabel {
.raceMapIndicatorPanelTextLabel {
height: 12px;
width: 55px;
vertical-align: middle;
@@ -18,12 +18,12 @@
text-align: center;
}
.combinedWindPanelCanvas {
.raceMapIndicatorPanelCanvas {
width: 55px;
margin-left: 6px;
cursor: pointer;
}
.trueNorthIndicator {
opacity: 1.0;
}
.combinedWindPanel {}
.trueNorthIndicator {}
@@ -3,10 +3,19 @@ package com.sap.sailing.gwt.ui.client.shared.racemap;
import com.google.gwt.resources.client.CssResource;
import com.google.gwt.resources.client.CssResource.Shared;
/**
* Contains class names for styles that can get overwritten in the {@link RaceMap}.
* The {@link RaceMap} may require customized styles of elements when it is used in
* different contexts.
*
* @author Alexander Ries
*
*/
@Shared
public interface RaceMapStyle extends CssResource {
public String raceMapIndicatorPanel();
public String raceMapIndicatorPanelTextLabel();
public String raceMapIndicatorPanelCanvas();
public String combinedWindPanel();
public String combinedWindPanelTextLabel();
public String combinedWindPanelCanvas();
public String trueNorthIndicator();
}
@@ -35,11 +35,11 @@ public class TrueNorthIndicatorPanel extends FlowPanel {
this.coordinateSystem = coordinateSystem;
this.raceMapResources = theRaceMapResources;
this.raceMapStyle = raceMapStyle;
addStyleName(raceMapStyle.combinedWindPanel());
addStyleName(raceMapStyle.raceMapIndicatorPanel());
addStyleName(raceMapStyle.trueNorthIndicator());
transformer = raceMapResources.getTrueNorthIndicatorIconTransformer();
canvas = transformer.getCanvas();
canvas.addStyleName(this.raceMapStyle.combinedWindPanelCanvas());
canvas.addStyleName(this.raceMapStyle.raceMapIndicatorPanelCanvas());
add(canvas);
canvas.addClickHandler(new ClickHandler() {
@Override
@@ -59,7 +59,7 @@ public class TrueNorthIndicatorPanel extends FlowPanel {
}
});
textLabel = new Label("");
textLabel.addStyleName(this.raceMapStyle.combinedWindPanelTextLabel());
textLabel.addStyleName(this.raceMapStyle.raceMapIndicatorPanelTextLabel());
add(textLabel);
}