If you think the Android project nadia listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/*
* Control.java/*www.java2s.com*/
*
* Copyright (c) 2013, Emmanuel Arana Corzo. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/package com.redarctic.nadia.controls.menu;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Point;
import com.redarctic.nadia.baseengine.DrawableObject;
import com.redarctic.nadia.controls.DirectionalPad;
publicabstractclass Control implements DrawableObject {
protected String name;
protected String text;
protected Point size;
protected Point position;
protected Object value;
protectedboolean hasFocus;
protectedboolean enabled;
protectedboolean visible;
protectedboolean tabStop;
protected Paint spriteFont;
protectedlong color;
protected String type;
protected DirectionalPad gamepad;
public Control() {
this.color = Color.WHITE;
this.enabled = true;
this.visible = true;
this.spriteFont = ControlManager.getSpriteFont();
}
public String getName() {
return name;
}
publicvoid setName(String name) {
this.name = name;
}
public String getText() {
return text;
}
publicvoid setText(String text) {
this.text = text;
}
public Point getSize() {
return size;
}
publicvoid setSize(Point size) {
this.size = size;
}
public Point getPosition() {
return position;
}
publicvoid setPosition(Point position) {
this.position = position;
this.position.y = (int)this.position.y;
}
public Object getValue() {
return value;
}
publicvoid setValue(Object value) {
this.value = value;
}
publicboolean isHasFocus() {
return hasFocus;
}
publicvoid setHasFocus(boolean hasFocus) {
this.hasFocus = hasFocus;
}
publicboolean isEnabled() {
return enabled;
}
publicvoid setEnabled(boolean enabled) {
this.enabled = enabled;
}
publicboolean isVisible() {
return visible;
}
publicvoid setVisible(boolean visible) {
this.visible = visible;
}
publicboolean isTabStop() {
return tabStop;
}
publicvoid setTabStop(boolean tabStop) {
this.tabStop = tabStop;
}
public Paint getSpriteFont() {
return spriteFont;
}
publicvoid setSpriteFont(Paint spriteFont) {
this.spriteFont = spriteFont;
}
publiclong getColor() {
return color;
}
publicvoid setColor(long color) {
this.color = color;
}
public String getType() {
return type;
}
publicvoid setType(String type) {
this.type = type;
}
public DirectionalPad getGamepad() {
return gamepad;
}
publicvoid setGamepad(DirectionalPad gamepad) {
this.gamepad = gamepad;
}
publicabstractvoid handleInput();
}