|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsk.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 android.app.Activity |
mainActivity
Reference to the main activity. |
protected android.view.View |
mainView
The main view controlled by this controller. |
| Constructor Summary | |
|---|---|
protected |
AbstractController(int mainViewId,
android.app.Activity mainActivity)
Creates new controller. |
| Method Summary | |
|---|---|
protected void |
checkButton(int buttonbarId,
int actionIndex,
boolean value)
Checks or un-checks given button on the button bar. |
void |
destroy()
The controller is about to be destroyed. |
boolean |
equals(java.lang.Object o)
|
void |
flipVisibility()
Flips the player visibility - shows it if it is hidden or vice versa. |
protected java.util.EnumMap<ZoomEnum,java.lang.Integer> |
getZoom()
Checks if this controller is zoomed. |
int |
hashCode()
|
void |
hide()
Hides the view and removes it (the View.GONE functionality). |
static void |
initButtonBar(ButtonBar bar,
java.util.List<ActionsEnum> actions,
android.graphics.Point bitmapSize,
android.graphics.Point hoveredBitmapSize)
Initializes given button bar with buttons. |
protected void |
initButtonBar(int buttonbarId,
java.util.List<ActionsEnum> actions)
Initializes given button bar with buttons. |
protected void |
initButtonBar(int buttonbarId,
java.util.List<ActionsEnum> actions,
android.graphics.Point bitmapSize,
android.graphics.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 void |
onAction(ActionsEnum action)
Called when an action button is pressed. |
protected abstract void |
performZoom(java.util.Map<ZoomEnum,java.lang.Integer> 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(java.util.Map<ZoomEnum,java.lang.Integer> 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 android.view.View mainView
protected android.app.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,
android.app.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,
java.util.List<ActionsEnum> actions)
buttonbarId - the resource id of the ButtonBar component.actions - the list of actions.
protected final void initButtonBar(int buttonbarId,
java.util.List<ActionsEnum> actions,
android.graphics.Point bitmapSize,
android.graphics.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.
protected final void checkButton(int buttonbarId,
int actionIndex,
boolean value)
buttonbarId - the button baractionIndex - the index of the actionvalue - the new value.
public static final void initButtonBar(ButtonBar bar,
java.util.List<ActionsEnum> actions,
android.graphics.Point bitmapSize,
android.graphics.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(java.lang.Object o)
equals in class java.lang.Objectpublic final int hashCode()
hashCode in class java.lang.Objectpublic final void zoom(java.util.Map<ZoomEnum,java.lang.Integer> zoom)
zoom - new zoom levels.protected abstract void performZoom(java.util.Map<ZoomEnum,java.lang.Integer> zoom)
zoom - new zoom levels.protected final java.util.EnumMap<ZoomEnum,java.lang.Integer> getZoom()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||