mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-22 16:03:15 +00:00
addNewPageBeforeIndex実装
This commit is contained in:
parent
e3a5dee36c
commit
0c59c85b28
|
@ -143,12 +143,20 @@ public class DocumentProcessorImpl implements DocumentProcessor{
|
||||||
xmlMetaPageModel.setIndex(index + 1);
|
xmlMetaPageModel.setIndex(index + 1);
|
||||||
xmlMetaModel.getPages().add(index, xmlMetaPageModel);
|
xmlMetaModel.getPages().add(index, xmlMetaPageModel);
|
||||||
xmlMetaModel.setPages(reIndexPages(xmlMetaModel.getPages()));
|
xmlMetaModel.setPages(reIndexPages(xmlMetaModel.getPages()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addNewPageBeforeIndex(Bitmap bitmap, int index) {
|
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);
|
||||||
|
|
||||||
|
XmlMetaPageModel xmlMetaPageModel = new XmlMetaPageModel();
|
||||||
|
xmlMetaPageModel.setFilename(filename);
|
||||||
|
xmlMetaPageModel.setIndex(index);
|
||||||
|
xmlMetaModel.getPages().add(index - 1, xmlMetaPageModel);
|
||||||
|
xmlMetaModel.setPages(reIndexPages(xmlMetaModel.getPages()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue
Block a user