Class BusItineraryLayer

    • Constructor Detail

      • BusItineraryLayer

        public BusItineraryLayer​(BusItinerary itinerary)
        Create a new layer.
        Parameters:
        itinerary - is the embedded itinerary
      • BusItineraryLayer

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

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

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

        public BusItineraryLayer​(AttributeCollection attributeProvider,
                                 BusItinerary itinerary)
        Create a new layer.
        Parameters:
        attributeProvider - is the attribute collection associated to this layer.
        itinerary - is the itinerary to put in the layer.
      • BusItineraryLayer

        public BusItineraryLayer​(AttributeCollection attributeProvider,
                                 BusItinerary itinerary,
                                 boolean autoUpdate)
        Create a new layer.
        Parameters:
        attributeProvider - is the attribute collection associated to this layer.
        itinerary - is the itinerary to put in the layer.
        autoUpdate - indicates if this layer is automatically updated when the given itinerary has changed.
        Since:
        4.0
      • BusItineraryLayer

        public BusItineraryLayer​(UUID id,
                                 AttributeCollection attributeProvider,
                                 BusItinerary itinerary)
        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.
        itinerary - is the itinerary to put in the layer.
        Since:
        4.0
      • BusItineraryLayer

        public BusItineraryLayer​(UUID id,
                                 AttributeCollection attributeProvider,
                                 BusItinerary itinerary,
                                 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.
        itinerary - is the itinerary to put in the layer.
        autoUpdate - indicates if this layer is automatically updated when the given itinerary has changed.
        Since:
        4.0
    • Method Detail

      • initializeElements

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

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

      • onBusItineraryInverted

        protected boolean onBusItineraryInverted​(BusChangeEvent event)
        Invoked when a bus itinerary is inverted.

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

        Parameters:
        event - is the source of the event.
        Returns:
        true if the events was fired, otherwise false.
      • onBusItineraryHaltAdded

        protected boolean onBusItineraryHaltAdded​(BusItineraryHalt halt,
                                                  int index,
                                                  BusChangeEvent event)
        Invoked when a bus itinerary halt was added in the attached itinerary.

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

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

        protected boolean onBusItineraryHaltRemoved​(BusItineraryHalt halt,
                                                    int index,
                                                    BusChangeEvent event)
        Invoked when a bus itinerary halt was removed from the attached itinerary.

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

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

        protected boolean onAllBusItineraryHaltRemoved​(BusChangeEvent event)
        Invoked when all the bus itinerary halts were removed from the attached itinerary.

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

        Parameters:
        event - is the source of the event.
        Returns:
        true if the events was fired, otherwise false.
      • onBusItineraryHaltChanged

        protected boolean onBusItineraryHaltChanged​(BusItineraryHalt halt,
                                                    int index,
                                                    BusChangeEvent event)
        Invoked when a bus itinerary halt was changed in the attached itinerary.

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

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

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

        @Pure
        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.
      • getBusItinerary

        @Pure
        public BusItinerary getBusItinerary()
        Replies the bus itinerary displayed by this layer.
        Returns:
        the bus itinerary displayed by this layer.
      • isValidLayer

        @Pure
        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