Refresh the texture drop down contents when one edits a single copy of a
decal
This commit is contained in:
parent
265fdfe05e
commit
4c3a16f02b
@ -93,4 +93,8 @@ public class DecalModel extends AbstractListModel implements ComboBoxModel {
|
||||
}
|
||||
}
|
||||
|
||||
public void refresh() {
|
||||
decals = document.getDecalList().toArray(new DecalImage[0]);
|
||||
fireContentsChanged(this, 0, decals.length);
|
||||
}
|
||||
}
|
||||
|
@ -145,7 +145,8 @@ public class AppearancePanel extends JPanel {
|
||||
|
||||
final JButton colorButton = new JButton(new ColorIcon(ab.getPaint()));
|
||||
|
||||
final JComboBox textureDropDown = new JComboBox(new DecalModel(this, document, ab));
|
||||
final DecalModel decalModel = new DecalModel(this, document, ab);
|
||||
final JComboBox textureDropDown = new JComboBox(decalModel);
|
||||
|
||||
ab.addChangeListener(new StateChangeListener() {
|
||||
@Override
|
||||
@ -274,6 +275,7 @@ public class AppearancePanel extends JPanel {
|
||||
try {
|
||||
DecalImage newImage = editDecalHelper.editDecal(SwingUtilities.getWindowAncestor(AppearancePanel.this), document, c, ab.getImage());
|
||||
ab.setImage(newImage);
|
||||
decalModel.refresh();
|
||||
} catch (EditDecalHelperException ex) {
|
||||
JOptionPane.showMessageDialog(AppearancePanel.this, ex.getMessage(), "", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user