/*----------------------------------------------------------------------------- The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.mozilla.org/MPL/MPL-1.1.html Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. The Original Code is Fever Framework code. The Initial Developer of the Original Code is Romain Ecarnot. Portions created by Initial Developer are Copyright (C) 2006 the Initial Developer. All Rights Reserved. Contributor(s): Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -----------------------------------------------------------------------------*/ import org.aswing.CursorManager; import org.aswing.graphics.Graphics; import org.aswing.graphics.Pen; import org.aswing.graphics.SolidBrush; import fvaswing.components.cursors.FvCursor; /** * An 'unavailable drop' cursor. * * @author Romain Ecarnot */ class fvaswing.components.tree.FvInvalidDragCursor extends FvCursor { //------------------------------------------------------------------------- // Private properties //------------------------------------------------------------------------- private static var _instance : FvInvalidDragCursor; //------------------------------------------------------------------------- // Public API //------------------------------------------------------------------------- /** * Returns a unique instance. */ public static function getInstance() : FvInvalidDragCursor { if( _instance == undefined ) _instance = new FvInvalidDragCursor(); return _instance; } /** * Shows cursor and hides the system cursor. */ public static function show() : Void { CursorManager.showCustomCursor( getInstance() ); CursorManager.hideSystemCursor(); } /** * Hides cursor and shows the default system cursor. */ public static function hide() : Void { CursorManager.hideCustomCursor( getInstance() ); CursorManager.showSystemCursor(); } /** * Constructor. */ public function FvInvalidDragCursor() { super(); _arrowVisible = false; } /** * Concrete drawing implementation. */ public function repaint() : Void { _paintBasicCursor(); var circle : MovieClip = _container.createEmptyMovieClip( "__p__", 2 ); var crossBrush : SolidBrush = new SolidBrush( 0xffffff, 100 ); var p : Pen = new Pen( 0x000000 , 2, 100 ); var fx : Graphics = new Graphics( circle ); fx.drawCircle( p, 16, 11, 6 ); var cross : MovieClip = _container.createEmptyMovieClip( "__c__", 3 ); fx = new Graphics( cross ); fx.drawLine( p, 0, 0, 7.5, 7.5 ); cross._x = 11.5; cross._y = 6.5; _applyFilter(); } }