001/* [{
002Copyright 2007, 2008, 2009 Nicolas Carranza <nicarran at gmail.com>
003
004This file is part of jpen.
005
006jpen is free software: you can redistribute it and/or modify
007it under the terms of the GNU Lesser General Public License as published by
008the Free Software Foundation, either version 3 of the License,
009or (at your option) any later version.
010
011jpen is distributed in the hope that it will be useful,
012but WITHOUT ANY WARRANTY; without even the implied warranty of
013MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014GNU Lesser General Public License for more details.
015
016You should have received a copy of the GNU Lesser General Public License
017along with jpen.  If not, see <http://www.gnu.org/licenses/>.
018}] */
019package jpen.owner;
020
021import java.awt.geom.Point2D;
022import java.awt.Point;
023/**
024Defines the screen area where {@link jpen.PenEvent}s are fired or a drag-out operation can be started.
025*/
026public interface PenClip{
027        /**
028        Evaluates the current location of the origin of this PenClip on the screen, using screen coordinates. This method is called while holding the {@link PenOwner.PenManagerHandle#getPenSchedulerLock()}.
029        @param locationOnScreen a Point to put the evaluated result on. 
030        */
031        public void evalLocationOnScreen(Point locationOnScreen);
032        /**
033         This method is called while holding the {@link PenOwner.PenManagerHandle#getPenSchedulerLock()}.
034        @param point The point to test in PenClip coordinates.
035        @return {@code true} if the given point is inside this PenClip.
036        */
037        public boolean contains(Point2D.Float point);
038}