nodepainter.java

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

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

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

import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;

/**
 * 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,GC 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, GC g, Point thePoint, String legendText);
    /**
     * Returns the dimensions of this legend item
     */
    Point getLegendItemSize(JGraphPane graphPane, String legendText);
    void dispose();
    boolean isDisposed();
}

⌨️ 快捷键说明

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