📄 graphicsinfox.java
字号:
package edu.odu.cs.zeil.AlgAE.Client.DataViewer.DataGraph;import java.awt.Canvas;import java.awt.Component;import java.awt.Dimension;import java.awt.Font;import java.awt.Graphics;import edu.odu.cs.zeil.AlgAE.Client.IncrementControl;/** * An extended set of information about the graphics context in which * the data graph will be written, including support for double-buffered * implementations. * * @author Steven J. Zeil */public abstract class GraphicsInfo { /** * The graphics context in which to display the graph. * This is valid only between an <code>openGraphics</code>, * <code>closeGraphics</code> pair. * * @see edu.odu.cs.zeil.AlgAE.Client.DataViewer.DataGraph.GraphicsInfo.openGraphics * @see edu.odu.cs.zeil.AlgAE.Client.DataViewer.DataGraph.GraphicsInfo.closeGraphics */ public Graphics g; /** * The size of the area in which the graph is to be drawn. */ public Dimension canvasSize; /** * The font to be used for node and edge labels. */ public Font font; /** * The size of the font (in points) to be used for node and edge labels. */ public int fontSize; /** * Indicates the amount of space (in pixels/graphics units) to be left * as a border to each side and above and below the text of a node. * This size should be proportional to the fontSize. * @see openGraphics */ public Dimension textOffset; /** * Information about incremental drawing. * @see edu.odu.cs.zeil.AlgAE.Client.DataViewer.DataGraph.Graph.initiateMovement */ public IncrementControl increment; /** * Number of major iterations to be employed when repositioning * nodes. */ public int repositionEffort; /** * Are nodes repositioned automatically at the end of each frame? */ public boolean autoArranging; /** * The canvas that this graphic information is associated with. */ public Canvas canvas; public GraphicsInfo() { g = null; fontSize = 16; canvasSize = new Dimension(10, 10); textOffset = new Dimension (fontSize/2, fontSize/2); increment = new IncrementControl(); repositionEffort = 3; autoArranging = true; } /** * Initialize the graphics data member <code>g</code> to a valid * graphics context and sets the canvasSize and textOffset values. */ public abstract void openGraphics(); /** * Indicates that the graphics data member <code>g</code> is no longer * in use. * @param wasWrittenTo Input parameter, true if anything has been * written to the graphics context since it was opened. * False if we were "only looking". */ public abstract void closeGraphics(boolean wasWrittenTo); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -