Class DetectorImage

    • Constructor Detail

      • DetectorImage

        DetectorImage​(TrafCODDisplay display,
                      Point2D center,
                      String id,
                      String description)
        Construct a new DetectorImage.
        Parameters:
        display - TrafCODDisplay; the TrafCOD display on which this detector image will be rendered
        center - Point2D; the center location of the detector image on the TrafCOD display
        id - String; id used to match this detector with the TrafCOD detector input
        description - String; name of the detector (displayed as tool tip text)
    • Method Detail

      • draw

        public void draw​(Graphics2D g2)
        Draw yourself at the indicated location.
        Specified by:
        draw in interface TrafCODObject
        Parameters:
        g2 - Graphics2D; the graphics context
      • toolTipHit

        public String toolTipHit​(int testX,
                                 int testY)
        Check if the given coordinates hit the TrafCODObject. If it does return a String to be used as a tool tip text. If the coordinates do not hit this TrafCODObject return null.
        Specified by:
        toolTipHit in interface TrafCODObject
        Parameters:
        testX - int; the x-coordinate
        testY - int; the y-coordinate
        Returns:
        String; the tool tip text or null if the coordinates do not hit the TrafCodObject
      • getId

        public String getId()
        Retrieve the id of this DetectorImage.
        Returns:
        String; the id of this DetectorImage