001/*
002 * Copyright 2010-2015 Institut Pasteur.
003 * 
004 * This file is part of Icy.
005 * 
006 * Icy is free software: you can redistribute it and/or modify
007 * it under the terms of the GNU General Public License as published by
008 * the Free Software Foundation, either version 3 of the License, or
009 * (at your option) any later version.
010 * 
011 * Icy is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014 * GNU General Public License for more details.
015 * 
016 * You should have received a copy of the GNU General Public License
017 * along with Icy. If not, see <http://www.gnu.org/licenses/>.
018 */
019package icy.painter;
020
021import icy.canvas.IcyCanvas;
022import icy.sequence.Sequence;
023
024import java.awt.Graphics2D;
025import java.awt.event.KeyEvent;
026import java.awt.event.MouseEvent;
027import java.awt.geom.Point2D;
028
029/**
030 * Painter interface used by IcyCanvas subclasses to forward mouse and key events to sequence
031 * painters.
032 * 
033 * @deprecated Prefer the {@link Overlay} class to this interface when possible.
034 * @author Stephane
035 */
036@Deprecated
037public interface Painter
038{
039    /**
040     * Paint method called to draw the painter.
041     */
042    public void paint(Graphics2D g, Sequence sequence, IcyCanvas canvas);
043
044    /**
045     * Mouse press event forwarded to the painter.
046     * 
047     * @param e
048     *        mouse event
049     * @param imagePoint
050     *        mouse position (image coordinates)
051     * @param canvas
052     *        icy canvas
053     */
054    public void mousePressed(MouseEvent e, Point2D imagePoint, IcyCanvas canvas);
055
056    /**
057     * Mouse release event forwarded to the painter.
058     * 
059     * @param e
060     *        mouse event
061     * @param imagePoint
062     *        mouse position (image coordinates)
063     * @param canvas
064     *        icy canvas
065     */
066    public void mouseReleased(MouseEvent e, Point2D imagePoint, IcyCanvas canvas);
067
068    /**
069     * Mouse click event forwarded to the painter.
070     * 
071     * @param e
072     *        mouse event
073     * @param imagePoint
074     *        mouse position (image coordinates)
075     * @param canvas
076     *        icy canvas
077     */
078    public void mouseClick(MouseEvent e, Point2D imagePoint, IcyCanvas canvas);
079
080    /**
081     * Mouse move event forwarded to the painter.
082     * 
083     * @param e
084     *        mouse event
085     * @param imagePoint
086     *        mouse position (image coordinates)
087     * @param canvas
088     *        icy canvas
089     */
090    public void mouseMove(MouseEvent e, Point2D imagePoint, IcyCanvas canvas);
091
092    /**
093     * Mouse drag event forwarded to the painter.
094     * 
095     * @param e
096     *        mouse event
097     * @param imagePoint
098     *        mouse position (image coordinates)
099     * @param canvas
100     *        icy canvas
101     */
102    public void mouseDrag(MouseEvent e, Point2D imagePoint, IcyCanvas canvas);
103
104    /**
105     * Key press event forwarded to the painter.
106     * 
107     * @param e
108     *        key event
109     * @param imagePoint
110     *        mouse position (image coordinates)
111     * @param canvas
112     *        icy canvas
113     */
114    public void keyPressed(KeyEvent e, Point2D imagePoint, IcyCanvas canvas);
115
116    /**
117     * Key release event forwarded to the painter.
118     * 
119     * @param e
120     *        key event
121     * @param imagePoint
122     *        mouse position (image coordinates)
123     * @param canvas
124     *        icy canvas
125     */
126    public void keyReleased(KeyEvent e, Point2D imagePoint, IcyCanvas canvas);
127
128}