view src/uk/ac/qmul/eecs/depic/daw/gui/SequencePoint.java @ 4:473da40f3d39 tip

added html formatting to Daw/package-info.java
author Fiore Martin <f.martin@qmul.ac.uk>
date Thu, 25 Feb 2016 17:50:09 +0000
parents c0412c81d274
children
line wrap: on
line source
/*  
 Cross-Modal DAW Prototype - Prototype of a simple Cross-Modal Digital Audio Workstation.

 Copyright (C) 2015  Queen Mary University of London (http://depic.eecs.qmul.ac.uk/)
	
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
package uk.ac.qmul.eecs.depic.daw.gui;

import java.awt.geom.Ellipse2D;

import uk.ac.qmul.eecs.depic.patterns.MathUtils;
import uk.ac.qmul.eecs.depic.patterns.Sequence;

/**
 * 
 * A graphic representation of a Sequence.Value (automation point) 
 *
 */
public class SequencePoint extends Ellipse2D.Float {
	private static final long serialVersionUID = 1L;
	public final static int SIZE = 9;
	private Sequence.Value seqValue;
	
	
	
	public SequencePoint(Sequence.Value sequenceValue, float x, float y) {
		super(x, y, SIZE, SIZE);
		this.seqValue = sequenceValue;
	}

	public Sequence.Value getSequenceValue(){
		return seqValue;
	}
	
	@Override
	public String toString(){
		return "Sequence point ["+super.x+","+super.y+"]";
		
	}
	
	public boolean isXCentredAt(int p){
		return MathUtils.equal(p, x+SIZE/2, 0.2f);
	}
	
	public boolean isYCentredAt(int p){
		return MathUtils.equal(p, y+SIZE/2, 0.2f);
	}
	
}