labellayout.java

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

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

import java.awt.font.TextLayout;

public abstract class LabelLayout {
	static final int NOT_SET = -1;

	protected final int x;
	protected final int y;
	protected final int width;
	protected final int height;
	protected TextLayout textLayout;
	protected float textX;
	protected float textY;
	protected int bgX;
	protected int bgY;
	protected int bgWidth;
	protected int bgHeight;

	protected LabelLayout(int x, int y, int width, int height) {
		this.x = x;
		this.y = y;
		this.width = width;
		this.height = height;
	}

	public void setTextLayout(TextLayout textLayout) {
		this.textLayout = textLayout;
		calculate();
	}

	protected abstract void calculate();

	public float getTextX() {
		return textX;
	}

	public float getTextY() {
		return textY;
	}

	public int getBackgroundX() {
		return bgX;
	}

	public int getBackgroundY() {
		return bgY;
	}

	public int getBackgroundWidth() {
		return bgWidth;
	}

	public int getBackgroundHeight() {
		return bgHeight;
	}
}

⌨️ 快捷键说明

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