Class: GOffice::GraphAxisColorMap

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.foreach(handler, user_data) ⇒ nil

Executes handler to each color map installed on the system or loaded from a document.

Parameters:

  • handler (GOffice::GraphAxisColorMapHandler)

    a Gog::AxisColorMapHandler

  • user_data (GObject)

    data to pass to handler

Returns:

  • (nil)

.from_colors(name, nb, colors, type) ⇒ GOffice::GraphAxisColorMap

Creates a color map using colors.

Parameters:

  • name (String)

    color map name

  • nb (Integer)

    colors number

  • colors (GOffice::Color)

    the colors

  • type (GOffice::ResourceType)

    the resource type

Returns:

.get_from_id(id) ⇒ GOffice::GraphAxisColorMap

Retrieves the color map whose identifier is id.

Parameters:

  • id (String)

    the color map identifier to search for

Returns:

Instance Method Details

#deleteBoolean

Destroys the color map and remove it from the user directory and from the database.

Returns:

  • (Boolean)

    true on success.

#dupGOffice::GraphAxisColorMap

Duplicates the color map.

Returns:

#edit(cc) ⇒ GOffice::GraphAxisColorMap

Opens a dialog to edit the color map. If map is nil, creates a new one unless the user cancels the edition.

Parameters:

Returns:

#get_color(x) ⇒ GOffice::Color

Maps x to a color.

Parameters:

  • x (Float)

    the value to map

Returns:

  • (GOffice::Color)

    the found color.

#get_snapshot(discrete, horizontal, width, height) ⇒ GdkPixbuf::Pixbuf

Builds a snapshot of the color map.

Parameters:

  • discrete (Boolean)

    whether to use constant colors between each stop or a gradient.

  • horizontal (Boolean)

    whether to get an horizontal or a vertical snapshot.

  • width (Integer)

    the pixbuf width.

  • height (Integer)

    the pixbuf height.

Returns:

  • (GdkPixbuf::Pixbuf)

    the new Gdk::Pixbuf.

#idString

Retrieves the color map name.

Returns:

  • (String)

    the map name.

#maxInteger

Retrieves the value corresponding to the last color in the map. The first always corresponds to 0.

Returns:

  • (Integer)

    the maximum value.

#nameString

Retrieves the color map localized name.

Returns:

  • (String)

    the map name.

#resource_typeGOffice::ResourceType

Returns resource-type.

Returns:

#resource_type=(resource_type) ⇒ GOffice::ResourceType

Parameters:

Returns:

#to_cairo(cr, discrete, horizontal, width, height) ⇒ nil

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.

Parameters:

  • cr (cairo::Context)

    a cairo context.

  • discrete (Integer)

    whether to use constant colors between each stop or a gradient.

  • horizontal (Boolean)

    whether to get an horizontal or a vertical snapshot.

  • width (Float)

    the rectangle width.

  • height (Float)

    the rectangle height.

Returns:

  • (nil)