Class SequenceGraph

  • java.lang.Object
    • uk.ac.qmul.eecs.depic.daw.gui.SequenceGraph
  • All Implemented Interfaces:
    SequenceListener


    public class SequenceGraph
    extends java.lang.Object
    implements SequenceListener
    A visual representation of a sequence graph. Here used for automation graphs overlaying the audio track. It listen to sequences (automations) and, when the sequence is updated, it updates itself and triggers the registered change listeners.
    • Constructor Detail

      • SequenceGraph

        public SequenceGraph(java.awt.Color color,
                             java.awt.Dimension size)
    • Method Detail

      • getSize

        public java.awt.Dimension getSize()
      • setSize

        public void setSize(java.awt.Dimension size)
      • setColor

        public void setColor(java.awt.Color c)
      • getMillisecondsPerPixel

        public float getMillisecondsPerPixel()
      • setMillisecPerPixel

        public void setMillisecPerPixel(float millisecPerPixel)
      • getColor

        public java.awt.Color getColor()
      • getSequencePoints

        public java.util.List<SequencePoint> getSequencePoints()
      • getSequenceLines

        public java.util.List<java.awt.Shape> getSequenceLines()
      • draw

        public void draw(java.awt.Graphics g)
      • addChangeListener

        public void addChangeListener(javax.swing.event.ChangeListener l)
      • removeChangeListener

        public void removeChangeListener(javax.swing.event.ChangeListener l)
      • fireChangeListeners

        protected void fireChangeListeners()
      • sequenceUpdated

        public <T extends SequenceEvent> void sequenceUpdated(T evt)
        Description copied from interface: SequenceListener
        This method has to be implemented by classes that provide a continuous representation of the sequence. The method a callback that is called as soon as one of the values of the the sequence is added, deleted or modified. Implementors can thus promptly update their representation to reflect the changes in the sequence.
        Specified by:
        sequenceUpdated in interface SequenceListener
        Parameters:
        evt - an event holding information about the sequence that has been modfied.
      • setSequence

        public void setSequence(Sequence s)
        Sets a new sequence to be listened to. If the argument is null it stops listening to the previously set sequence, if any,m and clears all sequence points and lines. it calls updateSequence.
        Parameters:
        s - the new sequence.
      • getSequence

        public Sequence getSequence()
      • updateSequence

        public void updateSequence()
        Recompute the sequence points and lines. It should be called whenever a change is done to this object. For example after setSize and setMilliseconsPerPixel.