Interface IRenderer

All Known Subinterfaces:
IInternalWidget
All Known Implementing Classes:
AbstractInternalWidget, AbstractRenderer, BranchRenderer, CheckBoxRenderer, DefaultBottomLeftRenderer, DefaultCellRenderer, DefaultColumnFooterRenderer, DefaultColumnGroupHeaderRenderer, DefaultColumnHeaderRenderer, DefaultDropPointRenderer, DefaultEmptyCellRenderer, DefaultEmptyColumnFooterRenderer, DefaultEmptyColumnHeaderRenderer, DefaultEmptyRowHeaderRenderer, DefaultFocusRenderer, DefaultInsertMarkRenderer, DefaultRowHeaderRenderer, DefaultTopLeftRenderer, ExpandToggleRenderer, GridCellRenderer, GridFooterRenderer, GridHeaderRenderer, GroupToggleRenderer, SortArrowRenderer, ToggleRenderer, Win7ColumnGroupHeaderRenderer, Win7EmptyColumnHeaderRenderer, Win7GridColumnHeaderRenderer

public interface IRenderer

NOTE: THIS WIDGET AND ITS API ARE STILL UNDER DEVELOPMENT. THIS IS A PRE-RELEASE ALPHA VERSION. USERS SHOULD EXPECT API CHANGES IN FUTURE VERSIONS.

Renders a single visual unit. A IRenderer implementation can have state (i.e. is hovered or is selected) that affects the drawing.
  • Method Summary

    Modifier and Type Method Description
    org.eclipse.swt.graphics.Point computeSize​(org.eclipse.swt.graphics.GC gc, int wHint, int hHint, java.lang.Object value)
    Returns the size of the given value's visual representation.
    void paint​(org.eclipse.swt.graphics.GC gc, java.lang.Object value)
    Paints the visual representation of the given value on the given GC.
    void setBounds​(int x, int y, int width, int height)
    Sets the bounds of the drawing.
    void setBounds​(org.eclipse.swt.graphics.Rectangle bounds)
    Sets the bounds of the drawing.
    void setDisplay​(org.eclipse.swt.widgets.Display display)
    Sets the display.
    void setExpanded​(boolean expanded)
    Sets the expanded state.
    void setFocus​(boolean focus)
    Sets focus state.
    void setHover​(boolean hover)
    Sets the hover state.
    void setLocation​(int x, int y)
    Sets the location of the drawing.
    void setLocation​(org.eclipse.swt.graphics.Point location)
    Sets the location of the drawing.
    void setMouseDown​(boolean mouseDown)
    Sets the hover state.
    void setSelected​(boolean selected)
    Sets the selected state.
    void setSize​(int width, int height)
    Sets the area of the drawing.
    void setSize​(org.eclipse.swt.graphics.Point size)
    Sets the area of the drawing.
  • Method Details

    • paint

      void paint​(org.eclipse.swt.graphics.GC gc, java.lang.Object value)
      Paints the visual representation of the given value on the given GC. The actual class of the value object is determined by the use of the implementing class.

      Implementors need to respect the bounds values that may have been specified. The bounds values may affect the x and y values for all drawing operations as well as the width and heights. Implementors may use a Transform to translate the coordinates of all the drawing operations, otherwise they will need to offset each draw.

      Parameters:
      gc - GC to paint with
      value - the value being painted
    • computeSize

      org.eclipse.swt.graphics.Point computeSize​(org.eclipse.swt.graphics.GC gc, int wHint, int hHint, java.lang.Object value)
      Returns the size of the given value's visual representation.
      Parameters:
      gc - convenience GC for string and text extents
      wHint - given width (or SWT.DEFAULT)
      hHint - given height (or SWT.DEFAULT)
      value - value to be sized
      Returns:
      the size
    • setBounds

      void setBounds​(org.eclipse.swt.graphics.Rectangle bounds)
      Sets the bounds of the drawing.
      Parameters:
      bounds - Bounds.
    • setBounds

      void setBounds​(int x, int y, int width, int height)
      Sets the bounds of the drawing.
      Parameters:
      x - X coordinate.
      y - Y coordinate.
      width - Width.
      height - Height.
    • setLocation

      void setLocation​(org.eclipse.swt.graphics.Point location)
      Sets the location of the drawing.
      Parameters:
      location - Location.
    • setLocation

      void setLocation​(int x, int y)
      Sets the location of the drawing.
      Parameters:
      x - X.
      y - Y.
    • setFocus

      void setFocus​(boolean focus)
      Sets focus state.
      Parameters:
      focus - focus state.
    • setHover

      void setHover​(boolean hover)
      Sets the hover state.
      Parameters:
      hover - Hover state.
    • setMouseDown

      void setMouseDown​(boolean mouseDown)
      Sets the hover state.
      Parameters:
      mouseDown - Mouse state.
    • setSelected

      void setSelected​(boolean selected)
      Sets the selected state.
      Parameters:
      selected - Selection state.
    • setExpanded

      void setExpanded​(boolean expanded)
      Sets the expanded state.
      Parameters:
      expanded - Expansion state.
    • setSize

      void setSize​(int width, int height)
      Sets the area of the drawing.
      Parameters:
      width - Width.
      height - Height.
    • setSize

      void setSize​(org.eclipse.swt.graphics.Point size)
      Sets the area of the drawing.
      Parameters:
      size - Size.
    • setDisplay

      void setDisplay​(org.eclipse.swt.widgets.Display display)
      Sets the display.
      Parameters:
      display - Display.