Package org.emrick.project
Class ModifyBoardDialog
java.lang.Object
org.emrick.project.ModifyBoardDialog
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final JLabelprivate booleanprivate final JTextFieldprivate final JTextFieldprivate final JTextFieldprivate final JLabelprivate static final intprivate final Frameprivate final SerialTransmitterprivate final JCheckBoxprivate final JCheckBoxprivate final JCheckBox -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateModifyBoardDialog(Frame owner, SerialTransmitter st, List<LEDStrip> strips) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddRow(JPanel form, GridBagConstraints c, int row, String name, JTextField field, JCheckBox write, String placeholder) private static Stringprivate voidFills fields without triggering the other field's lookup.private voidprivate voidprivate static DocumentListenerprivate StringLeft/right position: from the show if the board is in it, otherwise the label's last letter (T10L = L).private voidShows what's on the board now (receivers on current firmware only).private voidrun()static voidshow(Frame owner, SerialTransmitter st, List<LEDStrip> strips) private voidprivate LEDStripstripById(int id) private LEDStripstripByLabel(String label) private Stringvalidate()private voidwrite()
-
Field Details
-
MAX_LEDS
private static final int MAX_LEDS- See Also:
-
owner
-
st
-
strips
-
labelField
-
idField
-
ledField
-
writeLabel
-
writeId
-
writeLeds
-
matchLabel
-
currentLabel
-
filling
private boolean filling
-
-
Constructor Details
-
ModifyBoardDialog
-
-
Method Details
-
show
- 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
-
stripByLabel
-
stripById
-
fillFromLabel
private void fillFromLabel() -
fillFromId
private void fillFromId() -
fill
Fills fields without triggering the other field's lookup. Deferred because a document can't be changed from its own listener. -
showMatch
-
readCurrentValues
private void readCurrentValues()Shows what's on the board now (receivers on current firmware only). -
describe
-
validate
- Returns:
- a message describing what's wrong, or null if the input is OK
-
position
Left/right position: from the show if the board is in it, otherwise the label's last letter (T10L = L). -
write
private void write()
-