<%-- 
 * Licensed Materials - Property of Perforce Software, Inc.
 * © Copyright Perforce Software, Inc. 2014, 2018
 * © Copyright IBM Corp. 2009, 2014
 * © Copyright ILOG 1996, 2009
 * All Rights Reserved.
 *
 * Note to U.S. Government Users Restricted Rights:
 * The Software and Documentation were developed at private expense and
 * are "Commercial Items" as that term is defined at 48 CFR 2.101,
 * consisting of "Commercial Computer Software" and
 * "Commercial Computer Software Documentation", as such terms are
 * used in 48 CFR 12.212 or 48 CFR 227.7202-1 through 227.7202-4,
 * as applicable.
 --%>
<%@ page contentType="text/html;charset=UTF-8pageEncoding="UTF-8"%>

<%-- JSF Tag libraries --%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://www.ilog.com/jviews/tlds/jviews-faces.tld"
 prefix="jv"%>
<%@ taglib
        uri="http://www.ilog.com/jviews/tlds/jviews-framework-faces.tld"
 prefix="jvf"%>
<%@ taglib
        uri="http://www.ilog.com/jviews/tlds/jviews-diagrammer-faces.tld"
 prefix="jvdf"%>
<%@ taglib uri="http://www.ilog.com/jviews/tlds/jviews-maps-faces.tld"
 prefix="jvmf"%>
<%@ taglib uri="WEB-INF/sampletags.tld" prefix="jvs"%>

