Class BusNetworkLayer

    • Constructor Detail

      • BusNetworkLayer

        public BusNetworkLayer​(BusNetwork network)
        Create a new layer.
        Parameters:
        network - is the embedded network
      • BusNetworkLayer

        public BusNetworkLayer​(BusNetwork network,
                               boolean autoUpdate)
        Create a new layer.
        Parameters:
        network - is the embedded network
        autoUpdate - indicates if this bus network should be automatically updated when a bus line as changed.
        Since:
        4.0
      • BusNetworkLayer

        public BusNetworkLayer​(UUID id,
                               BusNetwork network)
        Create a new layer.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        network - is the embedded network
        Since:
        4.0
      • BusNetworkLayer

        public BusNetworkLayer​(UUID id,
                               BusNetwork network,
                               boolean autoUpdate)
        Create a new layer.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        network - is the embedded network
        autoUpdate - indicates if this bus network should be automatically updated when a bus line as changed.
        Since:
        4.0
      • BusNetworkLayer

        public BusNetworkLayer​(AttributeCollection attributeProvider,
                               BusNetwork network)
        Create a new layer.
        Parameters:
        attributeProvider - is the attribute collection associated to this layer.
        network - is the embedded network
      • BusNetworkLayer

        public BusNetworkLayer​(AttributeCollection attributeProvider,
                               BusNetwork network,
                               boolean autoUpdate)
        Create a new layer.
        Parameters:
        attributeProvider - is the attribute collection associated to this layer.
        network - is the embedded network
        autoUpdate - indicates if this bus network should be automatically updated when a bus line as changed.
        Since:
        4.0
      • BusNetworkLayer

        public BusNetworkLayer​(UUID id,
                               AttributeCollection attributeProvider,
                               BusNetwork network)
        Create a new layer.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        attributeProvider - is the attribute collection associated to this layer.
        network - is the embedded network
        Since:
        4.0
      • BusNetworkLayer

        public BusNetworkLayer​(UUID id,
                               AttributeCollection attributeProvider,
                               BusNetwork network,
                               boolean autoUpdate)
        Create a new layer.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        attributeProvider - is the attribute collection associated to this layer.
        network - is the embedded network
        autoUpdate - indicates if this bus network should be automatically updated when a bus line as changed.
        Since:
        4.0
    • Method Detail

      • initializeElements

        protected void initializeElements()
        Run the initialization of the elements from the current bus line.

        This function is invoked by the constructor of BusLineLayer if its parameter autoUpdate is true, and not invoked if this parameter is false.

      • onBusLineAdded

        protected boolean onBusLineAdded​(BusLine line,
                                         int index)
        Invoked when a bus line was added in the attached network.

        This function exists to allow be override to provide a specific behaviour when a bus line has been added.

        Parameters:
        line - is the new line.
        index - is the index of the bus line.
        Returns:
        true if the events was fired, otherwise false.
      • onBusLineRemoved

        protected boolean onBusLineRemoved​(BusLine line,
                                           int index)
        Invoked when a bus line was removed from the attached network.

        This function exists to allow be override to provide a specific behaviour when a bus line has been removed.

        Parameters:
        line - is the removed line.
        index - is the index of the bus line.
        Returns:
        true if the events was fired, otherwise false.
      • onAllBusLineRemoved

        protected boolean onAllBusLineRemoved()
        Invoked when all the bus lines were removed from the attached network.

        This function exists to allow be override to provide a specific behaviour when a bus line has been removed.

        Returns:
        true if the events was fired, otherwise false.
      • onBusLineChanged

        protected boolean onBusLineChanged​(BusLine line,
                                           int index)
        Invoked when a bus line was changed in the attached network.

        This function exists to allow be override to provide a specific behaviour when a bus line has changed.

        Parameters:
        line - is the changed line.
        index - is the index of the bus line.
        Returns:
        true if the events was fired, otherwise false.
      • fireBusNetworkChanged

        protected void fireBusNetworkChanged()
        Send an event to notify listeners that the bus network has changed.
      • isLayerAutoUpdated

        public boolean isLayerAutoUpdated()
        Replies if this layer is automatically updated when a bus itinerary was removed or added.
        Returns:
        true if the layer is automatically updated, false.
      • setLayerAutoUpdated

        public void setLayerAutoUpdated​(boolean update)
        Set if this layer is automatically updated when a bus itinerary was removed or added.
        Parameters:
        update - is true if the layer should be automatically updated, false.
      • getBusNetwork

        public BusNetwork getBusNetwork()
        Replies the bus network displayed by this layer.
        Returns:
        the bus network displayed by this layer.
      • isValidLayer

        public boolean isValidLayer()
        Description copied from interface: BusLayer
        Replies if this layer and its content is marked as valid.

        The validity of a bus primitive depends on the type of this primitive. Please refers to the documentation of that primitive.

        Specified by:
        isValidLayer in interface BusLayer
        Returns:
        true if the layer is valid, otherwise false
      • revalidate

        public void revalidate()
        Description copied from interface: BusLayer
        Check if the validity of this layer is correctly set and change its values if necessary. This function revalidate also all the layers and primitives inside this layer.
        Specified by:
        revalidate in interface BusLayer