
net.vectorpublish.desktop.vp.pd.official.TechnicalMouseDown Maven / Gradle / Ivy
/*
* Copyright (c) 2016, Peter Rader. All rights reserved.
* ___ ___ __ ______ __ __ __ __
* | | |.-----..----.| |_ .-----..----.| __ \.--.--.| |--.| ||__|.-----.| |--.
* | | || -__|| __|| _|| _ || _|| __/| | || _ || || ||__ --|| |
* \_____/ |_____||____||____||_____||__| |___| |_____||_____||__||__||_____||__|__|
*
* http://www.gnu.org/licenses/gpl-3.0.html
*/
package net.vectorpublish.desktop.vp.pd.official;
import java.awt.event.MouseEvent;
/**
* The position and time of the Mouse-Down event.
*
* This class is required for the {@link TechnicalMouseDown} class to work. This
* is a readonly-class.
*/
public class TechnicalMouseDown {
/**
* The start-position on the x-axis.
*/
private final int technicalX;
/**
* The start-position on the y-axis.
*/
private final int technicalY;
/**
* The time the event occoured in miliseconds.
*/
private final long since;
/**
* Constructs the {@link TechnicalMouseDown} by an {@link MouseEvent move}
* that has was incomming.
*
* @param e
* The {@link MouseEvent move} this instance is responsible for.
*/
public TechnicalMouseDown(MouseEvent e) {
this.technicalX = e.getX();
this.technicalY = e.getY();
this.since = e.getWhen();
}
/**
* Returns when the {@link TechnicalMouseDown} happens.
*
* @return The moment in miliseconds the event occoured.
*/
public long getSince() {
return since;
}
/**
* Returns the position of the press on the x-axis.
*
* @return The x-position.
*/
public int getTechnicalStartX() {
return technicalX;
}
/**
* Returns the position of the press on the y-axis.
*
* @return The y-position.
*/
public int getTechnicalStartY() {
return technicalY;
}
/**
* A custom code to identify the concern of drag and drop actions.
*/
public Byte code;
}