Mercurial > dive4elements > river
changeset 27:e4155a6833a9
Integrated a header that contains a FLYS and a BfG logo.
flys-client/trunk@1427 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 08 Mar 2011 15:15:59 +0000 |
parents | c19985f75118 |
children | dfdb927b137d |
files | flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java flys-client/src/main/java/de/intevation/flys/client/client/FLYSImages.java flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages.java flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_de.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_en.properties flys-client/src/main/java/de/intevation/flys/client/client/images/bfg_logo.gif flys-client/src/main/java/de/intevation/flys/client/client/images/flys_logo.gif flys-client/src/main/java/de/intevation/flys/client/client/ui/FLYSHeader.java flys-client/src/main/webapp/FLYS.html |
diffstat | 10 files changed, 143 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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 <ingo@intevation.de> + + * 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 <ingo@intevation.de> * src/main/java/de/intevation/flys/client/client/services/CreateCollectionService.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);
--- /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 <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +public interface FLYSImages extends ClientBundle { + + @Source("images/bfg_logo.gif") + ImageResource logoBfg(); + + @Source("images/flys_logo.gif") + ImageResource logoFlys(); +}
--- 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);
--- 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
--- 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
Binary file flys-client/src/main/java/de/intevation/flys/client/client/images/bfg_logo.gif has changed
Binary file flys-client/src/main/java/de/intevation/flys/client/client/images/flys_logo.gif has changed
--- /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 <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +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 :
--- 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 @@ <!-- --> <!-- Any title is fine --> <!-- --> - <title>Web Application Starter Project</title> + <title>FLYS-3.0</title> <!-- --> <!-- This script loads your compiled module. -->