阅读:1476回复:0
mapxtreme问题,大家帮忙!
<P>问题不复杂,如下:</P>
<P>今天准备在jbuilder中开发mapxtreme,首先当然是按照开发文档进行。</P> <P>在</P> <P align=left><FONT face="Times New Roman">将 </FONT><B>MapXtreme Java Beans </B><FONT face="Times New Roman">添加到 </FONT><B>JBuilder 6 IDE<p></p></B></P> <P align=left><B>1. </B><FONT face="Times New Roman">在“文件”菜单中,单击新建,显示对象库。<p></p></FONT></P> <P align=left><B>2. </B><FONT face="Times New Roman">选择应用程序,然后单击确定。JBuilder 将创建一个带有标准示例应用程序的新<p></p></FONT></P> <P align=left><FONT face="Times New Roman">项目。<p></p></FONT></P> <P align=left><B>3. </B><FONT face="Times New Roman">单击设计选项卡,切换到 GUI 编辑模式。此时,右上部将出现一个归类的标签调<p></p></FONT></P> <P align=left><FONT face="Times New Roman">色板(Swing、Swing 容器等)。<p></p></FONT></P> <P align=left><B>4. </B><FONT face="Times New Roman">右键单击 </FONT><B>S</B><B>WING </B><FONT face="Times New Roman">选项卡,然后单击属性。此时将出现调色板对话框。<p></p></FONT></P> <P align=left><B>5. </B><FONT face="Times New Roman">单击添加以定义新页,提供页面的名称,例如 MapXtreme。<p></p></FONT></P> <P align=left><B>6. </B><FONT face="Times New Roman">在对话框左侧的“页面”列表中选择 MapXtreme 项目。<p></p></FONT></P> <P align=left><B>7. </B><FONT face="Times New Roman">单击添加组件选项卡。<p></p></FONT></P> <P align=left><B>8. </B><FONT face="Times New Roman">单击选择库按钮。此时将出现“选择其他库”对话框。<p></p></FONT></P> <P align=left><B>9. </B><FONT face="Times New Roman">单击新建按钮。此时将出现新建库向导。<p></p></FONT></P> <P align=left><B>10. </B><FONT face="Times New Roman">键入用于新库的名称,例如 mapxtreme_lib。<p></p></FONT></P> <P align=left><B>11. </B><FONT face="Times New Roman">单击添加按钮,然后选择 MapXtreme's lib/client/mxjbeans.jar 文件。“库路径”列表<p></p></FONT></P> <P align=left><FONT face="Times New Roman">现在应已包括 mxjbeans.jar。<p></p></FONT></P> <P align=left><B>12. </B><FONT face="Times New Roman">再次单击添加按钮,将目录添加到“库路径”列表 - MapXtreme lib/client 目录。<p></p></FONT></P> <P align=left><FONT face="Times New Roman">注: 务必只选择该目录。而不要展开该目录来显示其内容。<p></p></FONT></P> <P align=left><FONT face="Times New Roman">第 </FONT><B>7 </B><FONT face="Times New Roman">章</FONT><B>: MapXtreme JavaBeans<p></p></B></P> <P align=left><FONT face="Times New Roman">开发人员指南</FONT><B>121<p></p></B></P> <P align=left><B>13. </B><FONT face="Times New Roman">再次单击添加按钮,将以下 .jar 文件添加到“库路径”列表(大多数情况下均位<p></p></FONT></P> <P align=left><FONT face="Times New Roman">于 lib/common 目录中):mxj.jar、micsys.jar、miutil.jar、jdom.jar、xercesImpl.jar、<p></p></FONT></P> <P align=left><FONT face="Times New Roman">mxjtabdp.jar、mistyles.jar、mxjloc.jar 和 xml-apis.jar。<p></p></FONT></P> <P align=left><B>14. </B><FONT face="Times New Roman">单击确定,关闭新建库向导。<p></p></FONT></P> <P align=left><B>15. </B><FONT face="Times New Roman">确保选定新的 mapxtreme_lib 库,然后单击确定,关闭“选择其他库”对话框。<p></p></FONT></P> <P align=left><B>16. </B><FONT face="Times New Roman">在“组件过滤”框中,单击仅限 </FONT><B>J</B><B>AVA</B><B>B</B><B>EANS </B><FONT face="Times New Roman">选项。<p></p></FONT></P> <P align=left><B>17. </B><FONT face="Times New Roman">单击从所选库添加按钮。此时将出现“浏览类”对话框,显示以 com 为起始的<p></p></FONT></P> <P align=left><FONT face="Times New Roman">类树。<p></p></FONT></P> <P align=left><B>18. </B><FONT face="Times New Roman">展开 com 树形结构,直至看到 com.mapinfo.beans.vmapj 文件包的内容。选择<p></p></FONT></P> <P align=left><FONT face="Times New Roman">VisualMapJ 类,然后单击确定。此时将出现“结果”对话框,确认已经将<p></p></FONT></P> <P align=left><FONT face="Times New Roman">VisualMapJ 类添加到调色板。<p></p></FONT></P> <P align=left><B>19. </B><FONT face="Times New Roman">重复第16 步 和 第17 步,将更多 Java Beans 添加到调色板,但这次选择的不是<p></p></FONT></P> <P align=left><FONT face="Times New Roman">com.mapinfo.beans.vmapj.VisualMapJ 类,而是<p></p></FONT></P> <P align=left><FONT face="Times New Roman">com.mapinfo.beans.tools.MapToolBar。<p></p></FONT></P> <P align=left><B>20. </B><FONT face="Times New Roman">单击确定,关闭“调色板属性”对话框。<p></p></FONT></P> <P align=left><B>21. </B><FONT face="Times New Roman">在位于屏幕右上部的标签调色板区域,单击 MapXtreme 选项卡。(此时可能需要<p></p></FONT></P> <P align=left><FONT face="Times New Roman">滚动显示才能查看 MapXtreme 选项卡,具体取决于屏幕大小。)在 MapXtreme 调<p></p></FONT></P> <P align=left><FONT face="Times New Roman">色板中,可以看到对于每个已添加的 Java Beans,都会有一个相应的图标 - 本例<p></p></FONT></P> <P align=left><FONT face="Times New Roman">中的一个图标用于 VisualMapJ,另一个用于 MapToolBar。<p></p></FONT></P> <P align=left><FONT face="Times New Roman">在此可向调色板添加更多的 MapXtreme Java Beans,但是本例出于简化的目的,将只使用<p></p></FONT></P> <P align=left><FONT face="Times New Roman">VisualMapJ bean 和 MapToolBar bean。<p></p></FONT></P> <P align=left><FONT face="Times New Roman">在将 MapXtreme Java Beans 添加到 JBuilder 之后,即可使用相应的 beans 来基于 MapXtreme<p></p></FONT></P> <P align=left><FONT face="Times New Roman">Java beans 绘制 Swing 用户界面。<p></p></FONT></P> <P align=left><B>1. </B><FONT face="Times New Roman">在左侧较低的框中,单击标注为 contentPane (borderLayout) 的灰色矩形图标。<p></p></FONT></P> <P align=left><B>2. </B><FONT face="Times New Roman">单击 MapXtreme 组件调色板上的 VisualMapJ 图标。<p></p></FONT></P> <P align=left><B>3. </B><FONT face="Times New Roman">在表示应用程序的灰色矩形上绘制一个矩形。这一操作将 VisualMapJ 组件置于应<p></p></FONT></P> <P align=left><FONT face="Times New Roman">用程序之上(在 BorderLayout 的中点)。<p></p></FONT></P> <P align=left><B>4. </B><FONT face="Times New Roman">在左下侧选中了 VisualMapJ1 项之后,单击右侧的属性检查器面板中的<p></p></FONT></P> <P align=left><FONT face="Times New Roman">startupMapDef 属性的右侧。然后单击 </FONT><B>… </B><FONT face="Times New Roman">按钮,打开“开始 MapDef”对话框。<p></p></FONT></P> <P align=left><B>5. </B><FONT face="Times New Roman">单击更改起始地图定义按钮,然后选择 .mdf 文件,例如 world.mdf (位于<p></p></FONT></P> <P align=left><FONT face="Times New Roman">MapXtreme 的 examples/server/data 目录之下)。<p></p></FONT></P> <P align=left><B>6. </B><FONT face="Times New Roman">单击组件调色板上的 MapToolBar 图标。<p></p></FONT></P> <P align=left><B>7. </B><FONT face="Times New Roman">直接单击左下侧的框中 contentPane (borderLayout) 项。这一操作将 MapToolBar 置<p></p></FONT></P> <P align=left><FONT face="Times New Roman">于 BorderLayout 的“北方”点。<p></p></FONT></P> <P align=left><B>8. </B><FONT face="Times New Roman">在“运行”菜单,单击运行项目。此时将会启动应用程序,可用于查看地图并使<p></p></FONT></P> <P align=left><FONT face="Times New Roman">用 MapXtreme 的工具栏按钮与地图交互(放大等)。<p></p></FONT></P> <P>到最后几步往contentpanel里面添加VisualMapJ组件的时候问题出现了,</P> <P>1。添加地图定义</P> <P>错误提示:Warning: cannot set "startupMapDef" property for visualMapJ1 -- java.lang.IllegalArgumentException: argument type mismatch<BR>2。设置VisualMapJ属性的时候</P> <P>错误提示:Exception during paint(): java.lang.NoSuchMethodError: org.jdom.Element.addContent(Lorg/jdom/Element;)Lorg/jdom/Element;<BR>Exception during paint(): java.lang.NoSuchMethodError: org.jdom.Element.addContent(Lorg/jdom/Element;)Lorg/jdom/Element;<BR></P> <P>初学不久,很容易被各种小问题卡住,希望走过路过的,都能给小弟指点指点迷津,不胜感激!</P> |
|