smartinvoke入门系列10——多窗口的实现与互调

SmartInvoke还可以轻松的帮助你实现多窗口的功能。窗口之间可以方便的互调。首先我们点击eclipse工具栏上的图标:

 
打开新建对话框,输入如下内容:



 

点击完成后eclipse会在First_项目下新建一个SubWin.mxml文件。如下图:



 

我们在SubWin.mxml文件中添加一公共方法供FirstWin调用。内容如下:

           public function subWinMethod(bean:BeanTest):void{

               Alert.show(bean.name);

           }

这里的方法必须为public的。

在FirstWin.mxml文件中添加打开SubWin窗口的代码,如下:

 

               var subWin:FlashShell=FlashShell.CreateInstance0();

               subWin.setAppPath("SubWin");

               subWin.setSize(400,400);

               subWin.setText("SubWin.............");

              

               subWin.open();

通过调用subWin的getFlashViewer方法获得cn.smartinvoke.gui.FlashViewer类型对象,如果说FlashShell对象的作用是控制窗口,那么FlashViewer对象的作用就是控制窗口加载的swf。

通过调用FlashViewer对象上的asyncCallFlexApp,与callFlexApp方法可以调用到加载窗口所在flex application对象上的公共方法。方法说明如下:

asyncCallFlexApp(methodName:String, params:Array = null):void

异步调用当前FlashViewer加载的flex application对象的公共方法 方法不会挂起当前执行进程,直接返回

param methodName 调用方法名称 param params 调用方法参数

 

callFlexApp(methodName:String, params:Array = null):Object

同步调用当前FlashViewer加载的flex application对象的公共方法 方法会挂起当前执行进程直到java返回

方法提供了不同flex applcation互掉的机制 param methodName 调用方法名称 param params 调用方法参数。

所以通过如下代码就可以访问到SubWin.mxml中的方法:

 

               var viewer:FlashViewer=subWin.getFlashViewer();

               var bean:BeanTest=new BeanTest();

               bean.name="pz";

               viewer.asyncCallFlexApp("subWinMethod",[bean]);

 

 

但是这段代码不能在subWin.open();的后面调用,因为无法确定subWin所加载的swf是否加载完毕。不用当心,smartinvoke为我们提供了cn.smartinvoke.gui.ShellManager这个类,通过他可以监听到当前应用程序窗口的打开与关闭事件,代码如下:

                               ShellManager.Instance.addListener(function (evt:CShellEvent):void{

                                          var shell:FlashShell=evt.widget;

                                          if(evt.type==CShellEvent.Event_Open){

                                                         var viewer:FlashViewer=shell.getFlashViewer();

                                                         var bean:BeanTest=new BeanTest();

                                                         bean.name="pz";

                                                         viewer.asyncCallFlexApp("subWinMethod",[bean]);

                                                }

                                                if(evt.type==CShellEvent.Event_Closed){

                                                         this.labelInfo.text="窗口"+shell.getShellName()+"关闭了";

                                               }

                               },this);

 

 

工业级越界行为识别数据集:YOLOv8/v9直接训练的围栏异常检测资源 越界行为识别是智能安防与工业安全中的基础视觉任务,其核心在于对人员、车辆等目标跨越物理边界(如围栏、警戒线、作业禁区)的精准检测与分割。该技术依赖于高质量实例分割标注、归一化坐标格式及场景鲁棒性设计,具备低延迟、高召回、强泛化等工程价值,广泛应用于智慧工地电子围栏、化工厂禁区告警、物流园区越界监控及变电站安全巡检等真实工业场景。本数据集以YOLOv8/v9为基准构建,提供万张实拍+合成图像、像素级Segmentation标注、分层划分与完备元数据,开箱即用,直击工业落地中数据清洗、格式转换与标注不一致等关键 阅读详情

相关推荐

HFSS - 双频微带天线设计与仿真

一、设计指标 中心频率:1.9GHz、2.45GHz 匹配情况:中心频率处S11S_{11}S11​参数小于-20dB 介质板厚度:1.6mm 介质板介电常数:3.8 馈电方式:50Ω\OmegaΩ同轴线馈电 二、双频微带天线 获得双频工作的一种最简单的方法是辐射贴片的长度对应-一个频率谐振,其宽度对应另一个频率谐振,然后从对角线的一角馈电,就能使同一个辐射贴片工作于两个频率上。其结构如下图所示。 从图中可以得知,x轴上的A点(x,0)为激发TM10_{10}10​模式的50Ω\OmegaΩ馈电点,由

MaxWei 1万+

Smart Form中四种窗口类型的区别

smart form中4中类型的窗口: Main Window:主窗口 主窗口一般用于数据的列表显示,用于LOOP循环显示;当然也可显示非列表内容。 一个Form中只能包含一个主窗口。 主窗口可分页输出,即连续输出到几页。 无论输出几页,主窗口的宽度必须一致,高度和位置可以任意指定。 Secondary Window:次窗口 次窗口主要用于非列表显示内容的输出。 每一页中能

