Skip to content

Commit

Permalink
fix(jmask): add showing of parameter names in parameter visibility popup
Browse files Browse the repository at this point in the history
  • Loading branch information
kunstmusik committed Nov 20, 2023
1 parent fa309c0 commit 083926b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
8 changes: 8 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,19 @@ information.
### Updated

* Updated Jython interpreter to 2.7.3

### FIX

* Redid filechooser manager to hold on to Filechoosers so that they will
maintain last state (i.e., last file or folder selected) between uses

* JMask:

* Maintain name of parameter when changing parameter type

* Show parameter name in the popup for setting visibility of parameters


## [2.9.1] - 2023-09-10

### FIX
Expand Down
31 changes: 18 additions & 13 deletions blue-ui-core/src/main/java/blue/soundObject/editor/JMaskEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public JMaskEditor() {
final Box topPanel = new Box(BoxLayout.X_AXIS);
topPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.
createBevelBorder(BevelBorder.RAISED), new EmptyBorder(3, 3,
3, 3)));
3, 3)));
topPanel.add(new JLabel("JMask"));
topPanel.add(Box.createHorizontalStrut(5));
final JButton optionsButton = new JButton(IconFactory.getDownArrowIcon());
Expand All @@ -97,20 +97,20 @@ public JMaskEditor() {
});

useSeedCheckBox.addActionListener((ActionEvent e) -> {
if(jmask != null) {
if (jmask != null) {
jmask.setSeedUsed(useSeedCheckBox.isSelected());
}
});

seedSpinner.addChangeListener((ChangeEvent e) -> {
if(jmask != null) {
jmask.setSeed(((Number)seedSpinner.getValue()).longValue());
if (jmask != null) {
jmask.setSeed(((Number) seedSpinner.getValue()).longValue());
}
});
seedSpinner.setMaximumSize(new Dimension(140,200));
seedSpinner.setPreferredSize(new Dimension(140,22));

seedSpinner.setMaximumSize(new Dimension(140, 200));
seedSpinner.setPreferredSize(new Dimension(140, 22));

topPanel.add(useSeedCheckBox);
topPanel.add(seedSpinner);
topPanel.add(Box.createHorizontalStrut(5));
Expand Down Expand Up @@ -151,10 +151,10 @@ public void editScoreObject(ScoreObject sObj) {

JMask jmask = (JMask) sObj;
this.jmask = null;

useSeedCheckBox.setSelected(jmask.isSeedUsed());
seedSpinner.setValue(jmask.getSeed());

editorListPanel.setJMask(jmask);

this.jmask = jmask;
Expand All @@ -178,7 +178,7 @@ private void testScore() {
if (notes != null) {
InfoDialog.showInformationDialog(SwingUtilities.getRoot(this),
notes.toString(), BlueSystem.getString(
"soundObject.generatedScore"));
"soundObject.generatedScore"));
}
}

Expand All @@ -198,8 +198,13 @@ private void updatePopup() {

for (int i = 0; i < this.field.getSize(); i++) {
Parameter param = this.field.getParameter(i);
var paramName = param.getName();
String itemName = paramName != null && !paramName.isEmpty()
? String.format("Parameter %d - %s", (i + 1), paramName)
: String.format("Parameter %d", (i + 1));

JCheckBoxMenuItem menuItem = new JCheckBoxMenuItem(
"Parameter " + (i + 1));
itemName);
menuItem.setSelected(param.isVisible());
menuItem.putClientProperty("parameter", param);
popup.add(menuItem);
Expand Down

0 comments on commit 083926b

Please sign in to comment.