Skip to content

Commit

Permalink
Array List Model Update Fix (#484)
Browse files Browse the repository at this point in the history
Fix interval added/removed update events for ArrayListModel.
  • Loading branch information
RobertBColton committed Feb 23, 2020
1 parent 8bbd9c7 commit efb5b9e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion org/lateralgm/main/LGM.java
Expand Up @@ -135,7 +135,7 @@

public final class LGM
{
public static final String version = "1.8.98"; //$NON-NLS-1$
public static final String version = "1.8.99"; //$NON-NLS-1$

// TODO: This list holds the class loader for any loaded plugins which should be
// cleaned up and closed when the application closes.
Expand Down
12 changes: 11 additions & 1 deletion org/lateralgm/ui/swing/util/ArrayListModel.java
Expand Up @@ -83,7 +83,17 @@ public void updated(UpdateEvent e)
}
else
lde = new ListDataEvent(e.source.owner,ListDataEvent.CONTENTS_CHANGED,0,Integer.MAX_VALUE);

for (ListDataListener l : listeners)
l.contentsChanged(lde);
switch (lde.getType())
{
case ListDataEvent.INTERVAL_ADDED:
l.intervalAdded(lde);
case ListDataEvent.INTERVAL_REMOVED:
l.intervalRemoved(lde);
case ListDataEvent.CONTENTS_CHANGED:
default:
l.contentsChanged(lde);
}
}
}

0 comments on commit efb5b9e

Please sign in to comment.