Class GroupShape
- class ooodev.draw.shapes.GroupShape(component, lo_inst=None)[source]
Bases:
LoInstPropsPartial
,GroupShapeComp
,ShapePartialProps
,QiPartial
,PropPartial
,StylePartial
- __init__(component, lo_inst=None)[source]
Constructor.
- Parameters:
lo_inst (LoInst, optional) – Lo instance.
component (XShapeGroup) –
- Return type:
None
- add(shape)
Adds a shape to the collection.
- Parameters:
shape (XShape) – The shape to add.
- Return type:
None
- apply_styles(*styles, **kwargs)
Applies style to component.
- Parameters:
obj. (styles expandable list of styles object such as Font to apply to) –
kwargs (Any, optional) – Expandable list of key value pairs.
styles (StyleT) –
- Return type:
None
- enter_group()
Enters the group which enables the editing function for the parts of a grouped Shape. Then the parts can be edited instead of the group as a whole. This affects only the user interface. The behavior is not specified if this instance is not visible on any view. In this case it may or may not work.
- Return type:
None
- get_by_index(idx)
Gets the element at the specified index.
- Parameters:
idx (int) – The Zero-based index of the element.
- Returns:
The element at the specified index.
- Return type:
Any
- get_count()
Gets the number of elements contained in the container.
- Returns:
The number of elements.
- Return type:
int
- get_element_type()
Gets the type of the elements contained in the container.
- Returns:
The type of the elements.
None
means that it is a multi-type container and you cannot determine the exact types with this interface.- Return type:
Any
- get_position()
Gets the position of the shape in
100th mm
units.- Returns:
The position of the shape.
- Return type:
- get_property(name, default=<object object>)
Get property value
- Parameters:
name (str) – Property Name.
default (Any, optional) – Return value if property value is
None
.
- Returns:
Property value or default.
- Return type:
Any
- get_shape_type()
Gets the shape type.
- Returns:
The programmatic name of the shape type.
- Return type:
str
- get_size()
Gets the size of the shape in
100th mm
units.- Returns:
The size of the shape.
- Return type:
- has_elements()
Determines whether the container has elements.
- Return type:
bool
- leave_group()
leaves the group, which disables the editing function for the parts of a grouped Shape.
Then only the group as a whole can be edited.
This affects only the user interface. The behavior is not specified if this instance is not visible on any view. In this case it may or may not work.
- Return type:
None
- qi(atype, raise_err=False)
Generic method that get an interface instance from an object.
- Parameters:
atype (T) – Interface type to query obj for. Any Uno class that starts with ‘X’ such as XInterface
raise_err (bool, optional) – If True then raises MissingInterfaceError if result is None. Default False
- Raises:
MissingInterfaceError – If ‘raise_err’ is ‘True’ and result is None
- Returns:
instance of interface if supported; Otherwise, None
- Return type:
T | None
Note
When
raise_err=True
return value will never beNone
.
- remove(shape)
Removes a shape from the collection.
- Parameters:
shape (XShape) – The shape to remove.
- Return type:
None
- set_position(position)
Sets the position of the shape in
100th mm
units.- Parameters:
position (Point) – The position of the shape.
- Return type:
None
- set_property(**kwargs)
Set property value
- Parameters:
**kwargs (
Any
) – Variable length Key value pairs used to set properties.- Return type:
None
- set_size(size)
Sets the size of the shape in
100th mm
units.- Parameters:
size (Size) – The size of the shape.
- Return type:
None
- property component: com.sun.star.drawing.GroupShape
GroupShape Component
- Return type:
GroupShape
- property hyperlink: str | None
Gets/Sets property lets you get and set a hyperlink for this shape.
optional
- Return type:
str | None
- property interop_grab_bag: Tuple[PropertyValue, ...] | None
Grab bag of shape properties, used as a string-any map for interim interop purposes.
This property is intentionally not handled by the ODF filter. Any member that should be handled there should be first moved out from this grab bag to a separate property.
optional
- Return type:
Tuple[PropertyValue, …] | None
- property layer_id: int | None
Gets/Sets the ID of the Layer to which this Shape is attached.
optional
- Return type:
int | None
- property layer_name: str | None
Gets/Sets the name of the Layer to which this Shape is attached.
optional
- Return type:
str | None
- property move_protect: bool | None
Gets/Sets - With this set to
True
, this Shape cannot be moved interactively in the user interface.- Return type:
bool | None
- property name: str | None
Gets/Sets the name of this Shape.
optional
- Return type:
str | None
Gets/Sets the navigation order of this shape.
If this value is negative, the navigation order for this shapes page is equal to the z-order.
optional
- Return type:
int | None
- property position: GenericUnitPoint[UnitMM, float]
Gets the Position of the shape in
UnitMM
Values.- Return type:
GenericUnitPoint
[UnitMM
,float
]
- property printable: bool | None
Gets/Sets - If this is
False
, the Shape is not visible on printer outputs.optional
- Return type:
bool | None
- property relative_height: int | None
Gets/Sets the relative height of the object.
It is only valid if it is greater than zero.
optional
- Return type:
int | None
- property relative_height_relation: int | None
Gets/Sets the relation of the relative height of the object.
It is only valid if RelativeHeight is greater than zero.
optional
- Return type:
int | None
- property relative_width: int | None
Gets/Sets the relative width of the object.
It is only valid if it is greater than zero.
optional
- Return type:
int | None
- property relative_width_relation: int | None
Gets/Sets the relation of the relative width of the object.
It is only valid if
relative_width
is greater than zero.optional
- Return type:
int | None
- property shape_user_defined_attributes: NameContainerComp | None
Gets/Sets xml attributes.
They will be saved to and restored from automatic styles inside xml files.
When setting the value can be either a
NameContainerComp
orXNameContainer
.optional
- Returns:
The name container component. Or None if the property is not available.
- Return type:
NameContainerComp | None
- property size: GenericUnitSize[UnitMM, float]
Gets the size of the shape in
UnitMM
Values.- Return type:
GenericUnitSize
[UnitMM
,float
]
- property size_protect: bool | None
Gets/Sets With this set to
True
, this Shape may not be sized interactively in the user interface.optional
- Return type:
bool | None
- property style: StyleComp | None
Gets/Sets - this property lets you get and set a style for this shape.
optional
- Returns:
The style component. Or None if the property is not available.
- Return type:
StyleComp | None
- property transformation: HomogenMatrix3StructComp | None
this property lets you get and set the transformation matrix for this shape.
The transformation is a 3x3 homogeneous matrix and can contain translation, rotation, shearing and scaling.
optional
- Returns:
The homogen matrix 3 struct component. Or None if the property is not available.
- Return type:
HomogenMatrix3StructComp | None
Hint
HomogenMatrix3
can be imported fromooo.dyn.drawing.homogen_matrix_line3
- property visible: bool | None
If this is
False
, the Shape is not visible on screen outputs.Please note that the Shape may still be visible when printed, see Printable.
optional
- Return type:
bool | None
- property z_order: int | None
Gets/Sets the z-order of this Shape.
optional
- Return type:
int | None