Class DefaultScheduleItemRenderer

java.lang.Object
com.codename1.ui.scheduler.DefaultScheduleItemRenderer
All Implemented Interfaces:
ScheduleItemRenderer

public class DefaultScheduleItemRenderer extends Object implements ScheduleItemRenderer

The renderer a Scheduler starts with: a rounded block in the item's colour with its title, and its time and detail where they fit.

The colours and the font come from a UIID: the item's own when it has one, otherwise SchedulerItem, SchedulerBackgroundItem or SchedulerBlocked by its kind. An item or a resource with a colour of its own overrides the background, and the text turns black or white to stay readable on it.

  • Constructor Details

    • DefaultScheduleItemRenderer

      public DefaultScheduleItemRenderer()
  • Method Details

    • paintItem

      public void paintItem(Graphics g, Scheduler scheduler, ScheduleItem item, int x, int y, int width, int height, int state)
      Description copied from interface: ScheduleItemRenderer

      Paints item into a rectangle. The clip is already inside the view; an implementation that sets one of its own restores it.

      Parameters
      • state: a combination of the constants of this interface
      Specified by:
      paintItem in interface ScheduleItemRenderer
    • uiidOf

      protected String uiidOf(ScheduleItem item)
      The UIID an item is painted with.
    • paintText

      protected void paintText(Graphics g, Scheduler scheduler, ScheduleItem item, Font font, int color, int x, int y, int width, int height, int state)
      Draws the title, and under it the time and the detail when the rectangle is tall enough.