ishape.java

来自「java编写的最好的画图板程序」· Java 代码 · 共 45 行

JAVA
45
字号
/* * IShape.java * * Created on April 29, 2005, 4:47 PM */package hysun.draw;import java.awt.Graphics2D;import java.awt.event.MouseEvent;/** * All drawing shapes should implement this interface. * * @author hysun */public interface IShape {        /** Corresponding to mouse pressed event type */    public static final int RIGHT_PRESSED = 0;        /** Corresponding to mouse released event type */    public static final int LEFT_RELEASED = 1;        /** Corresponding to mouse dragged event type */    public static final int CURSOR_DRAGGED = 2;        /**      * Code for processing draw cursor events in the drawing process.     *     * @param evt the MouseEvent being detected.     * @param type the event type. can take values PRESSED, RELEASED, and      * DRAGGED.     */    public void processCursorEvent(MouseEvent evt, int type);            /**      * To be called by the UI to draw out the shape.      *     * @param g the Graphics2D context being passed for drawing.     */    public void draw(Graphics2D g);    }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?