少年休闲海 4873

AT91SAM9260搭建LINUX操作系统

一、 编写目的 2 二、 系统搭建 2 1. 下载相关软件包 2 2. Bootstrap编译 3 3. U-BOOT编译 5 4. LINUX编译 7 5. 通过U-BOOT的TFTP命令从TFTP服务器下载系统镜像 9 6. 文件系统制作 10 7. 挂载NFS作为根文件系统 10 三、 总结 14 一、编写目的 本文档用于记录AT91SAM9260 LINUX学

lshiceman的专栏 7412

smartinvoke入门系列1——smartinvoke的安装

首先确保你已正确安装了flash builder4的插件版,不是插件版的同学可以安装插件版,或者添加Java开发工具JDT插件到你的flash builder中。   然后到http://smartrcp.googlecode.com/files/cn.smartinvoke.ide.zip下载smartinvoke开发工具,下载完毕后解压该zip文件后,将得到的所有jar文件拷贝到flash...

smartinvoke的专栏 223

【HSCNN解析】HSCNN:从欠采样光谱图重建高光谱图的CNN网络

本文介绍HSCNN,是一个将欠采样光谱图重建为高光谱图的纯CNN网络,2017年提出。

上个大学哪有不疯的?硬撑罢了! 1622

Halcon Socket TCP通讯:从算子调用到工业视觉系统集成

本文详细介绍了Halcon Socket TCP通讯在工业视觉系统中的应用与优化技巧。从基础算子调用到高并发处理,再到与PLC、机器人及MES系统的集成实战,提供了全面的解决方案和性能优化建议,帮助开发者高效实现工业视觉系统的通讯需求。

weixin_33502772的博客 248

关于smartinvoke开发工具的操作

关于开发工具的安装:          在http://smartrcp.org/invoke/?page_id=16下载完cn.smartinvoke.ide.zip文件后,解压后得到: cn.smartinvoke.ide.jar cn.smartinvoke.ide.parse.jar cn.smartinvoke.ide.update.jar cn.smartinvok...

smartinvoke的专栏 220

实现自己的AI视频监控系统-第一章-视频拉流与解码4(重点)

使用本章节代码请引用此优快云链接,尊重知识、尊重他人劳动。这一小节将正式进入代码实现部分。我们会结合实际业务需要和拉流解码流程实现一个灵活、轻便、易用的视频拉流解码模块,支持多路视频拉流解码且可以动态更新更新内部参数。在开始设计之初,我们首先考虑的是使用大家所熟知的 **OpenCV(cv2.VideoCapture)**来实现拉流和解码功能。它的 API 简单直接,几行代码就能实现从网络流中读取帧,对于快速原型验证来说非常方便。然而,在经过深入的调研和测试后,我们发现 OpenCV 在处理多路视频流、追

soulproficiency的博客 2268

关于smartinvoke开发工具的操纵

关于开发工具的安装: 入门视频教程:http://v.youku.com/v_show/id_XMTY1MzAxNDg4.html入门文档教程:http://smartinvoke.group.iteye.com/group/wiki/3026-smartinvoke-java-flex 在http://smartrcp.org/invoke/?page_id=16下载完cn.smarti

乱世情郎 631

从AMBA到USB:手把手教你评估和选择Synopsys DesignWare里的免费商用IP

本文详细介绍了如何评估和选择Synopsys DesignWare中的免费商用IP,从AMBA到USB等关键模块。通过技术参数核对、验证环境评估和集成注意事项,帮助工程师高效利用这些经过硅验证的商业级IP,提升SoC设计效率。文章还探讨了免费IP与付费IP的边界策略,避免常见陷阱。

weixin_42683394的博客 297

瑞芯微RV1109平台GT911触摸屏驱动调试记录1

很明显这里可以看到系统已经配置了i2c-0、i2c-1、i2c-3、i2c-4、i2c-5,当开机的时候系统已经将相应的I2C节点注册成功了,说明I2C部分是没有问题的。

bingdund的博客 298

smartinvoke入门系列2——smartinvoke轻松上手

 简介: 本篇为smartinvoke开发系列的第一篇,主要让大家对smartinvoke有一个整体的认识,能够开发出简单独立的smartinvoke可运行桌面程序。 创建SmartInvoke项目: 依次选择Eclipse菜单栏中的 :文件 -> 新建 -> 其他 打开新建对话框,找到smartinvoke节点,选择New Project 节点,打开新建smartinvoke...

smartinvoke的专栏 242

通过采用下面方法检查内容,还是系统无法更新下载,但是错误代码变成了——下载错误 - 0x80004002-到底如何解决?必须重装系统吗?-这个到底是系统问题,还是硬件问题?

‌。

qq_15963745的博客 336

smartinvoke入门系列8——Flex本地右键菜单

