Class UnitsPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

class UnitsPanel extends JPanel
Shows every plugged-in unit and its details (board ID, label, firmware, battery, ...). New units are read automatically when plugged in; Refresh reads them all again.
  • Field Details

  • Constructor Details

  • Method Details

    • start

      void start()
    • shutdown

      void shutdown()
    • refreshDisplay

      void refreshDisplay()
      Re-renders the table and details (e.g. after the latest firmware version becomes known).
    • checkForPlugChanges

      private void checkForPlugChanges()
    • refreshInfo

      private void refreshInfo(String port)
      Re-reads a receiver's details without probing it again. Keeps the last details if it doesn't answer.
    • rescanAll

      private void rescanAll()
    • read

      private void read(String port)
    • update

      private void update(String port, String type, UnitInfo info, String status, boolean busy)
    • toggleBlink

      private void toggleBlink()
    • withPort

      private boolean withPort(String port, UnitsPanel.PortAction action)
      Claims, opens, runs, and releases a port. @return false if the port is used elsewhere or can't open
    • statusTone

      private static DevUI.Tone statusTone(UnitsPanel.Row row)
    • rebuildRows

      private void rebuildRows()
    • refreshRows

      private void refreshRows()
      Repaints rows in place; unlike fireTableDataChanged this keeps the selection.
    • selectedRow

      private UnitsPanel.Row selectedRow()
    • firmwareVerdict

      private static String firmwareVerdict(UnitInfo info)
    • refreshDetails

      private void refreshDetails()
    • section

      private static DevUI.Card section(String title)
    • line

      private static JPanel line(String key, JComponent value)
    • value

      private static void value(DevUI.Card card, String key, String value)
    • pillValue

      private static void pillValue(DevUI.Card card, String key, String text, DevUI.Tone tone)
    • bigValue

      private static void bigValue(DevUI.Card card, String k1, String v1, String k2, String v2)
      The two most important values, shown large side by side.
    • colorValue

      private static void colorValue(DevUI.Card card, String key, String rgb)
    • batteryValue

      private static void batteryValue(DevUI.Card card, double volts, double percent)
    • wrapCaption

      private static JComponent wrapCaption(String text)
    • capitalize

      private static String capitalize(String s)