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

net.anotheria.anosite.photoserver.shared.vo.PreviewSettingsVO Maven / Gradle / Ivy

The newest version!
package net.anotheria.anosite.photoserver.shared.vo;

import java.io.Serializable;

/**
 * Setting's for generating preview image from photo.
 *
 * @author Alexandr Bolbat
 * @version $Id: $Id
 */
public class PreviewSettingsVO implements Serializable, Cloneable {

	/**
	 * Basic serialVersionUID variable.
	 */
	private static final long serialVersionUID = 1546095390744834142L;

	/**
	 * Start by X.
	 */
	private int x;

	/**
	 * Start by Y.
	 */
	private int y;

	/**
	 * Width.
	 */
	private int width;

	/**
	 * Height.
	 */
	private int height;

	/**
	 * Default constructor.
	 *
	 * @param settings
	 *            - settings
	 */
	public PreviewSettingsVO(PreviewSettingsVO settings) {
		this(settings.getX(), settings.getY(), settings.getWidth(), settings.getHeight());
	}

	/**
	 * Default constructor.
	 *
	 * @param aX
	 *            - start by x
	 * @param aY
	 *            - start by y
	 * @param size
	 *            - size for make squared preview
	 */
	public PreviewSettingsVO(int aX, int aY, int size) {
		this(aX, aY, size, size);
	}

	/**
	 * Default constructor.
	 *
	 * @param aX
	 *            - start by x
	 * @param aY
	 *            - start by y
	 * @param aWidth
	 *            - width
	 * @param aHeight
	 *            - height
	 */
	public PreviewSettingsVO(int aX, int aY, int aWidth, int aHeight) {
		this.x = aX;
		this.y = aY;
		this.width = aWidth;
		this.height = aHeight;
	}

	/**
	 * 

Getter for the field x.

* * @return a int. */ public int getX() { return x; } /** *

Setter for the field x.

* * @param x a int. */ public void setX(int x) { this.x = x; } /** *

Getter for the field y.

* * @return a int. */ public int getY() { return y; } /** *

Setter for the field y.

* * @param y a int. */ public void setY(int y) { this.y = y; } /** *

Getter for the field width.

* * @return a int. */ public int getWidth() { return width; } /** *

Setter for the field width.

* * @param width a int. */ public void setWidth(int width) { this.width = width; } /** *

Getter for the field height.

* * @return a int. */ public int getHeight() { return height; } /** *

Setter for the field height.

* * @param height a int. */ public void setHeight(int height) { this.height = height; } /** {@inheritDoc} */ @Override public String toString() { return "PreviewSettingsVO [x=" + x + ", y=" + y + ", width=" + width + ", height=" + height + "]"; } /** {@inheritDoc} */ @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + height; result = prime * result + width; result = prime * result + x; result = prime * result + y; return result; } /** {@inheritDoc} */ @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; PreviewSettingsVO other = (PreviewSettingsVO) obj; if (height != other.height) return false; if (width != other.width) return false; if (x != other.x) return false; if (y != other.y) return false; return true; } /** {@inheritDoc} */ @Override protected Object clone() { return new PreviewSettingsVO(this); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy