Commit 144d51b4 authored by Florian Lugou's avatar Florian Lugou

removed some warnings

parent 0907a910
# IntelliJ
/.idea /.idea
*.iml *.iml
/build
# Vim
*.swp *.swp
# Emacs
.#*
# TTool
*~ *~
# Gradle
.gradle .gradle
# Compilation
/build
/bin /bin
/release /release
/TTool_install /TTool_install
...@@ -54,7 +54,7 @@ FORCE: ...@@ -54,7 +54,7 @@ FORCE:
# ========== SUB-PROJECTS BUILD ========== # ========== SUB-PROJECTS BUILD ==========
# ======================================== # ========================================
export TTOOL_SRC = $(TTOOL_PATH)/src/main/java export TTOOL_SRC = $(TTOOL_PATH)/src/main/java
export GLOBAL_JAVA = $(shell cd $(TTOOL_SRC); find . -name "*.java") export GLOBAL_JAVA = $(shell cd $(TTOOL_SRC); find . -name "[^.]*.java")
export TTOOL_RESOURCES = $(TTOOL_PATH)/src/main/resources export TTOOL_RESOURCES = $(TTOOL_PATH)/src/main/resources
export TTOOL_WEBCRAWLER_SRC = $(TTOOL_PATH)/src/main/java/web/crawler export TTOOL_WEBCRAWLER_SRC = $(TTOOL_PATH)/src/main/java/web/crawler
export TTOOL_BIN = $(TTOOL_PATH)/bin export TTOOL_BIN = $(TTOOL_PATH)/bin
......
...@@ -565,7 +565,7 @@ public final class GraphicLib { ...@@ -565,7 +565,7 @@ public final class GraphicLib {
sortJTabbedPane(jtp, v, beginIndex, maxIndex); sortJTabbedPane(jtp, v, beginIndex, maxIndex);
} }
public static void moveTabFromTo(JTabbedPane jtp, Vector v, int src, int dst) { public static <E> void moveTabFromTo(JTabbedPane jtp, Vector<E> v, int src, int dst) {
// Get all the properties // Get all the properties
Component comp = jtp.getComponentAt(src); Component comp = jtp.getComponentAt(src);
...@@ -593,7 +593,7 @@ public final class GraphicLib { ...@@ -593,7 +593,7 @@ public final class GraphicLib {
jtp.setForegroundAt(dst, fg); jtp.setForegroundAt(dst, fg);
jtp.setBackgroundAt(dst, bg); jtp.setBackgroundAt(dst, bg);
Object o = v.elementAt(src); E o = v.elementAt(src);
v.removeElementAt(src); v.removeElementAt(src);
v.insertElementAt(o, dst); v.insertElementAt(o, dst);
} }
......
...@@ -68,33 +68,20 @@ import java.util.List; ...@@ -68,33 +68,20 @@ import java.util.List;
/* available at http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/TableSorter.java */ /* available at http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/TableSorter.java */
public class TableSorter extends AbstractTableModel { public class TableSorter extends AbstractTableModel {
protected TableModel tableModel; private TableModel tableModel;
public static final int DESCENDING = -1; private static final int DESCENDING = -1;
public static final int NOT_SORTED = 0; private static final int NOT_SORTED = 0;
public static final int ASCENDING = 1;
private static Directive EMPTY_DIRECTIVE = new Directive(-1, NOT_SORTED); private static Directive EMPTY_DIRECTIVE = new Directive(-1, NOT_SORTED);
public static final Comparator COMPARABLE_COMAPRATOR = new Comparator() { @SuppressWarnings("unchecked")
private static final Comparator<Object> COMPARABLE_COMPARATOR = new Comparator<Object>() {
public int compare(Object o1, Object o2) { public int compare(Object o1, Object o2) {
return ((Comparable) o1).compareTo(o2); return ((Comparable) o1).compareTo(o2);
} }
}; };
public static final Comparator LEXICAL_COMPARATOR = new Comparator() { private static final Comparator<Object> LEXICAL_COMPARATOR = new Comparator<Object>() {
/*public int compare(Object o1, Object o2) {
return o1.toString().compareTo(o2.toString());
}*/
/*public int compare(Object o1, Object o2) {
int i1, i2;
try {
i1 = Integer.parseInt((String)o1);
i2 = Integer.parseInt((String)o2);
return i2 - i1;
} catch (Exception e) {
return o1.toString().compareTo(o2.toString());
}
}*/
public int compare(Object o1, Object o2) { public int compare(Object o1, Object o2) {
if ((o1 instanceof Integer) && (o2 instanceof Integer)) { if ((o1 instanceof Integer) && (o2 instanceof Integer)) {
return ((Integer)o1).compareTo((Integer)o2); return ((Integer)o1).compareTo((Integer)o2);
...@@ -103,14 +90,6 @@ public class TableSorter extends AbstractTableModel { ...@@ -103,14 +90,6 @@ public class TableSorter extends AbstractTableModel {
} }
}; };
public static final Comparator INTEGER_COMPARATOR = new Comparator() {
public int compare(Object o1, Object o2) {
if ((o1 instanceof Integer) && (o2 instanceof Integer)) {
return ((Integer)o1).compareTo((Integer)o2);
}
return o1.toString().compareTo(o2.toString());
}
};
private Row[] viewToModel; private Row[] viewToModel;
private int[] modelToView; private int[] modelToView;
...@@ -118,8 +97,7 @@ public class TableSorter extends AbstractTableModel { ...@@ -118,8 +97,7 @@ public class TableSorter extends AbstractTableModel {
private JTableHeader tableHeader; private JTableHeader tableHeader;
private MouseListener mouseListener; private MouseListener mouseListener;
private TableModelListener tableModelListener; private TableModelListener tableModelListener;
private Map columnComparators = new HashMap(); private List<Directive> sortingColumns = new ArrayList<>();
private List sortingColumns = new ArrayList();
public TableSorter() { public TableSorter() {
this.mouseListener = new MouseHandler(); this.mouseListener = new MouseHandler();
...@@ -146,7 +124,7 @@ public class TableSorter extends AbstractTableModel { ...@@ -146,7 +124,7 @@ public class TableSorter extends AbstractTableModel {
return tableModel; return tableModel;
} }
public void setTableModel(TableModel tableModel) { private void setTableModel(TableModel tableModel) {
if (this.tableModel != null) { if (this.tableModel != null) {
this.tableModel.removeTableModelListener(tableModelListener); this.tableModel.removeTableModelListener(tableModelListener);
} }
...@@ -180,13 +158,12 @@ public class TableSorter extends AbstractTableModel { ...@@ -180,13 +158,12 @@ public class TableSorter extends AbstractTableModel {
} }
} }
public boolean isSorting() { private boolean isSorting() {
return sortingColumns.size() != 0; return sortingColumns.size() != 0;
} }
private Directive getDirective(int column) { private Directive getDirective(int column) {
for (int i = 0; i < sortingColumns.size(); i++) { for (Directive directive: sortingColumns) {
Directive directive = (Directive)sortingColumns.get(i);
if (directive.column == column) { if (directive.column == column) {
return directive; return directive;
} }
...@@ -194,7 +171,7 @@ public class TableSorter extends AbstractTableModel { ...@@ -194,7 +171,7 @@ public class TableSorter extends AbstractTableModel {
return EMPTY_DIRECTIVE; return EMPTY_DIRECTIVE;
} }
public int getSortingStatus(int column) { private int getSortingStatus(int column) {
return getDirective(column).direction; return getDirective(column).direction;
} }
...@@ -206,7 +183,7 @@ public class TableSorter extends AbstractTableModel { ...@@ -206,7 +183,7 @@ public class TableSorter extends AbstractTableModel {
} }
} }
public void setSortingStatus(int column, int status) { private void setSortingStatus(int column, int status) {
Directive directive = getDirective(column); Directive directive = getDirective(column);
if (directive != EMPTY_DIRECTIVE) { if (directive != EMPTY_DIRECTIVE) {
sortingColumns.remove(directive); sortingColumns.remove(directive);
...@@ -217,7 +194,7 @@ public class TableSorter extends AbstractTableModel { ...@@ -217,7 +194,7 @@ public class TableSorter extends AbstractTableModel {
sortingStatusChanged(); sortingStatusChanged();
} }
protected Icon getHeaderRendererIcon(int column, int size) { private Icon getHeaderRendererIcon(int column, int size) {
Directive directive = getDirective(column); Directive directive = getDirective(column);
if (directive == EMPTY_DIRECTIVE) { if (directive == EMPTY_DIRECTIVE) {
return null; return null;
...@@ -230,40 +207,26 @@ public class TableSorter extends AbstractTableModel { ...@@ -230,40 +207,26 @@ public class TableSorter extends AbstractTableModel {
sortingStatusChanged(); sortingStatusChanged();
} }
public void setColumnComparator(Class type, Comparator comparator) { private Comparator<Object> getComparator(int column) {
if (comparator == null) {
columnComparators.remove(type);
} else {
columnComparators.put(type, comparator);
}
}
protected Comparator getComparator(int column) {
Class columnType = tableModel.getColumnClass(column); Class columnType = tableModel.getColumnClass(column);
Comparator comparator = (Comparator) columnComparators.get(columnType);
if (comparator != null) {
return comparator;
}
if (Comparable.class.isAssignableFrom(columnType)) { if (Comparable.class.isAssignableFrom(columnType)) {
return COMPARABLE_COMAPRATOR; return COMPARABLE_COMPARATOR;
} }
return LEXICAL_COMPARATOR; return LEXICAL_COMPARATOR;
} }
private Row[] getViewToModel() { private Row[] getViewToModel() {
try { if (viewToModel == null) {
if (viewToModel == null) { int tableModelRowCount = tableModel.getRowCount();
int tableModelRowCount = tableModel.getRowCount(); viewToModel = new Row[tableModelRowCount];
viewToModel = new Row[tableModelRowCount]; for (int row = 0; row < tableModelRowCount; row++) {
for (int row = 0; row < tableModelRowCount; row++) { viewToModel[row] = new Row(row);
viewToModel[row] = new Row(row); }
}
if (isSorting()) { if (isSorting()) {
Arrays.sort(viewToModel); Arrays.sort(viewToModel);
}
} }
} catch (Exception e) {} }
return viewToModel; return viewToModel;
} }
...@@ -321,7 +284,7 @@ public class TableSorter extends AbstractTableModel { ...@@ -321,7 +284,7 @@ public class TableSorter extends AbstractTableModel {
private class Row implements Comparable { private class Row implements Comparable {
private int modelIndex; private int modelIndex;
public Row(int index) { private Row(int index) {
this.modelIndex = index; this.modelIndex = index;
} }
...@@ -329,13 +292,12 @@ public class TableSorter extends AbstractTableModel { ...@@ -329,13 +292,12 @@ public class TableSorter extends AbstractTableModel {
int row1 = modelIndex; int row1 = modelIndex;
int row2 = ((Row) o).modelIndex; int row2 = ((Row) o).modelIndex;
for (Iterator it = sortingColumns.iterator(); it.hasNext();) { for (Directive directive : sortingColumns) {
Directive directive = (Directive) it.next();
int column = directive.column; int column = directive.column;
Object o1 = tableModel.getValueAt(row1, column); Object o1 = tableModel.getValueAt(row1, column);
Object o2 = tableModel.getValueAt(row2, column); Object o2 = tableModel.getValueAt(row2, column);
int comparison = 0; int comparison;
// Define null less than everything, except null. // Define null less than everything, except null.
if (o1 == null && o2 == null) { if (o1 == null && o2 == null) {
comparison = 0; comparison = 0;
...@@ -405,7 +367,6 @@ public class TableSorter extends AbstractTableModel { ...@@ -405,7 +367,6 @@ public class TableSorter extends AbstractTableModel {
// Something has happened to the data that may have invalidated the row order. // Something has happened to the data that may have invalidated the row order.
clearSortingState(); clearSortingState();
fireTableDataChanged(); fireTableDataChanged();
return;
} }
} }
...@@ -434,7 +395,7 @@ public class TableSorter extends AbstractTableModel { ...@@ -434,7 +395,7 @@ public class TableSorter extends AbstractTableModel {
private int size; private int size;
private int priority; private int priority;
public Arrow(boolean descending, int size, int priority) { private Arrow(boolean descending, int size, int priority) {
this.descending = descending; this.descending = descending;
this.size = size; this.size = size;
this.priority = priority; this.priority = priority;
...@@ -485,7 +446,7 @@ public class TableSorter extends AbstractTableModel { ...@@ -485,7 +446,7 @@ public class TableSorter extends AbstractTableModel {
private class SortableHeaderRenderer implements TableCellRenderer { private class SortableHeaderRenderer implements TableCellRenderer {
private TableCellRenderer tableCellRenderer; private TableCellRenderer tableCellRenderer;
public SortableHeaderRenderer(TableCellRenderer tableCellRenderer) { private SortableHeaderRenderer(TableCellRenderer tableCellRenderer) {
this.tableCellRenderer = tableCellRenderer; this.tableCellRenderer = tableCellRenderer;
} }
...@@ -515,7 +476,7 @@ public class TableSorter extends AbstractTableModel { ...@@ -515,7 +476,7 @@ public class TableSorter extends AbstractTableModel {
private int column; private int column;
private int direction; private int direction;
public Directive(int column, int direction) { private Directive(int column, int direction) {
this.column = column; this.column = column;
this.direction = direction; this.direction = direction;
} }
......
...@@ -59,7 +59,26 @@ import java.net.Socket; ...@@ -59,7 +59,26 @@ import java.net.Socket;
import java.util.ArrayList; import java.util.ArrayList;
public class Client { public class Client {
public Object parserAnswerMessage(Message answerMsg) { public byte[] parserAnswerMessageAsBytes(Message answerMsg) {
if (answerMsg ==null){
return null;
}
String cmd = answerMsg.getCmd();
if (cmd != null) {
if (cmd.equals(Message.RESULT_STATISTIC)) {
// the content are image.
return (byte[]) answerMsg.getContent().get(0);
} else if (cmd.equals(Message.RESULT_HISTOGRAM)) {
// the content are image.
return (byte[]) answerMsg.getContent().get(0);
}
}
return null;
}
public ArrayList<Record> parserAnswerMessage(Message answerMsg) {
//Analyse the message from the server, //Analyse the message from the server,
//Depends on the cmd, we can determine the values //Depends on the cmd, we can determine the values
if (answerMsg ==null){ if (answerMsg ==null){
...@@ -143,17 +162,9 @@ public class Client { ...@@ -143,17 +162,9 @@ public class Client {
} }
return r; ArrayList<Record> lrecord = new ArrayList<>();
lrecord.add(r);
} else if (cmd.equals(Message.RESULT_STATISTIC)) { return lrecord;
// the content are image.
byte[] encoded = (byte[]) answerMsg.getContent().get(0);
return encoded;
} else if (cmd.equals(Message.RESULT_HISTOGRAM)) {
// the content are image.
byte[] encoded = (byte[]) answerMsg.getContent().get(0);
return encoded;
} else } else
//TraceManager.addDev("The command is not supported\n"); //TraceManager.addDev("The command is not supported\n");
return null; return null;
......
...@@ -48,6 +48,7 @@ package ui; ...@@ -48,6 +48,7 @@ package ui;
import myutil.TraceManager; import myutil.TraceManager;
import java.awt.*;
import java.util.Vector; import java.util.Vector;
//import java.awt.geom.*; //import java.awt.geom.*;
...@@ -56,7 +57,7 @@ import java.util.Vector; ...@@ -56,7 +57,7 @@ import java.util.Vector;
public abstract class TGConnectorWithCommentConnectionPoints extends TGConnector { public abstract class TGConnectorWithCommentConnectionPoints extends TGConnector {
protected TGConnectingPointGroup tg; protected TGConnectingPointGroup tg;
public TGConnectorWithCommentConnectionPoints(int _x, int _y, int _minX, int _minY, int _maxX, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp, TGConnectingPoint _p1, TGConnectingPoint _p2, Vector _listPoint) { public TGConnectorWithCommentConnectionPoints(int _x, int _y, int _minX, int _minY, int _maxX, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp, TGConnectingPoint _p1, TGConnectingPoint _p2, Vector<Point> _listPoint) {
super(_x, _y, _minX, _minY, _maxX, _maxY, _pos, _father, _tdp, _p1, _p2, _listPoint); super(_x, _y, _minX, _minY, _maxX, _maxY, _pos, _father, _tdp, _p1, _p2, _listPoint);
// We create a connecting point per segment i.e : // We create a connecting point per segment i.e :
......
...@@ -274,7 +274,7 @@ public class JFrameAvatarInteractiveSimulation extends JFrame implements Avatar ...@@ -274,7 +274,7 @@ public class JFrameAvatarInteractiveSimulation extends JFrame implements Avatar
try { try {
Vector<AvatarSimulationPendingTransaction> ll = (Vector<AvatarSimulationPendingTransaction>)(ass.getPendingTransitions().clone()); Vector<AvatarSimulationPendingTransaction> ll = new Vector<>(ass.getPendingTransitions());
listPendingTransactions.clearSelection(); listPendingTransactions.clearSelection();
selectedComponentForTransaction1 = null; selectedComponentForTransaction1 = null;
...@@ -1391,7 +1391,7 @@ public class JFrameAvatarInteractiveSimulation extends JFrame implements Avatar ...@@ -1391,7 +1391,7 @@ public class JFrameAvatarInteractiveSimulation extends JFrame implements Avatar
public void updateAsynchronousChannels() { public void updateAsynchronousChannels() {
if (ass != null) { if (ass != null) {
lastAsyncmsgs = (Vector<AvatarSimulationAsynchronousTransaction>)(ass.getAsynchronousMessages().clone()); lastAsyncmsgs = new Vector<>(ass.getAsynchronousMessages());
if (fifos != null) { if (fifos != null) {
for(AvatarInteractiveSimulationFIFOData fifo: fifos) { for(AvatarInteractiveSimulationFIFOData fifo: fifos) {
......
...@@ -58,7 +58,7 @@ import java.util.Vector; ...@@ -58,7 +58,7 @@ import java.util.Vector;
public class AvatarRDVerifyConnector extends TGConnectorWithCommentConnectionPoints { public class AvatarRDVerifyConnector extends TGConnectorWithCommentConnectionPoints {
int w, h; int w, h;
public AvatarRDVerifyConnector(int _x, int _y, int _minX, int _minY, int _maxX, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp, TGConnectingPoint _p1, TGConnectingPoint _p2, Vector _listPoint) { public AvatarRDVerifyConnector(int _x, int _y, int _minX, int _minY, int _maxX, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp, TGConnectingPoint _p1, TGConnectingPoint _p2, Vector<Point> _listPoint) {
super(_x, _y, _minX, _minY, _maxX, _maxY, _pos, _father, _tdp, _p1, _p2, _listPoint); super(_x, _y, _minX, _minY, _maxX, _maxY, _pos, _father, _tdp, _p1, _p2, _listPoint);
value = "<<verify>>"; value = "<<verify>>";
......
...@@ -117,7 +117,7 @@ public class AvatarSMDPanel extends TDiagramPanel implements TDPWithAttributes { ...@@ -117,7 +117,7 @@ public class AvatarSMDPanel extends TDiagramPanel implements TDPWithAttributes {
public void enhance() { public void enhance() {
//System.out.println("enhance"); //System.out.println("enhance");
Vector v = new Vector(); Vector<TGComponent> v = new Vector<>();
Object o; Object o;
Iterator iterator = componentList.listIterator(); Iterator iterator = componentList.listIterator();
...@@ -132,7 +132,7 @@ public class AvatarSMDPanel extends TDiagramPanel implements TDPWithAttributes { ...@@ -132,7 +132,7 @@ public class AvatarSMDPanel extends TDiagramPanel implements TDPWithAttributes {
repaint(); repaint();
} }
public void enhance(Vector v, TGComponent tgc) { public void enhance(Vector<TGComponent> v, TGComponent tgc) {
TGComponent tgc1; TGComponent tgc1;
TGConnector tgcon; TGConnector tgcon;
int i; int i;
......
...@@ -117,14 +117,14 @@ public class EBRDDPanel extends TDiagramPanel { ...@@ -117,14 +117,14 @@ public class EBRDDPanel extends TDiagramPanel {
public void enhance() { public void enhance() {
//System.out.println("enhance"); //System.out.println("enhance");
Vector v = new Vector(); Vector<TGComponent> v = new Vector<>();
Object o; Object o;
Iterator iterator = componentList.listIterator(); Iterator iterator = componentList.listIterator();
while(iterator.hasNext()) { while(iterator.hasNext()) {
o = iterator.next(); o = iterator.next();
if (o instanceof EBRDDStartState){ if (o instanceof EBRDDStartState){
enhance(v, (EBRDDStartState)o); this.enhance(v, (EBRDDStartState)o);
} }
} }
...@@ -132,7 +132,7 @@ public class EBRDDPanel extends TDiagramPanel { ...@@ -132,7 +132,7 @@ public class EBRDDPanel extends TDiagramPanel {
repaint(); repaint();
} }
public void enhance(Vector v, TGComponent tgc) { public void enhance(Vector<TGComponent> v, TGComponent tgc) {
TGComponent tgc1; TGComponent tgc1;
TGConnector tgcon; TGConnector tgcon;
int i; int i;
...@@ -165,7 +165,7 @@ public class EBRDDPanel extends TDiagramPanel { ...@@ -165,7 +165,7 @@ public class EBRDDPanel extends TDiagramPanel {
// Explore next elements // Explore next elements
for(i=0; i<tgc.getNbNext(); i++) { for(i=0; i<tgc.getNbNext(); i++) {
tgc1 = getNextTGComponent(tgc, i); tgc1 = getNextTGComponent(tgc, i);
enhance(v, tgc1); this.enhance(v, tgc1);
} }
} }
......
...@@ -223,7 +223,7 @@ public class InteractionOverviewDiagramPanel extends TDiagramPanel { ...@@ -223,7 +223,7 @@ public class InteractionOverviewDiagramPanel extends TDiagramPanel {
public void enhance() { public void enhance() {
//System.out.println("enhance"); //System.out.println("enhance");
Vector v = new Vector(); Vector<TGComponent> v = new Vector<>();
Object o; Object o;
Iterator iterator = componentList.listIterator(); Iterator iterator = componentList.listIterator();
...@@ -238,7 +238,7 @@ public class InteractionOverviewDiagramPanel extends TDiagramPanel { ...@@ -238,7 +238,7 @@ public class InteractionOverviewDiagramPanel extends TDiagramPanel {
repaint(); repaint();
} }
public void enhance(Vector v, TGComponent tgc) { public void enhance(Vector<TGComponent> v, TGComponent tgc) {
TGComponent tgc1; TGComponent tgc1;
TGConnector tgcon; TGConnector tgcon;
int i; int i;
......
...@@ -221,7 +221,7 @@ public class TMLCPPanel extends TDiagramPanel { ...@@ -221,7 +221,7 @@ public class TMLCPPanel extends TDiagramPanel {
public void enhance() { public void enhance() {
//System.out.println("enhance"); //System.out.println("enhance");
Vector v = new Vector(); Vector<TGComponent> v = new Vector<>();
Object o; Object o;
Iterator iterator = componentList.listIterator(); Iterator iterator = componentList.listIterator();
...@@ -236,7 +236,7 @@ public class TMLCPPanel extends TDiagramPanel { ...@@ -236,7 +236,7 @@ public class TMLCPPanel extends TDiagramPanel {
repaint(); repaint();
} }
public void enhance(Vector v, TGComponent tgc) { public void enhance(Vector<TGComponent> v, TGComponent tgc) {
TGComponent tgc1; TGComponent tgc1;
TGConnector tgcon; TGConnector tgcon;
int i; int i;
......
...@@ -59,7 +59,7 @@ import java.util.Vector; ...@@ -59,7 +59,7 @@ import java.util.Vector;
public class DiagramTreeModel implements TreeModel { public class DiagramTreeModel implements TreeModel {
private MainGUI mgui; private MainGUI mgui;
private Vector treeModelListeners = new Vector(); private Vector<TreeModelListener> treeModelListeners = new Vector<>();
public DiagramTreeModel(MainGUI _mgui) { public DiagramTreeModel(MainGUI _mgui) {
......
...@@ -77,7 +77,7 @@ public class JDiagramTree extends javax.swing.JTree implements ActionListener, M ...@@ -77,7 +77,7 @@ public class JDiagramTree extends javax.swing.JTree implements ActionListener, M
private DiagramTreeModel dtm; private DiagramTreeModel dtm;
//for update //for update
private Set m_expandedTreePaths = new HashSet(); private Set<TreePath> m_expandedTreePaths = new HashSet<>();
private TreePath[] m_selectedTreePaths = new TreePath[0]; private TreePath[] m_selectedTreePaths = new TreePath[0];
//private boolean m_nodeWasSelected = false; //private boolean m_nodeWasSelected = false;
...@@ -204,11 +204,11 @@ public class JDiagramTree extends javax.swing.JTree implements ActionListener, M ...@@ -204,11 +204,11 @@ public class JDiagramTree extends javax.swing.JTree implements ActionListener, M
public synchronized void run(){ public synchronized void run(){
checkPaths(); checkPaths();
Iterator l_keys = m_expandedTreePaths.iterator(); Iterator<TreePath> l_keys = m_expandedTreePaths.iterator();
TreePath l_path = null; TreePath l_path = null;
while(l_keys.hasNext()){ while(l_keys.hasNext()){
try { try {
l_path = (TreePath) l_keys.next(); l_path = l_keys.next();
TreePath parent = l_path.getParentPath(); TreePath parent = l_path.getParentPath();
//System.out.println("Path: " + l_path); //System.out.println("Path: " + l_path);
//System.out.println("Parent path: " + parent); //System.out.println("Parent path: " + parent);
...@@ -228,9 +228,9 @@ public class JDiagramTree extends javax.swing.JTree implements ActionListener, M ...@@ -228,9 +228,9 @@ public class JDiagramTree extends javax.swing.JTree implements ActionListener, M
private void checkPaths() { private void checkPaths() {
TreePath l_path = null; TreePath l_path = null;
Iterator l_keys = m_expandedTreePaths.iterator(); Iterator<TreePath> l_keys = m_expandedTreePaths.iterator();
while(l_keys.hasNext()){ while(l_keys.hasNext()){
l_path = (TreePath) l_keys.next(); l_path = l_keys.next();
if (!isAPathOf(l_path)) { if (!isAPathOf(l_path)) {
m_expandedTreePaths.remove(l_path); m_expandedTreePaths.remove(l_path);
} }
...@@ -273,11 +273,11 @@ public class JDiagramTree extends javax.swing.JTree implements ActionListener, M ...@@ -273,11 +273,11 @@ public class JDiagramTree extends javax.swing.JTree implements ActionListener, M
public void treeExpanded(TreeExpansionEvent treeExpansionEvent) { public void treeExpanded(TreeExpansionEvent treeExpansionEvent) {
TreePath tp = treeExpansionEvent.getPath(); TreePath tp = treeExpansionEvent.getPath();