All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class View extends JPanel
The GUI for the Barlow/Härpfer Indispensability demo. Contains the Java-Swing widgets for user IO and the check and construction for the NSM data object.
See Also:
  • Field Details

    • STRING_CHECK_BOX

      public static final String STRING_CHECK_BOX
      See Also:
    • STRING_NO_CHECK

      public static final String STRING_NO_CHECK
      See Also:
    • nsm

      @Opt NSM nsm
      The currently selected meter. Is null during power up and after erronuous input.
    • leftPart

      final JPanel leftPart
      Left part of the toplevel GUI window.
    • clockPanel

      final View.ClockPanel clockPanel
      Right part of the toplevel GUI window.
    • meter

      final JTextField meter
      Where to enter the source text of the NSM. May contain digits 0..9, interspersed with blanks and comma. Hitting return or clicking a different widget will start interpretation. The Result is presented in meterStatus. When this result is an error message, all other input widgets are disabled. (The meter may be changed when playing.)
    • meterStatus

      final JTextField meterStatus
      Display the result of interpreting the source text in meter. When this result is an error message, all other input widgets are disabled. If is a valid NSM, the clock display is updated accordingly.
    • clockFill

      final JComboBox clockFill
      Switch visibility of tree inside clock face.
    • playPauseButton

      final PlayPauseButton playPauseButton
      Widget to hold and continue the playing process. This process happens synchronuously in the output audio and in the graphics of clockPanel.
    • writeLilypond

      final JButton writeLilypond
    • writeMusicXml

      final JButton writeMusicXml
    • COLUMN0

      static final int COLUMN0
      See Also:
    • soundSelect

      final EnumPost<View.sound> soundSelect
      Widget to select the sound synthesis.
    • audible

      final JSlider audible
      Slider to set the threshold of the indispensability value to be audible.
    • tempo

      final JSlider tempo
      Slider to set the tempo in "events per minute".
    • volumePost

      final IntPost volumePost
      Data point for overall volume. Range is 0.0 - 1.0.
    • volumeSlider

      final IntPost.SwingSlider volumeSlider
      Slider for overall volume.
    • mtable

      final JTable mtable
      Output for the meter and the calculated indispensability values.
    • ctable

      final JTable ctable
      Output for the missed/passed constraints and ohter statistics.
    • SHORT_DESCRIPTION

      static final String SHORT_DESCRIPTION
      Displayed description text.
      See Also:
    • phaseEnabled

      boolean[] phaseEnabled
    • errorState

      boolean errorState
      Global flag whether an input error occured when interpreting the input to meter.
    • CIRCLE_INSETS

      public static final int CIRCLE_INSETS
      Distance of the main circle to the margins of the clock panel.
      See Also:
    • RADIUS_MIN

      public static final int RADIUS_MIN
      Radius of the smallest circle which represents an event.
      See Also:
    • RADIUS_MAX

      public static final int RADIUS_MAX
      Radius of the largest circle which represents an event.
      See Also:
    • TREE_ROOT_RADIUS

      public int TREE_ROOT_RADIUS
      Radius of the mark of the tree root in the middle. Can be overridden by subclassing.
    • COLOR_ERROR_BG

      public static final Color COLOR_ERROR_BG
      Background of meterStatus in case of a meter input error.
    • COLOR_OKAY_BG

      public static final Color COLOR_OKAY_BG
      Background of meterStatus in case of a valid meter input.
    • COLOR_LOGG_MESSAGE

      public static final Color COLOR_LOGG_MESSAGE
      Background of meterStatus for a neutral logg message.
    • COLOR_HEADER

      public static final Color COLOR_HEADER
      Background of column and row headers of tables.
    • COLOR_INACTIVE

      public static final Color COLOR_INACTIVE
      Events which are currently not active.
    • COLOR_INACTIVE_MUTED

      public static final Color COLOR_INACTIVE_MUTED
    • COLOR_ACTIVE

      public static final Color COLOR_ACTIVE
      Events which are currently active.
    • COLOR_ACTIVE_MUTED

      public static final Color COLOR_ACTIVE_MUTED
    • COLOR_BORDER

      public static final Color COLOR_BORDER
      Color for the borders of circles.
    • LINE_STROKE

      static final Stroke LINE_STROKE
      Linetype for the borders of circles.
    • GRAY_FACTOR

      static final float GRAY_FACTOR
      See Also:
    • LEVEL_GRAYS

      static final Color[] LEVEL_GRAYS
    • tableModel

      final AbstractTableModel tableModel
      Displays in three rows: the event index (zero-based), the metric weights, and the calculated indispensability values.
    • constraintsTableModel

      final AbstractTableModel constraintsTableModel
      Displays in rows: level numbers and forall/exists, then the properties.
               0   1    2    ∀   ∃ 
         D     1   123  1  
         H-MXE ✓   -    ✓   -   ✓ 
         
      ( ✓ = Unicode hexadecimal: 0x2713)
    • constraintTexts

      Object[][] constraintTexts
    • LINE_SUBCYCLES

      int LINE_SUBCYCLES
    • LINE_RELDIFFS

      int LINE_RELDIFFS
    • cacheSubcyclesText

      final Map<Integer,String> cacheSubcyclesText
    • cacheDifferencesText

      final Map<Integer,String> cacheDifferencesText
    • FILTERING_STEM

      public static final String FILTERING_STEM
      See Also:
    • FILTERING_LY_SUFFIX

      public static final String FILTERING_LY_SUFFIX
      See Also:
    • FILTERING_XML_SUFFIX

      public static final String FILTERING_XML_SUFFIX
      See Also:
    • constraintsAll

      boolean[] constraintsAll
    • DEFAULT_DEMO

      public static final String DEFAULT_DEMO
      See Also:
  • Constructor Details

    • View

      View()
      Main constructor which creates the whole application.
  • Method Details

    • reactToMeterInput

      boolean reactToMeterInput()
      Is called when user wants to change focus away from meter input textfield, or presses return.
    • updateEnabled

      void updateEnabled()
    • getErrorState

      boolean getErrorState()
    • abuseMeterStatus

      void abuseMeterStatus(String text)
    • setMeterStatus

      void setMeterStatus(boolean error, String text)
      Set the text of the GUI widget meterStatus and the global error flag. Clear the clock graphic in case of error. (The table is currently not cleared.)
    • showPhase

      void showPhase(int i)
      Called from the sequencer to update the GUI to the current event.
    • levelGray

      static Color levelGray(int i)
    • fillConstraintTexts

      void fillConstraintTexts(NSM nsm)
    • conjugate

      void conjugate(Object[] row)
    • conjugate

      void conjugate(Object[] row, int startWithLayer)
    • conjugate

      void conjugate(Object[] row, int start, int end)
    • doPrintFilterings

      static @Opt PreMessage doPrintFilterings(NSM nsm, NSM.BeamStyle beamStyle)
      Writes a file into pwd.
      Returns:
      PreMessage for "file not found", etc.
    • printFilterings

      static boolean printFilterings(String patternText, NSM.BeamStyle beamStyle, MessageReceiver<SimpleMessage<String>> msg)
    • main

      public static void main(String[] args)
      Create and start the GUI.