メソッドの統合

This commit is contained in:
r-ca 2024-01-14 16:59:02 +09:00
parent d6a0dbeaa2
commit 4ae2a9fe3a
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9
2 changed files with 2 additions and 19 deletions

View File

@ -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;
// 更新

View File

@ -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) {