Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
未触发在JavaFX WebView onclick事件上呈现SVG路径元素_Svg_Javafx_Inkscape_Javafx Webengine - Fatal编程技术网

未触发在JavaFX WebView onclick事件上呈现SVG路径元素

未触发在JavaFX WebView onclick事件上呈现SVG路径元素,svg,javafx,inkscape,javafx-webengine,Svg,Javafx,Inkscape,Javafx Webengine,我有一个带有嵌入式webView组件的javafx应用程序(jdk1.8.072) 我有一个由inkscape工具创建的svg: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!-- Created with Inkscape (http://www.inkscape.org/) --> <svg xmlns:osb="http://www.openswatchbook.org/uri/2009

我有一个带有嵌入式webView组件的javafx应用程序(jdk1.8.072)

我有一个由inkscape工具创建的svg:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
   xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   id="svg2"
   version="1.1"
   inkscape:version="0.91 r13725"
   width="1920"
   height="600"
   viewBox="0 0 1920 600"
   sodipodi:docname="prova_link.svg">
  <metadata
     id="metadata8">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title />
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <defs
     id="defs6">
    <linearGradient
       id="linearGradient4288"
       osb:paint="solid">
      <stop
         style="stop-color:#ff0000;stop-opacity:1;"
         offset="0"
         id="stop4290" />
    </linearGradient>
    <linearGradient
       inkscape:collect="always"
       id="linearGradient4210">
      <stop
         style="stop-color:#00ff00;stop-opacity:1;"
         offset="0"
         id="stop4212" />
      <stop
         style="stop-color:#00ff00;stop-opacity:0;"
         offset="1"
         id="stop4214" />
    </linearGradient>
    <inkscape:perspective
       sodipodi:type="inkscape:persp3d"
       inkscape:vp_x="78.642594 : 273.36913 : 1"
       inkscape:vp_y="0 : 967.24275 : 0"
       inkscape:vp_z="837.94953 : 273.36913 : 1"
       inkscape:persp3d-origin="458.29604 : 176.64486 : 1"
       id="perspective4153" />
    <linearGradient
       inkscape:collect="always"
       xlink:href="#linearGradient4210"
       id="linearGradient4216"
       x1="166.32027"
       y1="80.578522"
       x2="526.18355"
       y2="80.578522"
       gradientUnits="userSpaceOnUse" />
  </defs>
  <sodipodi:namedview
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1"
     objecttolerance="10"
     gridtolerance="10"
     guidetolerance="10"
     inkscape:pageopacity="0"
     inkscape:pageshadow="2"
     inkscape:window-width="1920"
     inkscape:window-height="1018"
     id="namedview4"
     showgrid="false"
     inkscape:zoom="0.80666667"
     inkscape:cx="67.403168"
     inkscape:cy="460.14918"
     inkscape:window-x="1358"
     inkscape:window-y="-8"
     inkscape:window-maximized="1"
     inkscape:current-layer="svg2" />
  <path
     sodipodi:type="star"
     style="opacity:1;fill:#fa0000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:82.125;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
     id="path4143"
     sodipodi:sides="5"
     sodipodi:cx="75.619835"
     sodipodi:cy="203.30579"
     sodipodi:r1="50.034138"
     sodipodi:r2="31.917227"
     sodipodi:arg1="0.7328151"
     sodipodi:arg2="1.3611336"
     inkscape:flatsided="false"
     inkscape:rounded="0"
     inkscape:randomized="0"
     d="M 112.80992,236.77686 82.262768,234.52406 55.27932,249.01879 47.982269,219.27057 25.858623,198.0869 51.895946,181.95429 65.20623,154.36734 l 23.389002,19.77771 30.349848,4.134 -11.58212,28.35591 z"
     inkscape:transform-center-x="3.2179809"
     inkscape:transform-center-y="-1.6127244"
     onclick="javascript:alert(&quot;HELLO&quot;);" />
  <rect
     style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:82.125;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
     id="rect4161"
     width="92.975204"
     height="50.826447"
     x="226.8595"
     y="74.380165" />
  <rect
     style="opacity:1;fill:#de8787;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:82.125;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
     id="rect4163"
     width="140.08264"
     height="90.495865"
     x="388.01654"
     y="259.09091" />
  <path
     style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:5px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
     d="M 296.29601,125.20661 417.1976,259.09091"
     id="path4165"
     inkscape:connector-type="polyline"
     inkscape:connector-curvature="100"
     inkscape:connection-start="#rect4161"
     inkscape:connection-end="#rect4163"
     onclick="javascript:alert(&quot;HELLO&quot;);" />
</svg>

image/svg+xml
id为“path4143”的路径表示一个“星形”

id为“path4165”的路径表示使用“连接器实用程序”创建的“链接”

在chrome、explorer和firefox上加载此svg时,两个svg元素上的onclick事件被正确触发

在javafx应用程序的webEngine组件上加载相同的svg时,不会触发“链接”上的onclick事件

这似乎是JavaFXWebEngine上的一个bug。 有人能帮我吗?

谢谢

也许它只记录填充的点击,而不记录笔划。这两种方法都可以。我尝试在路径(关闭路径)中添加“Z命令”,在样式属性中添加#000000填充,但什么都不做。我尝试在路径(关闭路径)中添加“Z命令”,在样式属性中添加“#000000填充”,但什么都不做。当我向“M命令”添加一些负值时,单击仅在形状的一部分上注册。形状明显改变了,这对我不好。绘制一个矩形形状,使填充与当前线条的笔划匹配。可能它只注册填充上的单击,而不注册笔划。这两种方法都可以。我尝试在路径(关闭路径)中添加“Z命令”,在样式属性中添加#000000填充,但什么都不做。我尝试在路径(关闭路径)中添加“Z命令”,在样式属性中添加“#000000填充”,但什么都不做。当我向“M命令”添加一些负值时,单击仅在形状的一部分上注册。形状明显改变了,这对我不好。画一个矩形形状,使填充与当前线条的笔划相匹配。