output.java

来自「这是个国外JAVA爱好者写的条形码生成器」· Java 代码 · 共 51 行

JAVA
51
字号
package net.sourceforge.barbecue.output;

public interface Output {
	/**
	 * "Draws" a bar at the given coordinates.
	 * @param x the x coordinate
	 * @param y the y coordinate
	 * @param width the width
	 * @param height the height
	 * @param paintWithForegroundColor if true, use the foreground color, otherwise use the background color
         * @return the width of the bar drawn
	 */
	int drawBar(int x, int y, int width, int height, boolean paintWithForegroundColor) throws OutputException;

	/**
	 * Sets up the drawing environment.  Called before drawing starts.
	 * Matched with call to endDraw() at the end.  This allows for caching as needed.
	 */
	void beginDraw() throws OutputException;

	/**
	 * Balanced with startDraw(), used for caching, output of epilogues.
	 * @param width The output width (in pixels) of the barcode
	 * @param height The output height (in pixels) of the barcode.
	 */
	void endDraw(int width, int height) throws OutputException;

	/**
	 * Draw the specified text.
	 * @param text text to draw
	 * @param layout the text layout calculator
	 * @return the height of this text
	 */
	int drawText(String text, LabelLayout layout) throws OutputException;

	/**
	 * Swaps the foreground and background colours of the output.
	 */
	void toggleDrawingColor();
        
	/**
	 * Paint the background the background colour, based on the height and the width.
	 * @param x the x coordinate
	 * @param y the y coordinate
	 * @param width the width to be painted
	 * @param height the height to be painted
	 */
	void paintBackground(int x, int y, int width, int height);
        
}

⌨️ 快捷键说明

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