Class ModifyBoardDialog

java.lang.Object
org.emrick.project.ModifyBoardDialog

public class ModifyBoardDialog extends Object
Hardware > Modify Board: writes a receiver's board label, board ID, and LED count. With a show open, the fields fill each other in from the show: entering a board label fills in its board ID and LED count, and entering a board ID fills in its label. Without a show, values are written as entered. The unit is read back afterwards so the result can be confirmed.
  • Field Details

  • Constructor Details

  • Method Details

    • show

      public static void show(Frame owner, SerialTransmitter st, List<LEDStrip> strips)
      Parameters:
      strips - the open show's LED strips, or an empty list if no show is open
    • run

      private void run()
    • addRow

      private void addRow(JPanel form, GridBagConstraints c, int row, String name, JTextField field, JCheckBox write, String placeholder)
    • onChange

      private static DocumentListener onChange(Runnable action)
    • stripByLabel

      private LEDStrip stripByLabel(String label)
    • stripById

      private LEDStrip stripById(int id)
    • fillFromLabel

      private void fillFromLabel()
    • fillFromId

      private void fillFromId()
    • fill

      private void fill(Runnable change)
      Fills fields without triggering the other field's lookup. Deferred because a document can't be changed from its own listener.
    • showMatch

      private void showMatch(LEDStrip strip, String notFound)
    • readCurrentValues

      private void readCurrentValues()
      Shows what's on the board now (receivers on current firmware only).
    • describe

      private static String describe(UnitInfo info)
    • validate

      private String validate()
      Returns:
      a message describing what's wrong, or null if the input is OK
    • position

      private String position(String label, int id)
      Left/right position: from the show if the board is in it, otherwise the label's last letter (T10L = L).
    • write

      private void write()