diff --git a/embedded/cursor_move.gif b/embedded/cursor_move.gif
new file mode 100755
index 00000000..47d4f989
Binary files /dev/null and b/embedded/cursor_move.gif differ
diff --git a/embedded/cursor_resize.gif b/embedded/cursor_resize.gif
new file mode 100755
index 00000000..6edc8577
Binary files /dev/null and b/embedded/cursor_resize.gif differ
diff --git a/net/systemeD/controls/DragHandle.mxml b/net/systemeD/controls/DragHandle.mxml
new file mode 100755
index 00000000..b6e91af4
--- /dev/null
+++ b/net/systemeD/controls/DragHandle.mxml
@@ -0,0 +1,95 @@
+
+
+
+
+ 0x8B8B8B
+ 0xFFFFFF
+ 0.2
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/net/systemeD/controls/MoveManager.as b/net/systemeD/controls/MoveManager.as
new file mode 100755
index 00000000..e9d494e4
--- /dev/null
+++ b/net/systemeD/controls/MoveManager.as
@@ -0,0 +1,207 @@
+package net.systemeD.controls {
+ import flash.events.Event;
+ import flash.events.MouseEvent;
+ import flash.geom.Rectangle;
+
+ import mx.controls.Button;
+ import mx.core.Container;
+ import mx.core.EdgeMetrics;
+ import mx.core.UIComponent;
+ import mx.managers.CursorManager;
+
+ /**
+ * Similar to the ResizeManager, this class adds support for moving a component by dragging it
+ * with the mouse. It also supports showing a custom cursor while dragging.
+ *
+ * @author Chris Callendar
+ * @date March 17th, 2009
+ */
+ public class MoveManager {
+
+ public static const DRAG_START:String = "dragStart";
+
+ public static const DRAGGING:String = "dragging";
+
+ public static const DRAG_END:String = "dragEnd";
+
+ // the component that is being moved
+ private var moveComponent:UIComponent;
+
+ // the component that when dragged causes the above component to move
+ private var dragComponent:UIComponent;
+
+ private var dragging:Boolean;
+
+ private var _enabled:Boolean;
+
+ private var _bringToFrontOnMove:Boolean;
+
+ private var _constrainToParentBounds:Boolean;
+
+ private var _constrainToBounds:Rectangle;
+
+ [Embed(source="../../../embedded/cursor_move.gif")]
+ public var moveIcon:Class;
+
+ private var moveCursorID:int;
+
+ public function MoveManager(moveComponent:UIComponent = null, dragComponent:UIComponent = null) {
+ dragging = false;
+ _enabled = true;
+ _bringToFrontOnMove = false;
+ _constrainToParentBounds = false;
+ _constrainToBounds = null;
+ moveCursorID = 0;
+ addMoveSupport(moveComponent, dragComponent);
+ }
+
+ public function get enabled():Boolean {
+ return _enabled;
+ }
+
+ public function set enabled(en:Boolean):void {
+ if (en != _enabled) {
+ _enabled = en;
+ }
+ }
+
+ public function get bringToFrontOnMove():Boolean {
+ return _bringToFrontOnMove;
+ }
+
+ public function set bringToFrontOnMove(value:Boolean):void {
+ _bringToFrontOnMove = value;
+ }
+
+ /**
+ * Returns true if the component's movement is constrained to within
+ * the parent's bounds.
+ */
+ public function get constrainToParentBounds():Boolean {
+ return _constrainToParentBounds;
+ }
+
+ /**
+ * Set to true if the component's movement is to be constrained to within
+ * the parent's bounds.
+ */
+ public function set constrainToParentBounds(value:Boolean):void {
+ _constrainToParentBounds = value;
+ }
+
+ /**
+ * Returns the bounds used to constrain the component's movement.
+ */
+ public function get constrainToBounds():Rectangle {
+ return _constrainToBounds;
+ }
+
+ /**
+ * Sets the bounds used to constrain the component's movement.
+ */
+ public function set constrainToBounds(value:Rectangle):void {
+ _constrainToBounds = value;
+ }
+
+ /**
+ * Adds support for moving a component.
+ * @param moveComponent the component that will have its x and y values changed
+ * @param dragComponent the component that will have a mouse_down listener added to listen
+ * for when the user drags it. If null then the moveComponent is used instead.
+ */
+ public function addMoveSupport(moveComponent:UIComponent, dragComponent:UIComponent = null):void {
+ this.moveComponent = moveComponent;
+ this.dragComponent = dragComponent;
+ if (dragComponent) {
+ dragComponent.addEventListener(MouseEvent.MOUSE_DOWN, dragComponentMouseDown);
+ } else if (moveComponent) {
+ moveComponent.addEventListener(MouseEvent.MOUSE_DOWN, dragComponentMouseDown);
+ }
+ }
+
+ /**
+ * Removes move support, removes the mouse listener and the move handle.
+ */
+ public function removeMoveSupport():void {
+ if (dragComponent) {
+ dragComponent.removeEventListener(MouseEvent.MOUSE_DOWN, dragComponentMouseDown);
+ } else if (moveComponent) {
+ moveComponent.removeEventListener(MouseEvent.MOUSE_DOWN, dragComponentMouseDown);
+ }
+ }
+
+ /**
+ * This function gets called when the user presses down the mouse button on the
+ * dragComponent (or if not specified then the moveComponent).
+ * It starts the drag process.
+ */
+ private function dragComponentMouseDown(event:MouseEvent):void {
+ if (!enabled) {
+ return;
+ }
+
+ // move above all others
+ if (bringToFrontOnMove && moveComponent.parent) {
+ var index:int = moveComponent.parent.getChildIndex(moveComponent);
+ var last:int = moveComponent.parent.numChildren - 1;
+ if (index != last) {
+ moveComponent.parent.setChildIndex(moveComponent, last);
+ }
+ }
+
+ // Constain the movement by the parent's bounds?
+ var bounds:Rectangle = null;
+ if (constrainToBounds != null) {
+ bounds = constrainToBounds;
+ } else if (constrainToParentBounds && moveComponent.parent) {
+ bounds = new Rectangle(0, 0, moveComponent.parent.width, moveComponent.parent.height);
+ // need to reduce the size by the component's width/height
+ bounds.width = Math.max(0, bounds.width - moveComponent.width);
+ bounds.height = Math.max(0, bounds.height - moveComponent.height);
+ }
+ moveComponent.startDrag(false, bounds);
+ setMoveCursor();
+ moveComponent.systemManager.addEventListener(MouseEvent.MOUSE_MOVE, dragComponentMove);
+ moveComponent.systemManager.addEventListener(MouseEvent.MOUSE_UP, dragComponentMouseUp);
+ moveComponent.systemManager.stage.addEventListener(Event.MOUSE_LEAVE, dragComponentMouseUp);
+ }
+
+ private function dragComponentMove(event:MouseEvent):void {
+ if (!dragging) {
+ dragging = true;
+ moveComponent.clearStyle("top");
+ moveComponent.clearStyle("right");
+ moveComponent.clearStyle("bottom");
+ moveComponent.clearStyle("left");
+ moveComponent.dispatchEvent(new Event(DRAG_START));
+ }
+ moveComponent.dispatchEvent(new Event(DRAGGING));
+ }
+
+ private function dragComponentMouseUp(event:Event):void {
+ moveComponent.stopDrag();
+ removeMoveCursor();
+ if (dragging) {
+ dragging = false;
+ moveComponent.dispatchEvent(new Event(DRAG_END));
+ }
+ moveComponent.systemManager.removeEventListener(MouseEvent.MOUSE_MOVE, dragComponentMove);
+ moveComponent.systemManager.removeEventListener(MouseEvent.MOUSE_UP, dragComponentMouseUp);
+ moveComponent.systemManager.stage.removeEventListener(Event.MOUSE_LEAVE, dragComponentMouseUp);
+ }
+
+ private function setMoveCursor():void {
+ if ((moveCursorID == 0) && (moveIcon != null)) {
+ moveCursorID = CursorManager.setCursor(moveIcon, 2, -12, -10);
+ }
+ }
+
+ private function removeMoveCursor():void {
+ if (moveCursorID != 0) {
+ CursorManager.removeCursor(moveCursorID);
+ moveCursorID = 0;
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/net/systemeD/controls/ResizableDraggableTitleWindowSkin.mxml b/net/systemeD/controls/ResizableDraggableTitleWindowSkin.mxml
new file mode 100755
index 00000000..1e543793
--- /dev/null
+++ b/net/systemeD/controls/ResizableDraggableTitleWindowSkin.mxml
@@ -0,0 +1,408 @@
+
+
+
+
+
+
+
+
+
+ /* Define the skin elements that should not be colorized.
+ For panel, border and title background are skinned, but the content area and title text are not. */
+ static private const exclusions:Array = ["background", "titleDisplay", "contentGroup"];
+
+ private var cornerRadius:Number;
+
+ override public function get colorizeExclusions():Array {
+ return exclusions;
+ }
+
+ override protected function initializationComplete():void {
+ useChromeColor = true;
+ super.initializationComplete();
+ }
+
+ override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
+ if (getStyle("borderVisible") == true) {
+ border.visible = true;
+ background.left = background.top = background.right = background.bottom = 1;
+ contents.left = contents.top = contents.right = contents.bottom = 1;
+ } else {
+ border.visible = false;
+ background.left = background.top = background.right = background.bottom = 0;
+ contents.left = contents.top = contents.right = contents.bottom = 0;
+ }
+
+ dropShadow.visible = getStyle("dropShadowVisible");
+
+ var cr:Number = getStyle("cornerRadius");
+ var withControls:Boolean =
+ (currentState == "disabledWithControlBar" ||
+ currentState == "normalWithControlBar" ||
+ currentState == "inactiveWithControlBar");
+
+ if (cornerRadius != cr) {
+ cornerRadius = cr;
+
+ dropShadow.tlRadius = cornerRadius;
+ dropShadow.trRadius = cornerRadius;
+ dropShadow.blRadius = withControls ? cornerRadius : 0;
+ dropShadow.brRadius = withControls ? cornerRadius : 0;
+
+ setPartCornerRadii(topMaskRect, withControls);
+ setPartCornerRadii(border, withControls);
+ setPartCornerRadii(background, withControls);
+ }
+
+ if (bottomMaskRect) {
+ setPartCornerRadii(bottomMaskRect, withControls);
+ }
+ borderStroke.color = getStyle("borderColor");
+ borderStroke.alpha = getStyle("borderAlpha");
+ backgroundFill.color = getStyle("backgroundColor");
+ backgroundFill.alpha = getStyle("backgroundAlpha");
+
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+ }
+
+ private function setPartCornerRadii(target:Rect, includeBottom:Boolean):void {
+ target.topLeftRadiusX = cornerRadius;
+ target.topRightRadiusX = cornerRadius;
+ target.bottomLeftRadiusX = includeBottom ? cornerRadius : 0;
+ target.bottomRightRadiusX = includeBottom ? cornerRadius : 0;
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/net/systemeD/controls/ResizablePanel.as b/net/systemeD/controls/ResizablePanel.as
new file mode 100644
index 00000000..eff0b42a
--- /dev/null
+++ b/net/systemeD/controls/ResizablePanel.as
@@ -0,0 +1,38 @@
+package flexScript {
+ import flash.events.MouseEvent;
+
+ import mx.containers.Panel;
+ import mx.controls.Button;
+
+ public class ResizablePanel extends Panel {
+ private var resizer:Button = new Button();
+
+ public function ResizablePanel() {
+ super();
+ resizer.addEventListener(MouseEvent.MOUSE_DOWN, resizeDown);
+ }
+ override protected function createChildren():void {
+ resizer.height=10;
+ resizer.width = 10;
+ super.createChildren();
+ rawChildren.addChild(resizer);
+ }
+ override protected function updateDisplayList(w:Number, h:Number):void {
+ super.updateDisplayList(w,h);
+ resizer.y = h - resizer.height;
+ resizer.x = w - resizer.width;
+ }
+ private function resizeDown(e:MouseEvent):void {
+ stage.addEventListener(MouseEvent.MOUSE_MOVE, scalePanel);
+ stage.addEventListener(MouseEvent.MOUSE_UP, stopScale);
+ }
+ private function scalePanel(e:MouseEvent):void{
+ if((stage.mouseX - x)>50) width = (stage.mouseX-x);
+ if((stage.mouseY - y)>50) height = (stage.mouseY-y);
+ }
+ private function stopScale(e:MouseEvent):void{
+ stage.removeEventListener(MouseEvent.MOUSE_MOVE, scalePanel);
+ stage.removeEventListener(MouseEvent.MOUSE_UP, stopScale);
+ }
+ }
+}
diff --git a/net/systemeD/controls/ResizablePanelSkin.mxml b/net/systemeD/controls/ResizablePanelSkin.mxml
new file mode 100644
index 00000000..1acfeba0
--- /dev/null
+++ b/net/systemeD/controls/ResizablePanelSkin.mxml
@@ -0,0 +1,384 @@
+
+
+
+
+
+
+
+
+
+ /* Define the skin elements that should not be colorized.
+ For panel, border and title background are skinned, but the content area and title text are not. */
+ static private const exclusions:Array = ["background", "titleDisplay", "contentGroup", "controlBarGroup"];
+
+ /**
+ * @private
+ */
+ override public function get colorizeExclusions():Array {
+ return exclusions;
+ }
+
+ /**
+ * @private
+ */
+ override protected function initializationComplete():void {
+ useChromeColor = true;
+ super.initializationComplete();
+ }
+
+ /**
+ * @private
+ */
+ override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
+ if (getStyle("borderVisible") == true) {
+ border.visible = true;
+ background.left = background.top = background.right = background.bottom = 1;
+ contents.left = contents.top = contents.right = contents.bottom = 1;
+ } else {
+ border.visible = false;
+ background.left = background.top = background.right = background.bottom = 0;
+ contents.left = contents.top = contents.right = contents.bottom = 0;
+ }
+
+ dropShadow.visible = getStyle("dropShadowVisible");
+
+ var cr:Number = getStyle("cornerRadius");
+ var withControls:Boolean =
+ (currentState == "disabledWithControlBar" ||
+ currentState == "normalWithControlBar");
+
+ if (cornerRadius != cr) {
+ cornerRadius = cr;
+
+ dropShadow.tlRadius = cornerRadius;
+ dropShadow.trRadius = cornerRadius;
+ dropShadow.blRadius = withControls ? cornerRadius : 0;
+ dropShadow.brRadius = withControls ? cornerRadius : 0;
+
+ setPartCornerRadii(topMaskRect, withControls);
+ setPartCornerRadii(border, withControls);
+ setPartCornerRadii(background, withControls);
+ }
+
+ if (bottomMaskRect)
+ setPartCornerRadii(bottomMaskRect, withControls);
+
+ borderStroke.color = getStyle("borderColor");
+ borderStroke.alpha = getStyle("borderAlpha");
+ backgroundFill.color = getStyle("backgroundColor");
+ backgroundFill.alpha = getStyle("backgroundAlpha");
+
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+ }
+
+ /**
+ * @private
+ */
+ private function setPartCornerRadii(target:Rect, includeBottom:Boolean):void {
+ target.topLeftRadiusX = cornerRadius;
+ target.topRightRadiusX = cornerRadius;
+ target.bottomLeftRadiusX = includeBottom ? cornerRadius : 0;
+ target.bottomRightRadiusX = includeBottom ? cornerRadius : 0;
+ }
+
+ private var cornerRadius:Number;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/net/systemeD/controls/ResizeHandleLines.mxml b/net/systemeD/controls/ResizeHandleLines.mxml
new file mode 100755
index 00000000..1dcfc508
--- /dev/null
+++ b/net/systemeD/controls/ResizeHandleLines.mxml
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/net/systemeD/controls/ResizeManager.as b/net/systemeD/controls/ResizeManager.as
new file mode 100755
index 00000000..c39b04b8
--- /dev/null
+++ b/net/systemeD/controls/ResizeManager.as
@@ -0,0 +1,349 @@
+package net.systemeD.controls {
+ import flash.events.Event;
+ import flash.events.EventDispatcher;
+ import flash.events.MouseEvent;
+ import flash.geom.Point;
+ import flash.geom.Rectangle;
+ import flash.utils.Dictionary;
+
+ import mx.core.FlexGlobals;
+ import mx.core.UIComponent;
+ import mx.events.ResizeEvent;
+ import mx.managers.CursorManager;
+
+ import spark.primitives.Rect;
+
+ /**
+ * This is the style direction that can be set on the resize component.
+ * Defaults to "both" which means the component can be resized horizontally and vertically.
+ */
+ [Style(name="resizeDirection", type="String", enumeration="both,vertical,horizontal", inherit="no")]
+
+ /**
+ * Utility class for allowing containers to be resized by a resize handle.
+ * The resize handle will cause the UIComponent to be resized when the user drags the handle.
+ * It also supports showing a custom cursor while the resizing is occurring.
+ * The resize component can also be restricted to only allow resizing in the horizontal
+ * or vertical direction.
+ *
+ * @author Chris Callendar
+ * @date March 17th, 2009
+ */
+ public class ResizeManager extends EventDispatcher {
+
+ public static const RESIZE_START:String = "resizeStart";
+
+ public static const RESIZE_END:String = "resizeEnd";
+
+ public static const RESIZING:String = "resizing";
+
+ public static const STYLE_RESIZE_DIRECTION:String = "resizeDirection";
+
+ public static const DIRECTION_BOTH:String = "both";
+
+ public static const DIRECTION_HORIZONTAL:String = "horizontal";
+
+ public static const DIRECTION_VERTICAL:String = "vertical";
+
+ private static const resizeDirections:Dictionary = new Dictionary(true);
+
+ private const RESIZE_HANDLE_SIZE:int = 16;
+
+ private var resizeInitX:Number = 0;
+
+ private var resizeInitY:Number = 0;
+
+ private var _resizeHandle:UIComponent;
+
+ private var _enabled:Boolean;
+
+ private var _bringToFrontOnResize:Boolean;
+
+ private var _resizeDirection:String;
+
+ private var _resizeComponent:UIComponent;
+
+ private var _constrainToParentBounds:Boolean;
+
+ private var isResizing:Boolean;
+
+ private var startWidth:Number;
+
+ private var startHeight:Number;
+
+ [Embed(source="../../../embedded/cursor_resize.gif")]
+ public var resizeCursorIcon:Class;
+
+ private var resizeCursorID:int;
+
+
+ public function ResizeManager(resizeComponent:UIComponent = null, resizeHandle:UIComponent = null, resizeDirection:String = "both") {
+ this._enabled = true;
+ this.resizeComponent = resizeComponent;
+ this.resizeHandle = resizeHandle;
+ this._bringToFrontOnResize = false;
+ this._resizeDirection = resizeDirection;
+ resizeCursorID = 0;
+ }
+
+ [Bindable("enabledChanged")]
+ public function get enabled():Boolean {
+ return _enabled && (resizeComponent != null) && resizeComponent.enabled;
+ }
+
+ public function set enabled(en:Boolean):void {
+ if (en != _enabled) {
+ _enabled = en;
+ dispatchEvent(new Event("enabledChanged"));
+ }
+ }
+
+ [Bindable("resizeComponentChanged")]
+ public function get resizeComponent():UIComponent {
+ return _resizeComponent;
+ }
+
+ public function set resizeComponent(value:UIComponent):void {
+ if (value != _resizeComponent) {
+ _resizeComponent = value;
+ dispatchEvent(new Event("resizeComponentChanged"));
+ }
+ }
+
+ [Bindable("bringToFrontOnResizeChanged")]
+ public function get bringToFrontOnResize():Boolean {
+ return _bringToFrontOnResize;
+ }
+
+ public function set bringToFrontOnResize(value:Boolean):void {
+ if (value != _bringToFrontOnResize) {
+ _bringToFrontOnResize = value;
+ dispatchEvent(new Event("bringToFrontOnResizeChanged"));
+ }
+ }
+
+ [Bindable("resizeDirectionChanged")]
+ /**
+ * Sets the resize direction.
+ * Defaults to both, meaning that the component can be resized in the horizontal
+ * and the vertical directions.
+ * If the direction is set to "horizontal", then the component can only be resized
+ * in the horizontal direction.
+ * Similarily when the direction is "vertical" only vertical resizing is allowed.
+ */
+ public function get resizeDirection():String {
+ var direction:String = DIRECTION_BOTH;
+ if (_resizeDirection == DIRECTION_BOTH) {
+ // first check if a style was set on the resize component
+ var style:Object = resizeComponent.getStyle(STYLE_RESIZE_DIRECTION);
+ if (style != null) {
+ direction = String(style);
+ } else {
+ direction = resizeDirections[resizeComponent];
+ }
+ if ((direction != DIRECTION_HORIZONTAL) && (direction != DIRECTION_VERTICAL)) {
+ direction = DIRECTION_BOTH;
+ }
+ }
+ return direction;
+ }
+
+ public function set resizeDirection(value:String):void {
+ if (value != _resizeDirection) {
+ _resizeDirection = value;
+ dispatchEvent(new Event("resizeDirectionChanged"));
+ }
+ }
+
+ /**
+ * Returns the resizeHandle UIComponent.
+ */
+ [Bindable("resizeHandleChanged")]
+ public function get resizeHandle():UIComponent {
+ return _resizeHandle;
+ }
+
+ public function set resizeHandle(value:UIComponent):void {
+ if (value != _resizeHandle) {
+ if (_resizeHandle) {
+ _resizeHandle.removeEventListener(MouseEvent.MOUSE_DOWN, resizeHandler);
+ _resizeHandle.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverResizeHandler);
+ _resizeHandle.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutResizeHandler);
+ }
+ this._resizeHandle = value;
+ if (_resizeHandle) {
+ _resizeHandle.addEventListener(MouseEvent.MOUSE_DOWN, resizeHandler, false, 0, true);
+ _resizeHandle.addEventListener(MouseEvent.MOUSE_OVER, mouseOverResizeHandler, false, 0, true);
+ _resizeHandle.addEventListener(MouseEvent.MOUSE_OUT, mouseOutResizeHandler, false, 0, true);
+ if (!_resizeHandle.toolTip) {
+ _resizeHandle.toolTip = "Drag this handle to resize the component";
+ }
+ }
+ dispatchEvent(new Event("resizeHandleChanged"));
+ }
+ }
+
+ /**
+ * Returns true if the resizing should be constrained to keep the resizeComponent from going outside the parent bounds.
+ */
+ public function get constrainToParentBounds():Boolean {
+ return _constrainToParentBounds;
+ }
+
+ /**
+ * Set to true to constrain the resizing to keep the resize component inside the parent bounds.
+ */
+ public function set constrainToParentBounds(value:Boolean):void {
+ _constrainToParentBounds = value;
+ }
+
+
+ // Resize event handler
+ private function resizeHandler(event:MouseEvent):void {
+ if (enabled) {
+ event.stopImmediatePropagation();
+ startResize(event.stageX, event.stageY);
+ }
+ }
+
+ private function startResize(globalX:Number, globalY:Number):void {
+ // dispatch a resizeStart event - can be cancelled!
+ var event:ResizeEvent = new ResizeEvent(RESIZE_START, false, true, resizeComponent.width, resizeComponent.height);
+ var okay:Boolean = resizeComponent.dispatchEvent(event);
+ if (okay) {
+ isResizing = true;
+
+ // move above all others
+ if (bringToFrontOnResize && resizeComponent.parent) {
+ var index:int = resizeComponent.parent.getChildIndex(resizeComponent);
+ var last:int = resizeComponent.parent.numChildren - 1;
+ if (index != last) {
+ resizeComponent.parent.setChildIndex(resizeComponent, last);
+ }
+ }
+
+ resizeInitX = globalX;
+ resizeInitY = globalY;
+ startWidth = resizeComponent.width;
+ startHeight = resizeComponent.height;
+ // Add event handlers so that the SystemManager handles the mouseMove and mouseUp events.
+ // Set useCapure flag to true to handle these events
+ // during the capture phase so no other component tries to handle them.
+ resizeComponent.systemManager.addEventListener(MouseEvent.MOUSE_MOVE, resizeMouseMoveHandler, true, 0, true);
+ resizeComponent.systemManager.addEventListener(MouseEvent.MOUSE_UP, resizeMouseUpHandler, true, 0, true);
+ }
+ }
+
+ /**
+ * Resizes this panel as the user moves the mouse with the mouse button down.
+ * Also restricts the width and height based on the resizeComponent's minWidth, maxWidth, minHeight, and
+ * maxHeight properties.
+ */
+ private function resizeMouseMoveHandler(event:MouseEvent):void {
+ event.stopImmediatePropagation();
+
+ var oldWidth:Number = resizeComponent.width;
+ var oldHeight:Number = resizeComponent.height;
+ var newWidth:Number = oldWidth + event.stageX - resizeInitX;
+ var newHeight:Number = oldHeight + event.stageY - resizeInitY;
+ //trace("Changing size from " + oldWidth + "x" + oldHeight + " to " + newWidth + "x" + newHeight);
+
+ var resizeH:Boolean = (resizeDirection != DIRECTION_VERTICAL);
+ var resizeV:Boolean = (resizeDirection != DIRECTION_HORIZONTAL);
+
+ // constrain the size to keep the resize component inside the parent bounds
+ if (constrainToParentBounds && resizeComponent.parent) {
+ var parentWidth:Number = resizeComponent.parent.width;
+ var parentHeight:Number = resizeComponent.parent.height;
+ if ((resizeComponent.x + newWidth) > parentWidth) {
+ newWidth = parentWidth - resizeComponent.x;
+ }
+ if ((resizeComponent.y + newHeight) > parentHeight) {
+ newHeight = parentHeight - resizeComponent.y;
+ }
+ }
+ // restrict the width/height
+ if ((newWidth >= resizeComponent.minWidth) && (newWidth <= resizeComponent.maxWidth) && resizeH) {
+ resizeComponent.width = newWidth;
+ }
+ if ((newHeight >= resizeComponent.minHeight) && (newHeight <= resizeComponent.maxHeight) && resizeV) {
+ resizeComponent.height = newHeight;
+ }
+
+
+ resizeInitX = event.stageX;
+ resizeInitY = event.stageY;
+
+ // Update the scrollRect property (this is used by the PopUpManager)
+ // will usually be null
+ if (resizeComponent.scrollRect) {
+ var rect:Rectangle = resizeComponent.scrollRect;
+ rect.width = resizeComponent.width;
+ rect.height = resizeComponent.height;
+ resizeComponent.scrollRect = rect;
+ }
+
+ resizeComponent.dispatchEvent(new ResizeEvent(RESIZING, false, false, oldWidth, oldHeight));
+ }
+
+ /**
+ * Removes the event handlers from the SystemManager.
+ */
+ private function resizeMouseUpHandler(event:MouseEvent):void {
+ event.stopImmediatePropagation();
+ resizeComponent.systemManager.removeEventListener(MouseEvent.MOUSE_MOVE, resizeMouseMoveHandler, true);
+ resizeComponent.systemManager.removeEventListener(MouseEvent.MOUSE_UP, resizeMouseUpHandler, true);
+ if (isResizing) {
+ isResizing = false;
+ resizeComponent.dispatchEvent(new ResizeEvent(RESIZE_END, false, false, startWidth, startHeight));
+ }
+
+ // check if the mouse is outside the resize handle
+ var pt:Point = resizeHandle.globalToLocal(new Point(event.stageX, event.stageY));
+ var bounds:Rectangle = new Rectangle(0, 0, resizeHandle.width, resizeHandle.height);
+ var isOver:Boolean = bounds.containsPoint(pt);
+ if (!isOver) {
+ removeResizeCursor();
+ }
+ }
+
+ private function mouseOverResizeHandler(event:MouseEvent):void {
+ setResizeCursor();
+ FlexGlobals.topLevelApplication.systemManager.addEventListener(MouseEvent.MOUSE_OUT, mouseOutResizeHandler, true, 0, true);
+ }
+
+ private function mouseOutResizeHandler(event:MouseEvent):void {
+ if (!isResizing) {
+ removeResizeCursor();
+ FlexGlobals.topLevelApplication.systemManager.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutResizeHandler, true);
+ }
+ }
+
+ private function setResizeCursor():void {
+ if ((resizeCursorID == 0) && (resizeCursorIcon != null)) {
+ resizeCursorID = CursorManager.setCursor(resizeCursorIcon);
+ }
+ }
+
+ private function removeResizeCursor():void {
+ if (resizeCursorID != 0) {
+ CursorManager.removeCursor(resizeCursorID);
+ resizeCursorID = 0;
+ }
+ }
+
+ /**
+ * Sets which direction the component can be resized - "horizontal", "vertical", or "both" (default).
+ */
+ public static function setResizeDirection(resizeComponent:UIComponent, direction:String = "both"):void {
+ if (resizeComponent != null) {
+ if ((direction == DIRECTION_HORIZONTAL) || (direction == DIRECTION_VERTICAL)) {
+ resizeDirections[resizeComponent] = direction;
+ } else if (resizeDirections[resizeComponent] != null) {
+ delete resizeDirections[resizeComponent];
+ }
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/net/systemeD/potlatch2/FloatingMap.mxml b/net/systemeD/potlatch2/FloatingMap.mxml
new file mode 100644
index 00000000..32debad7
--- /dev/null
+++ b/net/systemeD/potlatch2/FloatingMap.mxml
@@ -0,0 +1,132 @@
+
+
+
+
+
+
+
+
+
+
+
+