Class BusLineLayer

    • Constructor Detail

      • BusLineLayer

        public BusLineLayer​(BusLine line)
        Create a new layer.
        Parameters:
        line - is the embedded line
      • BusLineLayer

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

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

        public BusLineLayer​(BusLine line,
                            boolean autoUpdate)
        Create a new layer.
        Parameters:
        line - is the embedded line
        autoUpdate - indicates if this layer is automatically updated when the given line has changed.
        Since:
        4.0
      • BusLineLayer

        public BusLineLayer​(UUID id,
                            BusLine line,
                            boolean autoUpdate)
        Create a new layer.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        line - is the embedded line
        autoUpdate - indicates if this layer is automatically updated when the given line has changed.
        Since:
        4.0
      • BusLineLayer

        public BusLineLayer​(AttributeCollection attributeProvider,
                            BusLine line,
                            boolean autoUpdate)
        Create a new layer.
        Parameters:
        attributeProvider - is the attribute collection associated to this layer.
        line - is the embedded line
        autoUpdate - indicates if this layer is automatically updated when the given line has changed.
        Since:
        4.0
      • BusLineLayer

        public BusLineLayer​(UUID id,
                            AttributeCollection attributeProvider,
                            BusLine line)
        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.
        line - is the embedded line
        Since:
        4.0
      • BusLineLayer

        public BusLineLayer​(UUID id,
                            AttributeCollection attributeProvider,
                            BusLine line,
                            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.
        line - is the embedded line
        autoUpdate - indicates if this layer is automatically updated when the given line has 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.

      • onBusItineraryAdded

        protected boolean onBusItineraryAdded​(BusItinerary itinerary,
                                              int index)
        Invoked when a bus itinerary was added in the attached line.

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

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

        protected boolean onBusItineraryRemoved​(BusItinerary itinerary,
                                                int index)
        Invoked when a bus itinerary was removed from the attached line.

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

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

        protected boolean onAllBusItineraryRemoved()
        Invoked when all the bus itineraries were removed from the attached line.

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

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

        protected boolean onBusItineraryChanged​(BusItinerary itinerary,
                                                int index)
        Invoked when a bus itinerary was changed in the attached line.

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

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

        protected void fireBusLineChanged()
        Send an event to notify listeners that the bus line 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.
      • getBusLine

        public BusLine getBusLine()
        Replies the bus line displayed by this layer.
        Returns:
        the bus line 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