更新実装 WIP

This commit is contained in:
r-ca 2024-01-29 05:28:47 +09:00
parent afb40170ca
commit 1e046e7b9e
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -130,7 +130,26 @@ public class DocumentProcessorImpl implements DocumentProcessor{
@Override @Override
public DocumentProcessor updatePageAtIndex(Bitmap bitmap, int index) { public DocumentProcessor updatePageAtIndex(Bitmap bitmap, int index) {
return null; logger.debug("updatePageAtIndex", "called");
String filename = UUID.randomUUID().toString() + ".png"; // TODO-rca: 拡張子を動的にする
try {
this.fileManager.getNewInstance().createDirectoryIfNotExist(DEFAULT_SAVE_DIR).resolve(DEFAULT_SAVE_DIR).saveBitmap(bitmap, filename);
} catch (Exception e) {
logger.error("updatePageAtIndex", "failed: Unknown error");
logger.e_code("d9191286-6092-40b3-80ed-9239106a8c65");
// Recover (Undo latest action)
lacertaVcs.undo();
}
Page page = new Page();
page.setFileName(filename);
page.setBitmap(bitmap);
this.documentDetail.getPages().set(index, page);
lacertaVcs.updatePage(index, filename);
return this;
} }
@Override @Override