|
37 | 37 | import org.apache.logging.log4j.Logger;
|
38 | 38 | import org.kitodo.api.dataeditor.rulesetmanagement.RulesetManagementInterface;
|
39 | 39 | import org.kitodo.api.dataformat.LogicalDivision;
|
40 |
| -import org.kitodo.api.dataformat.PhysicalDivision; |
41 | 40 | import org.kitodo.api.dataformat.MediaVariant;
|
| 41 | +import org.kitodo.api.dataformat.PhysicalDivision; |
42 | 42 | import org.kitodo.api.dataformat.View;
|
43 | 43 | import org.kitodo.data.database.beans.Folder;
|
44 | 44 | import org.kitodo.data.database.beans.Process;
|
@@ -528,15 +528,20 @@ public GalleryMediaContent getGalleryMediaContent(PhysicalDivision physicalDivis
|
528 | 528 | }
|
529 | 529 |
|
530 | 530 | /**
|
531 |
| - * Get a List of all PhysicalDivisions and the LogicalDivisions they are assigned to |
532 |
| - * which are displayed between two selected PhysicalDivisions. This method selects the Stripes that are affected by the selection and delegates |
533 |
| - * the selection of the contained PhysicalDivisions. |
| 531 | + * Get a List of all PhysicalDivisions and the LogicalDivisions they are |
| 532 | + * assigned to which are displayed between two selected PhysicalDivisions. |
| 533 | + * This method selects the Stripes that are affected by the selection and |
| 534 | + * delegates the selection of the contained PhysicalDivisions. |
| 535 | + * |
534 | 536 | * @param first
|
535 |
| - * First selected PhysicalDivision. A Pair of the PhysicalDivision and the LogicalDivision to which the PhysicalDivision is assigned. |
| 537 | + * First selected PhysicalDivision. A Pair of the |
| 538 | + * PhysicalDivision and the LogicalDivision to which the |
| 539 | + * PhysicalDivision is assigned. |
536 | 540 | * @param last
|
537 |
| - * Last selected PhysicalDivision. A Pair of the PhysicalDivision and the Logical Division to which the PhysicalDivision is assigned. |
538 |
| - * @return |
539 |
| - * A List of all selected PhysicalDivisions |
| 541 | + * Last selected PhysicalDivision. A Pair of the PhysicalDivision |
| 542 | + * and the Logical Division to which the PhysicalDivision is |
| 543 | + * assigned. |
| 544 | + * @return A List of all selected PhysicalDivisions |
540 | 545 | */
|
541 | 546 | private List<Pair<PhysicalDivision, LogicalDivision>> getMediaWithinRange(Pair<PhysicalDivision, LogicalDivision> first,
|
542 | 547 | Pair<PhysicalDivision, LogicalDivision> last) {
|
@@ -582,18 +587,23 @@ This stripe is displayed last, but is actually the logical structure (first stri
|
582 | 587 | }
|
583 | 588 |
|
584 | 589 | /**
|
585 |
| - * Get a List of all PhysicalDivisions and the LogicalDivisions they are assigned to |
586 |
| - * which are displayed between two selected PhysicalDivisions. This method selected the PhysicalDivisions between and including the two indices. |
| 590 | + * Get a List of all PhysicalDivisions and the LogicalDivisions they are |
| 591 | + * assigned to which are displayed between two selected PhysicalDivisions. |
| 592 | + * This method selected the PhysicalDivisions between and including the two |
| 593 | + * indices. |
| 594 | + * |
587 | 595 | * @param firstIndices
|
588 |
| - * First selected PhysicalDivision. |
589 |
| - * A Pair of indices of the PhysicalDivision and the LogicalDivision to which the PhysicalDivision is assigned. |
| 596 | + * First selected PhysicalDivision. A Pair of indices of the |
| 597 | + * PhysicalDivision and the LogicalDivision to which the |
| 598 | + * PhysicalDivision is assigned. |
590 | 599 | * @param lastIndices
|
591 |
| - * Last selected PhysicalDivision. |
592 |
| - * A Pair of indices of the PhysicalDivision and the Logical Division to which the PhysicalDivision is assigned. |
| 600 | + * Last selected PhysicalDivision. A Pair of indices of the |
| 601 | + * PhysicalDivision and the Logical Division to which the |
| 602 | + * PhysicalDivision is assigned. |
593 | 603 | * @param galleryStripes
|
594 |
| - * A List of GalleryStripes which contain the two selected PhysicalDivisions and all in between |
595 |
| - * @return |
596 |
| - * A List of all selected PhysicalDivisions |
| 604 | + * A List of GalleryStripes which contain the two selected |
| 605 | + * PhysicalDivisions and all in between |
| 606 | + * @return A List of all selected PhysicalDivisions |
597 | 607 | */
|
598 | 608 | private List<Pair<PhysicalDivision, LogicalDivision>> getMediaWithinRangeFromSelectedStripes(
|
599 | 609 | Pair<Integer, Integer> firstIndices, Pair<Integer, Integer> lastIndices, List<GalleryStripe> galleryStripes) {
|
@@ -720,7 +730,8 @@ public boolean isSelected(GalleryMediaContent galleryMediaContent, GalleryStripe
|
720 | 730 |
|
721 | 731 | private void selectMedia(String physicalDivisionOrder, String stripeIndex, String selectionType) {
|
722 | 732 | PhysicalDivision selectedPhysicalDivision = null;
|
723 |
| - for (PhysicalDivision physicalDivision : this.dataEditor.getWorkpiece().getAllPhysicalDivisionChildrenFilteredByTypePageAndSorted()) { |
| 733 | + for (PhysicalDivision physicalDivision : this.dataEditor.getWorkpiece() |
| 734 | + .getAllPhysicalDivisionChildrenFilteredByTypePageAndSorted()) { |
724 | 735 | if (Objects.equals(physicalDivision.getOrder(), Integer.parseInt(physicalDivisionOrder))) {
|
725 | 736 | selectedPhysicalDivision = physicalDivision;
|
726 | 737 | break;
|
@@ -832,7 +843,8 @@ private void defaultSelect(GalleryMediaContent currentSelection, GalleryStripe p
|
832 | 843 | }
|
833 | 844 |
|
834 | 845 | dataEditor.getSelectedMedia().clear();
|
835 |
| - dataEditor.getSelectedMedia().add(new ImmutablePair<>(currentSelection.getView().getPhysicalDivision(), parentStripe.getStructure())); |
| 846 | + dataEditor.getSelectedMedia().add( |
| 847 | + new ImmutablePair<>(currentSelection.getView().getPhysicalDivision(), parentStripe.getStructure())); |
836 | 848 | }
|
837 | 849 |
|
838 | 850 | private void rangeSelect(GalleryMediaContent currentSelection, GalleryStripe parentStripe) {
|
@@ -867,11 +879,14 @@ private void multiSelect(GalleryMediaContent currentSelection, GalleryStripe par
|
867 | 879 | }
|
868 | 880 |
|
869 | 881 | /**
|
870 |
| - * Get the index of this GalleryMediaContent's PhysicalDivision out of all PhysicalDivisions |
871 |
| - * which are assigned to more than one LogicalDivision. |
| 882 | + * Get the index of this GalleryMediaContent's PhysicalDivision out of all |
| 883 | + * PhysicalDivisions which are assigned to more than one LogicalDivision. |
872 | 884 | *
|
873 |
| - * @param galleryMediaContent object to find the index for |
874 |
| - * @return index of the GalleryMediaContent's PhysicalDivision if present in the List of several assignments, or -1 if not present in the list. |
| 885 | + * @param galleryMediaContent |
| 886 | + * object to find the index for |
| 887 | + * @return index of the GalleryMediaContent's PhysicalDivision if present in |
| 888 | + * the List of several assignments, or -1 if not present in the |
| 889 | + * list. |
875 | 890 | */
|
876 | 891 | public int getSeveralAssignmentsIndex(GalleryMediaContent galleryMediaContent) {
|
877 | 892 | if (Objects.nonNull(galleryMediaContent.getView()) && Objects.nonNull(galleryMediaContent.getView().getPhysicalDivision())) {
|
|
0 commit comments