|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.baka.ambient.activity.main.AbstractController
public abstract class AbstractController
A base class each controller must extend. Defines common operations.
Nested Class Summary | |
---|---|
protected class |
AbstractController.Listener
The activity button listener. |
Field Summary | |
---|---|
protected AmbientApplication |
app
Returns the application instance. |
protected boolean |
cycle
If true then random/repeat modes are cycled instead of being
activated. |
protected AbstractController.Listener |
listener
Listens for click actions and activates ActionsEnum stored in the
tag values. |
protected Activity |
mainActivity
Reference to the main activity. |
protected View |
mainView
The main view controlled by this controller. |
Constructor Summary | |
---|---|
protected |
AbstractController(int mainViewId,
Activity mainActivity)
Creates new controller. |
Method Summary | |
---|---|
void |
destroy()
The controller is about to be destroyed. |
boolean |
equals(Object o)
|
void |
flipVisibility()
Flips the player visibility - shows it if it is hidden or vice versa. |
int |
hashCode()
|
void |
hide()
Hides the view and removes it (the View.GONE functionality). |
static void |
initButtonBar(ButtonBar bar,
List<ActionsEnum> actions,
Point bitmapSize,
Point hoveredBitmapSize)
Initializes given button bar with buttons. |
protected void |
initButtonBar(int buttonbarId,
List<ActionsEnum> actions)
Initializes given button bar with buttons. |
protected void |
initButtonBar(int buttonbarId,
List<ActionsEnum> actions,
Point bitmapSize,
Point hoveredBitmapSize)
Initializes given button bar with buttons. |
protected boolean |
isDestroyed()
Checks if this controller was destroyed. |
boolean |
isVisible()
Checks if the view controlled by this controller is visible. |
protected boolean |
isZoomed()
Checks if this controller is zoomed. |
protected void |
onAction(ActionsEnum action)
Called when an action button is pressed. |
protected abstract void |
performZoom(boolean zoom)
Zooms, or un-zooms the controller. |
void |
setVisibility(boolean visible)
Sets the visibility of the view controlled by this controller. |
void |
show()
Shows the view on screen. |
void |
update(Interval select)
Reinitializes the underlying view. |
protected void |
visibilityChanged(boolean visible)
Invoked when the component visibility changes. |
void |
zoom(boolean zoom)
Zooms, or un-zooms the controller. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected View mainView
protected Activity mainActivity
protected boolean cycle
true
then random/repeat modes are cycled instead of being
activated.
protected final AbstractController.Listener listener
ActionsEnum
stored in the
tag values.
protected AmbientApplication app
Constructor Detail |
---|
protected AbstractController(int mainViewId, Activity mainActivity)
mainViewId
- the view whose visibility is controlled.mainActivity
- the activity.Method Detail |
---|
public final void flipVisibility()
public final boolean isVisible()
true
if visible, false
otherwise.public final void show()
protected void visibilityChanged(boolean visible)
visible
- new visibility flag.public final void hide()
View.GONE
functionality).
public final void setVisibility(boolean visible)
visible
- if true
then the view is made visible, otherwise
it is made GONE.protected void onAction(ActionsEnum action)
action
- the action to takepublic void update(Interval select)
select
- reset selection to this interval.protected void initButtonBar(int buttonbarId, List<ActionsEnum> actions)
buttonbarId
- the resource id of the ButtonBar
component.actions
- the list of actions.protected void initButtonBar(int buttonbarId, List<ActionsEnum> actions, Point bitmapSize, Point hoveredBitmapSize)
buttonbarId
- the resource id of the ButtonBar
component.actions
- the list of actions.bitmapSize
- the size of all buttons.hoveredBitmapSize
- maximum size of a button when hovered.public static final void initButtonBar(ButtonBar bar, List<ActionsEnum> actions, Point bitmapSize, Point hoveredBitmapSize)
bar
- the ButtonBar
component.actions
- the list of actions.bitmapSize
- the size of all buttons.hoveredBitmapSize
- maximum size of a button when hovered.public void destroy()
super()
if you override
this method!
protected final boolean isDestroyed()
true
if this controller is destroyed.public final boolean equals(Object o)
equals
in class Object
public final int hashCode()
hashCode
in class Object
public final void zoom(boolean zoom)
zoom
- true
zoom the controller in, false
zoom the controller out.protected abstract void performZoom(boolean zoom)
zoom
- true
zoom the controller in, false
zoom the controller out.protected final boolean isZoomed()
true
if zoomed, false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |