/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*/
// Can be found at: https://code.google.com/archive/p/aephyr/source/default/source
// package aephyr.swing;
package be.nikiroo.fanfix_swing.gui.utils;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.swing.JTree;
import javax.swing.SortOrder;
import javax.swing.event.EventListenerList;
import javax.swing.event.TreeExpansionEvent;
import javax.swing.event.TreeExpansionListener;
import javax.swing.event.TreeModelEvent;
import javax.swing.event.TreeModelListener;
import javax.swing.event.TreeWillExpandListener;
import javax.swing.tree.ExpandVetoException;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
public class TreeModelTransformer implements TreeModel {
public TreeModelTransformer(JTree tree, TreeModel model) {
if (tree == null)
throw new IllegalArgumentException();
if (model == null)
throw new IllegalArgumentException();
this.tree = tree;
this.model = model;
handler = createHandler();
addListeners();
}
private JTree tree;
private TreeModel model;
private Handler handler;
private Filter filter;
private TreePath filterStartPath;
private int filterDepthLimit;
private SortOrder sortOrder = SortOrder.UNSORTED;
private Map