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


Java SpenNoteDoc類代碼示例

本文整理匯總了Java中com.samsung.android.sdk.pen.document.SpenNoteDoc的典型用法代碼示例。如果您正苦於以下問題:Java SpenNoteDoc類的具體用法?Java SpenNoteDoc怎麽用?Java SpenNoteDoc使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SpenNoteDoc類屬於com.samsung.android.sdk.pen.document包,在下文中一共展示了SpenNoteDoc類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setupNoteDoc

import com.samsung.android.sdk.pen.document.SpenNoteDoc; //導入依賴的package包/類
@SuppressWarnings("deprecation")
private void setupNoteDoc() {
    try {
        spenNoteDoc = new SpenNoteDoc(this, 1000, 1000);
        spenPageDoc = spenNoteDoc.appendPage();
        spenPageDoc.setBackgroundColor(getResources().getColor(R.color.white));
        spenSimpleSurfaceView.setPageDoc(spenPageDoc, true);
    } catch (IOException e) {
        e.printStackTrace();
    }
}
 
開發者ID:akexorcist,項目名稱:Example-SamsungSDK,代碼行數:12,代碼來源:MainActivity.java

示例2: load

import com.samsung.android.sdk.pen.document.SpenNoteDoc; //導入依賴的package包/類
/**
 * 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,代碼行數:37,代碼來源:PenService.java

示例3: getSpenNoteDoc

import com.samsung.android.sdk.pen.document.SpenNoteDoc; //導入依賴的package包/類
/**
 * Get SPen Note Doc
 * 
 * @return mSpenNoteDoc SpenNoteDoc
 * 
 */
protected SpenNoteDoc getSpenNoteDoc() {
    return mSpenNoteDoc;
}
 
開發者ID:Samsung,項目名稱:CordovaPlugins,代碼行數:10,代碼來源:SpenSurface.java


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