xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arvind Sareen" <arvind_sar...@hotmail.com>
Subject Checkbox in SVG
Date Thu, 01 Aug 2002 07:13:59 GMT

Hi

I am trying to embed checkbox in an svg file but I get an error whenever I 
try to write checkbox in the svg file.

Brief description of the code is that I have yellow rectangles which when 
clicked show change of state but at the same time I want to show the lines 
also which depict the colour of the lines to be displayed.
Instead of yellow rectangles, i want to have checkboxes over there.
Can anybody give a workaround or solution to the problem.
Below is the code of the svg file.


<%@ page language="java" import="java.net.*,itspri.*" 
errorPage="ErrorPageForCH.jsp"%>

<%  String sql = request.getParameter("sql");
    sql = URLEncoder.encode(sql);
    String sState = request.getParameter("State");

    itspri.UBPlotMap legend = new itspri.UBPlotMap();
    itspri.WidthColorParameter stateBoundary = 
legend.getStateBoundaryColor();
    itspri.WidthColorParameter countyBoundary = 
legend.getCountyBoundaryColor();
    itspri.WidthColorParameter indianReservation = 
legend.getIndianReservationColor();
    itspri.WidthColorParameter city = legend.getCityColor();
    itspri.WidthColorParameter majorRoute = legend.getMajorRouteColor();

%>
<svg id="leg" viewBox="0 0 300 550" zoomAndPan="disable">
  <desc>Legend for Montana State</desc>
  <rect id="all" style="fill:whitesmoke;stroke:black;stroke-width:0" x="0" 
y="0" width="100%" height="100%"/>
  <text style="font-size:16" x="10" y="15">ITS-PRI Legend</text>
  <line 
style="fill:none;stroke:RGB(<%=stateBoundary.sRed%>,<%=stateBoundary.sGreen%>,<%=stateBoundary.sBlue%>);stroke-width:2.50;stroke-linejoin:ROUND;stroke-linecap:ROUND;opacity:1"

x1="50" y1="57" x2="70" y2="57"/>
  <text style="font-size:13" x="80" y="60">State Boundary</text>
  <text style="font-size:11" x="80" y="75">Refresh</text>

  <%
     if (sState.equals("true"))
     {
  %>

  <rect id="cbx1_1" style="fill:yellow;stroke:black;stroke-width:1" x="20" 
y="52" width="10" height="10"/>
  <a><rect id="cbx1_0" onclick="onoff1('cbx1_0','State 
Boundary','<%=sql%>')" style="fill:yellow;stroke:black;stroke-width:1" 
x="50" y="68" width="8" height="8"/></a>
<%
     }
     else
     {
%>
  <rect id="cbx1_1" style="fill:white;stroke:black;stroke-width:1" x="20" 
y="52" width="10" height="10"/>
  <a><rect id="cbx1_0" onclick="onoff1('cbx1_0','State 
Boundary','<%=sql%>')" style="fill:yellow;stroke:black;stroke-width:1" 
x="50" y="68" width="8" height="8"/></a>
<%
     }
%>

  <line 
style="fill:none;stroke:RGB(<%=countyBoundary.sRed%>,<%=countyBoundary.sGreen%>,<%=countyBoundary.sBlue%>);stroke-width:2.50;stroke-linejoin:ROUND;stroke-linecap:ROUND;opacity:1"

x1="50" y1="97" x2="70" y2="97"/>
  <text style="font-size:13" x="80" y="100">County Boundary</text>
  <a><rect id="cbx2_0" onclick="onoff('cbx2_0','County Boundary')" 
style="fill:yellow;stroke:black;stroke-width:1" x="20" y="92" width="10" 
height="10"/></a>
  <line 
style="fill:none;stroke:RGB(<%=indianReservation.sRed%>,<%=indianReservation.sGreen%>,<%=indianReservation.sBlue%>);stroke-width:2.50;stroke-linejoin:ROUND;stroke-linecap:ROUND;opacity:1"

x1="50" y1="137" x2="70" y2="137"/>
  <text style="font-size:13" x="80" y="140">Indian Reservation</text>
  <a><rect id="cbx3_0" onclick="onoff('cbx3_0','Indian Reservation')" 
style="fill:yellow;stroke:black;stroke-width:1" x="20" y="130" width="10" 
height="10"/></a>
  <line 
style="fill:none;stroke:RGB(<%=city.sRed%>,<%=city.sGreen%>,<%=city.sBlue%>);stroke-width:0.63;stroke-linejoin:ROUND;stroke-linecap:ROUND;opacity:1"

x1="50" y1="175" x2="70" y2="175"/>
  <text style="font-size:13" x="80" y="180">Cities</text>
  <a><rect id="cbx4_0" onclick="onoff('cbx4_0','Cities')" 
style="fill:yellow;stroke:black;stroke-width:1" x="20" y="170" width="10" 
height="10"/></a>
  <line 
style="fill:none;stroke:RGB(<%=majorRoute.sRed%>,<%=majorRoute.sGreen%>,<%=majorRoute.sBlue%>);stroke-width:2.50;stroke-linejoin:ROUND;stroke-linecap:ROUND;opacity:1"

x1="50" y1="215" x2="70" y2="215"/>
  <text style="font-size:13" x="80" y="220">Major Routes</text>
  <a><rect id="cbx5_0" onclick="onoff('cbx5_0','Major Routes')" 
style="fill:yellow;stroke:black;stroke-width:1" x="20" y="210" width="10" 
height="10"/></a>
</svg>


Regards

Arvind

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message