nodepainter.java

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

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

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

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

/**
 * The painter for the node.
 */
public interface NodePainter {
    
    public static final int SMALL = 0;
    public static final int LARGE = 1;
    
    /**
     * Paints the supplied node.
     *
     * @param graphPane             the graph pane
     * @param g                     the graphics
     * @param node                  the node to paint
     */
    void paintNode(JGraphPane graphPane,Graphics2D g,Node node, int size);
    /**
     * Checks whether given point is inside the node.
     *
     * @param graphPane             the graph pane
     * @param node                  the node
     * @param point                 the point
     * @return                      <code>true</code> if the point is in the node
     */
    boolean isInNode(JGraphPane graphPane,Node node,Point point, int size);
    /**
     * Returns the outer rectangle of the node on screen.
     *
     * @param graphPane             the graph pane
     * @param node                  the node
     * @param nodeScreenRectangle   the rectangle receiving the node's coordinates
     */
    void getNodeScreenBounds(JGraphPane graphPane,Node node, int size, Rectangle nodeScreenRectangle);
    /**
     * Paints the specified legend item
     * 
     * @param ThePoint the point to draw the legend item at
     * @param legendText The text for this legend item
     */
    void paintLegendItem(JGraphPane graphPane, Graphics2D g, Point thePoint, String legendText);
    /**
     * Returns the dimensions of this legend item
     */
    Dimension getLegendItemSize(JGraphPane graphPane, String legendText);
}

⌨️ 快捷键说明

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