Package de.hpi.eworld.model.db.data

Examples of de.hpi.eworld.model.db.data.TrafficLightStateList


  protected void saveTLS() {
    int i, j;

    HashMap<EdgeModel, TrafficLightStateList> newLogic = new HashMap<EdgeModel, TrafficLightStateList>();
    Color item;
    TrafficLightStateList tls;

    for (i = 0; i < logicTable.getRowCount(); i++) {
      // Get Edge at corresponding row
      EdgeModel edge = currentIncomingEdges.get(i);

      tls = new TrafficLightStateList();

      for (j = 0; j < logicTable.getColumnCount()-1; j++) {
        item = ((TLSCellRenderer) logicTable.getDefaultRenderer(Object.class)).getTrafficLightStates().get(i).get(j);

        if (item.equals(Color.GREEN)) {
          tls.add(new TrafficLightStateListEntry(
              TrafficLightState.Green));
        }
        if (item.equals(Color.YELLOW)) {
          tls.add(new TrafficLightStateListEntry(
              TrafficLightState.Yellow));
        }
        if (item.equals(Color.RED)) {
          tls.add(new TrafficLightStateListEntry(
              TrafficLightState.Red));
        }
      }

      newLogic.put(edge, tls);
View Full Code Here


            int countIncomingEdge = 0;
            for (EdgeModel e : existingNode.getUsedBy()) {
              // incoming edge...
              if (e.getToNode().equals(existingNode)) {
                if (dl.get(e) == null) {
                  dl.put(e, new TrafficLightStateList());
                }

                int c = k - countIncomingEdge * noOutgoing - 1;
                String phaseCode = phase.substring(c, c + 1) + brake.substring(c, c + 1)
                    + yellow.substring(c, c + 1);
View Full Code Here

TOP

Related Classes of de.hpi.eworld.model.db.data.TrafficLightStateList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.