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

📄 nodepainter.java

📁 JPowerGraph is a Java library for creating directed graphs for Swing. It supports graph movement, se
💻 JAVA
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -