mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Added test dialog for dividing leds over transforms
Former-commit-id: 0d4549d32c40df3fcbd0c308b249566721445b13
This commit is contained in:
parent
79f66f7db1
commit
dc4a41c64a
@ -0,0 +1,48 @@
|
||||
package org.hyperion.hypercon.gui;
|
||||
|
||||
import java.awt.GridLayout;
|
||||
|
||||
import javax.swing.ButtonGroup;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JRadioButton;
|
||||
|
||||
public class LedDivideDialog extends JFrame {
|
||||
|
||||
private final int mLedCount;
|
||||
private final int mTransformCount;
|
||||
|
||||
private JPanel mContentPanel;
|
||||
|
||||
public LedDivideDialog(int pLedCnt, int pTransformCnt) {
|
||||
super();
|
||||
|
||||
mLedCount = pLedCnt;
|
||||
mTransformCount = pTransformCnt;
|
||||
|
||||
initialise();
|
||||
}
|
||||
|
||||
private void initialise() {
|
||||
mContentPanel = new JPanel();
|
||||
mContentPanel.setLayout(new GridLayout(mLedCount, mTransformCount, 5, 5));
|
||||
|
||||
for (int iLed=0; iLed<mLedCount; ++iLed) {
|
||||
ButtonGroup ledGroup = new ButtonGroup();
|
||||
for (int iTransform=0; iTransform<mTransformCount; ++iTransform) {
|
||||
JRadioButton ledTransformButton = new JRadioButton();
|
||||
ledGroup.add(ledTransformButton);
|
||||
mContentPanel.add(ledTransformButton);
|
||||
}
|
||||
}
|
||||
|
||||
setContentPane(mContentPanel);
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] pArgs) {
|
||||
LedDivideDialog dialog = new LedDivideDialog(50, 3);
|
||||
dialog.setSize(600, 800);
|
||||
dialog.setVisible(true);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user