package jgrasp_viewers_python;


import java.util.EnumSet;
import jgrasp.viewer.ViewerCreateData;
import jgrasp.viewer.ViewerInfo;
import jgrasp.viewer.ViewerPriorityData;


/** A bar graph viewer that plays musical notes when a value changes. **/
public class _X_MusicalBarGraphView extends _X_BarGraphView {

   /** Creates a new musical bar graph viewer.
    *
    * @param vcd viewer creation data. **/
   public _X_MusicalBarGraphView(final ViewerCreateData vcd) {
      super(vcd, EnumSet.of(Flags.MUSICAL));
   }


   /** {@inheritDoc} **/
   @Override
   public void getInfo(final ViewerInfo vi) {
      vi.setShortDescription("Musical viewer for integral and floating point arrays and lists");
      vi.setLongDescription("This viewer displays integral and floating point arrays and java.util.List "
            + "implementations as a bar graph, and plays musical notes when the elements change.");
   }
   
   
   /** {@inheritDoc} **/
   @Override
   public int getPriority(final ViewerPriorityData vpd) {
      int priority = super.getPriority(vpd);
      return priority == (Integer.MIN_VALUE) ? priority : (priority - 1);
   }
}