SmartInvoke屏蔽了Flash中的系统内置右键,添加了系统本地右键菜单功能。只需几段代码就可以创建出本地右键菜单。右键菜单主要用到以下四个类: cn.smartinvoke.gui.control.CAction;            菜单项信息类,封装了菜单项的id,菜单项的显示文字,菜单项的图标,菜单项类型等信息。 cn.smartinvoke.gui.control.CNa...

smartinvoke的专栏 194

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

smartinvoke入门系列3——程序的打包与单独运行

当然,SmartInvoke程序要能够方便的打包成类似exe可执行文件的形式才能算得上是一个真正的CS程序。 为了让SmartInvoke程序能够成功的打包运行,首先得在FirstWin.java入口类中添加一方法以指明程序所要加载的swf文件的路径。内容如下: public String getMainSWF(){         return "/FirstWin.swf"; } 该...

smartinvoke的专栏 202

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

smartinvoke入门系列6——让Flex实现事件回调与多线程

本质上来说事件回调也是属于Java调用Flex。前面的Java调用Flex部分已经实现了该功能。但前面介绍的方式有些弊端: 1.  导致Java逻辑代码与Flex接口部分代码结合的比较紧密,降低了代码的可维护性。 2.  程序调用的smartinvoke API比较多,代码的可移植性不高。 在这里我们介绍smartinvoke的事件回调机制,可以解决上面遇到的两个问题。 首先修改First...

smartinvoke的专栏 162

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

smartinvoke入门系列5——实现Java调用Flex

前面讲的都是Flex调用Java的情况,但是在某些时候需要Java调用Flex,比如,当Java某个后台任务执行完毕后应该调用Flex以便界面得到响应。   首先我们在Flex项目First_中新建一服务类cn.first.FlexService供Java调用,内容如下: package cn.first {     import cn.smartinvoke.ServerObject;...

smartinvoke的专栏 179

通过SmartInvoke运用java与flex轻松构建cs程序(理解SmartInvoke的运行原理)

 三种对象(理解这三种对象的概念是掌握SmartInvoke的关键):  服务对象:      即实现了IServiceable接口或注册到ITypefactory字典标记为服类型的类;  代码实现如下:view plaincopy to clipboardprint?

smartinvoke的专栏 532

smartinvoke入门系列9——窗口类型FlashShell与事件

SmartInvoke使用cn.smartinvoke.gui.shell.FlashShell类管理应用程序打开的窗口,通过该对象,用户可以设置窗口的标题,位置,大小,是否可以,透明度等属性,还可以监听窗口的 CShellEvent.Event_Activated,CShellEvent.Event_Closed,CShellEvent.Event_Deactivated, CShellEve...

smartinvoke的专栏 279

smartinvoke中文API及演示程序

java部分API: http://smartrcp.org/doc/java/   Flex部分API: http://smartrcp.org/doc/flex/   示例程序 下面所介绍的示例程序都可以从http://smartrcp.googlecode.com/files/demos.zip下载到。 SmartInvoke媒体播放器,可以播放flex所支持的媒体格式。它...

smartinvoke的专栏 247

通过SmartInvoke运用java与flex轻松构建cs程序(数据类型的传递)

flex与java基本类型对照关系如下: SmartInvoke对以下所列的基本数据类型做了特殊处理,提高了调用的效率, 这里要着重说下数组(Object[]),链表(LinkedList),与哈希字典(Hashtable) 这三种集合类型,虽然说它们是SmartInvoke的内置数据类型,但是可以用来存储任何 数据类型。  Java类型  flex类型 Boolean B...

smartinvoke的专栏 109

通过SmartInvoke运用java与flex轻松构建cs程序(两分钟轻松上手)

 原文地址http://smartinvoke.cn/pages/disArticel.jsp?id=13大家都知道flex的web application不能操作和访问本地文件,我们今天就通过 smartInvoke让flex可以轻松的访问到本地文件。 一:在java应用程序中创建一操作本地文件的test.CFile类,创建几个对文件进

smartinvoke的专栏 633

smartinvoke入门系列4——Java与Flex传递复杂类型

在Flex调用Java方法时,不仅可以传递基本数据类型,而且可以传递自定义复杂的数据类型。在这里我们把这种类型称作Bean Class Type,它的作用类似于J2EE里的Bean Class,只起着组织复杂数据的作用。 在eclipse 工具栏上点击 在Flex调用Java方法时,不仅可以传递基本数据类型,而且可以传递自定义复杂的数据类型。在这里我们把这种类型称作Bean Class Typ...

smartinvoke的专栏 176

smartinvoke入门系列7——让Flex捕获键盘组合键

在FirstWin.mxml中通过调用addKeyBoardListener方法可以设置键盘监听器,该方法在cn.smartinvoke.gui.SIApplication类中定义,方法说明如下:    public function addKeyBoardListener(listener:Function, target:Object, vk1:int = -1, vk2:int = -1...

smartinvoke的专栏 205
上一篇: smartinvoke入门系列9——窗口类型FlashShell与事件
下一篇: smartinvoke中文API及演示程序
smartinvoke
博客等级 码龄17年 4粉丝 12原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值