001 /* 002 * Copyright (c) 2005, romain guy (romain.guy@jext.org) and craig wickesser (craig@codecraig.com) 003 * All rights reserved. 004 * 005 * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 006 * 007 * * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 008 * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 009 * * Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 010 * 011 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 012 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 013 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 014 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 015 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 016 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 017 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 018 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 019 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 020 * POSSIBILITY OF SUCH DAMAGE. 021 */ 022 023 package net.java.swingfx.jdraggable; 024 025 import java.awt.Component; 026 027 /** 028 * A <code>DraggableMask</code> is an object which allows any {@link java.awt.Component} 029 * to be "masked" as a {@link net.java.swingfx.jdraggable.Draggable}. This ability is 030 * provided so that implementations of the {@link net.java.swingfx.jdraggable.DraggableManager} 031 * can be coded to use the {@link net.java.swingfx.jdraggable.Draggable} interface. 032 * 033 * @author craig 034 * @since v0.1 035 * @see net.java.swingfx.jdraggable.DefaultDraggableManager#startDrag(Component) 036 * <br> 037 * $Header: /cvs/swingfx/docs/api/src-html/net/java/swingfx/jdraggable/DraggableMask.html,v 1.1 2005/06/23 00:24:45 codecraig Exp $ 038 */ 039 public class DraggableMask implements Draggable { 040 /** 041 * the component being "masked" 042 */ 043 private Component component; 044 045 /** 046 * Creates a new <code>DraggableMask</code> which masks <code>component</code> 047 * 048 * @param component the <code>Component</code> to mask 049 */ 050 public DraggableMask(Component component) { 051 this.component = component; 052 } 053 054 /* (non-Javadoc) 055 * @see com.codecraig.jdraggable.Draggable#getComponent() 056 */ 057 public Component getComponent() { 058 return component; 059 } 060 }