⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 polylinehandle.java

📁 开源(Open Source)项目JHotDraw的文档和源程序
💻 JAVA
字号:
/*
 * @(#)PolyLineHandle.java 5.2
 *
 */

package CH.ifa.draw.figures;

import java.awt.*;
import CH.ifa.draw.framework.*;
import CH.ifa.draw.standard.LocatorHandle;

/**
 * A handle for a node on the polyline.
 */
public class PolyLineHandle extends LocatorHandle {

    private int fIndex;
    private Point fAnchor;

   /**
    * Constructs a poly line handle.
    * @param owner the owning polyline figure.
    * @l the locator
    * @index the index of the node associated with this handle.
    */
    public PolyLineHandle(PolyLineFigure owner, Locator l, int index) {
        super(owner, l);
        fIndex = index;
    }

    public void invokeStart(int  x, int  y, DrawingView view) {
        fAnchor = new Point(x, y);
    }

    public void invokeStep (int x, int y, int anchorX, int anchorY, DrawingView view) {
        myOwner().setPointAt(new Point(x, y), fIndex);
    }

    private PolyLineFigure myOwner() {
        return (PolyLineFigure)owner();
    }
}


⌨️ 快捷键说明

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