从svg中删除转换或从svg路径获取Java awt组件

从svg中删除转换或从svg路径获取Java awt组件,java,swing,svg,awt,inkscape,Java,Swing,Svg,Awt,Inkscape,我有一个svg图像,其中多个路径元素按如下方式分组: <g id="gbase-7-2" transform="rotate(180,1066.40705,-904.8082)"> <path sodipodi:nodetypes="ccccc" id="basetroc-1-5-8" d="M 245.83838,-1232.793 308.95904,-1342.1212 498.32103,-1232.793 403.640

我有一个svg图像,其中多个路径元素按如下方式分组:

 <g
   id="gbase-7-2"
   transform="rotate(180,1066.40705,-904.8082)">
  <path
     sodipodi:nodetypes="ccccc"
     id="basetroc-1-5-8"
     d="M 245.83838,-1232.793 308.95904,-1342.1212 498.32103,-1232.793 403.64003,-1123.4648 Z"
     style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#ffcd9e;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
     inkscape:connector-curvature="0" />
  <path
     sodipodi:nodetypes="ccccc"
     id="basetroc-2-8-7"
     d="M 498.32103,-1232.793 687.6830099999998,-1123.4648 561.4416799999999,-1014.1366 403.6400299999999,-1123.4648 Z"
     style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#d18946;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
     inkscape:connector-curvature="0" />
 <path
         id="basetroc-1"
         d="M270.96338 617.6461C270.96338 617.6461 334.08404 508.3179 334.08404 508.3179C334.08404 508.3179 523.44603 617.6461 523.44603 617.6461C523.44603 617.6461 428.76503 726.9743 428.76503 726.9743C428.76503 726.9743 270.96338 617.6461 270.96338 617.6461C270.96338 617.6461 270.96338 617.6461 270.96338 617.6461"
         style="stroke-linejoin:miter;stroke-width:5.0;stroke-opacity:1;fill-opacity:1;color:#000000;fill-rule:nonzero;stroke-dashoffset:0;visibility:visible;stroke:#000000;stroke-linecap:butt;stroke-miterlimit:4;marker:none;stroke-dasharray:none;overflow:visible;enable-background:accumulate;display:inline;fill:#d18946" />

等等。每一条路都是棋盘上的一块区域。总体而言,所有组(以及路径)绘制一个六边形棋盘

现在我想知道每个字段的坐标,因为我想知道在Swing/AWT Java应用程序中单击哪个字段,背景是图片。问题是所有的组都通过旋转进行变换。 有没有办法得到每一块的“真实坐标”? 非常感谢:-)

我试图删除任何翻译: 它绘制了一个工作的svg,但路径如下所示:

 <g
   id="gbase-7-2"
   transform="rotate(180,1066.40705,-904.8082)">
  <path
     sodipodi:nodetypes="ccccc"
     id="basetroc-1-5-8"
     d="M 245.83838,-1232.793 308.95904,-1342.1212 498.32103,-1232.793 403.64003,-1123.4648 Z"
     style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#ffcd9e;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
     inkscape:connector-curvature="0" />
  <path
     sodipodi:nodetypes="ccccc"
     id="basetroc-2-8-7"
     d="M 498.32103,-1232.793 687.6830099999998,-1123.4648 561.4416799999999,-1014.1366 403.6400299999999,-1123.4648 Z"
     style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#d18946;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
     inkscape:connector-curvature="0" />
 <path
         id="basetroc-1"
         d="M270.96338 617.6461C270.96338 617.6461 334.08404 508.3179 334.08404 508.3179C334.08404 508.3179 523.44603 617.6461 523.44603 617.6461C523.44603 617.6461 428.76503 726.9743 428.76503 726.9743C428.76503 726.9743 270.96338 617.6461 270.96338 617.6461C270.96338 617.6461 270.96338 617.6461 270.96338 617.6461"
         style="stroke-linejoin:miter;stroke-width:5.0;stroke-opacity:1;fill-opacity:1;color:#000000;fill-rule:nonzero;stroke-dashoffset:0;visibility:visible;stroke:#000000;stroke-linecap:butt;stroke-miterlimit:4;marker:none;stroke-dasharray:none;overflow:visible;enable-background:accumulate;display:inline;fill:#d18946" />


我已经考虑过蜡染,但我不确定这是不是正确的工具,因为我只想知道坐标。也许这对你有用: