Mercurial > hg > cmdp
view src/uk/ac/qmul/eecs/depic/patterns/SequenceEvent.java @ 0:3074a84ef81e
first import
author | Fiore Martin <f.martin@qmul.ac.uk> |
---|---|
date | Wed, 26 Aug 2015 16:16:53 +0100 |
parents | |
children | 629262395647 |
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.patterns; import java.util.EventObject; public class SequenceEvent extends EventObject{ private static final long serialVersionUID = 1L; public enum What { VALUE_ADDED, VALUE_REMOVED, VALUE_CHANGED, END_CHANGED, BEGIN_CHANGED }; private Sequence.Value value; private SequenceEvent.What what; public SequenceEvent(Sequence seq,Sequence.Value val, What what){ super(seq); this.value = val; this.what = what; } public What getWhat(){ return what; } @Override public Sequence getSource(){ return (Sequence)super.getSource(); } /** * If the event concerns a particular value, it returns a reference to that value. * If the event concerns the whole sequence it returns {@code null}. * * @return a reference to the value, or {@code null} if the event concerns no value */ public Sequence.Value getValue(){ return value; } }