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
/*
* DrawableGameComponent.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.baseengine;
import com.redarctic.nadia.ext.simplesignalslot.ISignalProvider;
import com.redarctic.nadia.ext.simplesignalslot.ISlotProvider;
import com.redarctic.nadia.ext.simplesignalslot.SignalSlotMap;
import com.redarctic.nadia.ext.simplesignalslot.SlotProviderMethodPair;
publicabstractclass DrawableGameComponent
extends GameComponent implements DrawableObject, ISignalProvider, ISlotProvider {
privateint drawOrder;
privateboolean visible;
publicstaticfinal String SIGNAL_DRAW_ORDER_CHANGED = "DRAW_ORDER_CHANGED";
publicstaticfinal String SIGNAL_VISIBLE_CHANGED = "VISIBLE_CHANGED";
public DrawableGameComponent() {
super();
this.drawOrder = 0;
this.visible = true;
this.initialize();
//this.loadContent();
SignalSlotMap.fastConnect(this, SIGNAL_DRAW_ORDER_CHANGED,
SlotProviderMethodPair.create(this, "onDrawOrderChanged", Integer.class));
SignalSlotMap.fastConnect(this, SIGNAL_VISIBLE_CHANGED,
SlotProviderMethodPair.create(this, "onVisibleChanged", Boolean.class));
}
publicvoid initialize() {
}
publicint getDrawOrder() {
return drawOrder;
}
publicvoid setDrawOrder(int drawOrder) {
this.drawOrder = drawOrder;
Integer value = this.drawOrder;
SignalSlotMap.fastEmit(this, SIGNAL_DRAW_ORDER_CHANGED, value);
value = null;
}
publicboolean isVisible() {
return visible;
}
publicvoid setVisible(boolean visible) {
this.visible = visible;
Boolean value = this.visible;
SignalSlotMap.fastEmit(this, SIGNAL_VISIBLE_CHANGED, value);
value = null;
}
publicabstractvoid onDrawOrderChanged(Integer value);
publicabstractvoid onVisibleChanged(Boolean value);
protectedvoid loadContent() {
}
protectedabstractvoid unloadContent();
}