<%-- JSF Page content --%>
<f:view locale="#{localeBean.locale}">
        <%-- Internationalisation options --%>
        <f:loadBundle basename="demo.messagesvar="msg/>
        <html>
        <head>
        <title>JViews Maps Faces Sample</title>
        <%-- Note:title is overwritten later --%>
        <link href="data/style.cssrel="stylesheettype="text/css/>
        <meta content="no-cachehttp-equiv="Cache-Control/>
        <meta content="no-cachehttp-equiv="Pragma/>
        <meta http-equiv="Content-Typecontent="text/html; charset=UTF-8/>
        </head>
        <body bgcolor="white">
        <%--  internationalisation of javascript generated elements --%>
        <jvs:javaScriptVariable var="property_i18n_label"
                value="#{msg.property_message}/>
        <jvs:javaScriptVariable var="value_i18n_label"
                value="#{msg.value_message}/>
        <jvs:javaScriptVariable var="commit_i18n_label"
                value="#{msg.commit_message}/>
        <jvs:javaScriptVariable var="cancel_i18n_label"
                value="#{msg.cancel_message}/>
        <jvs:javaScriptVariable var="title_i18n_label"
                value="#{msg.page_title}/>
        <jvs:javaScriptVariable var="none_i18n_label"
                value="#{msg.no_selection}/>
        <jvs:javaScriptVariable var="selection_i18n_label"
                value="#{msg.selection_label}/>
                
        <script type="text/javascript" src="data/scripts.js"></script>
        
        <%-- Input page options --%>
        <h:form id="up_form">
                <h:panelGrid columns="20" rowClasses="tdc">
                        <%-- Locale selection --%>
                        <h:outputText value="#{msg.locale_choice}" styleClass="text" />
                        <h:selectOneMenu
                                onchange="document.getElementById('up_form:submit').click();"
                                immediate="truevalue="#{localeBean.locale}"
                                styleClass="little-text">
                                <f:selectItem itemValue="en_USitemLabel="English/>
                                <f:selectItem itemValue="ja_JPitemLabel="Japanese/>
                        </h:selectOneMenu>
                        <h:outputText value="#{msg.project_choice}styleClass="text/>
                        <%-- Project selection --%>
                        <h:selectOneMenu id="projonchange="submit()"
                                value="#{projectBean.project}styleClass="little-text">
                                <f:selectItem itemValue="/data/weather.idpritemLabel="#{msg.map1}/>
                                <f:selectItem itemValue="/data/usa.idpritemLabel="#{msg.map2}/>
                                <f:selectItem itemValue="/data/usa.ivlitemLabel="#{msg.map3}/>
                                <f:selectItem itemValue="nullitemLabel="#{msg.map4}/>
                        </h:selectOneMenu>
                        <%-- View Size Selection --%>
                        <h:outputText value="#{msg.size_choice}styleClass="text/>
                        <h:selectOneMenu onchange="submit()"
                                value="#{viewConfigurationBean.size}styleClass="little-text">
                                <f:selectItem itemValue="400x200"
                                        itemLabel="#{msg.small_size_label}/>
                                <f:selectItem itemValue="800x400"
                                        itemLabel="#{msg.medium_size_label}/>
                                <f:selectItem itemValue="1600x800itemLabel="#{msg.big_size_label}/>
                        </h:selectOneMenu>
                        <%-- Tiling setting --%>
                        <h:outputText value="#{msg.tiling_choice}styleClass="text/>
                        <h:selectBooleanCheckbox id="checkbox"
                                value="#{viewConfigurationBean.tiling}onchange="submit()/>
                        <h:commandButton id="submitvalue="OKaction="show"
                                styleClass="little-text/>
                </h:panelGrid>
        </h:form>
        <HR />
        <%-- Main page --%>
        <h:form>
                <%-- View Interactors Definitions --%>
                <jvf:zoomInteractor id="zoomInteractorlineColor="#D00000/>
                <jvf:panInteractor id="panInteractor/>
                <jvdf:selectInteractor id="selectInteractor/>
                <jvf:tooltipInteractor id="tooltipInteractor"
                        template="tooltipCallback/>
                <jvf:highlightInteractor id="hightlightcolor="yellow"></jvf:highlightInteractor>
                <jv:interactorGroup id="selectHighlight"
                        interactors="selectInteractor tooltipInteractor panInteractor hightlight"></jv:interactorGroup>
                <%-- Page content --%>
                <h:panelGrid columns="3">
                        <%-- Button toolbar --%>
                        <h:panelGrid styleClass="bordercellpadding="0cellspacing="0">
                                <h:panelGrid>
                                        <jv:imageButton id="selectButtonstyleClass="button"
                                                buttonGroupId="interactors"
                                                onclick="setInteractor(selectHighlight)selected="true"
                                                image="images/arrow.gifrolloverImage="images/arrowh.gif"
                                                selectedImage="images/arrowd.giftitle="#{msg.select_tooltip}"
                                                message="#{msg.select_message}messageBoxId="messages/>
                                        <f:verbatim>
                                                <HR />
                                        </f:verbatim>

                                        <jv:imageButton id="zoomInButtonstyleClass="button"
                                                selected="falseonclick="mapID.zoomIn()image="images/zoom.gif"
                                                rolloverImage="images/zoomh.gifselectedImage="images/zoomd.gif"
                                                title="#{msg.zoomin_tooltip}message="#{msg.zoomin_message}"
                                                messageBoxId="messages/>

                                        <jv:imageButton id="zoomOutButtonstyleClass="button"
                                                selected="falseonclick="mapID.zoomOut()"
                                                image="images/unzoom.gifrolloverImage="images/unzoomh.gif"
                                                selectedImage="images/unzoomd.giftitle="#{msg.zoomout_tooltip}"
                                                message="#{msg.zoomout_message}messageBoxId="messages/>

                                        <jv:imageButton id="zoomRectButtonstyleClass="button"
                                                selected="falseonclick="setInteractor(zoomInteractor)"
                                                buttonGroupId="interactorsimage="images/zoomrect.gif"
                                                rolloverImage="images/zoomrecth.gif"
                                                selectedImage="images/zoomrectd.gif"
                                                title="#{msg.zoomarea_tooltip}message="#{msg.zoomarea_message}"
                                                messageBoxId="messages/>

                                        <jv:imageButton id="showAllButtonstyleClass="button"
                                                selected="falseonclick="mapID.showAll()"
                                                image="images/zoomfit.gifrolloverImage="images/zoomfith.gif"
                                                selectedImage="images/zoomfitd.giftitle="#{msg.showall_tooltip}"
                                                message="#{msg.showall_message}messageBoxId="messages/>

                                        <f:verbatim>
                                                <HR />
                                        </f:verbatim>
                                        <jv:imageButton styleClass="buttonselected="false"
                                                onclick="setCreateNodeInteractor()buttonGroupId="interactors"
                                                image="images/add.gifrolloverImage="images/addh.gif"
                                                selectedImage="images/addd.giftitle="#{msg.add_tooltip}"
                                                message="#{msg.add_message}messageBoxId="messages"
                                                enabled="#{projectBean.editable}/>
                                        <jv:imageButton id="deleteButtonstyleClass="button"
                                                selected="falseonclick="deleteIt()image="images/delete.gif"
                                                rolloverImage="images/deleteh.gif"
                                                selectedImage="images/deleted.giftitle="#{msg.delete_tooltip}"
                                                message="#{msg.delete_message}messageBoxId="messages/>
                                        <f:verbatim>
                                                <HR />
                                        </f:verbatim>
                                        <jv:imageButton id="startButtonstyleClass="button"
                                                selected="falseonclick="startStopTimer()"
                                                image="images/start.gifrolloverImage="images/starth.gif"
                                                title="#{msg.animate_tooltip}message="#{msg.animate_message}"
                                                messageBoxId="messagesenabled="#{projectBean.editable}/>
                                </h:panelGrid>
                        </h:panelGrid>
                        <h:panelGrid cellpadding="0cellspacing="0">
                                <h:panelGrid columns="1cellpadding="0cellspacing="0"
                                        styleClass="border">
                                        <%-- Main view --%>
                                        <jvs:panel style="#{viewConfigurationBean.panelStyle}">
                                                <jvmf:mapView id="mapID"
                                                        style="position:absolute;left:0px;top:0px"
                                                        interactorId="selectHighlight"
                                                        width="#{viewConfigurationBean.width}"
                                                        height="#{viewConfigurationBean.height}editable="true"
                                                        data="#{projectBean.project}servlet="demo.UpdatingServlet"
                                                        waitingImage="images/wait.gif"
                                                        tileSize="#{viewConfigurationBean.tileSize}"
                                                        tileManager="#{projectBean.tileManager}"
                                                        hitmapLayers="SymbolszoomLevels="1,2,8,16,64,256,1024"
                                                        onImageLoaded="updateZoomMenuItems(view)"
                                                        accessible="true">
                                                        <%-- Selection management --%>
                                                        <f:facet name="selectionManager">
                                                                <jvdf:selectionManager imageMode="false"
                                                                        propertyAccessor="#{selectionProviderBean.propertyAccessor}"
                                                                        forceUpdateProperties="true"
                                                                        onSelectionChanged="displaySelection()lineColor="#498CEE"
                                                                        lineWidth="2/>
                                                        </f:facet>
                                                        <%-- Pop-up menu --%>
                                                        <jvf:contextualMenu>
                                                                <jv:menu label="root">
                                                                        <!--
                                                              <jv:menuItem label="#{msg.pan_message}image="images/pan.gifonclick="panButton.doClick()/>
                                                                -->
                                                                        <jv:menuItem label="#{msg.zoomin_message}"
                                                                                image="images/zoom.gifonclick="mapID.zoomIn(true)/>
                                                                        <jv:menuItem label="#{msg.zoomout_message}"
                                                                                image="images/unzoom.gifonclick="mapID.zoomOut(true)/>
                                                                        <jv:menuItem label="#{msg.edit_message}"
                                                                                image="images/edit.gifonclick="editSelection()"
                                                                                invocationContext="IMAGE_SERVLET_CONTEXT/>
                                                                </jv:menu>
                                                        </jvf:contextualMenu>
                                                </jvmf:mapView>
                                                <jvf:overview id="overviewviewId="mapID"
                                                        style="#{viewConfigurationBean.overviewStyle}"
                                                        messageBoxId="messages/>
                                                <%-- Interactive panning tool --%>
                                                <jvf:panTool id="panToolviewId="mapID"
                                                        style="#{viewConfigurationBean.panToolStyle}"
                                                        messageBoxId="messages/>
                                        </jvs:panel>
                                </h:panelGrid>
                                <%-- Status information --%>
                                <jv:messageBox id="messagesstyleClass="textstyle="height:20px"
                                        width="#{viewConfigurationBean.width}/>

                        </h:panelGrid>
                        <h:panelGrid cellpadding="0cellspacing="0"
                                columnClasses="padding-bottom">
                                <%-- Overview 
            
             --%>
                                <%-- Layer visibility control --%>
                                <jvmf:layerTool id="layerTool"
                                        title="#{msg.layer_selection_tooltip}"
                                        message="#{msg.layer_selection_message}"
                                        styleClass="layerToolStyleviewId="mapIDmessageBoxId="messages"
                                        enabled="true/>
                                <%-- Selection Properties table --%>
                                <f:verbatim>
                                        <span id="tableId"> </span>
                                </f:verbatim>
                                <f:verbatim>
                                        <span id="spanId"> </span>
                                </f:verbatim>
                                <%-- Main view --%>
                                <h:commandButton id="clearCacheButton"
                                        actionListener="#{projectBean.clearServerCache}"
                                        value="#{msg.clearcache_message}title="#{msg.clearcache_tooltip}"
                                        disabled="#{projectBean.noProjectLoaded}/>
                        </h:panelGrid>
                </h:panelGrid>


        </h:form>
</body>
        </html>

</f:view>