Skip to content

Commit

Permalink
Better plotter settings panel (#764)
Browse files Browse the repository at this point in the history
* removed open/export no longer used by Donatello

* allow resize

* fix error message

* replace container contents instead of adding to

* added "opens" back in for Github CI
  • Loading branch information
i-make-robots authored Jan 3, 2025
1 parent 2c97a3a commit 119009a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ private void openPlotterSettings() {
JDialog dialog = new JDialog(SwingUtilities.getWindowAncestor(this),Translator.get("PlotterSettingsPanel.Title"));
dialog.add(plotterSettingsPanel);
dialog.setMinimumSize(new Dimension(350,300));
dialog.setResizable(false);
dialog.setResizable(true);
dialog.pack();

app.enableMenuBar(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public boolean deleteProfile(String robotUID) {
profileNames.remove(robotUID);
}
catch (Exception e) {
logger.error("Failed to delete profile {}. {}", robotUID, e);
logger.error("Failed to delete profile {}. ", robotUID, e);
return true;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,20 @@ private void deleteProfile(String uid) {
*/
private void changeProfile() {
String name = (String)configurationList.getSelectedItem();
if(name!=null) {
logger.debug("changing profile to {}",name);
if(plotterSettingsPanel!=null) {
this.remove(plotterSettingsPanel);
}
plotterSettingsManager.setLastSelectedProfile(name);
PlotterSettings plotterSettings = new PlotterSettings(name);
plotterSettingsPanel = new PlotterSettingsPanel(plotterSettings);
container.add(plotterSettingsPanel,BorderLayout.CENTER);
this.revalidate();
plotterSettingsPanel.addListener(this::firePlotterSettingsChanged);
firePlotterSettingsChanged(plotterSettings);
if(name==null) return;

logger.debug("changing profile to {}",name);
if(plotterSettingsPanel!=null) {
this.remove(plotterSettingsPanel);
}
plotterSettingsManager.setLastSelectedProfile(name);
PlotterSettings plotterSettings = new PlotterSettings(name);
plotterSettingsPanel = new PlotterSettingsPanel(plotterSettings);
container.removeAll();
container.add(plotterSettingsPanel,BorderLayout.CENTER);
this.revalidate();
plotterSettingsPanel.addListener(this::firePlotterSettingsChanged);
firePlotterSettingsChanged(plotterSettings);
}

/**
Expand Down
11 changes: 0 additions & 11 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,6 @@
opens com.marginallyclever.makelangelo.makeart.io;
opens com.marginallyclever.makelangelo.plotter.plottercontrols;
opens com.marginallyclever.makelangelo.turtle;

exports com.marginallyclever.communications;
exports com.marginallyclever.convenience.log to ch.qos.logback.core;
exports com.marginallyclever.makelangelo;
exports com.marginallyclever.makelangelo.makeart;
exports com.marginallyclever.makelangelo.makeart.imagefilter;
exports com.marginallyclever.makelangelo.makeart.turtletool;
exports com.marginallyclever.makelangelo.paper;
exports com.marginallyclever.makelangelo.plotter.plottersettings;
exports com.marginallyclever.makelangelo.turtle;

opens com.marginallyclever.convenience.noise;
opens com.marginallyclever.convenience.helpers;
}

0 comments on commit 119009a

Please sign in to comment.