All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.harium.etyl.ui.button.RoundCornerButton Maven / Gradle / Ivy

There is a newer version: 1.0.18
Show newest version
package com.harium.etyl.ui.button;

import com.harium.etyl.commons.event.GUIEvent;
import com.harium.etyl.core.graphics.Graphics;
import com.harium.etyl.ui.base.BaseButton;
import com.harium.etyl.ui.theme.Theme;

/**
 * 
 * @author yuripourre
 *
 */

public class RoundCornerButton extends BaseButton {

	public RoundCornerButton(int x, int y, int w, int h) {
		super(x, y, w, h);
	}
	
	@Override
	public void draw(Graphics g) {
		
		Theme theme = getTheme();

		if (!mouseOver) {
			g.setColor(theme.getBaseColor());
		} else {
			if (lastEvent == GUIEvent.MOUSE_LEFT_BUTTON_DOWN) {
				g.setColor(theme.getActiveColor());
			} else {
				g.setColor(theme.getSelectionColor());
			}
		}
		
		g.fillRoundRect(x, y, w, h, style.roundness.width, style.roundness.height);
		drawLabel(g);
	}
		
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy