mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 21:50:46 +00:00
substance event dispatch fix
This commit is contained in:
@@ -160,36 +160,39 @@ public class DetailPanel extends JPanel implements TagEditorPanel {
|
||||
}
|
||||
|
||||
public void showCard(final String name, final Trait trait) {
|
||||
CardLayout layout = (CardLayout) innerPanel.getLayout();
|
||||
layout.show(innerPanel, name);
|
||||
boolean b = cardMap.get(name) instanceof TraitDetail;
|
||||
buttonsPanel.setVisible(b);
|
||||
View.execInEventDispatch(() -> {
|
||||
CardLayout layout = (CardLayout) innerPanel.getLayout();
|
||||
layout.show(innerPanel, name);
|
||||
boolean b = cardMap.get(name) instanceof TraitDetail;
|
||||
buttonsPanel.setVisible(b);
|
||||
|
||||
TraitDetail newDetail = null;
|
||||
if (b) {
|
||||
newDetail = (TraitDetail) cardMap.get(name);
|
||||
}
|
||||
for (JComponent v : cardMap.values()) {
|
||||
if (v instanceof TraitDetail) {
|
||||
if (v != newDetail) {
|
||||
TraitDetail oldDetail = (TraitDetail) v;
|
||||
oldDetail.setActive(false);
|
||||
TraitDetail newDetail = null;
|
||||
if (b) {
|
||||
newDetail = (TraitDetail) cardMap.get(name);
|
||||
}
|
||||
for (JComponent v : cardMap.values()) {
|
||||
if (v instanceof TraitDetail) {
|
||||
if (v != newDetail) {
|
||||
TraitDetail oldDetail = (TraitDetail) v;
|
||||
oldDetail.setActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (newDetail != null) {
|
||||
newDetail.setActive(true);
|
||||
}
|
||||
|
||||
selectedCard = name;
|
||||
selectedLabel.setText(selectedCard);
|
||||
if (trait == null) {
|
||||
traitNameLabel.setText("-");
|
||||
} else {
|
||||
if (abcPanel != null) {
|
||||
traitNameLabel.setText(trait.getName(abcPanel.abc).getName(abcPanel.abc.constants, null, false));
|
||||
if (newDetail != null) {
|
||||
newDetail.setActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
selectedCard = name;
|
||||
selectedLabel.setText(selectedCard);
|
||||
if (trait == null) {
|
||||
traitNameLabel.setText("-");
|
||||
} else {
|
||||
if (abcPanel != null) {
|
||||
traitNameLabel.setText(trait.getName(abcPanel.abc).getName(abcPanel.abc.constants, null, false));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void editButtonActionPerformed(ActionEvent evt) {
|
||||
|
||||
Reference in New Issue
Block a user