本文整理匯總了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();
}
}
示例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);
}
}
示例3: getSpenNoteDoc
import com.samsung.android.sdk.pen.document.SpenNoteDoc; //導入依賴的package包/類
/**
* Get SPen Note Doc
*
* @return mSpenNoteDoc SpenNoteDoc
*
*/
protected SpenNoteDoc getSpenNoteDoc() {
return mSpenNoteDoc;
}