f@0: /* f@0: Cross-Modal DAW Prototype - Prototype of a simple Cross-Modal Digital Audio Workstation. f@0: f@0: Copyright (C) 2015 Queen Mary University of London (http://depic.eecs.qmul.ac.uk/) f@0: f@0: This program is free software: you can redistribute it and/or modify f@0: it under the terms of the GNU General Public License as published by f@0: the Free Software Foundation, either version 3 of the License, or f@0: (at your option) any later version. f@0: f@0: This program is distributed in the hope that it will be useful, f@0: but WITHOUT ANY WARRANTY; without even the implied warranty of f@0: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the f@0: GNU General Public License for more details. f@0: f@0: You should have received a copy of the GNU General Public License f@0: along with this program. If not, see . f@0: */ f@0: package uk.ac.qmul.eecs.depic.patterns; f@0: f@0: import java.util.EventObject; f@0: f@1: /** f@1: * f@1: * An event in a sequence. Objects of this type are passed to the listeners of a sequence when it get changed. f@1: * f@1: */ f@0: public class SequenceEvent extends EventObject{ f@0: private static final long serialVersionUID = 1L; f@0: f@1: /** f@1: * f@1: * Type of events in a sequence f@1: * f@1: */ f@0: public enum What { f@0: VALUE_ADDED, f@0: VALUE_REMOVED, f@0: VALUE_CHANGED, f@0: END_CHANGED, f@0: BEGIN_CHANGED f@0: }; f@0: private Sequence.Value value; f@0: private SequenceEvent.What what; f@0: f@0: public SequenceEvent(Sequence seq,Sequence.Value val, What what){ f@0: super(seq); f@0: this.value = val; f@0: this.what = what; f@0: } f@0: f@0: public What getWhat(){ f@0: return what; f@0: } f@0: f@0: @Override f@0: public Sequence getSource(){ f@0: return (Sequence)super.getSource(); f@0: } f@0: f@0: /** f@0: * If the event concerns a particular value, it returns a reference to that value. f@0: * If the event concerns the whole sequence it returns {@code null}. f@0: * f@0: * @return a reference to the value, or {@code null} if the event concerns no value f@0: */ f@0: public Sequence.Value getValue(){ f@0: return value; f@0: } f@0: }