76 |
private final JLabel lToKey = |
private final JLabel lToKey = |
77 |
new JLabel(i18n.getLabel("JSPianoRollPrefsDlg.lToKey")); |
new JLabel(i18n.getLabel("JSPianoRollPrefsDlg.lToKey")); |
78 |
|
|
79 |
|
private final JLabel lHeight = |
80 |
|
new JLabel(i18n.getLabel("JSPianoRollPrefsDlg.lHeight")); |
81 |
|
|
82 |
private final JSpinner spinnerFirstKey; |
private final JSpinner spinnerFirstKey; |
83 |
private final JSpinner spinnerLastKey; |
private final JSpinner spinnerLastKey; |
84 |
|
|
85 |
|
private final JSpinner spinnerHeight; |
86 |
|
|
87 |
public |
public |
88 |
MainPane() { |
MainPane() { |
89 |
spinnerFirstKey = new JSpinner(new SpinnerNumberModel(0, 0, 127, 1)); |
spinnerFirstKey = new JSpinner(new SpinnerNumberModel(0, 0, 127, 1)); |
90 |
spinnerLastKey = new JSpinner(new SpinnerNumberModel(0, 0, 127, 1)); |
spinnerLastKey = new JSpinner(new SpinnerNumberModel(0, 0, 127, 1)); |
91 |
|
spinnerHeight = new JSpinner(new SpinnerNumberModel(80, 80, 300, 1)); |
92 |
|
|
93 |
int i = CC.preferences().getIntProperty("midiKeyboard.firstKey"); |
int i = CC.preferences().getIntProperty("midiKeyboard.firstKey"); |
94 |
spinnerFirstKey.setValue(i); |
spinnerFirstKey.setValue(i); |
96 |
i = CC.preferences().getIntProperty("midiKeyboard.lastKey"); |
i = CC.preferences().getIntProperty("midiKeyboard.lastKey"); |
97 |
spinnerLastKey.setValue(i); |
spinnerLastKey.setValue(i); |
98 |
|
|
99 |
setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); |
i = CC.preferences().getIntProperty("midiKeyboard.height"); |
100 |
add(lFromKey); |
spinnerHeight.setValue(i); |
101 |
add(Box.createRigidArea(new Dimension(6, 0))); |
|
102 |
add(spinnerFirstKey); |
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); |
103 |
add(Box.createRigidArea(new Dimension(6, 0))); |
|
104 |
add(lToKey); |
JPanel p = new JPanel(); |
105 |
add(Box.createRigidArea(new Dimension(6, 0))); |
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); |
106 |
add(spinnerLastKey); |
p.add(lFromKey); |
107 |
|
p.add(Box.createRigidArea(new Dimension(6, 0))); |
108 |
|
p.add(spinnerFirstKey); |
109 |
|
p.add(Box.createRigidArea(new Dimension(6, 0))); |
110 |
|
p.add(lToKey); |
111 |
|
p.add(Box.createRigidArea(new Dimension(6, 0))); |
112 |
|
p.add(spinnerLastKey); |
113 |
|
p.setAlignmentX(LEFT_ALIGNMENT); |
114 |
|
add(p); |
115 |
|
|
116 |
String s = i18n.getLabel("JSPianoRollPrefsDlg.keyRange"); |
String s = i18n.getLabel("JSPianoRollPrefsDlg.keyRange"); |
117 |
setBorder(BorderFactory.createTitledBorder(s)); |
p.setBorder(BorderFactory.createTitledBorder(s)); |
118 |
|
p.setMaximumSize(new Dimension(Short.MAX_VALUE, p.getPreferredSize().height)); |
119 |
|
|
120 |
|
add(Box.createRigidArea(new Dimension(0, 6))); |
121 |
|
|
122 |
|
p = new JPanel(); |
123 |
|
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); |
124 |
|
p.add(lHeight); |
125 |
|
p.add(Box.createRigidArea(new Dimension(6, 0))); |
126 |
|
p.add(spinnerHeight); |
127 |
|
p.setAlignmentX(LEFT_ALIGNMENT); |
128 |
|
add(p); |
129 |
} |
} |
130 |
|
|
131 |
public void |
public void |
146 |
|
|
147 |
CC.preferences().setIntProperty("midiKeyboard.firstKey", i); |
CC.preferences().setIntProperty("midiKeyboard.firstKey", i); |
148 |
CC.preferences().setIntProperty("midiKeyboard.lastKey", j); |
CC.preferences().setIntProperty("midiKeyboard.lastKey", j); |
149 |
|
|
150 |
|
i = Integer.parseInt(spinnerHeight.getValue().toString()); |
151 |
|
CC.preferences().setIntProperty("midiKeyboard.height", i); |
152 |
} |
} |
153 |
} |
} |
154 |
} |
} |