# HG changeset patch # User Ingo Weinzierl # Date 1299597359 0 # Node ID e4155a6833a9875d499b67bf58ea1c8d9b904c55 # Parent c19985f751188cc3ad2704c24f31ae5b7413d5e2 Integrated a header that contains a FLYS and a BfG logo. flys-client/trunk@1427 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r c19985f75118 -r e4155a6833a9 flys-client/ChangeLog --- a/flys-client/ChangeLog Mon Mar 07 13:47:55 2011 +0000 +++ b/flys-client/ChangeLog Tue Mar 08 15:15:59 2011 +0000 @@ -1,3 +1,27 @@ +2011-03-08 Ingo Weinzierl + + * src/main/java/de/intevation/flys/client/client/images/flys_logo.gif, + src/main/java/de/intevation/flys/client/client/images/bfg_logo.gif: New. + A logo of the BfG and a logo of the application FLYS. Both copied from + desktop FLYS. + + * src/main/java/de/intevation/flys/client/client/FLYSImages.java: New. + This interface grants access to the images used in this application. + + * src/main/java/de/intevation/flys/client/client/FLYSMessages_en.properties, + src/main/java/de/intevation/flys/client/client/FLYSMessages_de.properties, + src/main/java/de/intevation/flys/client/client/FLYSMessages.java: + Added the fullname of FLYS. + + * src/main/java/de/intevation/flys/client/client/ui/FLYSHeader.java: New. + This class displays the header containing a FLYS and a BfG logo. + + * src/main/java/de/intevation/flys/client/client/FLYS.java: Integrated the + FLYSHeader into the layout at the bottom of the application. + + * src/main/webapp/FLYS.html: Set the title of the application to + "FLYS-3.0". + 2011-03-07 Ingo Weinzierl * src/main/java/de/intevation/flys/client/client/services/CreateCollectionService.java, diff -r c19985f75118 -r e4155a6833a9 flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java Mon Mar 07 13:47:55 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java Tue Mar 08 15:15:59 2011 +0000 @@ -18,6 +18,7 @@ import de.intevation.flys.client.client.services.UserService; import de.intevation.flys.client.client.services.UserServiceAsync; import de.intevation.flys.client.client.ui.CollectionView; +import de.intevation.flys.client.client.ui.FLYSHeader; import de.intevation.flys.client.client.ui.FLYSView; import de.intevation.flys.client.client.ui.FLYSWorkspace; import de.intevation.flys.client.client.ui.MainMenu; @@ -68,6 +69,7 @@ menu = new MainMenu(this); view = new FLYSView(); + vertical.addMember(new FLYSHeader()); vertical.addMember(menu); vertical.addMember(view); diff -r c19985f75118 -r e4155a6833a9 flys-client/src/main/java/de/intevation/flys/client/client/FLYSImages.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSImages.java Tue Mar 08 15:15:59 2011 +0000 @@ -0,0 +1,19 @@ +package de.intevation.flys.client.client; + +import com.google.gwt.resources.client.ClientBundle; +import com.google.gwt.resources.client.ImageResource; + + +/** + * This interface grants access to the images used in this application. + * + * @author Ingo Weinzierl + */ +public interface FLYSImages extends ClientBundle { + + @Source("images/bfg_logo.gif") + ImageResource logoBfg(); + + @Source("images/flys_logo.gif") + ImageResource logoFlys(); +} diff -r c19985f75118 -r e4155a6833a9 flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages.java Mon Mar 07 13:47:55 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages.java Tue Mar 08 15:15:59 2011 +0000 @@ -11,6 +11,9 @@ @DefaultMessage("FLYS-3.0") String title(); + @DefaultMessage("Flusshydrologische Software") + String fullname(); + @DefaultMessage("User: ''{0}''") String user(String user); diff -r c19985f75118 -r e4155a6833a9 flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_de.properties --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_de.properties Mon Mar 07 13:47:55 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_de.properties Tue Mar 08 15:15:59 2011 +0000 @@ -1,4 +1,5 @@ title = FLYS-3.0 +fullname = Flusshydrologische Software user = Benutzer: ''{0}'' guest = Gast projects = Berechnungen diff -r c19985f75118 -r e4155a6833a9 flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_en.properties --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_en.properties Mon Mar 07 13:47:55 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_en.properties Tue Mar 08 15:15:59 2011 +0000 @@ -1,4 +1,5 @@ title = FLYS-3.0 +fullname = Flusshydrologische Software user = User: ''{0}'' guest = guest projects = Calculations diff -r c19985f75118 -r e4155a6833a9 flys-client/src/main/java/de/intevation/flys/client/client/images/bfg_logo.gif Binary file flys-client/src/main/java/de/intevation/flys/client/client/images/bfg_logo.gif has changed diff -r c19985f75118 -r e4155a6833a9 flys-client/src/main/java/de/intevation/flys/client/client/images/flys_logo.gif Binary file flys-client/src/main/java/de/intevation/flys/client/client/images/flys_logo.gif has changed diff -r c19985f75118 -r e4155a6833a9 flys-client/src/main/java/de/intevation/flys/client/client/ui/FLYSHeader.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/FLYSHeader.java Tue Mar 08 15:15:59 2011 +0000 @@ -0,0 +1,92 @@ +package de.intevation.flys.client.client.ui; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.resources.client.ImageResource; + +import com.smartgwt.client.types.Alignment; +import com.smartgwt.client.widgets.Img; +import com.smartgwt.client.widgets.Label; +import com.smartgwt.client.widgets.layout.HLayout; +import com.smartgwt.client.widgets.layout.VLayout; + +import de.intevation.flys.client.client.FLYSImages; +import de.intevation.flys.client.client.FLYSMessages; + + +/** + * @author Ingo Weinzierl + */ +public class FLYSHeader extends HLayout { + + /** The interface that provides the image resources. */ + private FLYSImages IMAGES = GWT.create(FLYSImages.class); + + /** The interface that provides the message resources. */ + private FLYSMessages MESSAGES = GWT.create(FLYSMessages.class); + + /** The height used for this header.*/ + public static final int HEIGHT = 75; + + /** The height used for the images.*/ + public static final int IMG_HEIGHT = 50; + + + public FLYSHeader() { + init(); + } + + public void init() { + setWidth100(); + setHeight(HEIGHT); + setLayoutLeftMargin(5); + setLayoutRightMargin(5); + + ImageResource flysRes = IMAGES.logoFlys(); + ImageResource bfgRes = IMAGES.logoBfg(); + + Img flys = new Img( + flysRes.getURL(), + calcWidth(flysRes,IMG_HEIGHT), + IMG_HEIGHT); + + Img bfg = new Img( + bfgRes.getURL(), + calcWidth(bfgRes, IMG_HEIGHT), + IMG_HEIGHT); + + Label fullname = new Label(MESSAGES.fullname()); + fullname.setHeight(HEIGHT - IMG_HEIGHT); + + VLayout left = new VLayout(); + left.addMember(flys); + left.addMember(fullname); + + HLayout right = new HLayout(); + right.setAlign(Alignment.RIGHT); + right.addMember(bfg); + + addMember(left); + addMember(right); + } + + + /** + * This method calculates the wight of an image relative to the given + * height. + * + * @param res The ImageResource that points to the image. + * @param height The pre-defined height. + * + * @return the calculated width that should be used for the image. + */ + protected int calcWidth(ImageResource res, int height) { + int widthOrig = res.getWidth(); + int heightOrig = res.getHeight(); + + double factor = heightOrig / height; + double width = widthOrig / factor; + + return (int) width * 10 / 10; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r c19985f75118 -r e4155a6833a9 flys-client/src/main/webapp/FLYS.html --- a/flys-client/src/main/webapp/FLYS.html Mon Mar 07 13:47:55 2011 +0000 +++ b/flys-client/src/main/webapp/FLYS.html Tue Mar 08 15:15:59 2011 +0000 @@ -19,7 +19,7 @@ - Web Application Starter Project + FLYS-3.0