Shumate.PathLayer

g GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Shumate.Layer Shumate.Layer Gtk.Widget->Shumate.Layer Shumate.PathLayer Shumate.PathLayer Shumate.Layer->Shumate.PathLayer

Subclasses:

None

Methods

Inherited:

Shumate.Layer (1), Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new (viewport)

add_node (location)

get_closed ()

get_dash ()

get_fill ()

get_fill_color ()

get_nodes ()

get_outline_color ()

get_outline_width ()

get_stroke ()

get_stroke_color ()

get_stroke_width ()

insert_node (location, position)

remove_all ()

remove_node (location)

set_closed (value)

set_dash (dash_pattern)

set_fill (value)

set_fill_color (color)

set_outline_color (color)

set_outline_width (value)

set_stroke (value)

set_stroke_color (color)

set_stroke_width (value)

Virtual Methods

Inherited:

Shumate.Layer (1), Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)

Properties

Inherited:

Shumate.Layer (1), Gtk.Widget (34), Gtk.Accessible (1)

Name

Type

Flags

Short Description

closed

bool

r/w

The Path is Closed

fill

bool

r/w

The shape is filled

fill-color

Gdk.RGBA

r/w

The path’s fill color

outline-color

Gdk.RGBA

r/w

The path’s outline color

outline-width

float

r/w

The path’s outline width

stroke

bool

r/w

The shape is stroked

stroke-color

Gdk.RGBA

r/w

The path’s stroke color

stroke-width

float

r/w

The path’s stroke width

Signals

Inherited:

Gtk.Widget (13), GObject.Object (1)

Fields

Inherited:

Gtk.Widget (13), GObject.Object (1)

Class Details

class Shumate.PathLayer(**kwargs)
Bases:

Shumate.Layer

Abstract:

No

Structure:

Shumate.PathLayerClass

A layer displaying line path between inserted [iface`Location`] objects

This layer shows a connection between inserted objects implementing the [iface`Location`] interface. This means that both [class`Marker`] objects and [class`Coordinate`] objects can be inserted into the layer. Of course, custom objects implementing the [iface`Location`] interface can be used as well.

classmethod new(viewport)
Parameters:

viewport (Shumate.Viewport) – the [class`Viewport`]

Returns:

a new instance of [class`PathLayer`].

Return type:

Shumate.PathLayer

Creates a new instance of [class`PathLayer`].

add_node(location)
Parameters:

location (Shumate.Location) – a [iface`Location`]

Adds a [iface`Location`] object to the layer. The node is prepended to the list.

get_closed()
Returns:

True when the path is closed, False otherwise

Return type:

bool

Gets information whether the path is closed.

get_dash()
Returns:

the list

Return type:

[int]

Returns the list of dash segment lengths.

get_fill()
Returns:

True if the path is filled, False otherwise.

Return type:

bool

Checks whether the path is filled.

get_fill_color()
Returns:

the path’s fill color.

Return type:

Gdk.RGBA

Gets the path’s fill color.

get_nodes()
Returns:

the list

Return type:

[Shumate.Location]

Gets a copy of the list of all [iface`Location`] objects inserted into the layer. You should free the list but not its contents.

get_outline_color()
Returns:

the path’s outline color.

Return type:

Gdk.RGBA

Gets the path’s outline color.

get_outline_width()
Returns:

the width of the outline

Return type:

float

Gets the width of the outline.

get_stroke()
Returns:

True if the path is stroked, False otherwise.

Return type:

bool

Checks whether the path is stroked.

get_stroke_color()
Returns:

the path’s stroke color.

Return type:

Gdk.RGBA

Gets the path’s stroke color.

get_stroke_width()
Returns:

the width of the stroke

Return type:

float

Gets the width of the stroke.

insert_node(location, position)
Parameters:
  • location (Shumate.Location) – a [iface`Location`]

  • position (int) – position in the list where the [iface`Location`] object should be inserted

Inserts a [iface`Location`] object to the specified position.

remove_all()

Removes all [iface`Location`] objects from the layer.

remove_node(location)
Parameters:

location (Shumate.Location) – a [iface`Location`]

Removes the [iface`Location`] object from the layer.

set_closed(value)
Parameters:

value (bool) – True to make the path closed

Makes the path closed.

set_dash(dash_pattern)
Parameters:

dash_pattern ([int]) – list of integer values representing lengths of dashes/spaces (see cairo documentation of cairo.Context.set_dash())

Sets dashed line pattern in a way similar to cairo.Context.set_dash() of cairo. This method supports only integer values for segment lengths. The values have to be passed inside the data pointer of the list (using the %GUINT_TO_POINTER conversion)

Pass None to use solid line.

set_fill(value)
Parameters:

value (bool) – if the path is filled

Sets the path to be filled

set_fill_color(color)
Parameters:

color (Gdk.RGBA or None) – The path’s fill color or None to reset to the default color. The color parameter is copied.

Set the path’s fill color.

set_outline_color(color)
Parameters:

color (Gdk.RGBA or None) – The path’s outline color or None to reset to the default color. The color parameter is copied.

Set the path’s outline color.

set_outline_width(value)
Parameters:

value (float) – the width of the outline (in pixels)

Sets the width of the outline

set_stroke(value)
Parameters:

value (bool) – if the path is stroked

Sets the path to be stroked

set_stroke_color(color)
Parameters:

color (Gdk.RGBA or None) – The path’s stroke color or None to reset to the default color. The color parameter is copied.

Set the path’s stroke color.

set_stroke_width(value)
Parameters:

value (float) – the width of the stroke (in pixels)

Sets the width of the stroke

Property Details

Shumate.PathLayer.props.closed
Name:

closed

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

The shape is a closed path

Shumate.PathLayer.props.fill
Name:

fill

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

The shape should be filled

Shumate.PathLayer.props.fill_color
Name:

fill-color

Type:

Gdk.RGBA

Default Value:

None

Flags:

READABLE, WRITABLE

The path’s fill color

Shumate.PathLayer.props.outline_color
Name:

outline-color

Type:

Gdk.RGBA

Default Value:

None

Flags:

READABLE, WRITABLE

The path’s outline color

Shumate.PathLayer.props.outline_width
Name:

outline-width

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

The path’s outline width (in pixels)

Shumate.PathLayer.props.stroke
Name:

stroke

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE

The shape should be stroked

Shumate.PathLayer.props.stroke_color
Name:

stroke-color

Type:

Gdk.RGBA

Default Value:

None

Flags:

READABLE, WRITABLE

The path’s stroke color

Shumate.PathLayer.props.stroke_width
Name:

stroke-width

Type:

float

Default Value:

2.0

Flags:

READABLE, WRITABLE

The path’s stroke width (in pixels)