diff --git a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/PaginationPanel.java b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/PaginationPanel.java index 7be1e2bed45..dac9751538d 100644 --- a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/PaginationPanel.java +++ b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/PaginationPanel.java @@ -62,8 +62,7 @@ public class PaginationPanel { /** * Constructor. * - * @param dataEditor - * DataEditorForm instance + * @param dataEditor DataEditorForm instance */ PaginationPanel(DataEditorForm dataEditor) { this.dataEditor = dataEditor; @@ -73,22 +72,20 @@ public class PaginationPanel { } /** - * Checks and updates media references in workpiece depending on changes in - * file system. + * Checks and updates media references in workpiece depending on changes in file system. */ public void updateMediaReferences() { boolean mediaReferencesChanged = false; try { mediaReferencesChanged = ServiceManager.getFileService().searchForMedia(dataEditor.getProcess(), - dataEditor.getWorkpiece()); + dataEditor.getWorkpiece()); } catch (InvalidImagesException e) { Helper.setErrorMessage(e.getLocalizedMessage()); } catch (MediaNotFoundException e) { Helper.setWarnMessage(e.getMessage()); } dataEditor.setMediaUpdated(mediaReferencesChanged); - List physicalDivisions = dataEditor.getWorkpiece() - .getAllPhysicalDivisionChildrenSortedFilteredByPageAndTrack(); + List physicalDivisions = dataEditor.getWorkpiece().getAllPhysicalDivisionChildrenSortedFilteredByPageAndTrack(); for (int i = 1; i < physicalDivisions.size(); i++) { PhysicalDivision physicalDivision = physicalDivisions.get(i - 1); physicalDivision.setOrder(i); @@ -116,16 +113,15 @@ public List getPaginationSelectionSelectedItems() { * selected items to set */ public void setPaginationSelectionSelectedItems(List selectedItems) { - List physicalDivisions = dataEditor.getWorkpiece() - .getAllPhysicalDivisionChildrenSortedFilteredByPageAndTrack(); + List physicalDivisions = dataEditor.getWorkpiece().getAllPhysicalDivisionChildrenSortedFilteredByPageAndTrack(); if (!selectedItems.isEmpty()) { int lastItemIndex = selectedItems.get(selectedItems.size() - 1); - if (this.paginationSelectionSelectedItems.isEmpty() || !Objects.equals( - this.paginationSelectionSelectedItems.get(this.paginationSelectionSelectedItems.size() - 1), - lastItemIndex)) { + if (this.paginationSelectionSelectedItems.isEmpty() + || !Objects.equals(this.paginationSelectionSelectedItems.get( + this.paginationSelectionSelectedItems.size() - 1), lastItemIndex)) { dataEditor.getStructurePanel().updateNodeSelection( - dataEditor.getGalleryPanel().getGalleryMediaContent(physicalDivisions.get(lastItemIndex)), - physicalDivisions.get(lastItemIndex).getLogicalDivisions().get(0)); + dataEditor.getGalleryPanel().getGalleryMediaContent(physicalDivisions.get(lastItemIndex)), + physicalDivisions.get(lastItemIndex).getLogicalDivisions().get(0)); updateMetadataPanel(); } } @@ -223,6 +219,7 @@ public List getPaginationSelectionItems() { return paginationSelectionItems; } + /** * Returns the items for the paginationTypeSelect select menu. * @@ -275,8 +272,7 @@ private void prepareSelectPaginationScopeSelectedItem() { } private void preparePaginationSelectionItems() { - List physicalDivisions = dataEditor.getWorkpiece() - .getAllPhysicalDivisionChildrenSortedFilteredByPageAndTrack(); + List physicalDivisions = dataEditor.getWorkpiece().getAllPhysicalDivisionChildrenSortedFilteredByPageAndTrack(); paginationSelectionItems = new ArrayList<>(physicalDivisions.size()); for (int i = 0; i < physicalDivisions.size(); i++) { View view = View.of(physicalDivisions.get(i)); @@ -290,8 +286,7 @@ private void preparePaginationSelectionItems() { */ public void preparePaginationSelectionSelectedItems() { paginationSelectionSelectedItems = new ArrayList<>(); - List physicalDivisions = dataEditor.getWorkpiece() - .getAllPhysicalDivisionChildrenSortedFilteredByPageAndTrack(); + List physicalDivisions = dataEditor.getWorkpiece().getAllPhysicalDivisionChildrenSortedFilteredByPageAndTrack(); for (Pair selectedElement : dataEditor.getSelectedMedia()) { for (int i = 0; i < physicalDivisions.size(); i++) { PhysicalDivision physicalDivision = physicalDivisions.get(i); @@ -314,18 +309,18 @@ private void preparePaginationTypeSelectItems() { private void prepareSelectPaginationModeItems() { selectPaginationModeItems = new ArrayList<>(6); - selectPaginationModeItems - .add(new IllustratedSelectItem(PaginatorMode.PAGES, "pageCount", "paginierung_seite.svg")); - selectPaginationModeItems - .add(new IllustratedSelectItem(PaginatorMode.DOUBLE_PAGES, "columnCount", "paginierung_spalte.svg")); - selectPaginationModeItems - .add(new IllustratedSelectItem(PaginatorMode.FOLIATION, "sheetCounting", "paginierung_blatt.svg")); - selectPaginationModeItems.add(new IllustratedSelectItem(PaginatorMode.RECTOVERSO_FOLIATION, - "sheetCountingRectoVerso", "paginierung_blatt_rectoverso.svg")); + selectPaginationModeItems.add(new IllustratedSelectItem(PaginatorMode.PAGES, "pageCount", + "paginierung_seite.svg")); + selectPaginationModeItems.add(new IllustratedSelectItem(PaginatorMode.DOUBLE_PAGES, "columnCount", + "paginierung_spalte.svg")); + selectPaginationModeItems.add(new IllustratedSelectItem(PaginatorMode.FOLIATION, "sheetCounting", + "paginierung_blatt.svg")); + selectPaginationModeItems.add(new IllustratedSelectItem(PaginatorMode.RECTOVERSO_FOLIATION, "sheetCountingRectoVerso", + "paginierung_blatt_rectoverso.svg")); selectPaginationModeItems.add(new IllustratedSelectItem(PaginatorMode.RECTOVERSO, "pageCountRectoVerso", "paginierung_seite_rectoverso.svg")); - selectPaginationModeItems.add( - new IllustratedSelectItem(PaginatorMode.DOUBLE_PAGES, "pageCountDouble", "paginierung_doppelseite.svg")); + selectPaginationModeItems.add(new IllustratedSelectItem(PaginatorMode.DOUBLE_PAGES, "pageCountDouble", + "paginierung_doppelseite.svg")); } private void prepareSelectPaginationScopeItems() { @@ -364,7 +359,7 @@ public void startPaginationClick() { } } } catch (NumberFormatException e) { - Helper.setErrorMessage("paginationFormatError", new Object[] {paginationStartValue }); + Helper.setErrorMessage("paginationFormatError", new Object[] { paginationStartValue }); } paginationSelectionSelectedItems = new ArrayList<>(); preparePaginationSelectionItems(); @@ -381,9 +376,8 @@ private void updateMetadataPanel() { && dataEditor.getStructurePanel().getSelectedLogicalNode().getData() instanceof StructureTreeNode && Objects.nonNull(dataEditor.getStructurePanel().getSelectedLogicalNode().getData()) && ((StructureTreeNode) dataEditor.getStructurePanel().getSelectedLogicalNode().getData()) - .getDataObject() instanceof View) { - View view = (View) ((StructureTreeNode) dataEditor.getStructurePanel().getSelectedLogicalNode().getData()) - .getDataObject(); + .getDataObject() instanceof View) { + View view = (View) ((StructureTreeNode) dataEditor.getStructurePanel().getSelectedLogicalNode().getData()).getDataObject(); dataEditor.getMetadataPanel().showPageInLogical(view.getPhysicalDivision()); } }