如何确定h:graphicImage中不同区域的坐标

问题描述

我正在编写一个类似于 Java EE 教程中 dukes-bookstore 案例研究的 JSF 应用程序。在 dukes-bookstore 示例中,h:graphicImage 由 6 个区域组成,每个区域在 index.xhtml 页面显示一本书。每个区域的坐标都硬编码在应用程序配置资源文件 faces-config.xml 中。以下代码显示了托管 bean 元素的声明,这些元素捕获 h:graphicImage 的每个区域的坐标、形状和替代文本。

<managed-bean eager="true">
        <description>
            Causes the default VariableResolver implementation to instantiate the 
            managed bean Book201 of the class components.model.ImageArea in application 
            scope if the bean does not already exist in any scope,and initialize the
            shape,alt,and coords properties with the values specified by the
            managed-property elements.
        </description>
        <managed-bean-name>Book201</managed-bean-name>
        <managed-bean-class>javaeetutorial.dukesbookstore.model.ImageArea</managed-bean-class>
        <managed-bean-scope>application</managed-bean-scope>
        <managed-property>
            <description>
                Initializes the shape property of the managed bean Book201 with the value 
                rect.
            </description>
            <property-name>shape</property-name>
            <value>rect</value>
        </managed-property>
        <managed-property>
            <description>
                Initializes the alt property of the managed bean Book201 with the value 
                Duke.
            </description>
            <property-name>alt</property-name>
            <value>Duke</value>
        </managed-property>
        <managed-property>
            <description>
                Initializes the coords property of the managed bean Book201 with the value 
                specified by the value element. 
            </description>
            <property-name>coords</property-name>
            <value>67,23,212,268</value>
        </managed-property>
    </managed-bean>
...........................
...........................

本教程没有解释坐标 (67,268) 是如何计算的,所以我想知道如何为我的应用程序确定这样的坐标(我的应用程序中的 h:graphicImage 由几个自动部件组成)?

谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)