ishape.java
来自「JGraph扩展应用。自定义Renderer,自定义视图View实现自定义工作流」· Java 代码 · 共 56 行
JAVA
56 行
/* * IShape.java * * Created on April 29, 2005, 4:47 PM */package flow.graph.gui.graph.item.unit;import java.awt.Point;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); /** * Called when loading model from file. */ public void setShapeData(String data) throws Exception; /** * Called when saving model to file. */ public String getShapeData(); }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?