// Path: src/main/java/infovis/data/BusLine.java
// public final class BusLine implements Comparable<BusLine> {
// 
//   /** Bus line used for walked sections of a route. */
//   public static final BusLine WALK = new BusLine("Walk", null, Color.BLACK);
// 
//   /** Bus line name. */
//   private final String name;
// 
//   /** Long bus line name. */
//   private final String longName;
// 
//   /** Bus color. */
//   private final Color color;
// 
//   /** The hidden sorting name. */
//   private final String hiddenSortingName;
// 
//   /**
//    * Constructor taking the name and the color.
//    * 
//    * @param name Bus line name,
//    * @param longName Long bus line name, may be <code>null</code>.
//    * @param color Bus line color.
//    */
//   BusLine(final String name, final String longName, final Color color) {
//     this.name = Objects.requireNonNull(name).intern();
//     this.longName = Objects.nonNull(longName, this.name);
//     this.color = Objects.requireNonNull(color);
//     final String tmp = "0000000000" + name;
//     final int l = tmp.length();
//     hiddenSortingName = tmp.substring(l - 10, l);
//   }
// 
//   /**
//    * Getter.
//    * 
//    * @return bus line name
//    */
//   public String getName() {
//     return name;
//   }
// 
//   /**
//    * Getter.
//    * 
//    * @return The full bus line name.
//    */
//   public String getFullName() {
//     return longName;
//   }
// 
//   /**
//    * Getter.
//    * 
//    * @return bus line color
//    */
//   public Color getColor() {
//     return color;
//   }
// 
//   @Override
//   public String toString() {
//     return String.format("%s[%s, %08X]", getClass().getSimpleName(), name, color.getRGB());
//   }
// 
//   /**
//    * Checks for equality with other bus lines.
//    * 
//    * @param line The other line.
//    * @return If both are equal and non-null.
//    */
//   public boolean equals(final BusLine line) {
//     return line != null && (this == line || name.equals(line.name));
//   }
// 
//   @Override
//   public boolean equals(final Object obj) {
//     return obj instanceof BusLine && name.equals(((BusLine) obj).name);
//   }
// 
//   @Override
//   public int hashCode() {
//     return name.hashCode();
//   }
// 
//   @Override
//   public int compareTo(final BusLine o) {
//     return -hiddenSortingName.compareTo(o.hiddenSortingName);
//   }
// 
// }


import infovis.data.BusLine;
import infovis.util.VecUtil;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.Stroke;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;
import java.awt.geom.Rectangle2D;
package infovis.draw;



/**
 * Realizes the actual painting of bus stations.
 * 
 * @author Joschi <josua.krause@googlemail.com>
 */
public interface StationRealizer {

  /**
   * The shape of the depiction of the bus station. This is also the area that
   * can be clicked on.
   * 
   * @param x The x translation.
   * @param y The y translation.
   * @param r The radius of the station.
   * @return The shape of the bus station.
   */
  Shape createStationShape(double x, double y, double r);

  /**
   * Draws the bus station.
   * 
   * @param g The graphics context.
   * @param station The station that is drawn.
   * @param stroke The stroke that can be used.
   * @param referenceNode Whether this node is the reference node.
   * @param secondarySelected Whether this node is secondary selected.
   */
  void drawStation(Graphics2D g, Shape station, Stroke stroke, boolean referenceNode,
      boolean secondarySelected);

