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

Class VectorLayer

source code

Instance Methods [hide private]
 
set_selection_key(key)
Sets the selection object to use by a vector layer.
source code
 
get_selection_key()
Gets the key identifying selection this vector layer displays.
source code
 
ensure_selection()
Ensures a vector layer's selection exist in data container.
source code
 
get_focus()
Gets focused object index.
source code
 
set_focus(focus)
Focues on one selection object.
source code
 
get_editable()
Gets editability of a vector layer.
source code
 
set_editable(editable)
Sets a vector layer editability.
source code
 
draw(drawable, target)
Draws layer on given drawable (which should be a DataView window).
source code
 
object_chosen(id)
Emits "object-chosen" signal on a vector layer.
source code
 
get_selection_type()
Gets the selection type of a vector layer.
source code
Method Details [hide private]

set_selection_key(key)

source code 

Sets the selection object to use by a vector layer.

Parameters:
  • key - Container string key identifying the selection object. (string)

get_selection_key()

source code 

Gets the key identifying selection this vector layer displays.

Returns:
The string key, or None if it isn't set. (string)

ensure_selection()

source code 

Ensures a vector layer's selection exist in data container.

This method can be called only when layer is plugged into a data view and it has a selection key set. If the data container contains a selection under the specified key the selection is returned. If there is none, a selection of appropriate type is created and put to the container first.

Provided the above conditions are met this method is suitable for just obtaining the selection object a vector layer uses too.

Returns:
The layer's selection (no reference is added). (Selection)

get_focus()

source code 

Gets focused object index.

Returns:
Focued object index, or -1 if no object is focused. (int)

set_focus(focus)

source code 

Focues on one selection object.

When a selection object is focused, it becomes the only one user can interact with. More precisely, "object-chosen" signal is emitted only for this object, and if the layer is editable only this object can be modified by the user.

Parameters:
  • focus - Index of object to focus on, use -1 to unfocus (allow interaction with any object). (int)
Returns:
True if the object was focused, False on failure. Failure can be caused by user currently moving another object, wrong object index, or the feature being unimplemented in layer. (bool)

get_editable()

source code 

Gets editability of a vector layer.

Returns:
True if layer is edtiable, False if it is not editable. (bool)

set_editable(editable)

source code 

Sets a vector layer editability.

It is an error to attempt to set a layer non-editabile while it is being edited.

When a layer is set noneditable, the user cannot change the selection. However, "object-chosen" signal is still emitted.

Parameters:
  • editable - True to set layer editable, False to set it noneditable. (bool)

draw(drawable, target)

source code 

Draws layer on given drawable (which should be a DataView window).

Parameters:
  • drawable - A drawable to draw on. (gdk.Drawable)
  • target - Rendering target. Expected values: RENDERING_TARGET_SCREEN, RENDERING_TARGET_PIXMAP_IMAGE. (RenderingTarget)

object_chosen(id)

source code 

Emits "object-chosen" signal on a vector layer.

This function is primarily intended for layer implementations.

Parameters:
  • id - Index of the chosen object. (int)

get_selection_type()

source code 

Gets the selection type of a vector layer.

This is a convenience wrapper around VectorLayer.class_get_selection_type().

Returns:
(GType)