Module gwy :: Class Ruler
[hide private]
[frames] | no frames]

Class Ruler

source code

Instance Methods [hide private]
 
set_range(lower, upper, position, max_size)
Sets range and current value of a ruler.
source code
 
draw_pos()
Draws a position marker.
source code
 
get_range()
Retrieves values indicating the range and current position of a Ruler.
source code
 
set_si_unit(units)
Sets the base units a ruler displays.
source code
 
get_si_unit()
Returns the base units a ruler uses.
source code
 
get_units_placement()
Gets current units placement of ruler ruler.
source code
 
set_units_placement(placement)
Sets whether and where units should be placed on the ruler.
source code
Method Details [hide private]

set_range(lower, upper, position, max_size)

source code 

Sets range and current value of a ruler.

Parameters:
  • lower - Lower limit of the ruler. (float)
  • upper - Upper limit of the ruler. (float)
  • position - Current position of the mark on the ruler. (float)
  • max_size - Maximum value used for calculating size of text labels. (float)

draw_pos()

source code 

Draws a position marker.

This method is intended primarily for subclass implementation.

get_range()

source code 

Retrieves values indicating the range and current position of a Ruler. See Ruler.set_range().

Returns:
Tuple consisting of 4 values (lower, upper, position, max_size). ((float), (float), (float), (float))

set_si_unit(units)

source code 

Sets the base units a ruler displays.

Setting units to None effectively disables them.

Parameters:
  • units - The base units this ruler should display. (SIUnit)

get_si_unit()

source code 

Returns the base units a ruler uses.

Returns:
The units the rules uses. (SIUnit)

get_units_placement()

source code 

Gets current units placement of ruler ruler.

Returns:
The units placement. (UnitsPlacement)

set_units_placement(placement)

source code 

Sets whether and where units should be placed on the ruler.

Parameters:
  • placement - Units placement specification. Expected values: UNITS_PLACEMENT_NONE, UNITS_PLACEMENT_AT_ZERO. (UnitsPlacement)