Not yet ready for use. APIs subject to change without notice

本文介绍如何在Tapestry4.1中创建自定义Dojo组件,并解决运行时出现的未准备好使用API警告。通过具体代码示例展示了组件的实现过程。
在tapestry4.1中创建自己的jodo组件,运行的时候,有这样的提示,Not yet ready for use. APIs subject to change without notice不知道是什么东东,有哪位可以指教一下,代码如下
Circles.script
xml 代码
 
  1. xml version="1.0"?>  
  2.   "-//Apache Software Foundation//Tapestry Script Specification 3.0//EN"  
  3.   "http://tapestry.apache.org/dtd/Script_3_0.dtd">  
  4. <script>  
  5.   
  6.     <body>  
  7.         <unique>  
  8.             dojo.require("dojo.gfx.*");  
  9.         unique>  
  10.     body>  
  11.   
  12. script>  

Circles.jwc
xml 代码
 
  1. xml version="1.0" encoding="UTF-8"?>  
  2.    Copyright 2004, 2005, 2006 The Apache Software Foundation  
  3.   
  4.    Licensed under the Apache License, Version 2.0 (the "License");  
  5.    you may not use this file except in compliance with the License.  
  6.    You may obtain a copy of the License at  
  7.   
  8.        http://www.apache.org/licenses/LICENSE-2.0  
  9.   
  10.    Unless required by applicable law or agreed to in writing, software  
  11.    distributed under the License is distributed on an "AS IS" BASIS,  
  12.    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
  13.    See the License for the specific language governing permissions and  
  14.    limitations under the License.  
  15. -->  
  16.   
  17.         "-//Apache Software Foundation//Tapestry Specification 4.0//EN"  
  18.         "http://tapestry.apache.org/dtd/Tapestry_4_0.dtd">  
  19.   
  20. <component-specification class="myComponent.Circles"  
  21.                          allow-body="yes" allow-informal-parameters="yes">  
  22.   
  23.     <description>  
  24.         Creates a modal Circles.  
  25.     description>  
  26.     <inject property="script" type="script" object="Circles.script"/>  
  27.   
  28. component-specification>  

Circles.java
java 代码
 
  1. package myComponent;  
  2.   
  3. import java.util.HashMap;  
  4. import java.util.Map;  
  5.   
  6. import org.apache.tapestry.IMarkupWriter;  
  7. import org.apache.tapestry.IRequestCycle;  
  8. import org.apache.tapestry.IScript;  
  9. import org.apache.tapestry.PageRenderSupport;  
  10. import org.apache.tapestry.TapestryUtils;  
  11. import org.apache.tapestry.dojo.form.IFormWidget;  
  12. import org.apache.tapestry.form.AbstractFormComponent;  
  13.   
  14. public  abstract class Circles extends AbstractFormComponent implements IFormWidget  
  15. {  
  16.   
  17. public abstract void setDestroy(boolean destroy);  
  18. public abstract IScript getScript();  
  19.   
  20. public abstract String getClientId();  
  21.   
  22. public abstract void setClientId(String id);  
  23. /** 
  24.  * Determined dynamically at runtime during rendering, informs widget implementations 
  25.  * if they should destroy their client side widget equivalents or leave them in tact. 
  26.  *  
  27.  * @return True if the widget should be destroyed on this render, false otherwise. 
  28.  */  
  29. public abstract boolean getDestroy();  
  30.   
  31. /** 
  32.  * {@inheritDoc} 
  33.  */  
  34. public void renderWidget(IMarkupWriter writer, IRequestCycle cycle)  
  35. {  
  36.     renderComponent(writer, cycle);  
  37. }  
  38.   
  39. /** 
  40.  * {@inheritDoc} 
  41.  */  
  42. protected void renderFormComponent(IMarkupWriter writer, IRequestCycle cycle)  
  43. {  
  44.     if(!cycle.isRewinding()) {  
  45.           
  46.         if (!cycle.getResponseBuilder().isDynamic()   
  47.                 || cycle.getResponseBuilder().explicitlyContains(this)) {  
  48.               
  49.             setDestroy(false);  
  50.         } else  
  51.             setDestroy(true);  
  52.     }  
  53.       
  54.     // don't render if not part of update response  
  55.       
  56.     if (cycle.getResponseBuilder().isDynamic()  
  57.             && (!cycle.getResponseBuilder().explicitlyContains(this)   
  58.                     && !cycle.getResponseBuilder().contains(this))) {  
  59.           
  60.         return;  
  61.     }  
  62.       
  63.     renderFormWidget(writer, cycle);  
  64. }  
  65.   
  66. /** 
  67.  * {@inheritDoc} 
  68.  */  
  69. protected void rewindFormComponent(IMarkupWriter writer, IRequestCycle cycle)  
  70. {  
  71.     rewindFormWidget(writer, cycle);  
  72. }  
  73.   
  74. /** 
  75.  * Called when rendering a form widget.  
  76.  *  
  77.  * @param writer 
  78.  *          The markup writer to render with. 
  79.  * @param cycle 
  80.  *          The cycle associated with request. 
  81.  */  
  82. protected void renderFormWidget(IMarkupWriter writer, IRequestCycle cycle)  
  83. {  
  84.     Map parms = new HashMap();  
  85.     parms.put("id", getClientId());  
  86.     parms.put("widget"this);  
  87.     PageRenderSupport pageRenderSupport = TapestryUtils.getPageRenderSupport(cycle, this);  
  88.     getScript().execute(this , cycle, pageRenderSupport , parms);  
  89. }  
  90.   
  91. /** 
  92.  * Called during form submission to retrieve submitted input values.  
  93.  * Components should do any validation/retrieval of values in this method.  
  94.  *  
  95.  * @param writer 
  96.  *          The passed in {@link IMarkupWriter} will be a {@link NullMarkupWriter}, making  
  97.  *          any content written ignored.  
  98.  * @param cycle 
  99.  *           Typically used to retrieve submitted value via cycle.getParameter(getName()). 
  100.  */  
  101. protected void rewindFormWidget(IMarkupWriter writer, IRequestCycle cycle)  
  102. {  
  103. }  
  104.   
  105. }  


application文件
xml 代码
 
  1. xml version="1.0"?>  
  2.   
  3.   "-//Apache Software Foundation//Tapestry Specification 4.0//EN"   
  4.   "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">  
  5.       
  6. <application name="workbench">  
  7.   <meta key="org.apache.tapestry.visit-class" value="org.apache.tapestry.workbench.Visit"/>  
  8.   <meta key="org.apache.tapestry.template-encoding" value="ISO-8859-1"/>  
  9.   <meta key="org.apache.tapestry.page-class-packages" value="org.apache.tapestry.workbench"/>  
  10.   <meta key="org.apache.tapestry.component-class-packages" value="org.apache.tapestry.workbench.components"/>  
  11.           
  12.   <library id="contrib" specification-path="classpath:/org/apache/tapestry/contrib/Contrib.library"/>  
  13.     
  14.   
  15.   
  16.   
  17.    <page name="Home" specification-path="/WEB-INF/home/Home.page"/>  
  18.    <page name="Page1" specification-path="/WEB-INF/pages/Page1.page"/>  
  19.      
  20.    <component-type type="Circles" specification-path="/myComponent/Circles.jwc"/>  
  21. application>  

代码就是这些,如有哪位高手遇到过这个问题,希望可以帮忙一下.
【无人机】基于改进粒子群算法的无人机路径规划研究[和遗传算法、粒子群算法进行比较](Matlab代码实现)内容概要:本文围绕基于改进粒子群算法的无人机路径规划展开研究,重点探讨了在复杂环境中利用改进粒子群算法(PSO)实现无人机三维路径规划的方法,并将其与遗传算法(GA)、标准粒子群算法等传统优化算法进行对比分析。研究内容涵盖路径规划的多目标优化、避障策略、航路点约束以及算法收敛性和寻优能力的评估,所有实验均通过Matlab代码实现,提供了完整的仿真验证流程。文章还提到了多种智能优化算法在无人机路径规划中的应用比较,突出了改进PSO在收敛速度和全局寻优方面的优势。; 适合人群:具备一定Matlab编程基础和优化算法知识的研究生、科研人员及从事无人机路径规划、智能优化算法研究的相关技术人员。; 使用场景及目标:①用于无人机在复杂地形或动态环境下的三维路径规划仿真研究;②比较不同智能优化算法(如PSO、GA、蚁群算法、RRT等)在路径规划中的性能差异;③为多目标优化问题提供算法选型和改进思路。; 阅读建议:建议读者结合文中提供的Matlab代码进行实践操作,重点关注算法的参数设置、适应度函数设计及路径约束处理方式,同时可参考文中提到的多种算法对比思路,拓展到其他智能优化算法的研究与改进中。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值