- 浏览: 73206 次
- 性别:
- 来自: 广州
-
文章分类
最新评论
In the module XML file, you specify your application's entry point class. In order to compile, a GWT module must specify an entry point. If a GWT module has no entry point, then it can only be inherited by other modules. It is possible to include other modules that have entry points specified in their module XML files. If so, then your module would have multiple entry points. Each entry point is executed in sequence.
By default, StockWatcher uses two style sheets: the default GWT
style sheet, standard.css (which is referenced via the inherited theme),
and the application style sheet, StockWatcher.css which was generated
by webAppCreator.
The host page references the path of JavaScript source code
(generated by GWT) responsible for the dynamic elements on the page. The
contents of the entire body element can be generated dynamically, for
example, as it is with starter application.
The StockWatcher class implements the GWT interface EntryPoint.
It contains the method onModuleLoad. Because the StockWatcher class is
specified as the entry point class in StockWatcher's module definition,
when you launch StockWatcher the onModuleLoad method is called.
The StockWatcher class inherits functionality via other GWT
modules you included in StockWatcher's module definition
(StockWatcher.gwt.xml). For example, when building the user interface,
you'll be able to include types and resources from the package
com.google.gwt.user.client.ui because it is part of the GWT core
functionality included in the GWT module com.google.gwt.user.User.
A Root panel is the container for the dynamic elements of your
application. It is at the top of any GWT user interface hierarchy. There
are two ways you can use a Root panel, either to generate the entire
body of the page or to generate specific elements embedded in the body.
The
Root panel works by wrapping an element in the HTML host page. By
default (that is, if you don't add any placeholders in the host page)
the Root panel wraps the body element. However, you can wrap any element
if you name it and then, when you call the Root panel, pass the name as
a parameter.
RootPanel.get() // Default. Wraps the HTML body element.
RootPanel.get("stockList") // Wraps any HTML element with an id of "stockList"
For StockWatcher, you'll follow the preferred strategy. Rather
than put links to the style sheets in the HTML host page, you'll use the
module XML file. Then, when you compile StockWatcher, the GWT compiler
will bundle all the static resources required to run your application
including the style sheets. This mechanism is called Automatic Resource
Inclusion.
In GWT, each class of widget has an associated style name (like
gwt-Button) that binds it to a CSS style rule. This is the widget's
primary style. Default values are defined for the primary style in the
theme style sheet.
Type of Element HTML Tag CSS Selector
Buttons in static HTML and GWT-generated buttons <button> button
Only GWT-generated buttons <button class="gwt-Button"> button.gwt-Button
Only my special GWT-generated button <button class="gwt-Button my-button"> button.my-button
Dependent styles are powerful because they are automatically
updated whenever the primary style name changes. In contrast, secondary
style names that are not dependent style names are not automatically
updated when the primary style name changes.
To do this, you'll use the addStyleDependentName method instead of the addStyleName method
If you launched the development mode server, you can run your
application in production mode (after compiling it) by removing the
gwt.codesvr parameter from the URL before loading the application.
The GWT RPC framework makes it easy for the client and server
components of your web application to exchange Java objects over HTTP.
The server-side code that gets invoked from the client is often referred
to as a service. The implementation of a GWT RPC service is based on
the well-known Java servlet architecture. Within the client code, you'll
use an automatically-generated proxy class to make calls to the
service. GWT will handle serialization of the Java objects passing back
and forth—the arguments in the method calls and the return value.
In order to define your RPC interface, you need to write three components:
Define an interface (StockPriceService) for your service that extends RemoteService and lists all your RPC methods.
Create a class (StockPriceServiceImpl) that extends RemoteServiceServlet and implements the interface you created above.
Define an asynchronous interface (StockPriceServiceAsync) to your service to be called from the client-side code.
Every service implementation is ultimately a servlet, but rather
than extending HttpServlet, it extends RemoteServiceServlet instead.
RemoteServiceServlet automatically handles serialization of the data
being passed between the client and the server and invoking the intended
method in your service implementation.
Notice the @RemoteServiceRelativePath annotation. This associates
the service with a default path relative to the module base URL.
In
the <servlet-mapping> element, the url-pattern can be in the form
of an absolute directory path (for example, /spellcheck or
/common/login). If you specify a default service path with a
@RemoteServiceRelativePath annotation on the service interface (as you
did with StockPriceService), then make sure the url-pattern matches the
annotation value.
To add an AsyncCallback parameter to all of our service methods, you must define a new interface as follows:
It must have the same name as the service interface, appended with Async (for example, StockPriceServiceAsync).
It must be located in the same package as the service interface.
Each
method must have the same name and signature as in the service
interface with an important difference: the method has no return type
and the last parameter is an AsyncCallback object.
Often, you will need to integrate GWT with existing handwritten
JavaScript or with a third-party JavaScript library. Occasionally you
may need to access low-level browser functionality not exposed by the
GWT class API's. The JavaScript Native Interface (JSNI) feature of GWT
can solve both of these problems by allowing you to integrate JavaScript
directly into your application's Java source code.
JSNI methods are declared native and contain JavaScript code in a
specially formatted comment block between the end of the parameter list
and the trailing semicolon. A JSNI comment block begins with the exact
token /*-{ and ends with the exact token }-*/. JSNI methods are called
just like any normal Java method. They can be static or instance
methods.
generated GWT files. At compile time, the GWT compiler performs
some syntax checks on the JavaScript inside the method, then generates
interface code for converting method arguments and return values
properly.
As of the GWT 1.5 release, the Java varargs construct is
supported. The GWT compiler will translate varargs calls between 2
pieces of Java code. However, calling a varargs JavaScript method from
Java will result in the callee receiving the arguments in an array.
When accessing the browser's window and document objects from
JSNI, you must reference them as $wnd and $doc, respectively. Your
compiled script runs in a nested frame, and $wnd and $doc are
automatically initialized to correctly refer to the host page's window
and document.
Calling Java methods from JavaScript is somewhat similar to
calling Java methods from C code in JNI. In particular, JSNI borrows the
JNI mangled method signature approach to distinguish among overloaded
methods. JavaScript calls into Java methods are of the following form:
[instance-expr.]@class-name::method-name(param-signature)(arguments)
instance-expr. : must be present when calling an instance method and must be absent when calling a static method
class-name : is the fully-qualified name of the class in which the method is declared (or a subclass thereof)
param-signature
: is the internal Java method signature as specified here but without
the trailing signature of the method return type since it is not needed
to choose the overload
arguments : is the actual argument list to pass to the called method
Calling Java constructors from JavaScript is identical to the above use case, except that the method name is alway new.
someTopLevelInstance.new InstanceInner(123) becomes
@pkg.TopLevel.InstanceInner::new(Lpkg/TopLevel;I)(someTopLevelInstance,
123)
The enclosing instance of a non-static class is implicitly
defined as the first parameter for constructors of a non-static class.
Regardless of how deeply-nested a non-static class is, it only needs a
reference to an instance of its immediately-enclosing type.
Static and instance fields can be accessed from handwritten JavaScript. Field references are of the form
[instance-expr.]@class-name::field-name
public class JSNIExample {
String myInstanceField;
static int myStaticField;
void instanceFoo(String s) {
// use s
}
static void staticFoo(String s) {
// use s
}
public native void bar(JSNIExample x, String s) /*-{
// Call instance method instanceFoo() on this
this.@com.google.gwt.examples.JSNIExample::instanceFoo(Ljava/lang/String;)(s
);
// Call instance method instanceFoo() on x
x.@com.google.gwt.examples.JSNIExample::instanceFoo(Ljava/lang/String;)(s
);
// Call static method staticFoo()
@com.google.gwt.examples.JSNIExample::staticFoo(Ljava/lang/String;)(s);
// Read instance field on this
var val = this.@com.google.gwt.examples.JSNIExample::myInstanceField
;
// Write instance field on x
x.@com.google.gwt.examples.JSNIExample::myInstanceField
= val + " and stuff";
// Read static field (no qualifier)
@com.google.gwt.examples.JSNIExample::myStaticField = val + " and stuff";
}-*/;
}
Sometimes you need to access a method or constructor defined in
GWT from outside JavaScript code. This code might be hand-written and
included in another java script file, or it could be a part of a third
party library. In this case, the GWT compiler will not get a chance to
build an interface between your JavaScript code and the GWT generated
JavaScript directly.
A way to make this kind of relationship work is
to assign the method via JSNI to an external, globally visible
JavaScript name that can be referenced by your hand-crafted JavaScript
code.
package mypackage;
public MyUtilityClass
{
public static int computeLoanInterest(int amt, float interestRate,
int term) { ... }
public static native void exportStaticMethod() /*-{
$wnd.computeLoanInterest =
$entry(@mypackage.MyUtilityClass::computeLoanInterest(IFI));
}-*/;
}
Notice
that the reference to the exported method has been wrapped in a call to
the $entry function. This implicitly-defined function ensures that the
Java-derived method is executed with the uncaught exception handler
installed and pumps a number of other utility services. The $entry
function is reentrant-safe and should be used anywhere that GWT-derived
JavaScript may be called into from a non-GWT context.
On application
initialization, call MyUtilityClass.exportStaticMethod() (e.g. from your
GWT Entry Point). This will assign the function to a variable in the
window object called computeLoanInterest.
Static String Internationalization
Static string
initialization requires very little overhead at runtime and therefore is
a very efficient technique for translating both constant and
parameterized strings. It is also the simplest technique to implement.
Static string internationalization uses standard Java properties files
to store translated strings and parameterized messages, then implements
strongly-typed Java interfaces to retrieve their values.
Dynamic String Internationalization
Dynamic string
internationalization is slower than static string internationalization,
but is very flexible. Applications using this technique look up
localized strings in the module's host page; therefore, they do not need
to be recompiled when you add a new locale. If you need to integrate a
GWT application with an existing server-side localization system,
dynamic string internationalization is the option to consider.
Localizable Interface
The most powerful technique is to
implement the Localizable interface. Implementing Localizable allows you
to go beyond simple string substitution and create localized versions
of custom types. It's an advanced internationalization technique that
you probably won't have to use very often.
First create the Java interface (StockWatcherConstants) that
accesses the properties files which hold each translation. The interface
uses annotations to specify the default translation. This interface
implements the GWT Constants interface. This interface is bound
automatically to any StockWatcherConstants*.properties files you create
because of its name.
First create the Java interface (StockWatcherMessages). It
accesses the properties files which hold the translations of each
parameterized message. This interface implements the GWT Messages
interface. Unlike the StockWatcherConstants interface, the methods in
this interface contain parameters. When you call these methods, the
arguments you pass will replace the placeholders you left in the strings
in the properties files. This interface is bound automatically to any
StockWatcherMessages*.properties files you create because of its name.
相关推荐
It includes a case study on wrapping the Google Ajax Search functionality using GWT. #### Chapter 9: Modularizing an Application Modularization is crucial for maintaining large-scale applications. ...
TinyYolo2实时视频流物体检测ONNX模型 运行 ONNX 模型,并结合 OpenCV 进行图像处理。具体流程包括: 1. 加载并初始化 ONNX 模型。 2. 从摄像头捕获实时视频流。 3. 对每一帧图像进行模型推理,生成物体检测结果。 4. 在界面上绘制检测结果的边界框和标签。
chromedriver-linux64-134.0.6998.23(Beta).zip
Web开发:ABP框架4-DDD四层架构的详解
chromedriver-linux64-135.0.7029.0(Canary).zip
实现人脸识别的考勤门禁系统可以分为以下步骤: 1. 采集人脸图像数据集:首先需要采集员工的人脸图像数据集,包括正面、侧面等多个角度的图像。可以使用MATLAB中的图像采集工具或者第三方库进行采集。 2. 预处理人脸图像数据:对采集到的人脸图像数据进行预处理,包括人脸检测、人脸对齐、人脸裁剪等操作。MATLAB提供了相关的图像处理工具箱,可以用于实现这些处理步骤。 3. 特征提取与特征匹配:使用人脸识别算法提取人脸图像的特征,比如使用人脸识别中常用的特征提取算法如Eigenfaces、Fisherfaces或者基于深度学习的算法。然后将员工的人脸数据与数据库中的人脸数据进行匹配,判断是否为注册员工。 4. 考勤记录与门禁控制:如果人脸匹配成功,系统可以记录员工的考勤时间,并且控制门禁系统进行开启。MATLAB可以与外部设备进行通信,实现门禁控制以及考勤记录功能。
yugy
企业IT治理体系规划.pptx
项目工程资源经过严格测试运行并且功能上ok,可实现复现复刻,拿到资料包后可实现复现出一样的项目,本人系统开发经验充足(全栈全领域),有任何使用问题欢迎随时与我联系,我会抽时间努力为您解惑,提供帮助 【资源内容】:包含源码+工程文件+说明等。答辩评审平均分达到96分,放心下载使用!可实现复现;设计报告也可借鉴此项目;该资源内项目代码都经过测试运行,功能ok 【项目价值】:可用在相关项目设计中,皆可应用在项目、毕业设计、课程设计、期末/期中/大作业、工程实训、大创等学科竞赛比赛、初期项目立项、学习/练手等方面,可借鉴此优质项目实现复刻,设计报告也可借鉴此项目,也可基于此项目来扩展开发出更多功能 【提供帮助】:有任何使用上的问题欢迎随时与我联系,抽时间努力解答解惑,提供帮助 【附带帮助】:若还需要相关开发工具、学习资料等,我会提供帮助,提供资料,鼓励学习进步 下载后请首先打开说明文件(如有);整理时不同项目所包含资源内容不同;项目工程可实现复现复刻,如果基础还行,也可在此程序基础上进行修改,以实现其它功能。供开源学习/技术交流/学习参考,勿用于商业用途。质量优质,放心下载使用
基于多目标粒子群算法的冷热电联供综合能源系统优化调度与运行策略分析,基于多目标粒子群算法的冷热电联供综合能源系统优化调度与运行策略分析,MATLAB代码:基于多目标粒子群算法冷热电联供综合能源系统运行优化 关键词:综合能源 冷热电三联供 粒子群算法 多目标优化 参考文档:《基于多目标算法的冷热电联供型综合能源系统运行优化》 仿真平台:MATLAB 平台采用粒子群实现求解 优势:代码注释详实,适合参考学习,非目前烂大街的版本,程序非常精品,请仔细辨识 主要内容:代码构建了含冷、热、电负荷的冷热电联供型综合能源系统优化调度模型,考虑了燃气轮机、电制冷机、锅炉以及风光机组等资源,并且考虑与上级电网的购电交易,综合考虑了用户购电购热冷量的成本、CCHP收益以及成本等各种因素,从而实现CCHP系统的经济运行,求解采用的是MOPSO算法(多目标粒子群算法),求解效果极佳,具体可以看图 ,核心关键词: 综合能源系统; 冷热电三联供; 粒子群算法; 多目标优化; MOPSO算法; 优化调度模型; 燃气轮机; 电制冷机; 锅炉; 风光机组; 上级电网购售电交易。,基于多目标粒子群算法的CCHP综合
DSP28379D串口升级方案:单核双核升级与Boot优化,C#上位机开发串口通信方案,DSP28379D串口升级方案:单核双核升级与Boot优化,C#上位机开发实现串口通信,DSP28379D串口升级方案 单核双核升级,boot升级,串口方案。 上位机用c#开发。 ,DSP28379D; 串口升级方案; 单核双核升级; boot升级; 上位机C#开发,DSP28379D串口双核升级方案:Boot串口升级技术使用C#上位机开发
项目工程资源经过严格测试运行并且功能上ok,可实现复现复刻,拿到资料包后可实现复现出一样的项目,本人系统开发经验充足(全栈全领域),有任何使用问题欢迎随时与我联系,我会抽时间努力为您解惑,提供帮助 【资源内容】:包含源码+工程文件+说明等。答辩评审平均分达到96分,放心下载使用!可实现复现;设计报告也可借鉴此项目;该资源内项目代码都经过测试运行,功能ok 【项目价值】:可用在相关项目设计中,皆可应用在项目、毕业设计、课程设计、期末/期中/大作业、工程实训、大创等学科竞赛比赛、初期项目立项、学习/练手等方面,可借鉴此优质项目实现复刻,设计报告也可借鉴此项目,也可基于此项目来扩展开发出更多功能 【提供帮助】:有任何使用上的问题欢迎随时与我联系,抽时间努力解答解惑,提供帮助 【附带帮助】:若还需要相关开发工具、学习资料等,我会提供帮助,提供资料,鼓励学习进步 下载后请首先打开说明文件(如有);整理时不同项目所包含资源内容不同;项目工程可实现复现复刻,如果基础还行,也可在此程序基础上进行修改,以实现其它功能。供开源学习/技术交流/学习参考,勿用于商业用途。质量优质,放心下载使用
基于PLC的双层自动门控制:光电传感触发,有序开关与延时功能实现,附程序、画面及参考文档。,基于PLC的双层自动门控制系统:精准控制,保障无尘环境;门间联动,智能安防新体验。,基于plc的双层自动门控制系统,全部采用博途仿真完成,提供程序,画面,参考文档,详情见图。 实现功能(详见上方演示视频): ① 某房间要求尽可能地保持无尘,在通道上设置了两道电动门,门1和门2,可通过光电传感器自动完成门的打开和关闭。 门1和门2 不能同时打开。 ② 第 1 道门(根据出入方向不同,可能是门 1 或门 2),是由在通道外的开门者通过按开门按钮打开的,而第 2 道门(根据出入方向不同,可能是门 1 或门 2 )则是在打开的第 1 道门关闭后自动地打开的(也可以由通道内的人按开门按钮来打开第2 道门)。 这两道门都是在门开后,经过 3s 的延时而自动关闭的。 ③ 在门关闭期间,如果对应的光电传感器的信号被遮断,则门立即自动打开。 如果在门外或者在门内的开门者按对应的开门按钮时,立即打开。 ④ 出于安全方面的考虑,如果在通道内的某个人经过光电传感器时,对应的门已经打开,则通道外的开门者可以不按开门按钮。
项目工程资源经过严格测试运行并且功能上ok,可实现复现复刻,拿到资料包后可实现复现出一样的项目,本人系统开发经验充足(全栈全领域),有任何使用问题欢迎随时与我联系,我会抽时间努力为您解惑,提供帮助 【资源内容】:包含源码+工程文件+说明等。答辩评审平均分达到96分,放心下载使用!可实现复现;设计报告也可借鉴此项目;该资源内项目代码都经过测试运行,功能ok 【项目价值】:可用在相关项目设计中,皆可应用在项目、毕业设计、课程设计、期末/期中/大作业、工程实训、大创等学科竞赛比赛、初期项目立项、学习/练手等方面,可借鉴此优质项目实现复刻,设计报告也可借鉴此项目,也可基于此项目来扩展开发出更多功能 【提供帮助】:有任何使用上的问题欢迎随时与我联系,抽时间努力解答解惑,提供帮助 【附带帮助】:若还需要相关开发工具、学习资料等,我会提供帮助,提供资料,鼓励学习进步 下载后请首先打开说明文件(如有);整理时不同项目所包含资源内容不同;项目工程可实现复现复刻,如果基础还行,也可在此程序基础上进行修改,以实现其它功能。供开源学习/技术交流/学习参考,勿用于商业用途。质量优质,放心下载使用
DeepSeek+DeepResearch——让科研像聊天一样简单 (1)DeepSeek如何做数据分析? (2)DeepSeek如何分析文件内容? (3)DeepSeek如何进行数据挖掘? (4)DeepSeek如何进行科学研究? (5)DeepSeek如何写综述? (6)DeepSeek如何进行数据可视化? (7)DeepSeek如何写作润色? (8)DeepSeek如何中英文互译? (9)DeepSeek如何做降重? (10)DeepSeek论文参考文献指令 (11)DeepSeek基础知识。
项目工程资源经过严格测试运行并且功能上ok,可实现复现复刻,拿到资料包后可实现复现出一样的项目,本人系统开发经验充足(全栈全领域),有任何使用问题欢迎随时与我联系,我会抽时间努力为您解惑,提供帮助 【资源内容】:包含源码+工程文件+说明等。答辩评审平均分达到96分,放心下载使用!可实现复现;设计报告也可借鉴此项目;该资源内项目代码都经过测试运行,功能ok 【项目价值】:可用在相关项目设计中,皆可应用在项目、毕业设计、课程设计、期末/期中/大作业、工程实训、大创等学科竞赛比赛、初期项目立项、学习/练手等方面,可借鉴此优质项目实现复刻,设计报告也可借鉴此项目,也可基于此项目来扩展开发出更多功能 【提供帮助】:有任何使用上的问题欢迎随时与我联系,抽时间努力解答解惑,提供帮助 【附带帮助】:若还需要相关开发工具、学习资料等,我会提供帮助,提供资料,鼓励学习进步 下载后请首先打开说明文件(如有);整理时不同项目所包含资源内容不同;项目工程可实现复现复刻,如果基础还行,也可在此程序基础上进行修改,以实现其它功能。供开源学习/技术交流/学习参考,勿用于商业用途。质量优质,放心下载使用
1、文件内容:jdepend-demo-2.9.1-10.el7.rpm以及相关依赖 2、文件形式:tar.gz压缩包 3、安装指令: #Step1、解压 tar -zxvf /mnt/data/output/jdepend-demo-2.9.1-10.el7.tar.gz #Step2、进入解压后的目录,执行安装 sudo rpm -ivh *.rpm 4、更多资源/技术支持:公众号禅静编程坊
项目工程资源经过严格测试运行并且功能上ok,可实现复现复刻,拿到资料包后可实现复现出一样的项目,本人系统开发经验充足(全栈全领域),有任何使用问题欢迎随时与我联系,我会抽时间努力为您解惑,提供帮助 【资源内容】:包含源码+工程文件+说明等。答辩评审平均分达到96分,放心下载使用!可实现复现;设计报告也可借鉴此项目;该资源内项目代码都经过测试运行;功能ok 【项目价值】:可用在相关项目设计中,皆可应用在项目、毕业设计、课程设计、期末/期中/大作业、工程实训、大创等学科竞赛比赛、初期项目立项、学习/练手等方面,可借鉴此优质项目实现复刻,设计报告也可借鉴此项目,也可基于此项目来扩展开发出更多功能 【提供帮助】:有任何使用上的问题欢迎随时与我联系,抽时间努力解答解惑,提供帮助 【附带帮助】:若还需要相关开发工具、学习资料等,我会提供帮助,提供资料,鼓励学习进步 下载后请首先打开说明文件(如有);整理时不同项目所包含资源内容不同;项目工程可实现复现复刻,如果基础还行,也可在此程序基础上进行修改,以实现其它功能。供开源学习/技术交流/学习参考,勿用于商业用途。质量优质,放心下载使用
内容概要:本文档详细介绍了如何利用 MATLAB 实现鲸鱼优化算法 (WOA) 和长短期记忆网络 (LSTM) 相结合的技术——WOA-LSTM,在数据分类和预测领域的应用。文章首先概述了LSTM在网络训练中超参数依赖的问题以及WOA作为一种新颖的全局优化算法的优势。接着阐述了该项目的研究背景、目的及其重要意义,并深入讨论了项目面临的六大主要挑战,从模型优化到超参数空间管理。文档特别强调WOA-LSTM融合所带来的性能提升、降低计算复杂度的能力及其实现自动化的超参数优化流程。除此之外,文中展示了模型的应用广泛性,覆盖了从金融市场的股票预测到智能制造业的各种实际场景,并提供了具体的模型架构细节和代码实例,以帮助理解模型的工作原理和技术要点。 适合人群:具有一定编程技能的研究人员、工程师和科学家们,尤其是对深度学习技术和机器学习感兴趣的专业人士。 使用场景及目标:该文档的目标是向用户传授使用MATLAB实现WOA-LSTM进行复杂数据分类和预测的方法论,旨在指导读者理解和掌握如何利用WOA进行超参数寻优,从而改善LSTM网络性能。 其他说明:通过阅读这份文档,使用者不仅能够获得有关WOA-LSTM技术的具体实现方式的知识,而且还可以获取关于项目规划和实际部署过程中的宝贵经验。
tomcat安装及配置教程.md