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

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

There is a newer version: 1.3.2
Show newest version
package tech.grasshopper.reporter.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 int id;
	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 DestinationStore {

		private Destination dashboardDestination;

		private List attributeSummaryDestinations = new ArrayList<>();

		private List testDestinations = new ArrayList<>();

		private List topLevelTestDestinations = new ArrayList<>();

		private List attributeDetailDestinations = new ArrayList<>();

		private List testMediaDestinations = new ArrayList<>();

		public void addAttributeSummaryDestination(Destination destination) {
			attributeSummaryDestinations.add(destination);
		}

		public void addTestDestination(Destination destination) {
			testDestinations.add(destination);
		}

		public void addTopLevelTestDestination(Destination destination) {
			topLevelTestDestinations.add(destination);
		}

		public void addAttributeDetailDestination(Destination destination) {
			attributeDetailDestinations.add(destination);
		}

		public void addTestMediaDestination(Destination destination) {
			testMediaDestinations.add(destination);
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy