public static class

ImageScript.DrawingContext

extends Object
java.lang.Object
   ↳ net.pierrox.lightning_launcher.script.api.ImageScript.DrawingContext

Class Overview

The DrawingContext is the link between the drawing script and the drawing target. The same script can be used to draw several images. For instance an ImageScript instance can be set for icon A, B and C, the drawing context then gives infos on the currently drawn icon.

Summary

Public Constructors
DrawingContext(SharedAsyncGraphicsDrawable drawable, Item item)
Public Methods
Canvas getCanvas()
Return a canvas on which to draw
int getHeight()
Return the drawing height
int getId()
Return an unique identifier for this context
Item getItem()
Return the item for which the drawing occurs.
int getWidth()
Return the drawing width
void invalidate()
void setDrawingInfo(Canvas canvas, int width, int height)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public DrawingContext (SharedAsyncGraphicsDrawable drawable, Item item)

Public Methods

public Canvas getCanvas ()

Return a canvas on which to draw

Returns
  • a canvas or null if not currently ready for draw

public int getHeight ()

Return the drawing height

Returns
  • the height in pixel, or 0 if not currently ready for draw

public int getId ()

Return an unique identifier for this context

public Item getItem ()

Return the item for which the drawing occurs. Currently this method will only return a value when drawing shortcut icons (set through setImage(Image)), otherwise it will return null.

public int getWidth ()

Return the drawing width

Returns
  • the width in pixel, or 0 if not currently ready for draw

public void invalidate ()

public void setDrawingInfo (Canvas canvas, int width, int height)