public static final int LINE_V_ALIGN_CENTER = 512;
public static final int LINE_V_ALIGN_BOTTOM = 1024;
private DynaButtons parent;
private Image buttonImage;
private Image highliteImage;
private Image currentImage;
private Color backgroundColor = null;
private Image backgroundImage = null;
private String buttonText;
private PopObject popObject;
private Color fontColor;
private Color highliteFontColor;
private Color currentFontColor;
private Font buttonFont;
private int textJustification;
private int textAlignment;
private Image offScreenImage;
private Graphics offScreenGraphics;
private Dimension offScreenSize;
PopButton(DynaButtons parent, PopObject popObject, String buttonText, Color fontColor, Color highliteFontColor, Font buttonFont, int textJustification, int textAlignment, Image buttonImage, Image highliteImage, Color backgroundColor) {
this.parent = parent;
this.popObject = popObject;
this.buttonText = buttonText;
this.fontColor = fontColor;
this.highliteFontColor = highliteFontColor;
this.buttonFont = buttonFont;
this.textJustification = textJustification;
this.textAlignment = textAlignment;
this.buttonImage = buttonImage;
this.highliteImage = highliteImage;
this.backgroundColor = backgroundColor;
this.currentImage = buttonImage;
this.currentFontColor = fontColor;
((Component)this).repaint();
}
PopButton(DynaButtons parent, PopObject popObject, String buttonText, Color fontColor, Color highliteFontColor, Font buttonFont, int textJustification, int textAlignment, Image buttonImage, Image highliteImage, Image backgroundImage) {
this.parent = parent;
this.popObject = popObject;
this.buttonText = buttonText;
this.fontColor = fontColor;
this.buttonFont = buttonFont;
this.textJustification = textJustification;
this.textAlignment = textAlignment;
this.buttonImage = buttonImage;
this.highliteImage = highliteImage;
this.backgroundImage = backgroundImage;
this.currentImage = buttonImage;
this.currentFontColor = fontColor;
((Component)this).repaint();
}
private void drawBackground(Graphics g) {
if (this.backgroundColor != null) {
g.setColor(this.backgroundColor);
Dimension d = ((Component)this).size();
g.fillRect(0, 0, d.width, d.height);
} else if (this.backgroundImage != null) {
int imHeight = this.backgroundImage.getHeight(this);
int imWidth = this.backgroundImage.getWidth(this);
Dimension d = ((Component)this).size();
int x = d.width / imWidth + 1;
int y = d.height / imHeight + 1;
for(int i = 0; i < y; ++i) {
for(int j = 0; j < x; ++j) {
g.drawImage(this.backgroundImage, j * imWidth, i * imHeight, this);