Source code for ooodev.adapter.chart2.coordinate_system_container_partial

from __future__ import annotations
from typing import Any, TYPE_CHECKING, Tuple
import uno

from import XCoordinateSystemContainer

from ooodev.exceptions import ex as mEx
from ooodev.loader import lo as mLo

    from import XCoordinateSystem
    from ooodev.utils.type_var import UnoInterface

[docs]class CoordinateSystemContainerPartial: """ Partial class for XCoordinateSystemContainer. """
[docs] def __init__( self, component: XCoordinateSystemContainer, interface: UnoInterface | None = XCoordinateSystemContainer ) -> None: """ Constructor Args: component (XCoordinateSystemContainer): UNO Component that implements ```` interface. interface (UnoInterface, optional): The interface to be validated. Defaults to ``XCoordinateSystemContainer``. """ def validate(comp: Any, obj_type: Any) -> None: if obj_type is None: return if not mLo.Lo.is_uno_interfaces(comp, obj_type): raise mEx.MissingInterfaceError(obj_type) validate(component, interface) self.__component = component
# region XCoordinateSystemContainer
[docs] def add_coordinate_system(self, coord_sys: XCoordinateSystem) -> None: """ Add a coordinate system to the coordinate system container Raises: ``IllegalArgumentException`` """ self.__component.addCoordinateSystem(coord_sys)
[docs] def get_coordinate_systems(self) -> Tuple[XCoordinateSystem, ...]: """ Gets all coordinate systems """ return self.__component.getCoordinateSystems()
[docs] def remove_coordinate_system(self, coord_sys: XCoordinateSystem) -> None: """ Removes one coordinate system from the coordinate system container. Raises: ``NoSuchElementException`` """ self.__component.removeCoordinateSystem(coord_sys)
[docs] def set_coordinate_systems(self, *systems: XCoordinateSystem) -> None: """ Set all coordinate systems. Raises: ``IllegalArgumentException`` """ self.__component.setCoordinateSystems(systems)
# endregion XCoordinateSystemContainer