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

org.pptx4j.Point Maven / Gradle / Ivy

Go to download

docx4j is a library which helps you to work with the Office Open XML file format as used in docx documents, pptx presentations, and xlsx spreadsheets.

There is a newer version: 11.4.11
Show newest version
package org.pptx4j;


public class Point {
	
	public static final int extentToPixelConversionFactor = 9525; //12700;

	Point(long x, long y) {
		this.x = x;
		this.y = y;
	}

	long x;
	public long getX() {
		return x;
	}
	public String getXAsString() {
		return Long.toString(x);
	}
	public void setX(long x) {
		this.x = x;
	}

	long y;
	public long getY() {
		return y;
	}
	public String getYAsString() {
		return Long.toString(y);
	}
	public void setY(long y) {
		this.y = y;
	}

	Point add(Point point2) {
		return new Point(
				x + point2.x, y + point2.y);
	}
	Point subtract(Point point2) {
		return new Point(
				x - point2.x, y - point2.y);
	}
	
	Point toPixels() {
		return new Point( Math.round(x/extentToPixelConversionFactor),
						  Math.round(y/extentToPixelConversionFactor) );
		
	}

	public String debug() {
		return "(" + x + ", "  + y + ")";
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy