changeconnectionendhandle.java

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

JAVA
62
字号
/*
 * @(#)ChangeConnectionEndHandle.java 5.2
 *
 */

package CH.ifa.draw.standard;

import java.awt.Point;

import CH.ifa.draw.framework.*;

/**
 * A handle to reconnect the end point of
 * a connection to another figure.
 */

public class ChangeConnectionEndHandle extends ChangeConnectionHandle {

    /**
     * Constructs the connection handle.
     */
    public ChangeConnectionEndHandle(Figure owner) {
        super(owner);
    }

    /**
     * Gets the end figure of a connection.
     */
    protected Connector target() {
        return fConnection.end();
    }

    /**
     * Disconnects the end figure.
     */
    protected void disconnect() {
        fConnection.disconnectEnd();
    }

    /**
     * Sets the end of the connection.
     */
    protected void connect(Connector c) {
        fConnection.connectEnd(c);
    }

    /**
     * Sets the end point of the connection.
     */
    protected void setPoint(int x, int y) {
        fConnection.endPoint(x, y);
    }

    /**
     * Returns the end point of the connection.
     */
    public Point locate() {
        return fConnection.endPoint();
    }
}

⌨️ 快捷键说明

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