Class VScheduleTimePanel

    • Field Detail

      • LINE_HEIGHT

        public static int LINE_HEIGHT
        Line Height
      • HEADING

        public static int HEADING
        Heading Space
    • Constructor Detail

      • VScheduleTimePanel

        public VScheduleTimePanel()
    • Method Detail

      • setTimeSlots

        public void setTimeSlots​(MAssignmentSlot[] timeSlots)
        Set Time Slots and calculate width
        Parameters:
        timeSlots - time slots
      • getHeaderHeight

        public int getHeaderHeight()
        Get the height of the Header
        Returns:
        height of the header
      • getSlotHeight

        public int getSlotHeight()
        Get the height of a slot
        Returns:
        height of a slot
      • getSlotCount

        public int getSlotCount()
        Get the height of a slot
        Returns:
        height of a slot
      • getSlotYStart

        public int getSlotYStart​(int slot)
        Get Y start position of Slot
        Parameters:
        slot - slot index
        Returns:
        y start position
      • getSlotYEnd

        public int getSlotYEnd​(int slot)
        Get Y end position of Slot
        Parameters:
        slot - slot index
        Returns:
        y end position
      • getTimeSlotIndex

        public int getTimeSlotIndex​(Timestamp time,
                                    boolean endTime)
        Return the Time Slot index for the time. Based on start time and not including end time
        Parameters:
        time - time (day is ignored)
        endTime - if true, the end time is included
        Returns:
        slot index
      • getTimeSlot

        public MAssignmentSlot getTimeSlot​(int index)
        Get Time Slot
        Parameters:
        index - time index
        Returns:
        Assignment Slot
      • getTimeSlotIndex

        public int getTimeSlotIndex​(int yPos)
        Get Time Slot Index
        Parameters:
        yPos - Y position
        Returns:
        Assignment Slot Index
      • paint

        public void paint​(Graphics g)
        Paint it
        Overrides:
        paint in class JComponent
        Parameters:
        g - the Graphics object
      • getStroke

        public static Stroke getStroke​(boolean slotLine)
        Get Stroke
        Parameters:
        slotLine - if true return dashed line
        Returns:
        Stroke