mirror of
https://github.com/AndorsTrailRelease/ATCS.git
synced 2025-10-27 18:44:03 +01:00
Some refactoring. Replaced all "listeners" list by instances of
CopyOnWriteArrayList, to allow listeners to unregister themselves due to an event while preventing ConcurrentModificationExceptions. Modified all GameDataElement.elementChanged concrete implementation to remove the backlink from the oldOne.An element pointed by an altered element will not show the game source element in its backlink list anymore.
This commit is contained in:
@@ -2,11 +2,12 @@ package com.gpl.rpg.atcontentstudio;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
public class Notification {
|
||||
|
||||
public static List<Notification> notifs = new ArrayList<Notification>();
|
||||
private static List<NotificationListener> listeners = new ArrayList<NotificationListener>();
|
||||
private static List<NotificationListener> listeners = new CopyOnWriteArrayList<NotificationListener>();
|
||||
public static boolean showS = true, showI = true, showW = true, showE = true;
|
||||
|
||||
static {
|
||||
|
||||
@@ -349,18 +349,21 @@ public class Dialogue extends JSONElement {
|
||||
@Override
|
||||
public void elementChanged(GameDataElement oldOne, GameDataElement newOne) {
|
||||
if (switch_to_npc == oldOne) {
|
||||
oldOne.removeBacklink(this);
|
||||
switch_to_npc = (NPC) newOne;
|
||||
if (newOne != null) newOne.addBacklink(this);
|
||||
} else {
|
||||
if (replies != null) {
|
||||
for (Reply r : replies) {
|
||||
if (r.next_phrase == oldOne) {
|
||||
oldOne.removeBacklink(this);
|
||||
r.next_phrase = (Dialogue) newOne;
|
||||
if (newOne != null) newOne.addBacklink(this);
|
||||
}
|
||||
if (r.requirements != null) {
|
||||
for (Requirement req : r.requirements) {
|
||||
if (req.required_obj == oldOne) {
|
||||
oldOne.removeBacklink(this);
|
||||
req.required_obj = newOne;
|
||||
if (newOne != null) newOne.addBacklink(this);
|
||||
}
|
||||
@@ -371,6 +374,7 @@ public class Dialogue extends JSONElement {
|
||||
if (rewards != null) {
|
||||
for (Reward r : rewards) {
|
||||
if (r.reward_obj == oldOne) {
|
||||
oldOne.removeBacklink(this);
|
||||
r.reward_obj = newOne;
|
||||
if (newOne != null) newOne.addBacklink(this);
|
||||
}
|
||||
|
||||
@@ -194,6 +194,7 @@ public class Droplist extends JSONElement {
|
||||
if (dropped_items != null) {
|
||||
for (DroppedItem di : dropped_items) {
|
||||
if (di.item == oldOne) {
|
||||
oldOne.removeBacklink(this);
|
||||
di.item = (Item) newOne;
|
||||
if (newOne != null) newOne.addBacklink(this);
|
||||
}
|
||||
|
||||
@@ -451,12 +451,14 @@ public class Item extends JSONElement {
|
||||
@Override
|
||||
public void elementChanged(GameDataElement oldOne, GameDataElement newOne) {
|
||||
if (this.category == oldOne) {
|
||||
oldOne.removeBacklink(this);
|
||||
this.category = (ItemCategory) newOne;
|
||||
if (newOne != null) newOne.addBacklink(this);
|
||||
} else {
|
||||
if (this.equip_effect != null && this.equip_effect.conditions != null) {
|
||||
for (ConditionEffect c : this.equip_effect.conditions) {
|
||||
if (c.condition == oldOne) {
|
||||
oldOne.removeBacklink(this);
|
||||
c.condition = (ActorCondition) newOne;
|
||||
if (newOne != null) newOne.addBacklink(this);
|
||||
}
|
||||
@@ -465,6 +467,7 @@ public class Item extends JSONElement {
|
||||
if (this.hit_effect != null && this.hit_effect.conditions_source != null) {
|
||||
for (TimedConditionEffect c : this.hit_effect.conditions_source) {
|
||||
if (c.condition == oldOne) {
|
||||
oldOne.removeBacklink(this);
|
||||
c.condition = (ActorCondition) newOne;
|
||||
if (newOne != null) newOne.addBacklink(this);
|
||||
}
|
||||
@@ -473,6 +476,7 @@ public class Item extends JSONElement {
|
||||
if (this.hit_effect != null && this.hit_effect.conditions_target != null) {
|
||||
for (TimedConditionEffect c : this.hit_effect.conditions_target) {
|
||||
if (c.condition == oldOne) {
|
||||
oldOne.removeBacklink(this);
|
||||
c.condition = (ActorCondition) newOne;
|
||||
if (newOne != null) newOne.addBacklink(this);
|
||||
}
|
||||
@@ -482,6 +486,7 @@ public class Item extends JSONElement {
|
||||
if (this.kill_effect != null && this.kill_effect.conditions_source != null) {
|
||||
for (TimedConditionEffect c : this.kill_effect.conditions_source) {
|
||||
if (c.condition == oldOne) {
|
||||
oldOne.removeBacklink(this);
|
||||
c.condition = (ActorCondition) newOne;
|
||||
if (newOne != null) newOne.addBacklink(this);
|
||||
}
|
||||
|
||||
@@ -357,16 +357,19 @@ public class NPC extends JSONElement {
|
||||
@Override
|
||||
public void elementChanged(GameDataElement oldOne, GameDataElement newOne) {
|
||||
if (dialogue == oldOne) {
|
||||
oldOne.removeBacklink(this);
|
||||
this.dialogue = (Dialogue) newOne;
|
||||
if (newOne != null) newOne.addBacklink(this);
|
||||
} else {
|
||||
if (this.droplist == oldOne) {
|
||||
oldOne.removeBacklink(this);
|
||||
this.droplist = (Droplist) newOne;
|
||||
if (newOne != null) newOne.addBacklink(this);
|
||||
} else {
|
||||
if (this.hit_effect != null && this.hit_effect.conditions_source != null) {
|
||||
for (TimedConditionEffect tce : this.hit_effect.conditions_source) {
|
||||
if (tce.condition == oldOne) {
|
||||
oldOne.removeBacklink(this);
|
||||
tce.condition = (ActorCondition) newOne;
|
||||
if (newOne != null) newOne.addBacklink(this);
|
||||
}
|
||||
@@ -375,6 +378,7 @@ public class NPC extends JSONElement {
|
||||
if (this.hit_effect != null && this.hit_effect.conditions_target != null) {
|
||||
for (TimedConditionEffect tce : this.hit_effect.conditions_target) {
|
||||
if (tce.condition == oldOne) {
|
||||
oldOne.removeBacklink(this);
|
||||
tce.condition = (ActorCondition) newOne;
|
||||
if (newOne != null) newOne.addBacklink(this);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.util.Enumeration;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.swing.tree.TreeNode;
|
||||
|
||||
@@ -439,7 +440,7 @@ public class TMXMap extends GameDataElement {
|
||||
this.link();
|
||||
|
||||
changedOnDisk = false;
|
||||
for (MapChangedOnDiskListener l : new ArrayList<TMXMap.MapChangedOnDiskListener>(listeners)) {
|
||||
for (MapChangedOnDiskListener l : listeners) {
|
||||
l.mapReloaded();
|
||||
}
|
||||
}
|
||||
@@ -449,7 +450,7 @@ public class TMXMap extends GameDataElement {
|
||||
dismissNextChangeNotif--;
|
||||
} else {
|
||||
changedOnDisk = true;
|
||||
for (MapChangedOnDiskListener l : new ArrayList<TMXMap.MapChangedOnDiskListener>(listeners)) {
|
||||
for (MapChangedOnDiskListener l : listeners) {
|
||||
l.mapChanged();
|
||||
}
|
||||
}
|
||||
@@ -460,7 +461,7 @@ public class TMXMap extends GameDataElement {
|
||||
public void mapReloaded();
|
||||
}
|
||||
|
||||
private List<MapChangedOnDiskListener> listeners = new ArrayList<TMXMap.MapChangedOnDiskListener>();
|
||||
private List<MapChangedOnDiskListener> listeners = new CopyOnWriteArrayList<TMXMap.MapChangedOnDiskListener>();
|
||||
|
||||
public void addMapChangedOnDiskListener(MapChangedOnDiskListener l) {
|
||||
listeners.add(l);
|
||||
|
||||
@@ -108,7 +108,6 @@ public class TMXMapSet implements ProjectTreeNode {
|
||||
for (WatchEvent<?> event : wk.pollEvents()) {
|
||||
Path changed = (Path) event.context();
|
||||
String name = changed.getFileName().toString();
|
||||
System.out.println("Changed: "+name);
|
||||
String id = name.substring(0, name.length() - 4);
|
||||
TMXMap map = getMap(id);
|
||||
if (map != null) {
|
||||
|
||||
@@ -103,7 +103,7 @@ public class WorldmapSegment extends GameDataElement {
|
||||
@Override
|
||||
public void elementChanged(GameDataElement oldOne, GameDataElement newOne) {
|
||||
oldOne.removeBacklink(this);
|
||||
newOne.addBacklink(this);
|
||||
if(newOne != null) newOne.addBacklink(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
import javax.swing.AbstractListModel;
|
||||
@@ -681,7 +682,7 @@ public abstract class Editor extends JPanel implements ProjectElementListener {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
|
||||
@@ -10,6 +10,7 @@ import java.awt.event.ItemEvent;
|
||||
import java.awt.event.ItemListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.swing.ComboBoxModel;
|
||||
import javax.swing.DefaultListCellRenderer;
|
||||
@@ -518,7 +519,7 @@ public class JSONCreationWizard extends JDialog {
|
||||
return DataType.values()[index];
|
||||
}
|
||||
|
||||
List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
@@ -584,7 +585,7 @@ public class JSONCreationWizard extends JDialog {
|
||||
public void elementCreated(JSONElement created);
|
||||
}
|
||||
|
||||
private List<CreationCompletedListener> listeners = new ArrayList<JSONCreationWizard.CreationCompletedListener>();
|
||||
private List<CreationCompletedListener> listeners = new CopyOnWriteArrayList<JSONCreationWizard.CreationCompletedListener>();
|
||||
|
||||
public void addCreationListener(CreationCompletedListener l) {
|
||||
listeners.add(l);
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.swing.ButtonGroup;
|
||||
import javax.swing.ComboBoxModel;
|
||||
@@ -603,7 +604,7 @@ public class JSONImportWizard extends JDialog {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
@@ -639,7 +640,7 @@ public class JSONImportWizard extends JDialog {
|
||||
return DataType.values()[index];
|
||||
}
|
||||
|
||||
List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.BorderFactory;
|
||||
@@ -101,7 +102,7 @@ public class NotificationsPane extends JList {
|
||||
}
|
||||
}
|
||||
|
||||
private List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
private List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
listeners.add(l);
|
||||
|
||||
@@ -11,6 +11,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.swing.ComboBoxModel;
|
||||
import javax.swing.JButton;
|
||||
@@ -67,7 +68,7 @@ public class ProjectCreationWizard extends JDialog {
|
||||
return Project.ResourceSet.values()[index];
|
||||
}
|
||||
|
||||
List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
|
||||
@@ -11,6 +11,7 @@ import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JLabel;
|
||||
@@ -655,7 +656,7 @@ public class ProjectsTree extends JPanel {
|
||||
return ((ProjectTreeNode)parent).getIndex((ProjectTreeNode) child);
|
||||
}
|
||||
|
||||
List<TreeModelListener> listeners = new ArrayList<TreeModelListener>();
|
||||
List<TreeModelListener> listeners = new CopyOnWriteArrayList<TreeModelListener>();
|
||||
|
||||
@Override
|
||||
public void addTreeModelListener(TreeModelListener l) {
|
||||
|
||||
@@ -9,6 +9,7 @@ import java.awt.event.ActionListener;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.swing.ButtonGroup;
|
||||
import javax.swing.ComboBoxModel;
|
||||
@@ -231,7 +232,7 @@ public class TMXMapCreationWizard extends JDialog {
|
||||
public void mapCreated(TMXMap created);
|
||||
}
|
||||
|
||||
private List<CreationCompletedListener> listeners = new ArrayList<TMXMapCreationWizard.CreationCompletedListener>();
|
||||
private List<CreationCompletedListener> listeners = new CopyOnWriteArrayList<TMXMapCreationWizard.CreationCompletedListener>();
|
||||
|
||||
public void addCreationListener(CreationCompletedListener l) {
|
||||
listeners.add(l);
|
||||
@@ -257,7 +258,7 @@ public class TMXMapCreationWizard extends JDialog {
|
||||
return proj.getMap(index);
|
||||
}
|
||||
|
||||
List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
|
||||
@@ -12,6 +12,8 @@ import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentSkipListSet;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.swing.Action;
|
||||
import javax.swing.JFileChooser;
|
||||
@@ -452,10 +454,8 @@ public class WorkspaceActions {
|
||||
public void putValue(String key, Object value) {
|
||||
PropertyChangeEvent event = new PropertyChangeEvent(this, key, values.get(key), value);
|
||||
values.put(key, value);
|
||||
synchronized(listeners) {
|
||||
for (PropertyChangeListener l : listeners) {
|
||||
l.propertyChange(event);
|
||||
}
|
||||
for (PropertyChangeListener l : listeners) {
|
||||
l.propertyChange(event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -463,10 +463,8 @@ public class WorkspaceActions {
|
||||
public void setEnabled(boolean b) {
|
||||
PropertyChangeEvent event = new PropertyChangeEvent(this, "enabled", isEnabled(), b);
|
||||
enabled = b;
|
||||
synchronized(listeners) {
|
||||
for (PropertyChangeListener l : listeners) {
|
||||
l.propertyChange(event);
|
||||
}
|
||||
for (PropertyChangeListener l : listeners) {
|
||||
l.propertyChange(event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -475,20 +473,16 @@ public class WorkspaceActions {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
private Set<PropertyChangeListener> listeners = new HashSet<PropertyChangeListener>();
|
||||
private List<PropertyChangeListener> listeners = new CopyOnWriteArrayList<PropertyChangeListener>();
|
||||
|
||||
@Override
|
||||
public void addPropertyChangeListener(PropertyChangeListener listener) {
|
||||
synchronized(listeners) {
|
||||
listeners.add(listener);
|
||||
}
|
||||
listeners.add(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removePropertyChangeListener(PropertyChangeListener listener) {
|
||||
synchronized(listeners) {
|
||||
listeners.remove(listener);
|
||||
}
|
||||
listeners.remove(listener);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JDialog;
|
||||
@@ -144,7 +145,7 @@ public class WorldmapCreationWizard extends JDialog {
|
||||
public void segmentCreated(WorldmapSegment created);
|
||||
}
|
||||
|
||||
private List<CreationCompletedListener> listeners = new ArrayList<WorldmapCreationWizard.CreationCompletedListener>();
|
||||
private List<CreationCompletedListener> listeners = new CopyOnWriteArrayList<WorldmapCreationWizard.CreationCompletedListener>();
|
||||
|
||||
public void addCreationListener(CreationCompletedListener l) {
|
||||
listeners.add(l);
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JDialog;
|
||||
@@ -176,7 +177,7 @@ public class WorldmapLabelEditionWizard extends JDialog {
|
||||
public void labelCreated(WorldmapSegment.NamedArea created);
|
||||
}
|
||||
|
||||
private List<CreationCompletedListener> listeners = new ArrayList<WorldmapLabelEditionWizard.CreationCompletedListener>();
|
||||
private List<CreationCompletedListener> listeners = new CopyOnWriteArrayList<WorldmapLabelEditionWizard.CreationCompletedListener>();
|
||||
|
||||
public void addCreationListener(CreationCompletedListener l) {
|
||||
listeners.add(l);
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.swing.DefaultListCellRenderer;
|
||||
import javax.swing.ImageIcon;
|
||||
@@ -752,7 +753,7 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
}
|
||||
}
|
||||
|
||||
List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
@@ -917,7 +918,7 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
}
|
||||
|
||||
|
||||
List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
@@ -1031,7 +1032,7 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
}
|
||||
}
|
||||
|
||||
List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.swing.DefaultListCellRenderer;
|
||||
import javax.swing.ImageIcon;
|
||||
@@ -196,7 +197,7 @@ public class DroplistEditor extends JSONElementEditor {
|
||||
}
|
||||
}
|
||||
|
||||
List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.swing.DefaultListCellRenderer;
|
||||
import javax.swing.ImageIcon;
|
||||
@@ -578,7 +579,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
}
|
||||
}
|
||||
|
||||
List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
@@ -640,7 +641,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
}
|
||||
}
|
||||
|
||||
List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
@@ -723,7 +724,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
}
|
||||
}
|
||||
|
||||
List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.swing.DefaultListCellRenderer;
|
||||
import javax.swing.ImageIcon;
|
||||
@@ -397,7 +398,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
}
|
||||
}
|
||||
|
||||
List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
@@ -459,7 +460,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
}
|
||||
}
|
||||
|
||||
List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.ImageIcon;
|
||||
@@ -293,7 +294,7 @@ public class QuestEditor extends JSONElementEditor {
|
||||
if (quest.stages.isEmpty()) quest.stages = null;
|
||||
}
|
||||
|
||||
public List<TableModelListener> listeners = new ArrayList<TableModelListener>();
|
||||
public List<TableModelListener> listeners = new CopyOnWriteArrayList<TableModelListener>();
|
||||
|
||||
@Override
|
||||
public void addTableModelListener(TableModelListener l) {
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.ComboBoxModel;
|
||||
@@ -890,7 +891,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
return index;
|
||||
}
|
||||
|
||||
List<TreeModelListener> listeners = new ArrayList<TreeModelListener>();
|
||||
List<TreeModelListener> listeners = new CopyOnWriteArrayList<TreeModelListener>();
|
||||
|
||||
@Override
|
||||
public void addTreeModelListener(TreeModelListener l) {
|
||||
@@ -999,7 +1000,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
}
|
||||
}
|
||||
|
||||
List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
@@ -1078,7 +1079,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
}
|
||||
}
|
||||
|
||||
List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
@@ -1150,7 +1151,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
return availableLayers.size();
|
||||
}
|
||||
|
||||
List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
listeners.add(l);
|
||||
@@ -1206,7 +1207,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
}
|
||||
}
|
||||
|
||||
List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
@@ -1251,7 +1252,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
return area.spawnGroup.get(index);
|
||||
}
|
||||
|
||||
List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
@@ -1533,7 +1534,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
return null;
|
||||
}
|
||||
|
||||
List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.util.Enumeration;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.DefaultListCellRenderer;
|
||||
@@ -259,7 +260,7 @@ public class SpritesheetEditor extends Editor {
|
||||
|
||||
}
|
||||
|
||||
List<TableModelListener> listeners = new ArrayList<TableModelListener>();
|
||||
List<TableModelListener> listeners = new CopyOnWriteArrayList<TableModelListener>();
|
||||
|
||||
@Override
|
||||
public void addTableModelListener(TableModelListener l) {
|
||||
@@ -358,7 +359,7 @@ public class SpritesheetEditor extends Editor {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<ListDataListener> listeners = new ArrayList<ListDataListener>();
|
||||
List<ListDataListener> listeners = new CopyOnWriteArrayList<ListDataListener>();
|
||||
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.gpl.rpg.atcontentstudio.ui.tools;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.ImageIcon;
|
||||
@@ -200,7 +201,7 @@ public class ItemsTableView extends ElementTableView {
|
||||
//not editable.
|
||||
}
|
||||
|
||||
List<TableModelListener> listeners = new ArrayList<TableModelListener>();
|
||||
List<TableModelListener> listeners = new CopyOnWriteArrayList<TableModelListener>();
|
||||
|
||||
@Override
|
||||
public void addTableModelListener(TableModelListener l) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.gpl.rpg.atcontentstudio.ui.tools;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.ImageIcon;
|
||||
@@ -157,7 +158,7 @@ public class NPCsTableView extends ElementTableView {
|
||||
//not editable.
|
||||
}
|
||||
|
||||
List<TableModelListener> listeners = new ArrayList<TableModelListener>();
|
||||
List<TableModelListener> listeners = new CopyOnWriteArrayList<TableModelListener>();
|
||||
|
||||
@Override
|
||||
public void addTableModelListener(TableModelListener l) {
|
||||
|
||||
Reference in New Issue
Block a user