mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-17 01:31:01 +00:00
Style of CombinedWindPanel can get changed now by defining a local css for CombinedWindPanelStyle interface
This commit is contained in:
1 parent
d18f1bb8ea
commit
8ff59df803
7 files changed
+103
-29
No files matched your search
+30
@@ -0,0 +1,30 @@
|
||||
@CHARSET "UTF-8";
|
||||
|
||||
.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: "Arial";
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.combinedWindPanelCanvas{
|
||||
width: 35pt;
|
||||
height: 35pt;
|
||||
margin-top: 5pt;
|
||||
margin-left: 5pt;
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.startanalysis;
|
||||
|
||||
import com.google.gwt.resources.client.ClientBundle;
|
||||
import com.google.gwt.resources.client.ImageResource;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.CombinedWindPanelStyle;
|
||||
|
||||
interface StartAnalysisResources extends ClientBundle {
|
||||
|
||||
@Source("com/sap/sailing/dashboards/gwt/client/images/windarrow.png")
|
||||
ImageResource combinedWindIcon();
|
||||
|
||||
@Source("StartAnalysisCombinedWindPanel.css")
|
||||
CombinedWindPanelStyle combinedWindPanelStyle();
|
||||
}
|
||||
@@ -61,16 +61,6 @@ table {
|
||||
border-collapse: separate;
|
||||
}
|
||||
|
||||
.CombinedWindPanel {
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
-o-border-radius: 4px;
|
||||
-ms-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
background-color: rgba(255, 255, 255, 0.75);
|
||||
border: 1px solid #C9CACA;
|
||||
}
|
||||
|
||||
.CombinedWindPanelParentDiv {
|
||||
padding-top: 34px;
|
||||
padding-left: 10px;
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
@CHARSET "UTF-8";
|
||||
|
||||
.combinedWindPanel {
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
-o-border-radius: 4px;
|
||||
-ms-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
background-color: rgba(255, 255, 255, 0.75);
|
||||
border: 1px solid #C9CACA;
|
||||
}
|
||||
|
||||
.combinedWindPanelTextLabel {
|
||||
height: 12px;
|
||||
width: 55px;
|
||||
vertical-align: middle;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.combinedWindPanelCanvas{
|
||||
width: 55px;
|
||||
margin-left: 6px;
|
||||
cursor: pointer;
|
||||
}
|
||||
+16
-18
@@ -1,11 +1,10 @@
|
||||
package com.sap.sailing.gwt.ui.client.shared.racemap;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.google.gwt.canvas.client.Canvas;
|
||||
import com.google.gwt.dom.client.Style.Cursor;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.i18n.client.NumberFormat;
|
||||
import com.google.gwt.user.client.ui.FlowPanel;
|
||||
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
|
||||
import com.google.gwt.user.client.ui.Label;
|
||||
import com.sap.sailing.domain.common.WindSource;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
@@ -14,7 +13,7 @@ import com.sap.sailing.gwt.ui.shared.WindDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.WindTrackInfoDTO;
|
||||
|
||||
public class CombinedWindPanel extends FlowPanel {
|
||||
private static final int LABEL_HEIGHT = 12;
|
||||
//private static final int LABEL_HEIGHT = 12;
|
||||
|
||||
private final ImageTransformer transformer;
|
||||
private final StringMessages stringMessages;
|
||||
@@ -26,28 +25,27 @@ public class CombinedWindPanel extends FlowPanel {
|
||||
private WindSource windSource;
|
||||
|
||||
private Canvas canvas;
|
||||
|
||||
private static String CSS_STYLE_COMBINED_WIND_PANEL = "CombinedWindPanel";
|
||||
|
||||
private CombinedWindPanelStyle combinedWindPanelStyle;
|
||||
|
||||
private static final Logger logger = Logger.getLogger(CombinedWindPanel.class.getName());
|
||||
|
||||
/**
|
||||
*/
|
||||
public CombinedWindPanel(RaceMapImageManager theRaceMapResources, StringMessages stringMessages) {
|
||||
public CombinedWindPanel(RaceMapImageManager theRaceMapResources, CombinedWindPanelStyle combinedWindPanelStyle, StringMessages stringMessages) {
|
||||
this.stringMessages = stringMessages;
|
||||
this.raceMapResources = theRaceMapResources;
|
||||
this.combinedWindPanelStyle = combinedWindPanelStyle;
|
||||
|
||||
addStyleName(combinedWindPanelStyle.combinedWindPanel());
|
||||
|
||||
transformer = raceMapResources.getCombinedWindIconTransformer();
|
||||
canvas = transformer.getCanvas();
|
||||
int canvasWidth = canvas.getCanvasElement().getWidth();
|
||||
|
||||
addStyleName(CSS_STYLE_COMBINED_WIND_PANEL);
|
||||
|
||||
canvas.getElement().getStyle().setCursor(Cursor.POINTER);
|
||||
canvas.setWidth(canvasWidth + LABEL_HEIGHT + "px");
|
||||
textLabel = new Label("");
|
||||
textLabel.setSize(canvasWidth + LABEL_HEIGHT +"px", ""+LABEL_HEIGHT+"px");
|
||||
textLabel.getElement().getStyle().setFontSize(LABEL_HEIGHT, Unit.PX);
|
||||
textLabel.setWordWrap(false);
|
||||
textLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
|
||||
canvas.addStyleName(this.combinedWindPanelStyle.combinedWindPanelCanvas());
|
||||
add(canvas);
|
||||
|
||||
textLabel = new Label("");
|
||||
textLabel.addStyleName(this.combinedWindPanelStyle.combinedWindPanelTextLabel());
|
||||
add(textLabel);
|
||||
}
|
||||
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.sap.sailing.gwt.ui.client.shared.racemap;
|
||||
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.resources.client.CssResource.Shared;
|
||||
|
||||
@Shared
|
||||
public interface CombinedWindPanelStyle extends CssResource{
|
||||
|
||||
public String combinedWindPanel();
|
||||
|
||||
public String combinedWindPanelTextLabel();
|
||||
|
||||
public String combinedWindPanelCanvas();
|
||||
}
|
||||
+4
-1
@@ -3,7 +3,7 @@ package com.sap.sailing.gwt.ui.client.shared.racemap;
|
||||
import com.google.gwt.resources.client.ClientBundle;
|
||||
import com.google.gwt.resources.client.ImageResource;
|
||||
|
||||
interface RaceMapResources extends ClientBundle {
|
||||
public interface RaceMapResources extends ClientBundle {
|
||||
@Source("com/sap/sailing/gwt/ui/client/images/cameraBoat.png")
|
||||
ImageResource cameraBoatIcon();
|
||||
|
||||
@@ -18,4 +18,7 @@ interface RaceMapResources extends ClientBundle {
|
||||
|
||||
@Source("com/sap/sailing/gwt/ui/client/images/wind_expedition.png")
|
||||
ImageResource expeditionWindIcon();
|
||||
|
||||
@Source("CombinedWindPanel.css")
|
||||
CombinedWindPanelStyle combinedWindPanelStyle();
|
||||
}
|
||||
Reference in new issue
Block a user