net.sf.zekr.common.config
Class UserViewController

java.lang.Object
  extended by net.sf.zekr.common.config.UserViewController
All Implemented Interfaces:
IUserView

public class UserViewController
extends java.lang.Object
implements IUserView

This class holds values of current location and page of user view.

Author:
Mohsen Saboorian

Field Summary
 
Fields inherited from interface net.sf.zekr.common.config.IUserView
VM_ADVANCED_SEARCH, VM_QURAN_TRANS, VM_ROOT_SEARCH, VM_SEARCH
 
Constructor Summary
UserViewController(QuranPaging quranPaging)
           
 
Method Summary
 void changeTo(int page)
           
 void changeTo(IQuranLocation location)
           
 IQuranLocation getLocation()
           
 int getPage()
           
 int getViewMode()
           
 void setLocation(IQuranLocation location)
           
 void setPage(int page)
           
 void setViewMode(int viewMode)
          Set current runtime view mode.
 void synchLocation()
          Synchronize internal location with the current page number.
 void synchPage()
          Synchronize internal page number with the current location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserViewController

public UserViewController(QuranPaging quranPaging)
Method Detail

getLocation

public IQuranLocation getLocation()
Specified by:
getLocation in interface IUserView

setLocation

public void setLocation(IQuranLocation location)
Specified by:
setLocation in interface IUserView

getPage

public int getPage()
Specified by:
getPage in interface IUserView
Returns:
current page number.

setPage

public void setPage(int page)
Specified by:
setPage in interface IUserView

changeTo

public void changeTo(int page)
Specified by:
changeTo in interface IUserView

changeTo

public void changeTo(IQuranLocation location)
Specified by:
changeTo in interface IUserView

synchPage

public void synchPage()
Description copied from interface: IUserView
Synchronize internal page number with the current location.

Specified by:
synchPage in interface IUserView

synchLocation

public void synchLocation()
Description copied from interface: IUserView
Synchronize internal location with the current page number.

Specified by:
synchLocation in interface IUserView

getViewMode

public int getViewMode()
Specified by:
getViewMode in interface IUserView
Returns:
current runtime view mode. Can be one of IUserView.VM_SEARCH, IUserView.VM_ADVANCED_SEARCH, IUserView.VM_ROOT_SEARCH, or IUserView.VM_QURAN_TRANS.

setViewMode

public void setViewMode(int viewMode)
Description copied from interface: IUserView
Set current runtime view mode. Can be one of the VM_* constants available in this interface.

Specified by:
setViewMode in interface IUserView
Parameters:
viewMode - runtime view mode. Can be one of IUserView.VM_SEARCH, IUserView.VM_ADVANCED_SEARCH, IUserView.VM_ROOT_SEARCH, or IUserView.VM_QURAN_TRANS.