- 浏览: 311471 次
- 性别:
- 来自: 成都
-
文章分类
- 全部博客 (118)
- VS2008 (2)
- JAVA (34)
- AJAX (1)
- C# (1)
- Flex (16)
- FMS (6)
- SQLSERVER (1)
- ORACLE (1)
- Quartz (1)
- struts2 (1)
- java数据结构 (1)
- java设计模式 (3)
- JSF (0)
- web (2)
- jbpm4 (4)
- J2EE (1)
- webservice (2)
- javascript (8)
- spring (3)
- lucene (0)
- linux (9)
- ibatis (1)
- JPA (2)
- 外挂 (0)
- VB (0)
- Hibernate (1)
- OSGI (8)
- EXT (4)
- Maven (1)
- SpringSecurity (0)
- activiti (0)
- 项目开发 (0)
- 项目管理 (7)
- android (0)
- FFMPEG (1)
- C (2)
- eclipse (1)
最新评论
-
默默得守候在你的身边:
给力
java与Delphi写的dll交互 -
默默得守候在你的身边:
java与Delphi写的dll交互 -
fuguitong:
[url][url][url][url][url][url][ ...
doc转swf -
baidu_25402161:
到结束的时候一直 Can't delete processIn ...
一个请假单流程的实现(struts2.1.8+spring2.5+hibernate3集成jbpm4.3) -
lohaoo1:
nice!
java面包屑导航制作
只要是设计器就逃不脱对组件的动态调整。比如大小,位置是最常见的。
在flashBuilder中可以看到下面效果图:
在此简单实现,更多细节不予考虑,有点伤到我的神经了,总体设计思路图:
由resizeUI完成核心功能。
ResizeContainer容器类:
package org.forever.view { import flash.events.MouseEvent; import mx.collections.ArrayList; import mx.core.IUIComponent; import spark.components.SkinnableContainer; /**容器类*/ public class ResizeContainer { private var _app_container:SkinnableContainer; private var _current_resizeUI:ResizeUI; private var _resizeUIList:ArrayList; public function get mouseMoveCallFun():Function { return _mouseMoveCallFun; } public function set mouseMoveCallFun(value:Function):void { _mouseMoveCallFun = value; } private var _mouseMoveCallFun:Function; public function ResizeContainer(app_container:SkinnableContainer){ _app_container = app_container; initContainer(); _resizeUIList = new ArrayList(); } public function get current_resizeUI():ResizeUI { return _current_resizeUI; } public function set current_resizeUI(value:ResizeUI):void { if(null!=_current_resizeUI){ _current_resizeUI.hideResizeUI(); } _current_resizeUI = value; } public function register(uicomp:IUIComponent):void{ var _resizeUI:ResizeUI = new ResizeUI(uicomp,_app_container); _resizeUI.resizeContainer = this; _resizeUIList.addItem(_resizeUI); } public function initContainer():void{ _app_container.addEventListener(MouseEvent.MOUSE_DOWN,appContainerMouseDownHandler); _app_container.addEventListener(MouseEvent.MOUSE_MOVE,appContainerMouseMoveHandler); _app_container.addEventListener(MouseEvent.MOUSE_UP,appContainerMouseUpHandler); } public function appContainerMouseDownHandler(event:MouseEvent):void{ event.stopImmediatePropagation(); if(null!=_current_resizeUI){ _current_resizeUI.hideResizeUI(); } } public function appContainerMouseMoveHandler(event:MouseEvent):void{ if(null != _mouseMoveCallFun){ _mouseMoveCallFun(event); } } public function appContainerMouseUpHandler(event:MouseEvent):void{ if(null != _mouseMoveCallFun){ _mouseMoveCallFun = null; if(null!=_current_resizeUI)_current_resizeUI.updateUIComp(); } } } }
ResizeUI调整类:
package org.forever.view { import flash.display.DisplayObject; import flash.display.MorphShape; import flash.events.MouseEvent; import flash.ui.Mouse; import mx.controls.Alert; import mx.controls.Image; import mx.core.IUIComponent; import mx.core.IVisualElement; import mx.core.UIComponent; import mx.graphics.SolidColorStroke; import mx.logging.ILogger; import mx.logging.Log; import mx.managers.CursorManager; import spark.components.BorderContainer; import spark.components.SkinnableContainer; import spark.components.mediaClasses.VolumeBar; import spark.primitives.Line; /** *调整UI组件的一个类,类似在flashBuilder对组件的一个调整功能 */ public class ResizeUI{ private var _resizeContainer:ResizeContainer; private static var _log:ILogger = Log.getLogger("org.forever.report.view.ResizeUI"); private var _uiComp:IUIComponent; private var _container:SkinnableContainer; private var _centerRect:BorderContainer; private var _leftTopRect:BorderContainer; private var _rightTopRect:BorderContainer; private var _leftBottomRect:BorderContainer; private var _rightBottomRect:BorderContainer; private var _topCenterRect:BorderContainer; private var _leftCenterRect:BorderContainer; private var _bottomCenterRect:BorderContainer; private var _rightCenterRect:BorderContainer; private var _leftTopTopCenterLine:Line; private var _topCenterRightTopLine:Line; private var _leftTopLeftCenterLine:Line; private var _leftCenterLeftBottomLine:Line; private var _leftBottomBottomCenterLine:Line; private var _bottomCenterRightBottomLine:Line; private var _rightCenterRightBottomLine:Line; private var _rightTopRightCenterLine:Line; private var _rect_w:Number = 6; private var _startMove:Boolean = false; private var _moving:Boolean = false; public function get resizeContainer():ResizeContainer { return _resizeContainer; } public function set resizeContainer(value:ResizeContainer):void { _resizeContainer = value; } /**初始化中间矩形*/ public function initCenterRect():void{ _centerRect = new BorderContainer(); _centerRect.setStyle("borderColor","ffffff"); _centerRect.alpha = 1; _centerRect.visible = false; _container.addElement(_centerRect); } /**初始化所有矩形*/ public function initAllRectProp():void{ _leftTopRect = new BorderContainer(); _rightTopRect = new BorderContainer(); _leftBottomRect = new BorderContainer(); _rightBottomRect = new BorderContainer(); _topCenterRect = new BorderContainer(); _leftCenterRect = new BorderContainer(); _bottomCenterRect = new BorderContainer(); _rightCenterRect = new BorderContainer(); initRectProp(_leftTopRect); initRectProp(_rightTopRect); initRectProp(_leftBottomRect); initRectProp(_rightBottomRect); initRectProp(_topCenterRect); initRectProp(_leftCenterRect); initRectProp(_bottomCenterRect); initRectProp(_rightCenterRect); } /**初始化所有线条*/ public function initAllLine():void{ _leftTopTopCenterLine = new Line(); _leftTopTopCenterLine.stroke = new SolidColorStroke(0x70b2ee); _topCenterRightTopLine = new Line(); _topCenterRightTopLine.stroke = new SolidColorStroke(0x70b2ee); _leftTopLeftCenterLine = new Line(); _leftTopLeftCenterLine.stroke = new SolidColorStroke(0x70b2ee); _leftCenterLeftBottomLine = new Line(); _leftCenterLeftBottomLine.stroke = new SolidColorStroke(0x70b2ee); _leftBottomBottomCenterLine = new Line(); _leftBottomBottomCenterLine.stroke = new SolidColorStroke(0x70b2ee); _bottomCenterRightBottomLine = new Line(); _bottomCenterRightBottomLine.stroke = new SolidColorStroke(0x70b2ee); _rightCenterRightBottomLine = new Line(); _rightCenterRightBottomLine.stroke = new SolidColorStroke(0x70b2ee); _rightTopRightCenterLine = new Line(); _rightTopRightCenterLine.stroke = new SolidColorStroke(0x70b2ee); _container.addElement(_leftTopTopCenterLine); _container.addElement(_topCenterRightTopLine); _container.addElement(_leftTopLeftCenterLine); _container.addElement(_leftCenterLeftBottomLine); _container.addElement(_leftBottomBottomCenterLine); _container.addElement(_bottomCenterRightBottomLine); _container.addElement(_rightCenterRightBottomLine); _container.addElement(_rightTopRightCenterLine); } public function ResizeUI(uiComp:IUIComponent,container:SkinnableContainer){ _uiComp = uiComp; _container = container; initCenterRect(); initAllRectProp(); updateCenterRect(); initAllLine(); _uiComp.addEventListener(MouseEvent.MOUSE_DOWN,uiCompMouseDownHandler); _uiComp.addEventListener(MouseEvent.MOUSE_MOVE,uiCompMouseMoveHandler); _uiComp.addEventListener(MouseEvent.MOUSE_UP,uiCompMouseUpHandler); _centerRect.addEventListener(MouseEvent.MOUSE_UP,centerRectMouseUpHandler); _centerRect.addEventListener(MouseEvent.MOUSE_MOVE,centerRectMouseMoveHandler); _rightCenterRect.addEventListener(MouseEvent.MOUSE_DOWN,rightCenterMouseDownHandler); _topCenterRect.addEventListener(MouseEvent.MOUSE_DOWN,topCenterRectMouseDownHandler); _bottomCenterRect.addEventListener(MouseEvent.MOUSE_DOWN,bottomCenterRectMouseDownHandler); _leftCenterRect.addEventListener(MouseEvent.MOUSE_DOWN,leftCenterRectMouseDownHandler); _rightTopRect.addEventListener(MouseEvent.MOUSE_DOWN,rightTopRectMouseDownHandler); _rightBottomRect.addEventListener(MouseEvent.MOUSE_DOWN,rightBottomRectMouseDownHandler); _leftTopRect.addEventListener(MouseEvent.MOUSE_DOWN,leftTopRectMouseDownHandler); _leftBottomRect.addEventListener(MouseEvent.MOUSE_DOWN,leftBottomRectMouseDownHandler); } public function uiCompMouseDownHandler(event:MouseEvent):void{ event.stopImmediatePropagation(); _resizeContainer.current_resizeUI = this; _startMove = true;//点击组件做移动准备 _moving = false;//并未真正移动 _log.debug("_centerRect准备开始移动......"); updateCenterRect(); showResizeUI(); } public function updateUIComp():void{ _uiComp.x = _leftTopRect.x + _leftTopRect.width; _uiComp.y = _leftTopRect.y + _leftTopRect.height; _uiComp.width = _rightTopRect.x - _leftTopRect.x - _leftTopRect.width; _uiComp.height = _leftBottomRect.y - _leftTopRect.y - _leftTopRect.height; _log.debug("updateUIComp........."); updateCenterRect(); } public function updateCenterRect():void{ _centerRect.x = _uiComp.x; _centerRect.y = _uiComp.y; _centerRect.width = _uiComp.width; _centerRect.height = _uiComp.height; _log.debug("updateCenterRect....."); } public function uiCompMouseMoveHandler(event:MouseEvent):void{ if(_startMove && !_moving){ _uiComp.visible = false; _centerRect.visible = true; _centerRect.startDrag(); _moving = true; _log.debug("_centerRect开始移动......"); } } public function centerRectMouseMoveHandler(event:MouseEvent):void{ refreshResizeUI(); } public function centerRectMouseUpHandler(event:MouseEvent):void{ stopCenterRectMove(); refreshResizeUI(); } public function stopCenterRectMove():void{ _startMove = false; _moving = false; _centerRect.stopDrag(); _uiComp.x = _centerRect.x; _uiComp.y = _centerRect.y; _uiComp.visible = true; _centerRect.visible = false; _log.debug("停止_centerRect的移动........"); } public function uiCompMouseUpHandler(event:MouseEvent):void{ stopCenterRectMove(); } public function rightCenterMouseOverHandler(event:MouseEvent):void{ Mouse.hide(); } public function rightCenterMouseOutHandler(event:MouseEvent):void{ Mouse.show(); } public function leftBottomRectMouseDownHandler(event:MouseEvent):void{ event.stopImmediatePropagation(); _resizeContainer.mouseMoveCallFun = updateLeftBottomRectCall; } public function updateLeftBottomRectCall(event:MouseEvent):void{ updateLeftCenterRectCall(event); updateBottomCenterRectCall(event); } public function leftTopRectMouseDownHandler(event:MouseEvent):void{ event.stopImmediatePropagation(); _resizeContainer.mouseMoveCallFun = updateLeftTopRectCall; } public function updateLeftTopRectCall(event:MouseEvent):void{ updateTopCenterRectCall(event); updateLeftCenterRectCall(event); } public function rightBottomRectMouseDownHandler(event:MouseEvent):void{ event.stopImmediatePropagation(); _resizeContainer.mouseMoveCallFun = updateRightBottomRectCall; } public function updateRightBottomRectCall(event:MouseEvent):void{ updateRightCenterRectCall(event); updateBottomCenterRectCall(event); } public function rightTopRectMouseDownHandler(event:MouseEvent):void{ event.stopImmediatePropagation(); _resizeContainer.mouseMoveCallFun = updateRightTopRectCall; } public function updateRightTopRectCall(event:MouseEvent):void{ updateRightCenterRectCall(event); updateTopCenterRectCall(event); } public function leftCenterRectMouseDownHandler(event:MouseEvent):void{ event.stopImmediatePropagation(); _resizeContainer.mouseMoveCallFun = updateLeftCenterRectCall; } public function updateLeftCenterRectCall(event:MouseEvent):void{ _leftCenterRect.x = _container.mouseX; _leftTopRect.x = _leftCenterRect.x; _leftBottomRect.x = _leftCenterRect.x; updateLeftTopLeftCenterLine(); updateLeftCenterLeftBottomLine(); updateLeftTopTopCenterLine(); updateLeftBottomBottomCenterLine(); updateTopCenterRect(); updateBottomCenterRect(); updateTopCenterRightTopLine(); updateBottomCenterRightBottomLine(); } public function bottomCenterRectMouseDownHandler(event:MouseEvent):void{ event.stopImmediatePropagation(); _resizeContainer.mouseMoveCallFun = updateBottomCenterRectCall; } public function updateBottomCenterRectCall(event:MouseEvent):void{ _bottomCenterRect.y = _container.mouseY; _leftBottomRect.y = _bottomCenterRect.y; _rightBottomRect.y = _bottomCenterRect.y; updateLeftBottomBottomCenterLine(); updateBottomCenterRightBottomLine(); updateLeftCenterLeftBottomLine(); updateRightCenterRightBottomLine(); updateLeftCenterRect(); updateRightCenterRect(); updateLeftTopLeftCenterLine(); updateRightTopRightCenterLine(); } public function topCenterRectMouseDownHandler(event:MouseEvent):void{ event.stopImmediatePropagation(); _resizeContainer.mouseMoveCallFun = updateTopCenterRectCall; } public function updateTopCenterRectCall(event:MouseEvent):void{ _topCenterRect.y = _container.mouseY; _leftTopRect.y = _topCenterRect.y; _rightTopRect.y = _topCenterRect.y; updateLeftTopTopCenterLine(); updateTopCenterRightTopLine(); updateLeftTopLeftCenterLine(); updateRightTopRightCenterLine(); updateLeftCenterRect(); updateRightCenterRect(); updateLeftCenterLeftBottomLine(); updateRightCenterRightBottomLine(); } public function rightCenterMouseDownHandler(event:MouseEvent):void{ event.stopImmediatePropagation(); _resizeContainer.mouseMoveCallFun = updateRightCenterRectCall; } public function updateRightCenterRectCall(event:MouseEvent):void{ _rightCenterRect.x = _container.mouseX; _rightTopRect.x = _rightCenterRect.x; _rightBottomRect.x = _rightCenterRect.x; updateRightTopRightCenterLine(); updateRightCenterRightBottomLine(); updateTopCenterRightTopLine(); updateBottomCenterRightBottomLine(); updateTopCenterRect(); updateBottomCenterRect(); updateLeftBottomBottomCenterLine(); updateLeftTopTopCenterLine(); } public function updateRightCenterRect():void{ _rightCenterRect.y = (_rightTopRect.y + _rightBottomRect.y)/2; } public function updateLeftCenterRect():void{ _leftCenterRect.y = (_leftTopRect.y + _leftBottomRect.y)/2; } public function updateTopCenterRect():void{ _topCenterRect.x = (_leftTopTopCenterLine.xFrom + _topCenterRightTopLine.xTo)/2; } public function updateBottomCenterRect():void{ _bottomCenterRect.x = (_leftBottomBottomCenterLine.xFrom + _bottomCenterRightBottomLine.xTo)/2; } public function initRectProp(_rect:BorderContainer):void{ _rect.width = _rect_w; _rect.height = _rect_w; _rect.visible = false; _rect.setStyle("borderColor","#70B2EE"); _container.addElement(_rect); } public function refreshResizeUI():void{ _leftTopRect.x = _centerRect.x-_leftTopRect.width; _leftTopRect.y = _centerRect.y -_leftTopRect.height; _rightTopRect.x = _centerRect.x + _centerRect.width; _rightTopRect.y = _centerRect.y - _leftBottomRect.height; _leftBottomRect.x = _centerRect.x-_leftBottomRect.width; _leftBottomRect.y = _centerRect.y + _centerRect.height; _rightBottomRect.x = _centerRect.x + _centerRect.width; _rightBottomRect.y = _centerRect.y + _centerRect.height; _topCenterRect.x = _centerRect.x + _centerRect.width/2 -_topCenterRect.width/2 ; _topCenterRect.y = _centerRect.y - _topCenterRect.height; _leftCenterRect.x = _centerRect.x - _leftCenterRect.width; _leftCenterRect.y = _centerRect.y + _centerRect.height/2 - _leftCenterRect.height/2; _bottomCenterRect.x =_centerRect.x + _centerRect.width/2 -_topCenterRect.width/2 ; _bottomCenterRect.y = _centerRect.y + _centerRect.height; _rightCenterRect.x = _centerRect.x + _centerRect.width; _rightCenterRect.y = _centerRect.y + _centerRect.height/2 - _leftCenterRect.height/2; showAllRect(); updateLeftTopTopCenterLine(); updateBottomCenterRightBottomLine(); updateLeftBottomBottomCenterLine(); updateLeftCenterLeftBottomLine(); updateLeftTopLeftCenterLine(); updateTopCenterRightTopLine(); updateRightCenterRightBottomLine(); updateRightTopRightCenterLine(); _log.debug("refreshResizeUI............"); } public function showAllRect():void{ _leftTopRect.visible = true; _rightTopRect.visible = true; _leftBottomRect.visible = true; _rightBottomRect.visible = true; _topCenterRect.visible = true; _leftCenterRect.visible = true; _bottomCenterRect.visible = true; _rightCenterRect.visible = true; } public function hideResizeUI():void{ hideAllRect(); hideAllLine(); } public function showAllLine():void{ _leftTopTopCenterLine.visible = true; _topCenterRightTopLine.visible = true; _leftTopLeftCenterLine.visible = true; _leftCenterLeftBottomLine.visible = true; _leftBottomBottomCenterLine.visible = true; _bottomCenterRightBottomLine.visible = true; _rightCenterRightBottomLine.visible = true; _rightTopRightCenterLine.visible = true; } public function hideAllLine():void{ _leftTopTopCenterLine.visible = false; _topCenterRightTopLine.visible = false; _leftTopLeftCenterLine.visible = false; _leftCenterLeftBottomLine.visible = false; _leftBottomBottomCenterLine.visible = false; _bottomCenterRightBottomLine.visible = false; _rightCenterRightBottomLine.visible = false; _rightTopRightCenterLine.visible = false; } public function hideAllRect():void{ _leftTopRect.visible = false; _rightTopRect.visible = false; _leftBottomRect.visible = false; _rightBottomRect.visible = false; _topCenterRect.visible = false; _leftCenterRect.visible = false; _bottomCenterRect.visible = false; _rightCenterRect.visible = false; } /**显示所有辅助组件拖动的矩形框*/ public function showResizeUI():void{ _leftTopRect.x = _uiComp.x-_leftTopRect.width; _leftTopRect.y = _uiComp.y -_leftTopRect.height; _rightTopRect.x = _uiComp.x + _uiComp.width; _rightTopRect.y = _uiComp.y - _leftBottomRect.height; _leftBottomRect.x = _uiComp.x-_leftBottomRect.width; _leftBottomRect.y = _uiComp.y + _uiComp.height; _rightBottomRect.x = _uiComp.x + _uiComp.width; _rightBottomRect.y = _uiComp.y + _uiComp.height; _topCenterRect.x = _uiComp.x + _uiComp.width/2 -_topCenterRect.width/2 ; _topCenterRect.y = _uiComp.y - _topCenterRect.height; _leftCenterRect.x = _uiComp.x - _leftCenterRect.width; _leftCenterRect.y = _uiComp.y + _uiComp.height/2 - _leftCenterRect.height/2; _bottomCenterRect.x =_uiComp.x + _uiComp.width/2 -_topCenterRect.width/2 ; _bottomCenterRect.y = _uiComp.y + _uiComp.height; _rightCenterRect.x = _uiComp.x + _uiComp.width; _rightCenterRect.y = _uiComp.y + _uiComp.height/2 - _leftCenterRect.height/2; showAllRect(); updateLeftTopTopCenterLine(); updateBottomCenterRightBottomLine(); updateLeftBottomBottomCenterLine(); updateLeftCenterLeftBottomLine(); updateLeftTopLeftCenterLine(); updateTopCenterRightTopLine(); updateRightCenterRightBottomLine(); updateRightTopRightCenterLine(); showAllLine(); _log.debug("showResizeUI............"); } public function updateLeftTopTopCenterLine():void{ _leftTopTopCenterLine.xFrom = _leftTopRect.x+_leftTopRect.width; _leftTopTopCenterLine.yFrom = _leftTopRect.y+_leftTopRect.height/2; _leftTopTopCenterLine.xTo = _topCenterRect.x; _leftTopTopCenterLine.yTo = _topCenterRect.y+_leftTopRect.height/2; } public function updateBottomCenterRightBottomLine():void{ _bottomCenterRightBottomLine.xFrom = _bottomCenterRect.x + _bottomCenterRect.width; _bottomCenterRightBottomLine.yFrom = _bottomCenterRect.y + _bottomCenterRect.height/2; _bottomCenterRightBottomLine.xTo = _rightBottomRect.x; _bottomCenterRightBottomLine.yTo = _rightBottomRect.y + _rightBottomRect.height/2; } public function updateLeftBottomBottomCenterLine():void{ _leftBottomBottomCenterLine.xFrom = _leftBottomRect.x + _leftBottomRect.width; _leftBottomBottomCenterLine.yFrom = _leftBottomRect.y + _leftBottomRect.height/2; _leftBottomBottomCenterLine.xTo = _bottomCenterRect.x; _leftBottomBottomCenterLine.yTo = _bottomCenterRect.y + _bottomCenterRect.height/2; } public function updateLeftCenterLeftBottomLine():void{ _leftCenterLeftBottomLine.xFrom = _leftCenterRect.x + _leftCenterRect.width/2; _leftCenterLeftBottomLine.yFrom = _leftCenterRect.y + _leftCenterRect.height; _leftCenterLeftBottomLine.xTo = _leftBottomRect.x + _leftBottomRect.width/2; _leftCenterLeftBottomLine.yTo = _leftBottomRect.y; } public function updateLeftTopLeftCenterLine():void{ _leftTopLeftCenterLine.xFrom = _leftTopRect.x + _leftTopRect.width/2; _leftTopLeftCenterLine.yFrom = _leftTopRect.y + _leftTopRect.height; _leftTopLeftCenterLine.xTo = _leftCenterRect.x + _leftCenterRect.width/2; _leftTopLeftCenterLine.yTo = _leftCenterRect.y; } public function updateTopCenterRightTopLine():void{ _topCenterRightTopLine.xFrom = _topCenterRect.x+_topCenterRect.width; _topCenterRightTopLine.yFrom = _topCenterRect.y+_topCenterRect.height/2; _topCenterRightTopLine.xTo = _rightTopRect.x; _topCenterRightTopLine.yTo = _rightTopRect.y+_rightTopRect.height/2; } public function updateRightCenterRightBottomLine():void{ _rightCenterRightBottomLine.xFrom = _rightCenterRect.x + _rightCenterRect.width/2; _rightCenterRightBottomLine.yFrom = _rightCenterRect.y + _rightCenterRect.height; _rightCenterRightBottomLine.xTo = _rightBottomRect.x + _rightBottomRect.width/2; _rightCenterRightBottomLine.yTo = _rightBottomRect.y; } public function updateRightTopRightCenterLine():void{ _rightTopRightCenterLine.xFrom = _rightTopRect.x + _rightTopRect.width/2; _rightTopRightCenterLine.yFrom = _rightTopRect.y + _rightTopRect.height; _rightTopRightCenterLine.xTo = _rightCenterRect.x + _rightCenterRect.width/2; _rightTopRightCenterLine.yTo = _rightCenterRect.y; } } }
简单日志类LogUtil:
package org.forever.log { import mx.logging.Log; import mx.logging.LogEventLevel; import mx.logging.targets.TraceTarget; public class LogUtil { public function LogUtil() { } public static function initLogging():void { var logTarget:TraceTarget = new TraceTarget(); logTarget.filters=["*"]; logTarget.level = LogEventLevel.ALL; logTarget.includeDate = true; logTarget.includeTime = true; logTarget.includeCategory = true; logTarget.includeLevel = true; /* Begin logging. */ Log.addTarget(logTarget); } } }
例子类ResizeUIDemo.mxml:
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="init()"> <fx:Script> <![CDATA[ import org.forever.log.LogUtil; import org.forever.view.ResizeContainer; import org.forever.view.ResizeUI; public function init():void{ LogUtil.initLogging(); var _resizeContainer:ResizeContainer = new ResizeContainer(this); _resizeContainer.register(btn_1); _resizeContainer.register(btn_2); _resizeContainer.register(bc); _resizeContainer.register(lbl); } ]]> </fx:Script> <fx:Declarations> <!-- 将非可视元素(例如服务、值对象)放在此处 --> </fx:Declarations> <s:Button id="btn_1" x="282" y="125" label="按钮_1"/> <s:Button id="btn_2" x="71" y="214" label="按钮_2"/> <s:BorderContainer id="bc" x="111" y="77" width="85" height="69" backgroundColor="#75FA51"> </s:BorderContainer> <s:Label x="27" y="10" text="点击下面组件进行拖放或者调整大小" width="200" height="24" verticalAlign="middle"/> <s:Label id="lbl" x="224" y="223" text="标签组件"/> </s:Application>
效果图:
有时间在继续写了。累了。
发表评论
-
flex折线的实现
2011-10-02 20:40 3396用到的有三个类,BrokenLine.as,BrokenLin ... -
flex标尺的实现
2011-08-28 21:49 2247效果图: 组件类: package org.for ... -
flex设计器功能拆分之二(撤销与恢复)
2011-03-16 22:01 2590撤销与恢复主要用到了 ... -
flex4与JavaScript交互
2010-11-06 09:10 3062利用flex来开发程序很快,有时难免会和js交互. flex ... -
flex表格设计器
2010-07-17 19:30 5132未完,开发中...... 记录每次修改过程。 第一次开发, ... -
flex折线的实现
2010-06-10 17:17 2426看效果: 可以无限折: 带源码,欢迎交流 请查看htt ... -
flex视频播放器
2010-05-13 07:46 0wwew -
flex_java文件上传(一)
2010-05-09 22:34 1822功能如下: 能够批量上传勾上的文件,能够批量删除指定的文件 ... -
flex4正式版注册号
2010-04-10 21:54 1587网上找的,可以用 C:\WINDOWS\system32\d ... -
Chart之PieChart简单应用
2010-04-04 12:13 7191效果图: 功能:能够修改指定国家的获奖信息,能够指定要显示 ... -
Chart之ColumnChart简单应用
2010-04-04 10:03 2516效果图: 代码: <?xml version=&q ... -
flex4视频教程
2010-03-29 09:48 0http://you.video.sina.com.cn/vl ... -
flex视音频通讯-摄像头及麦克风检测
2010-03-29 09:44 958flex视音频通讯-摄像头及麦克风检测 <mx: ... -
在线中文api
2010-03-25 18:17 1553flex4注册码:1424-4008-9664-3602-34 ... -
flex框架集合
2010-02-27 09:10 10881月17日 Flex开源框架汇总 Cairngorm ... -
BlazeDS的初步使用
2009-11-26 11:30 2486刚接触这东西的时候去网上了解了哈,BlazeDS用于flex和 ... -
datagrid 嵌套单选按钮互斥方法
2009-11-24 11:20 1827在一次使用datagrid的时候,嵌入了单选按钮组件: 突 ...
相关推荐
内容概要:本文详细介绍了基于MATLAB GUI界面和卷积神经网络(CNN)的模糊车牌识别系统。该系统旨在解决现实中车牌因模糊不清导致识别困难的问题。文中阐述了整个流程的关键步骤,包括图像的模糊还原、灰度化、阈值化、边缘检测、孔洞填充、形态学操作、滤波操作、车牌定位、字符分割以及最终的字符识别。通过使用维纳滤波或最小二乘法约束滤波进行模糊还原,再利用CNN的强大特征提取能力完成字符分类。此外,还特别强调了MATLAB GUI界面的设计,使得用户能直观便捷地操作整个系统。 适合人群:对图像处理和深度学习感兴趣的科研人员、高校学生及从事相关领域的工程师。 使用场景及目标:适用于交通管理、智能停车场等领域,用于提升车牌识别的准确性和效率,特别是在面对模糊车牌时的表现。 其他说明:文中提供了部分关键代码片段作为参考,并对实验结果进行了详细的分析,展示了系统在不同环境下的表现情况及其潜在的应用前景。
嵌入式八股文面试题库资料知识宝典-计算机专业试题.zip
嵌入式八股文面试题库资料知识宝典-C and C++ normal interview_3.zip
内容概要:本文深入探讨了一款额定功率为4kW的开关磁阻电机,详细介绍了其性能参数如额定功率、转速、效率、输出转矩和脉动率等。同时,文章还展示了利用RMxprt、Maxwell 2D和3D模型对该电机进行仿真的方法和技术,通过外电路分析进一步研究其电气性能和动态响应特性。最后,文章提供了基于RMxprt模型的MATLAB仿真代码示例,帮助读者理解电机的工作原理及其性能特点。 适合人群:从事电机设计、工业自动化领域的工程师和技术人员,尤其是对开关磁阻电机感兴趣的科研工作者。 使用场景及目标:适用于希望深入了解开关磁阻电机特性和建模技术的研究人员,在新产品开发或现有产品改进时作为参考资料。 其他说明:文中提供的代码示例仅用于演示目的,实际操作时需根据所用软件的具体情况进行适当修改。
少儿编程scratch项目源代码文件案例素材-剑客冲刺.zip
少儿编程scratch项目源代码文件案例素材-几何冲刺 转瞬即逝.zip
内容概要:本文详细介绍了基于PID控制器的四象限直流电机速度驱动控制系统仿真模型及其永磁直流电机(PMDC)转速控制模型。首先阐述了PID控制器的工作原理,即通过对系统误差的比例、积分和微分运算来调整电机的驱动信号,从而实现转速的精确控制。接着讨论了如何利用PID控制器使有刷PMDC电机在四个象限中精确跟踪参考速度,并展示了仿真模型在应对快速负载扰动时的有效性和稳定性。最后,提供了Simulink仿真模型和详细的Word模型说明文档,帮助读者理解和调整PID控制器参数,以达到最佳控制效果。 适合人群:从事电力电子与电机控制领域的研究人员和技术人员,尤其是对四象限直流电机速度驱动控制系统感兴趣的读者。 使用场景及目标:适用于需要深入了解和掌握四象限直流电机速度驱动控制系统设计与实现的研究人员和技术人员。目标是在实际项目中能够运用PID控制器实现电机转速的精确控制,并提高系统的稳定性和抗干扰能力。 其他说明:文中引用了多篇相关领域的权威文献,确保了理论依据的可靠性和实用性。此外,提供的Simulink模型和Word文档有助于读者更好地理解和实践所介绍的内容。
嵌入式八股文面试题库资料知识宝典-2013年海康威视校园招聘嵌入式开发笔试题.zip
少儿编程scratch项目源代码文件案例素材-驾驶通关.zip
小区开放对周边道路通行能力影响的研究.pdf
内容概要:本文探讨了冷链物流车辆路径优化问题,特别是如何通过NSGA-2遗传算法和软硬时间窗策略来实现高效、环保和高客户满意度的路径规划。文中介绍了冷链物流的特点及其重要性,提出了软时间窗概念,允许一定的配送时间弹性,同时考虑碳排放成本,以达到绿色物流的目的。此外,还讨论了如何将客户满意度作为路径优化的重要评价标准之一。最后,通过一段简化的Python代码展示了遗传算法的应用。 适合人群:从事物流管理、冷链物流运营的专业人士,以及对遗传算法和路径优化感兴趣的科研人员和技术开发者。 使用场景及目标:适用于冷链物流企业,旨在优化配送路线,降低运营成本,减少碳排放,提升客户满意度。目标是帮助企业实现绿色、高效的物流配送系统。 其他说明:文中提供的代码仅为示意,实际应用需根据具体情况调整参数设置和模型构建。
少儿编程scratch项目源代码文件案例素材-恐怖矿井.zip
内容概要:本文详细介绍了基于STM32F030的无刷电机控制方案,重点在于高压FOC(磁场定向控制)技术和滑膜无感FOC的应用。该方案实现了过载、过欠压、堵转等多种保护机制,并提供了完整的源码、原理图和PCB设计。文中展示了关键代码片段,如滑膜观测器和电流环处理,以及保护机制的具体实现方法。此外,还提到了方案的移植要点和实际测试效果,确保系统的稳定性和高效性。 适合人群:嵌入式系统开发者、电机控制系统工程师、硬件工程师。 使用场景及目标:适用于需要高性能无刷电机控制的应用场景,如工业自动化设备、无人机、电动工具等。目标是提供一种成熟的、经过验证的无刷电机控制方案,帮助开发者快速实现并优化电机控制性能。 其他说明:提供的资料包括详细的原理图、PCB设计文件、源码及测试视频,方便开发者进行学习和应用。
基于有限体积法Godunov格式的管道泄漏检测模型研究.pdf
嵌入式八股文面试题库资料知识宝典-CC++笔试题-深圳有为(2019.2.28)1.zip
少儿编程scratch项目源代码文件案例素材-几何冲刺 V1.5.zip
Android系统开发_Linux内核配置_USB-HID设备模拟_通过root权限将Android设备转换为全功能USB键盘的项目实现_该项目需要内核支持configFS文件系统
C# WPF - LiveCharts Project
少儿编程scratch项目源代码文件案例素材-恐怖叉子 动画.zip
嵌入式八股文面试题库资料知识宝典-嵌⼊式⼯程师⾯试⾼频问题.zip