Beispiel #1
0
 public int getRowCount() {
   if (scenario != null && scenario.getDataSource() != null) {
     int count = 0;
     for (Edge edge : scenario.getDataSource().getEdgeLibrary()) {
       if ((networkTab.getEdgeTypeFilter() == null
               || edge.getEdgeType() == networkTab.getEdgeTypeFilter())
           && edge.getName()
               .toLowerCase()
               .contains(networkTab.getEdgeSearchText().toLowerCase())) {
         count++;
       }
     }
     return count;
   } else return 0;
 }
Beispiel #2
0
 public Object getValueAt(int row, int col) {
   if (col == 0) {
     Edge edge = (Edge) getValueAt(row, 1);
     for (Edge e : scenario.getNetwork().getEdges()) {
       if (e.equals(edge)) return true;
     }
     return false;
   } else if (col == 2) return ((Edge) getValueAt(row, 1)).getOrigin();
   else if (col == 3) return ((Edge) getValueAt(row, 1)).getDestination();
   else {
     int count = 0;
     for (Edge edge : scenario.getDataSource().getEdgeLibrary()) {
       if ((networkTab.getEdgeTypeFilter() == null
               || edge.getEdgeType() == networkTab.getEdgeTypeFilter())
           && edge.getName()
               .toLowerCase()
               .contains(networkTab.getEdgeSearchText().toLowerCase())) {
         if (count == row) return edge;
         count++;
       }
     }
     return null;
   }
 }