|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造函数 | 方法 | 详细信息: 字段 | 构造函数 | 方法 |
java.lang.Objectcom.foxconn.ebook.reader.engine.core.EREngine
public class EREngine
引擎控制類: 該類需要最先初始化,加載所有可用資源.
Example:
自定義配置:
private EngineConfig initConfig() {
EngineConfig config = new EngineConfig();
config.setLogOn(true);
config.setViewWidth(600);
config.setViewHeight(800);
config.setFontLevel(2);
return config;
初始化EREngine
private void initEngine() {
mIEREngine = (IEngineService) ERManager.getService(ERManager.ERENGINE_SERVICE);
mIEREngine.setApplication(this.getApplication());
mIEREngine.setContext(this);
mIEREngine.setConfig(initConfig());
mIEREngine.setRender(new Render2(mRenderView));
mIEREngine.setRecorder(new FileRecorder(this));
mIEREngine.setUpdateViewEnabled(true);
打開書籍
private void openBook(String pathname) {
mIEREngine.setBook(new Book(pathname));
mIEREngine.getAction().openBook();
嵌套类摘要 | |
---|---|
class |
EREngine.EngineHandler
The Class EngineHandler. |
字段摘要 |
---|
从接口 com.foxconn.ebook.reader.engine.core.IEngineService 继承的字段 |
---|
VERSION_NUMBER |
方法摘要 | |
---|---|
IAction |
getAction()
獲取IAction接口對象實例 |
Application |
getApplication()
獲取Application對象實例 |
Book |
getBook()
獲取Book對象. |
EngineConfig |
getConfig()
獲取配置對象實例 |
Context |
getContext()
獲取Context對象實例 |
int |
getLastError()
獲取最後信息碼. |
IRecorder |
getRecorder()
獲取數據存儲對象實例 |
BaseRender |
getRender()
獲取渲染對象實例 |
boolean |
getUpdateViewEnabled()
獲取當前是否為自動更新 |
java.lang.String |
getVersion()
獲取當前EREngine的版本號. |
void |
render()
手動渲染.當getUpdateViewEnabled()為false時,才需要調用該方法. |
void |
setApplication(Application app)
設置Application對象 |
void |
setBook(Book book)
設置Book對象. |
void |
setConfig(EngineConfig config)
設置自定義配置信息 |
void |
setContext(Context context)
設置Context對象 |
void |
setErrorHandler(int code,
IErrorCall handler)
設置錯誤處理回調. |
void |
setRecorder(IRecorder recorder)
設置數據存儲對象 |
void |
setRender(BaseRender render)
設置渲染對象 |
void |
setUpdateViewEnabled(boolean enabled)
設置是否自動更新顯示 |
从类 java.lang.Object 继承的方法 |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
方法详细信息 |
---|
public void setConfig(EngineConfig config)
IEngineService
中的 setConfig
config
- EngineConfig對象public EngineConfig getConfig()
IEngineService
中的 getConfig
public void setRender(BaseRender render)
IEngineService
中的 setRender
render
- the new renderpublic BaseRender getRender()
IEngineService
中的 getRender
public void setRecorder(IRecorder recorder)
IEngineService
中的 setRecorder
recorder
- the new recorderpublic IRecorder getRecorder()
IEngineService
中的 getRecorder
public void setApplication(Application app)
IEngineService
中的 setApplication
app
- the new applicationpublic Application getApplication()
IEngineService
中的 getApplication
public void setContext(Context context)
IEngineService
中的 setContext
context
- the new contextpublic Context getContext()
IEngineService
中的 getContext
public void setUpdateViewEnabled(boolean enabled)
IEngineService
中的 setUpdateViewEnabled
enabled
- true, 開啟自動更新. false, 關閉自動更新public boolean getUpdateViewEnabled()
IEngineService
中的 getUpdateViewEnabled
public IAction getAction()
IEngineService
中的 getAction
public void setBook(Book book)
IEngineService
中的 setBook
book
- Book對象實例public Book getBook()
IEngineService
中的 getBook
Book
public int getLastError()
IEngineService
中的 getLastError
EngineCode
public void setErrorHandler(int code, IErrorCall handler)
IEngineService
中的 setErrorHandler
code
- 信息代碼handler
- 錯誤處理的回調接口EngineCode
public void render()
IEngineService
中的 render
public java.lang.String getVersion()
IEngineService
复制的描述
IEngineService
中的 getVersion
|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造函数 | 方法 | 详细信息: 字段 | 构造函数 | 方法 |