  /**
   * Highlights a selected route.
   * 
   * @param g The graphics context.
   * @param liner The method to draw lines.
   * @param stations The shapes of the used stations.
   * @param lines The used lines.
   * @param busLines The used bus lines.
   * @param numbers The numbers of the highlighted lines.
   * @param maxNumbers The max numbers of the lines.
   */
  void drawRoute(Graphics2D g, LineRealizer liner, Shape[] stations, Line2D[] lines,
// Path: src/main/java/infovis/data/BusLine.java
// public final class BusLine implements Comparable<BusLine> {
// 
//   /** Bus line used for walked sections of a route. */
//   public static final BusLine WALK = new BusLine("Walk", null, Color.BLACK);
// 
//   /** Bus line name. */
//   private final String name;
// 
//   /** Long bus line name. */
//   private final String longName;
// 
//   /** Bus color. */
//   private final Color color;
// 
//   /** The hidden sorting name. */
//   private final String hiddenSortingName;
// 
//   /**
//    * Constructor taking the name and the color.
//    * 
//    * @param name Bus line name,
//    * @param longName Long bus line name, may be <code>null</code>.
//    * @param color Bus line color.
//    */
//   BusLine(final String name, final String longName, final Color color) {
//     this.name = Objects.requireNonNull(name).intern();
//     this.longName = Objects.nonNull(longName, this.name);
//     this.color = Objects.requireNonNull(color);
//     final String tmp = "0000000000" + name;
//     final int l = tmp.length();
//     hiddenSortingName = tmp.substring(l - 10, l);
//   }
// 
//   /**
//    * Getter.
//    * 
//    * @return bus line name
//    */
//   public String getName() {
//     return name;
//   }
// 
//   /**
//    * Getter.
//    * 
//    * @return The full bus line name.
//    */
//   public String getFullName() {
//     return longName;
//   }
// 
//   /**
//    * Getter.
//    * 
//    * @return bus line color
//    */
//   public Color getColor() {
//     return color;
//   }
// 
//   @Override
//   public String toString() {
//     return String.format("%s[%s, %08X]", getClass().getSimpleName(), name, color.getRGB());
//   }
// 
//   /**
//    * Checks for equality with other bus lines.
//    * 
//    * @param line The other line.
//    * @return If both are equal and non-null.
//    */
//   public boolean equals(final BusLine line) {
//     return line != null && (this == line || name.equals(line.name));
//   }
// 
//   @Override
//   public boolean equals(final Object obj) {
//     return obj instanceof BusLine && name.equals(((BusLine) obj).name);
//   }
// 
//   @Override
//   public int hashCode() {
//     return name.hashCode();
//   }
// 
//   @Override
//   public int compareTo(final BusLine o) {
//     return -hiddenSortingName.compareTo(o.hiddenSortingName);
//   }
// 
// }


// Path: src/main/java/infovis/draw/StationRealizer.java
import infovis.data.BusLine;
import infovis.util.VecUtil;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.Stroke;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;
import java.awt.geom.Rectangle2D;

package infovis.draw;



/**
 * Realizes the actual painting of bus stations.
 * 
 * @author Joschi <josua.krause@googlemail.com>
 */
public interface StationRealizer {

  /**
   * The shape of the depiction of the bus station. This is also the area that
   * can be clicked on.
   * 
   * @param x The x translation.
   * @param y The y translation.
   * @param r The radius of the station.
   * @return The shape of the bus station.
   */
  Shape createStationShape(double x, double y, double r);

  /**
   * Draws the bus station.
   * 
   * @param g The graphics context.
   * @param station The station that is drawn.
   * @param stroke The stroke that can be used.
   * @param referenceNode Whether this node is the reference node.
   * @param secondarySelected Whether this node is secondary selected.
   */
  void drawStation(Graphics2D g, Shape station, Stroke stroke, boolean referenceNode,
      boolean secondarySelected);

  /**
   * Highlights a selected route.
   * 
   * @param g The graphics context.
   * @param liner The method to draw lines.
   * @param stations The shapes of the used stations.
   * @param lines The used lines.
   * @param busLines The used bus lines.
   * @param numbers The numbers of the highlighted lines.
   * @param maxNumbers The max numbers of the lines.
   */
  void drawRoute(Graphics2D g, LineRealizer liner, Shape[] stations, Line2D[] lines,
      BusLine[] busLines, int[] numbers, int[] maxNumbers);