GOffice.GraphAxisColorMap¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37), GOffice.Persist (2) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | foreach(handler, *user_data) | 
| class | from_colors(name, nb, colors, type) | 
| class | get_from_id(id) | 
| delete() | |
| dup() | |
| edit(cc) | |
| get_color(x) | |
| get_id() | |
| get_max() | |
| get_name() | |
| get_resource_type() | |
| get_snapshot(discrete, horizontal, width, height) | |
| to_cairo(cr, discrete, horizontal, width, height) | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| resource-type | GOffice.ResourceType | r/w/co | The resource type for the color map | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Fields¶
| Inherited: | GObject.Object (1) | 
|---|
Class Details¶
- 
class GOffice.GraphAxisColorMap(**kwargs)¶
- Bases: - GObject.Object,- GOffice.Persist- Abstract: - No - 
classmethod foreach(handler, *user_data)¶
- Parameters: - handler (GOffice.GraphAxisColorMapHandler) – aGOffice.GraphAxisColorMapHandler
- user_data (objectorNone) – data to pass to handler
 - Executes handler to each color map installed on the system or loaded from a document. 
- handler (
 - 
classmethod from_colors(name, nb, colors, type)¶
- Parameters: - name (str) – color map name
- nb (int) – colors number
- colors (int) – the colors
- type (GOffice.ResourceType) – the resource type
 - Returns: - the newly created color map. - Return type: - Creates a color map using colors. 
- name (
 - 
classmethod get_from_id(id)¶
- Parameters: - id ( - str) – the color map identifier to search for- Returns: - the found color map. - Return type: - GOffice.GraphAxisColorMap- Retrieves the color map whose identifier is id. 
 - 
delete()¶
- Returns: - Trueon success.- Return type: - bool- Destroys the color map and remove it from the user directory and from the database. 
 - 
dup()¶
- Returns: - the new color map. - Return type: - GOffice.GraphAxisColorMap- Duplicates the color map. 
 - 
edit(cc)¶
- Parameters: - cc ( - GOffice.CmdContext) – a- GOffice.CmdContextor- None- Returns: - the edited color map. - Return type: - GOffice.GraphAxisColorMap- Opens a dialog to edit the color map. If self is - None, creates a new one unless the user cancels the edition.
 - 
get_color(x)¶
- Parameters: - x ( - float) – the- GOffice.valueto map- Returns: - the found color. - Return type: - int- Maps x to a color. 
 - 
get_max()¶
- Returns: - the maximum - GOffice.value.- Return type: - int- Retrieves the - GOffice.valuecorresponding to the last color in the map. The first always corresponds to 0.
 - 
get_resource_type()¶
- Returns: - the resource type. - Return type: - GOffice.ResourceType- Retrieves the resource type for self. 
 - 
get_snapshot(discrete, horizontal, width, height)¶
- Parameters: - Returns: - the new - GdkPixbuf.Pixbuf.- Return type: - Builds a snapshot of the color map. 
 - 
to_cairo(cr, discrete, horizontal, width, height)¶
- Parameters: - cr (cairo.Context) – a cairo context.
- discrete (int) – whether to use constant colors between each stop or a gradient.
- horizontal (bool) – whether to get an horizontal or a vertical snapshot.
- width (float) – the rectangle width.
- height (float) – the rectangle height.
 - When discrete is larger than 1, it will be interpreted as the number of major ticks used. The number of colors will then be discrete − 1. Draws a snapshot of the color map inside the rectangle. 
- cr (
 
- 
classmethod 
Property Details¶
- 
GOffice.GraphAxisColorMap.props.resource_type¶
- Name: - resource-type- Type: - GOffice.ResourceType- Default Value: - GOffice.ResourceType.INVALID- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- The resource type for the color map