diff --git a/processor/src/main/java/one/nem/lacerta/processor/DocumentProcessor.java b/processor/src/main/java/one/nem/lacerta/processor/DocumentProcessor.java index 75c8fd39..8a967ff0 100644 --- a/processor/src/main/java/one/nem/lacerta/processor/DocumentProcessor.java +++ b/processor/src/main/java/one/nem/lacerta/processor/DocumentProcessor.java @@ -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; // 更新 diff --git a/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java b/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java index 5efcb976..db63175c 100644 --- a/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java +++ b/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java @@ -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) {