@Test public void testFilterNoEdges() { highlights.clearSelection(); parameters.add("SELECTED"); parameters.add("EDGES"); parameters.add("LISTEMPTY"); dialog.filter(parameters, c20, highlights); }
public void filter(ArrayList<String> parameters, Structure structure, Highlights highlights) { if (parameters.get(1).equals("VERTICES") || existsVertexList(parameters.get(0))) { if (parameters.get(1).equals("VERTICES") && existsEdgeList(parameters.get(0))) { errorMsg = "List " + parameters.get(parameters.size() - 1) + " already exists as an edge list. Choose another name.\n"; return; } var targetVertexList = getTargetVertexList(parameters.get(parameters.size() - 1)); parameters.remove(parameters.size() - 1); ArrayList<Vertex> sourceVertexList = new ArrayList<>(); if (parameters.get(0).equals("SELECTED")) for (Object v : highlights.getSelection()) if (v instanceof Vertex) sourceVertexList.add((Vertex) v); if (parameters.get(0).equals("ALL")) sourceVertexList = new ArrayList<>((Collection<? extends Vertex>) structure.getVertices()); if (existsVertexList(parameters.get(0))) { sourceVertexList = findVertexList(parameters.get(0)); } if (parameters.get(1).equals("VERTICES")) { parameters.remove(1); parameters.remove(0); } else parameters.remove(0); filterVertices(sourceVertexList, targetVertexList, parameters); parameters.clear(); return; } if (parameters.get(1).equals("EDGES") || existsEdgeList(parameters.get(0))) { if (parameters.get(1).equals("EDGES") && existsVertexList(parameters.get(0))) { errorMsg = "List " + parameters.get(parameters.size() - 1) + " already exists as a vertex list. Choose another name.\n"; return; } ArrayList<Edge> targetEdgeList = getTargetEdgeList(parameters.get(parameters.size() - 1)); parameters.remove(parameters.size() - 1); ArrayList<Edge> sourceEdgeList = new ArrayList<Edge>(); if (parameters.get(0).equals("SELECTED")) for (Object v : highlights.getSelection()) if (v instanceof Edge) sourceEdgeList.add((Edge) v); if (parameters.get(0).equals("ALL")) sourceEdgeList = new ArrayList<Edge>(structure.getEdges()); if (existsEdgeList(parameters.get(0))) sourceEdgeList = findEdgeList(parameters.get(0)); if (parameters.get(1).equals("EDGES")) { parameters.remove(1); parameters.remove(0); } else parameters.remove(0); filterEdges(sourceEdgeList, targetEdgeList, parameters); parameters.clear(); return; } errorMsg = "List " + parameters.get(0) + " not found.\n"; return; }
Dialog { public void filter(ArrayList<String> parameters, Structure structure, Highlights highlights) { if (parameters.get(1).equals("VERTICES") || existsVertexList(parameters.get(0))) { if (parameters.get(1).equals("VERTICES") && existsEdgeList(parameters.get(0))) { errorMsg = "List " + parameters.get(parameters.size() - 1) + " already exists as an edge list. Choose another name.\n"; return; } var targetVertexList = getTargetVertexList(parameters.get(parameters.size() - 1)); parameters.remove(parameters.size() - 1); ArrayList<Vertex> sourceVertexList = new ArrayList<>(); if (parameters.get(0).equals("SELECTED")) for (Object v : highlights.getSelection()) if (v instanceof Vertex) sourceVertexList.add((Vertex) v); if (parameters.get(0).equals("ALL")) sourceVertexList = new ArrayList<>((Collection<? extends Vertex>) structure.getVertices()); if (existsVertexList(parameters.get(0))) { sourceVertexList = findVertexList(parameters.get(0)); } if (parameters.get(1).equals("VERTICES")) { parameters.remove(1); parameters.remove(0); } else parameters.remove(0); filterVertices(sourceVertexList, targetVertexList, parameters); parameters.clear(); return; } if (parameters.get(1).equals("EDGES") || existsEdgeList(parameters.get(0))) { if (parameters.get(1).equals("EDGES") && existsVertexList(parameters.get(0))) { errorMsg = "List " + parameters.get(parameters.size() - 1) + " already exists as a vertex list. Choose another name.\n"; return; } ArrayList<Edge> targetEdgeList = getTargetEdgeList(parameters.get(parameters.size() - 1)); parameters.remove(parameters.size() - 1); ArrayList<Edge> sourceEdgeList = new ArrayList<Edge>(); if (parameters.get(0).equals("SELECTED")) for (Object v : highlights.getSelection()) if (v instanceof Edge) sourceEdgeList.add((Edge) v); if (parameters.get(0).equals("ALL")) sourceEdgeList = new ArrayList<Edge>(structure.getEdges()); if (existsEdgeList(parameters.get(0))) sourceEdgeList = findEdgeList(parameters.get(0)); if (parameters.get(1).equals("EDGES")) { parameters.remove(1); parameters.remove(0); } else parameters.remove(0); filterEdges(sourceEdgeList, targetEdgeList, parameters); parameters.clear(); return; } errorMsg = "List " + parameters.get(0) + " not found.\n"; return; } }
Dialog { public void filter(ArrayList<String> parameters, Structure structure, Highlights highlights) { if (parameters.get(1).equals("VERTICES") || existsVertexList(parameters.get(0))) { if (parameters.get(1).equals("VERTICES") && existsEdgeList(parameters.get(0))) { errorMsg = "List " + parameters.get(parameters.size() - 1) + " already exists as an edge list. Choose another name.\n"; return; } var targetVertexList = getTargetVertexList(parameters.get(parameters.size() - 1)); parameters.remove(parameters.size() - 1); ArrayList<Vertex> sourceVertexList = new ArrayList<>(); if (parameters.get(0).equals("SELECTED")) for (Object v : highlights.getSelection()) if (v instanceof Vertex) sourceVertexList.add((Vertex) v); if (parameters.get(0).equals("ALL")) sourceVertexList = new ArrayList<>((Collection<? extends Vertex>) structure.getVertices()); if (existsVertexList(parameters.get(0))) { sourceVertexList = findVertexList(parameters.get(0)); } if (parameters.get(1).equals("VERTICES")) { parameters.remove(1); parameters.remove(0); } else parameters.remove(0); filterVertices(sourceVertexList, targetVertexList, parameters); parameters.clear(); return; } if (parameters.get(1).equals("EDGES") || existsEdgeList(parameters.get(0))) { if (parameters.get(1).equals("EDGES") && existsVertexList(parameters.get(0))) { errorMsg = "List " + parameters.get(parameters.size() - 1) + " already exists as a vertex list. Choose another name.\n"; return; } ArrayList<Edge> targetEdgeList = getTargetEdgeList(parameters.get(parameters.size() - 1)); parameters.remove(parameters.size() - 1); ArrayList<Edge> sourceEdgeList = new ArrayList<Edge>(); if (parameters.get(0).equals("SELECTED")) for (Object v : highlights.getSelection()) if (v instanceof Edge) sourceEdgeList.add((Edge) v); if (parameters.get(0).equals("ALL")) sourceEdgeList = new ArrayList<Edge>(structure.getEdges()); if (existsEdgeList(parameters.get(0))) sourceEdgeList = findEdgeList(parameters.get(0)); if (parameters.get(1).equals("EDGES")) { parameters.remove(1); parameters.remove(0); } else parameters.remove(0); filterEdges(sourceEdgeList, targetEdgeList, parameters); parameters.clear(); return; } errorMsg = "List " + parameters.get(0) + " not found.\n"; return; } Dialog(List<GralogList<Vertex>> allCollectionVertex, List<GralogList<Edge>> allCollectionEdge);  Dialog(); }
Dialog { public void filter(ArrayList<String> parameters, Structure structure, Highlights highlights) { if (parameters.get(1).equals("VERTICES") || existsVertexList(parameters.get(0))) { if (parameters.get(1).equals("VERTICES") && existsEdgeList(parameters.get(0))) { errorMsg = "List " + parameters.get(parameters.size() - 1) + " already exists as an edge list. Choose another name.\n"; return; } var targetVertexList = getTargetVertexList(parameters.get(parameters.size() - 1)); parameters.remove(parameters.size() - 1); ArrayList<Vertex> sourceVertexList = new ArrayList<>(); if (parameters.get(0).equals("SELECTED")) for (Object v : highlights.getSelection()) if (v instanceof Vertex) sourceVertexList.add((Vertex) v); if (parameters.get(0).equals("ALL")) sourceVertexList = new ArrayList<>((Collection<? extends Vertex>) structure.getVertices()); if (existsVertexList(parameters.get(0))) { sourceVertexList = findVertexList(parameters.get(0)); } if (parameters.get(1).equals("VERTICES")) { parameters.remove(1); parameters.remove(0); } else parameters.remove(0); filterVertices(sourceVertexList, targetVertexList, parameters); parameters.clear(); return; } if (parameters.get(1).equals("EDGES") || existsEdgeList(parameters.get(0))) { if (parameters.get(1).equals("EDGES") && existsVertexList(parameters.get(0))) { errorMsg = "List " + parameters.get(parameters.size() - 1) + " already exists as a vertex list. Choose another name.\n"; return; } ArrayList<Edge> targetEdgeList = getTargetEdgeList(parameters.get(parameters.size() - 1)); parameters.remove(parameters.size() - 1); ArrayList<Edge> sourceEdgeList = new ArrayList<Edge>(); if (parameters.get(0).equals("SELECTED")) for (Object v : highlights.getSelection()) if (v instanceof Edge) sourceEdgeList.add((Edge) v); if (parameters.get(0).equals("ALL")) sourceEdgeList = new ArrayList<Edge>(structure.getEdges()); if (existsEdgeList(parameters.get(0))) sourceEdgeList = findEdgeList(parameters.get(0)); if (parameters.get(1).equals("EDGES")) { parameters.remove(1); parameters.remove(0); } else parameters.remove(0); filterEdges(sourceEdgeList, targetEdgeList, parameters); parameters.clear(); return; } errorMsg = "List " + parameters.get(0) + " not found.\n"; return; } Dialog(List<GralogList<Vertex>> allCollectionVertex, List<GralogList<Edge>> allCollectionEdge);  Dialog(); @Deprecated Map<String, ArrayList<Vertex>> getVertexListS(); @Deprecated Map<String, ArrayList<Edge>> getEdgeListS(); void printLists(ArrayList<String> parameters); void twoListsOp(ArrayList<String> parameters); void delete(ArrayList<String> parameters); void complement(ArrayList<String> parameters, Structure structure); void sort(ArrayList<String> parameters); void connectClique(ArrayList<String> parameters, Structure structure); void connectTClosure(ArrayList<String> parameters, Structure structure); void connectSelfloop(ArrayList<String> parameters, Structure structure); void connectPath(ArrayList<String> parameters, Structure structure); void connectCycle(ArrayList<String> parameters, Structure structure); void connectBiclique(ArrayList<String> parameters, Structure structure); void connectMatching(ArrayList<String> parameters, Structure structure); void connectFormula(ArrayList<String> parameters, Structure structure); void connect2ListsFormula(ArrayList<String> parameters, Structure structure); boolean existsVertexList(String s); boolean existsEdgeList(String s); GralogList<Vertex> findVertexList(String s); GralogList<Edge> findEdgeList(String s); void filter(ArrayList<String> parameters, Structure structure, Highlights highlights); String getErrorMsg(); void setErrorMsg(String s); boolean addVertex(Vertex v); boolean removeVertex(Vertex v); boolean addEdge(Edge e); boolean removeEdge(Edge e); }
Dialog { public void filter(ArrayList<String> parameters, Structure structure, Highlights highlights) { if (parameters.get(1).equals("VERTICES") || existsVertexList(parameters.get(0))) { if (parameters.get(1).equals("VERTICES") && existsEdgeList(parameters.get(0))) { errorMsg = "List " + parameters.get(parameters.size() - 1) + " already exists as an edge list. Choose another name.\n"; return; } var targetVertexList = getTargetVertexList(parameters.get(parameters.size() - 1)); parameters.remove(parameters.size() - 1); ArrayList<Vertex> sourceVertexList = new ArrayList<>(); if (parameters.get(0).equals("SELECTED")) for (Object v : highlights.getSelection()) if (v instanceof Vertex) sourceVertexList.add((Vertex) v); if (parameters.get(0).equals("ALL")) sourceVertexList = new ArrayList<>((Collection<? extends Vertex>) structure.getVertices()); if (existsVertexList(parameters.get(0))) { sourceVertexList = findVertexList(parameters.get(0)); } if (parameters.get(1).equals("VERTICES")) { parameters.remove(1); parameters.remove(0); } else parameters.remove(0); filterVertices(sourceVertexList, targetVertexList, parameters); parameters.clear(); return; } if (parameters.get(1).equals("EDGES") || existsEdgeList(parameters.get(0))) { if (parameters.get(1).equals("EDGES") && existsVertexList(parameters.get(0))) { errorMsg = "List " + parameters.get(parameters.size() - 1) + " already exists as a vertex list. Choose another name.\n"; return; } ArrayList<Edge> targetEdgeList = getTargetEdgeList(parameters.get(parameters.size() - 1)); parameters.remove(parameters.size() - 1); ArrayList<Edge> sourceEdgeList = new ArrayList<Edge>(); if (parameters.get(0).equals("SELECTED")) for (Object v : highlights.getSelection()) if (v instanceof Edge) sourceEdgeList.add((Edge) v); if (parameters.get(0).equals("ALL")) sourceEdgeList = new ArrayList<Edge>(structure.getEdges()); if (existsEdgeList(parameters.get(0))) sourceEdgeList = findEdgeList(parameters.get(0)); if (parameters.get(1).equals("EDGES")) { parameters.remove(1); parameters.remove(0); } else parameters.remove(0); filterEdges(sourceEdgeList, targetEdgeList, parameters); parameters.clear(); return; } errorMsg = "List " + parameters.get(0) + " not found.\n"; return; } Dialog(List<GralogList<Vertex>> allCollectionVertex, List<GralogList<Edge>> allCollectionEdge);  Dialog(); @Deprecated Map<String, ArrayList<Vertex>> getVertexListS(); @Deprecated Map<String, ArrayList<Edge>> getEdgeListS(); void printLists(ArrayList<String> parameters); void twoListsOp(ArrayList<String> parameters); void delete(ArrayList<String> parameters); void complement(ArrayList<String> parameters, Structure structure); void sort(ArrayList<String> parameters); void connectClique(ArrayList<String> parameters, Structure structure); void connectTClosure(ArrayList<String> parameters, Structure structure); void connectSelfloop(ArrayList<String> parameters, Structure structure); void connectPath(ArrayList<String> parameters, Structure structure); void connectCycle(ArrayList<String> parameters, Structure structure); void connectBiclique(ArrayList<String> parameters, Structure structure); void connectMatching(ArrayList<String> parameters, Structure structure); void connectFormula(ArrayList<String> parameters, Structure structure); void connect2ListsFormula(ArrayList<String> parameters, Structure structure); boolean existsVertexList(String s); boolean existsEdgeList(String s); GralogList<Vertex> findVertexList(String s); GralogList<Edge> findEdgeList(String s); void filter(ArrayList<String> parameters, Structure structure, Highlights highlights); String getErrorMsg(); void setErrorMsg(String s); boolean addVertex(Vertex v); boolean removeVertex(Vertex v); boolean addEdge(Edge e); boolean removeEdge(Edge e);  }