Author: SergeySmirnov
Date: 2007-07-16 22:15:07 -0400 (Mon, 16 Jul 2007)
New Revision: 1651
Added:
trunk/samples/virtualEarth-sample/
trunk/samples/virtualEarth-sample/src/
trunk/samples/virtualEarth-sample/src/main/
trunk/samples/virtualEarth-sample/src/main/java/
trunk/samples/virtualEarth-sample/src/main/java/demo/
trunk/samples/virtualEarth-sample/src/main/java/demo/Bean.java
trunk/samples/virtualEarth-sample/src/main/resources/
trunk/samples/virtualEarth-sample/src/main/resources/japanCherry.skin.properties
trunk/samples/virtualEarth-sample/src/main/webapp/
trunk/samples/virtualEarth-sample/src/main/webapp/META-INF/
trunk/samples/virtualEarth-sample/src/main/webapp/META-INF/MANIFEST.MF
trunk/samples/virtualEarth-sample/src/main/webapp/WEB-INF/
trunk/samples/virtualEarth-sample/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/virtualEarth-sample/src/main/webapp/WEB-INF/faces-config.xml.l4t
trunk/samples/virtualEarth-sample/src/main/webapp/WEB-INF/web.xml
trunk/samples/virtualEarth-sample/src/main/webapp/index.jsp
trunk/samples/virtualEarth-sample/src/main/webapp/virtualEarth.xhtml
Log:
virtual earth sample
Added: trunk/samples/virtualEarth-sample/src/main/java/demo/Bean.java
===================================================================
--- trunk/samples/virtualEarth-sample/src/main/java/demo/Bean.java
(rev 0)
+++ trunk/samples/virtualEarth-sample/src/main/java/demo/Bean.java 2007-07-17 02:15:07 UTC
(rev 1651)
@@ -0,0 +1,41 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package demo;
+
+public class Bean {
+ String zoom;
+
+public String getZoom() {
+ return zoom;
+}
+
+public void setZoom(String zoom) {
+ this.zoom = zoom;
+}
+
+public String act() {
+ zoom = "17";
+ System.out.println("zoom="+zoom);
+ return null;
+}
+
+}
Added: trunk/samples/virtualEarth-sample/src/main/resources/japanCherry.skin.properties
===================================================================
--- trunk/samples/virtualEarth-sample/src/main/resources/japanCherry.skin.properties
(rev 0)
+++
trunk/samples/virtualEarth-sample/src/main/resources/japanCherry.skin.properties 2007-07-17
02:15:07 UTC (rev 1651)
@@ -0,0 +1,35 @@
+# render.kit=HTML_BASIC
+#Colors
+headerBackgroundColor=#E8BDBD
+headTextColor=#980808
+selectBackgroundColor=#d9E0E0
+generalBackgroundColor=#F8ECEC
+generalTextColor=#000000
+panelTextColor=#000000
+shadowBackgroundColor=#AFB1B2
+shadowOpacity=2
+tableBorderColor=#C0C0C0
+tableBackgroundColor=#ffffff
+selectControlColor=#980808
+controlBorderColor=#DFA5A5
+interfaceLevel3D=10
+overAllBackground=#ffffff
+generalLinkColor=#980808
+hoverLinkColor=#E10000
+visitedLinkColor=#c0c0c0
+# Fonts
+headerSizeFont=12px
+headerFamilyFont=Arial, Verdana, sans-serif
+tabSizeFont=11
+tabFamilyFont=Arial, Verdana, sans-serif
+buttonSizeFont=12
+buttonFamilyFont=Arial, Verdana, sans-serif
+buttonRadiusCorner=12
+panelRadiusCorner=5
+tabRadiusCorner=5
+
+# Preferable
+preferablePanelBodyPadding=0px 0px 0px 0px
+preferableDataSizeFont=11px
+preferableDataFamilyFont=Arial, Verdana, sans-serif
+preferableHeaderWeightFont=bold
Added: trunk/samples/virtualEarth-sample/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- trunk/samples/virtualEarth-sample/src/main/webapp/META-INF/MANIFEST.MF
(rev 0)
+++ trunk/samples/virtualEarth-sample/src/main/webapp/META-INF/MANIFEST.MF 2007-07-17
02:15:07 UTC (rev 1651)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: trunk/samples/virtualEarth-sample/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/virtualEarth-sample/src/main/webapp/WEB-INF/faces-config.xml
(rev 0)
+++ trunk/samples/virtualEarth-sample/src/main/webapp/WEB-INF/faces-config.xml 2007-07-17
02:15:07 UTC (rev 1651)
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces
Config 1.0//EN"
+
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
+<faces-config>
+ <managed-bean>
+ <managed-bean-name>bean</managed-bean-name>
+ <managed-bean-class>demo.Bean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ <managed-property>
+ <property-name>zoom</property-name>
+ <property-class>java.lang.String</property-class>
+ <value>10</value>
+ </managed-property>
+ </managed-bean>
+</faces-config>
Added: trunk/samples/virtualEarth-sample/src/main/webapp/WEB-INF/faces-config.xml.l4t
===================================================================
--- trunk/samples/virtualEarth-sample/src/main/webapp/WEB-INF/faces-config.xml.l4t
(rev 0)
+++
trunk/samples/virtualEarth-sample/src/main/webapp/WEB-INF/faces-config.xml.l4t 2007-07-17
02:15:07 UTC (rev 1651)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<PROCESS ENTITY="JSFProcess">
+ <PROCESS-ITEM ENTITY="JSFProcessGroup" NAME="rules:#panel.xhtml"
+ PATH="/panel.xhtml" SHAPE="98,111,0,0"
persistent="true"/>
+ <PROCESS-ITEM ENTITY="JSFProcessGroup" NAME="rules:#gmap.xhtml"
+ PATH="/gmap.xhtml" SHAPE="63,198,0,0"
persistent="true"/>
+</PROCESS>
Added: trunk/samples/virtualEarth-sample/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/samples/virtualEarth-sample/src/main/webapp/WEB-INF/web.xml
(rev 0)
+++ trunk/samples/virtualEarth-sample/src/main/webapp/WEB-INF/web.xml 2007-07-17 02:15:07
UTC (rev 1651)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <description>Richfaces virtualEarth Sample</description>
+ <display-name>virtualEarth-sample</display-name>
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.REFRESH_PERIOD</param-name>
+ <param-value>2</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>client</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.validateXml</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.verifyObjects</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.SKIN</param-name>
+ <param-value>japanCherry</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
+ <param-value>com.sun.facelets.FaceletViewHandler</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <filter>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-name>ajax4jsf</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>ajax4jsf</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Added: trunk/samples/virtualEarth-sample/src/main/webapp/index.jsp
===================================================================
--- trunk/samples/virtualEarth-sample/src/main/webapp/index.jsp
(rev 0)
+++ trunk/samples/virtualEarth-sample/src/main/webapp/index.jsp 2007-07-17 02:15:07 UTC
(rev 1651)
@@ -0,0 +1,7 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head></head>
+ <body>
+ <jsp:forward page="virtualEarth.jsf" />
+ </body>
+</html>
\ No newline at end of file
Added: trunk/samples/virtualEarth-sample/src/main/webapp/virtualEarth.xhtml
===================================================================
--- trunk/samples/virtualEarth-sample/src/main/webapp/virtualEarth.xhtml
(rev 0)
+++ trunk/samples/virtualEarth-sample/src/main/webapp/virtualEarth.xhtml 2007-07-17
02:15:07 UTC (rev 1651)
@@ -0,0 +1,82 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:ve="http://labs.jboss.com/jbossrichfaces/ui/virtualEarth"
+
xmlns:a4j="http://richfaces.org/ajax">
+
+ <f:view contentType="text/html" >
+
+ <body>
+
+
+ <h:panelGrid columns="2">
+ <ve:virtualEarth style="width:800px;" id="gm"
lat="37.97" dashboardSize="Normal" zoom="#{bean.zoom}"
mapStyle="Hybrid" var="map" />
+
+
+ <!-- client side solution -->
+ <h:panelGroup>
+ Dashboard:<br />
+ <a href="javascript:void(0);" onclick="map.HideDashboard();return
false;">Remove</a>
+ <a href="javascript:void(0);" onclick="map.ShowDashboard();return
false;">Show</a>
+ <br /><br />
+ Type:<br/>
+ <a href="javascript:void(0);"
onclick="map.SetMapStyle(VEMapStyle.Road);return false;">Road</a>
+ <a href="javascript:void(0);"
onclick="map.SetMapStyle(VEMapStyle.Aerial);return false;">Aerial</a>
+ <a href="javascript:void(0);"
onclick="map.SetMapStyle(VEMapStyle.Hybrid);return false;">Hybrid</a>
+ <a href="javascript:void(0);"
onclick="map.SetMapStyle(VEMapStyle.Birdseye);return
false;">Birdseye</a>
+ <br /><br />
+ Zoom:<br/>
+ <a href="javascript:void(0);" onclick="map.ZoomIn();return
false;">In</a>
+ <a href="javascript:void(0);" onclick="map.ZoomOut();return
false;">Out</a>
+ <br /><br />
+ <a href="javascript:void(0);" onclick="showExadel();return
false;">Show Exadel Office</a>
+
+ </h:panelGroup>
+
+
+ <!-- client side solution -->
+ <h:form>
+
+ </h:form>
+
+</h:panelGrid>
+
+ <a4j:outputPanel id="zoomer">
+ <script>
+ function zoomIt() {
+ map.setZoom(#{bean.zoom});
+ }
+ </script>
+ </a4j:outputPanel>
+
+ <a4j:outputPanel>
+ <script>
+
+ function createMarker(point,html) {
+ var marker = new GMarker(point);
+ GEvent.addListener(marker, "click", function() {
+ marker.openInfoWindowHtml(html);
+ });
+ return marker;
+ }
+
+
+
+ function showExadel() {
+
+ var point = new VELatLong(37.9721046, -122.0424842834);
+ map.SetCenterAndZoom(point, 16);
+ map.SetMapStyle(VEMapStyle.Birdseye);
+
+ }
+
+
+ </script>
+ </a4j:outputPanel>
+
+ </body>
+</f:view>
+</html>