Package arcmap :: Module graphics
[hide private]
[frames] | no frames]

Module graphics

source code

Code for graphical operations such as tile and shape drawing.

Classes [hide private]
  RGBA
Functions [hide private]
RGBA
getBackgroundColor()
Returns: a color representation of the background color from the gtk theme
source code
RGBA
getForegroundColor()
Returns: the foreground color from the gtk theme
source code
 
getHighlightColor() source code
gtk.FileFilter
getFileFilter()
Returns: A file filter for open dialogs allowing only image formats
source code
cairo.ImageSurface
loadImage(fileName)
This function is used so that images in any format supported by gdk can be loaded.
source code
cairo.SurfacePattern
getCheckerPattern(ts)
Returns: the new pattern
source code
 
drawGrid(context, tileSize, width, height)
Draw a grid with cells the same size as tiles on a cairo context
source code
 
drawShape(shape, context, handles=False) source code
 
drawPolygon(context, shape, outlineColor, fillColor, handles=False) source code
 
drawCircle(context, shape, outlineColor, fillColor, handles=False) source code
 
drawPointHandle(context, p, lineWidth=1.0) source code
 
drawMoveHandle(context, p)
Draws a movement handle (A four-pointed arrow)
source code
cairo.SurfacePattern
getDeleteCirclePattern(size)
Returns: a red circle with a line through it.
source code
cairo.SurfacePattern
getDeletePattern(size)
Returns: a red x
source code
Variables [hide private]
  log = logging.getLogger("graphics")
  __package__ = 'arcmap'
Function Details [hide private]

getBackgroundColor()

source code 
Returns: RGBA
a color representation of the background color from the gtk theme

getForegroundColor()

source code 
Returns: RGBA
the foreground color from the gtk theme

getFileFilter()

source code 
Returns: gtk.FileFilter
A file filter for open dialogs allowing only image formats

loadImage(fileName)

source code 

This function is used so that images in any format supported by gdk can be loaded.

Parameters:
  • fileName (string) - name of file to load
Returns: cairo.ImageSurface
An image surface containing the contents of the file

getCheckerPattern(ts)

source code 
Parameters:
  • ts (int) - size of the checker pattern in pixels
Returns: cairo.SurfacePattern
the new pattern

drawGrid(context, tileSize, width, height)

source code 

Draw a grid with cells the same size as tiles on a cairo context

Parameters:
  • context (cairo.Context) - the destination context
  • tileSize (int) - the size of the grid cells

drawPolygon(context, shape, outlineColor, fillColor, handles=False)

source code 
Parameters:
  • context (cairo.Context) - context to draw on
  • shape (shapes.Shape) - the shape to draw
  • outlineColor (RGBA) - color for the outline
  • fillColor (RGBA) - color for the filled shape
  • handles (bool) - True if handles should be drawn on the points

drawCircle(context, shape, outlineColor, fillColor, handles=False)

source code 
Parameters:
  • context (cairo.Context) - context to draw to
  • shape (shapes.Shape) - the shape to draw
  • outlineColor (RGBA) - color for the outline
  • fillColor (RGBA) - color for the filled shape
  • handles (bool) - True if the handles should be drawn, false otherwise

drawPointHandle(context, p, lineWidth=1.0)

source code 
Parameters:
  • context (cairo.Context) - destination context
  • p (shapes.Point) - the point to draw

drawMoveHandle(context, p)

source code 

Draws a movement handle (A four-pointed arrow)

Parameters:
  • context (cairo.Context) - the context to draw on
  • p (shapes.Point) - the point to draw the handle around

getDeleteCirclePattern(size)

source code 
Parameters:
  • size (int) - Size of the circle
Returns: cairo.SurfacePattern
a red circle with a line through it.

getDeletePattern(size)

source code 
Parameters:
  • size (int) - the size of the x
Returns: cairo.SurfacePattern
a red x