pointconstrainer.java

来自「开源(Open Source)项目JHotDraw的文档和源程序」· Java 代码 · 共 41 行

JAVA
41
字号
/*
 * @(#)PointConstrainer.java 5.2
 *
 */

package CH.ifa.draw.framework;

import java.awt.*;

/**
 * Interface to constrain a Point. This can be used to implement
 * different kinds of grids.
 * <hr>
 * <b>Design Patterns</b><P>
 * <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
 * <b><a href=../pattlets/sld034.htm>Strategy</a></b><br>
 * DrawingView is the StrategyContext.<br>
 *
 * @see DrawingView
 */


public interface PointConstrainer {
    /**
     * Constrains the given point.
     * @return constrained point.
     */
    public Point constrainPoint(Point p);

    /**
     * Gets the x offset to move an object.
     */
    public int getStepX();

    /**
     * Gets the y offset to move an object.
     */
    public int getStepY();

}

⌨️ 快捷键说明

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