當前位置: 首頁>>代碼示例>>Java>>正文


Java SpenNoteDoc.MODE_WRITABLE屬性代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:ayltai,項目名稱:Android-Lib-Pen,代碼行數:36,代碼來源:PenService.java


注:本文中的com.samsung.android.sdk.pen.document.SpenNoteDoc.MODE_WRITABLE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。