All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.grasshopper.pdf.destination.Destination Maven / Gradle / Ivy

There is a newer version: 2.14.0
Show newest version
package tech.grasshopper.pdf.destination;

import java.util.ArrayList;
import java.util.List;

import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDPageXYZDestination;

import lombok.Builder;
import lombok.Builder.Default;
import lombok.Data;

@Data
@Builder
public class Destination {

	private String name;
	private PDPage page;
	@Default
	private int xCoord = 0;
	@Default
	private int yCoord = 0;

	public PDPageXYZDestination createPDPageDestination() {
		PDPageXYZDestination destination = new PDPageXYZDestination();
		destination.setPage(page);
		destination.setLeft(xCoord);
		destination.setTop(yCoord);
		return destination;
	}

	@Data
	public static class ChapterDestinationStore {

		private Destination summaryChapterDestination;
		private List featureChapterDestinations = new ArrayList<>();
		private List scenarioChapterDestinations = new ArrayList<>();

		public void addFeatureChapterDestinations(Destination destination) {
			featureChapterDestinations.add(destination);
		}

		public void addScenarioChapterDestinations(Destination destination) {
			scenarioChapterDestinations.add(destination);
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy