edgepainter.java

来自「JPowerGraph is a Java library for creati」· Java 代码 · 共 40 行

JAVA
40
字号
package net.sourceforge.jpowergraph.painters;

import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Rectangle;

import net.sourceforge.jpowergraph.Edge;
import net.sourceforge.jpowergraph.pane.JGraphPane;

/**
 * The painter for the edge.
 */
public interface EdgePainter {
    /**
     * Paints the supplied edge.
     *
     * @param graphPane             the graph pane
     * @param g                     the graphics
     * @param edge                  the edge to paint
     */
    void paintEdge(JGraphPane graphPane,Graphics2D g,Edge edge);
    /**
     * Returns the distance of the point to the edge.
     *
     * @param graphPane             the graph pane
     * @param edge                  the edge
     * @param point                 the point
     * @return                      the distance of the point from the edge
     */
    double screenDistanceFromEdge(JGraphPane graphPane,Edge edge,Point point);
    /**
     * Returns the outer rectangle of the edge on screen.
     *
     * @param graphPane             the graph pane
     * @param edge                  the edge
     * @param edgeScreenRectangle   the rectangle receiving the edge's coordinates
     */
    void getEdgeScreenBounds(JGraphPane graphPane,Edge edge,Rectangle edgeScreenRectangle);
}

⌨️ 快捷键说明

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