本文整理匯總了Java中com.samsung.android.sdk.pen.document.SpenNoteDoc.MODE_WRITABLE屬性的典型用法代碼示例。如果您正苦於以下問題:Java SpenNoteDoc.MODE_WRITABLE屬性的具體用法?Java SpenNoteDoc.MODE_WRITABLE怎麽用?Java SpenNoteDoc.MODE_WRITABLE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.samsung.android.sdk.pen.document.SpenNoteDoc
的用法示例。
在下文中一共展示了SpenNoteDoc.MODE_WRITABLE屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: load
/**
* Loads a SPD file into the current {@link SpenNoteDoc document}.
* @param path the absolute path of a SPD file to load.
* @param writable <code>true</code> if the SPD file should be writable; otherwise, <code>false</code>.
* @throws IOException thrown if the specified <code>path</code> is not found or a cache directory cannot be generated.
* @throws SpenUnsupportedTypeException thrown if the file to load is not in SPD format.
* @throws SpenUnsupportedVersionException thrown if the Pen package installed on the device is incompatible.
* @throws SpenInvalidPasswordException thrown if the file is password protected.
*/
public void load(final String path, final boolean writable) throws SpenInvalidPasswordException, SpenUnsupportedTypeException, SpenUnsupportedVersionException, IOException {
if (this.surfaceView == null) {
throw new IllegalStateException();
}
final SpenNoteDoc noteDoc = new SpenNoteDoc(this.activity, path, this.canvasWidth, writable ? SpenNoteDoc.MODE_WRITABLE : SpenNoteDoc.MODE_READ_ONLY);
if (this.noteDoc != null) {
this.noteDoc.close();
}
this.noteDoc = noteDoc;
if (this.noteDoc.getPageCount() > 0) {
this.currentPage = 0;
final SpenPageDoc page = this.noteDoc.getPage(0);
page.setHistoryListener(this);
this.surfaceView.setPageDoc(page, true);
this.surfaceView.update();
}
if (this.noteDoc.getPageCount() > 1) {
this.noteDoc.getPage(1).setHistoryListener(this);
}
}