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

io.laniakia.ui.SelectionPoint Maven / Gradle / Ivy

There is a newer version: 1.0.2
Show newest version
package io.laniakia.ui;

import java.awt.Point;
import java.awt.Rectangle;

public class SelectionPoint 
{
	private Point startPoint;
	private Point endPoint;
	private Rectangle selectionRectangle;
	private Rectangle translatedRectangle;
	
	public SelectionPoint(Point startPoint, Point endPoint)
	{
		this.startPoint = startPoint;
		this.endPoint = endPoint;
		
		Rectangle selectionRectangle = new Rectangle(startPoint);
		selectionRectangle.add(endPoint);
		this.selectionRectangle = selectionRectangle;
	}
	
	public SelectionPoint(Rectangle rectangle)
	{
		this.selectionRectangle = rectangle;
	}
	
	public Point getStartPoint() 
	{
		return startPoint;
	}
	public void setStartPoint(Point startPoint) 
	{
		this.startPoint = startPoint;
	}
	public Point getEndPoint() 
	{
		return endPoint;
	}
	public void setEndPoint(Point endPoint) 
	{
		this.endPoint = endPoint;
		selectionRectangle = new Rectangle(startPoint);
		selectionRectangle.add(endPoint);
	}

	public Rectangle getRectangle() 
	{
		return selectionRectangle;
	}

	public void setRectangle(Rectangle rectangle) 
	{
		this.selectionRectangle = rectangle;
	}

	public Rectangle getTranslatedRectangle() 
	{
		return translatedRectangle;
	}

	public void setTranslatedRectangle(Rectangle translatedRectangle) 
	{
		this.translatedRectangle = translatedRectangle;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy