メソッドの統合

This commit is contained in:
r-ca committed 2024-01-14 16:59:02 +09:00
1 parent d6a0dbeaa2
commit 4ae2a9fe3a
2 files changed
+2 -19

No files matched your search

@@ -9,8 +9,7 @@ public interface DocumentProcessor {
// ページ操作
void addNewPageToLast(Bitmap bitmap) throws Exception;
void addNewPagesToLast(Bitmap[] bitmaps) throws Exception;
void addNewPageAfterIndex(Bitmap bitmap, int index) throws Exception;
void addNewPageBeforeIndex(Bitmap bitmap, int index) throws Exception;
void insertPageAtIndex(Bitmap bitmap, int index) throws Exception;
void removePageAtIndex(int index) throws Exception;
// 更新
@@ -94,7 +94,7 @@ public class DocumentProcessorImpl implements DocumentProcessor{
}
@Override
public void addNewPageAfterIndex(Bitmap bitmap, int index) throws Exception {
public void addNewPageAtIndex(Bitmap bitmap, int index) throws Exception {
logger.debug("addNewPageAfterIndex", "called");
String filename = UUID.randomUUID().toString() + ".png"; // TODO-rca: 拡張子を動的にする
@@ -108,22 +108,6 @@ public class DocumentProcessorImpl implements DocumentProcessor{
lacertaVcs.insertPage(index + 1, filename);
}
@Override
public void addNewPageBeforeIndex(Bitmap bitmap, int index) throws Exception {
logger.debug("addNewPageBeforeIndex", "called");
String filename = UUID.randomUUID().toString() + ".png"; // TODO-rca: 拡張子を動的にする
this.fileManager.getNewInstance().createDirectoryIfNotExist(DEFAULT_SAVE_DIR).resolve(DEFAULT_SAVE_DIR).saveBitmap(bitmap, filename);
Page page = new Page();
page.setFileName(filename);
page.setBitmap(bitmap);
this.documentDetail.getPages().add(index, page);
lacertaVcs.insertPage(index, filename);
}
@Override
public void removePageAtIndex(int index) {