sk.baka.ambient.activity.main
Class TaskSwitcherController

java.lang.Object
  extended by sk.baka.ambient.activity.main.AbstractController
      extended by sk.baka.ambient.activity.main.TaskSwitcherController
All Implemented Interfaces:
IBackgroundTask

public class TaskSwitcherController
extends AbstractController
implements IBackgroundTask

Controls trackbar and background tasks display window.

Author:
Martin Vysny

Nested Class Summary
 
Nested classes/interfaces inherited from class sk.baka.ambient.activity.main.AbstractController
AbstractController.Listener
 
Field Summary
static List<ActionsEnum> actions
          The actions to display on the Task switcher.
 
Fields inherited from class sk.baka.ambient.activity.main.AbstractController
app, cycle, listener, mainActivity, mainView
 
Constructor Summary
TaskSwitcherController(MainActivity mainActivity)
          Creates the controller
 
Method Summary
 void backgroundTask(int taskCount, String arbitraryTaskName, int progress, int maxProgress)
          Informs that a background task has been started or has ended.
 void highlightAction(ActionsEnum action)
          Highlights given action.
static void highlightAction(ActionsEnum action, ButtonBar bar)
          Highlights given action on the button bar.
protected  void performZoom(boolean zoom)
          Zooms, or un-zooms the controller.
 
Methods inherited from class sk.baka.ambient.activity.main.AbstractController
destroy, equals, flipVisibility, hashCode, hide, initButtonBar, initButtonBar, initButtonBar, isDestroyed, isVisible, isZoomed, onAction, setVisibility, show, update, visibilityChanged, zoom
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

actions

public static final List<ActionsEnum> actions
The actions to display on the Task switcher.

Constructor Detail

TaskSwitcherController

public TaskSwitcherController(MainActivity mainActivity)
Creates the controller

Parameters:
mainActivity - the activity
Method Detail

highlightAction

public void highlightAction(ActionsEnum action)
Highlights given action.

Parameters:
action - the action to highlight, may be null - in such case all actions will be de-highlighted.

highlightAction

public static void highlightAction(ActionsEnum action,
                                   ButtonBar bar)
Highlights given action on the button bar. The button bar must display actions in order for this method to work correctly.

Parameters:
action - the action to highlight, may be null - in such case all actions will be de-highlighted.
bar - the button bar.

backgroundTask

public void backgroundTask(int taskCount,
                           String arbitraryTaskName,
                           int progress,
                           int maxProgress)
Description copied from interface: IBackgroundTask
Informs that a background task has been started or has ended.

Specified by:
backgroundTask in interface IBackgroundTask
Parameters:
taskCount - current task count. Ignored if used for progress reporting.
arbitraryTaskName - a name of random active task. null if no tasks are executed or the executor failed to obtain a name. If used for a progress reporting then this is the new name of the task.
progress - total current progress of all tasks. If used for a progress reporting then this is the progress of this task.
maxProgress - total maximum progress of all tasks. If used for a progress reporting then this is the maximum progress of this task.

performZoom

protected void performZoom(boolean zoom)
Description copied from class: AbstractController
Zooms, or un-zooms the controller.

Specified by:
performZoom in class AbstractController
Parameters:
zoom - true zoom the controller in, false zoom the controller out.


Copyright © 2007-2008. All Rights Reserved.