Class AbstractBusContainer<CONTAINER extends BusContainer<?>,ELEMENT extends BusPrimitive<?>>
- java.lang.Object
-
- org.arakhne.afc.gis.primitive.AbstractGISElement<C,T>
-
- org.arakhne.afc.gis.primitive.AbstractBoundedGISElement<CONTAINER,AbstractBusPrimitive<CONTAINER>>
-
- org.arakhne.afc.gis.bus.network.AbstractBusPrimitive<CONTAINER>
-
- org.arakhne.afc.gis.bus.network.AbstractBusContainer<CONTAINER,ELEMENT>
-
- Type Parameters:
CONTAINER
- is the type of the object which could contains an instance of this class.ELEMENT
- is the type of the object which could be inside an instance of this class.
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<ELEMENT>
,EventListener
,AttributeChangeListener
,AttributeCollection
,AttributeProvider
,BusChangeListener
,BusContainer<ELEMENT>
,BusPrimitive<CONTAINER>
,BoundedGISElement
,FlagContainer
,GISCloneable<AbstractBusPrimitive<CONTAINER>>
,GISContainer<ELEMENT>
,GISEditable
,GISElement
,GISFlagContainer
,GISPrimitive
,BoundedElement2afp<Rectangle2d>
,InformedIterable<ELEMENT>
,JsonableObject
- Direct Known Subclasses:
BusItinerary
,BusLine
,BusNetwork
public abstract class AbstractBusContainer<CONTAINER extends BusContainer<?>,ELEMENT extends BusPrimitive<?>> extends AbstractBusPrimitive<CONTAINER> implements BusContainer<ELEMENT>
This object stands for bus primitives which are also containers of bus primitives.- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:56
- Author:
- Stéphane GALLAND
- See Also:
- Serialized Form
- Maven Group Id:
- org.arakhne.afc.gis
- Maven Artifact Id:
- gisbus
-
-
Field Summary
-
Fields inherited from class org.arakhne.afc.gis.bus.network.AbstractBusPrimitive
ATTR_COLOR, DEFAULT_COLOR
-
Fields inherited from interface org.arakhne.afc.gis.primitive.FlagContainer
FLAG_READONLY, FLAG_SELECTED
-
Fields inherited from interface org.arakhne.afc.gis.primitive.GISElement
ATTR_NAME, NAME_COMPARATOR
-
Fields inherited from interface org.arakhne.afc.gis.primitive.GISPrimitive
COMPARATOR
-
-
Constructor Summary
Constructors Constructor Description AbstractBusContainer(UUID id, AttributeCollection attributeProvider)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bindChangeListener(ChangeListener listener)
Bind the given listener to this container.void
fireGraphicalAttributeChanged(BusChangeEvent event)
Invoked when one of the graphical attributes of this element has changed, except those that change the bounding boxes.void
fireShapeChanged(BusChangeEvent event)
Invoked when the shape of this element changed.void
onBusPrimitiveChanged(BusChangeEvent event)
Invoked each time the bus primitive changed (excepts for graphical attributes).void
onBusPrimitiveGraphicalAttributeChanged(BusChangeEvent event)
Invoked each time the bus primitive graphical attributes changed.void
onBusPrimitiveShapeChanged(BusChangeEvent event)
Invoked each time the bus primitive topology changed.void
revalidate()
Check if the validity of this primitive is correctly set and change its values if necessary.-
Methods inherited from class org.arakhne.afc.gis.bus.network.AbstractBusPrimitive
addBusChangeListener, addGISEditableChangeListener, addListener, checkPrimitiveValidity, finalize, fireGraphicalAttributeChanged, firePrimitiveChanged, firePrimitiveChanged, firePrimitiveChanged, fireShapeChanged, fireValidityChanged, fireValidityChangedFor, getColor, getColor, getFlags, getGeoLocation, getInvalidityReason, getRawColor, hasFlag, indexInParent, isReadOnlyObject, isValidPrimitive, onAttributeChanged, rebuild, removeBusChangeListener, removeGISEditableChangeListener, removeListener, setColor, setFlag, setPrimitiveValidity, setReadOnlyObject, setUUID, switchFlag, toJson, unsetFlag
-
Methods inherited from class org.arakhne.afc.gis.primitive.AbstractBoundedGISElement
calcBounds, clone, getBoundingBox, resetBoundingBox, setBoundingBox
-
Methods inherited from class org.arakhne.afc.gis.primitive.AbstractGISElement
addAttributeChangeListener, addAttributes, addAttributes, attributes, copyAttributes, flush, freeMemory, getAllAttributeNames, getAllAttributes, getAllAttributesByType, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttributeAsBool, getAttributeAsDate, getAttributeAsDouble, getAttributeAsEnumeration, getAttributeAsEnumeration, getAttributeAsFloat, getAttributeAsInetAddress, getAttributeAsInt, getAttributeAsJavaClass, getAttributeAsLong, getAttributeAsString, getAttributeAsURI, getAttributeAsURL, getAttributeAsUUID, getAttributeCollection, getAttributeCount, getAttributeObject, getAttributeProvider, getContainer, getGeoId, getName, getTopContainer, getUUID, hasAttribute, hashKey, isEventFirable, onAttributeChangeEvent, removeAllAttributes, removeAttribute, removeAttributeChangeListener, renameAttribute, renameAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setAttributeType, setContainer, setEventFirable, setName, toMap, toMap, toString
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.attrs.collection.AttributeCollection
addAttributeChangeListener, addAttributes, addAttributes, flush, isEventFirable, removeAllAttributes, removeAttribute, removeAttributeChangeListener, renameAttribute, renameAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setAttributeType, setEventFirable
-
Methods inherited from interface org.arakhne.afc.attrs.collection.AttributeProvider
attributes, freeMemory, getAllAttributeNames, getAllAttributes, getAllAttributesByType, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttributeAsBool, getAttributeAsDate, getAttributeAsDouble, getAttributeAsEnumeration, getAttributeAsEnumeration, getAttributeAsFloat, getAttributeAsInetAddress, getAttributeAsInt, getAttributeAsJavaClass, getAttributeAsLong, getAttributeAsString, getAttributeAsURI, getAttributeAsURL, getAttributeAsUUID, getAttributeCount, getAttributeObject, hasAttribute, toMap, toMap
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.BoundedElement2afp
getBoundingBox
-
Methods inherited from interface org.arakhne.afc.gis.primitive.BoundedGISElement
getShape, resetBoundingBox
-
Methods inherited from interface org.arakhne.afc.gis.bus.network.BusPrimitive
getBusNetwork, rebuild
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISContainer
getColor, getName, resetBoundingBox, size
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISEditable
getName, setName
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISElement
clone, copyAttributes, getName, hashKey, setName
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISPrimitive
getGeoId, getUUID
-
Methods inherited from interface org.arakhne.afc.util.InformedIterable
getElementType
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Constructor Detail
-
AbstractBusContainer
AbstractBusContainer(UUID id, AttributeCollection attributeProvider)
Constructor.- Parameters:
id
- is the unique identifier of this element, ornull
if unknown.attributeProvider
- is the provider of attributes used by this bus stop.- Since:
- 2.0
-
-
Method Detail
-
bindChangeListener
public void bindChangeListener(ChangeListener listener)
Description copied from interface:GISContainer
Bind the given listener to this container.- Specified by:
bindChangeListener
in interfaceGISContainer<CONTAINER extends BusContainer<?>>
- Parameters:
listener
- the listener.
-
fireShapeChanged
public void fireShapeChanged(BusChangeEvent event)
Description copied from interface:BusPrimitive
Invoked when the shape of this element changed.This method also reset the bounding box to allow its re-computation (with a call to
BoundedGISElement.resetBoundingBox()
.In the implementation of a BusPrimitive, prefers to call
BusPrimitive.fireGraphicalAttributeChanged(String, Object, Object)
orfireShapeChanged()
instead ofBoundedGISElement.resetBoundingBox()
.If the attributes that change does not concern the shape (bounding box) of the element, prefers an invocation of
BusPrimitive.fireGraphicalAttributeChanged(String, Object, Object)
instead offireShapeChanged()
- Specified by:
fireShapeChanged
in interfaceBusPrimitive<CONTAINER extends BusContainer<?>>
- Overrides:
fireShapeChanged
in classAbstractBusPrimitive<CONTAINER extends BusContainer<?>>
- Parameters:
event
- the event.
-
fireGraphicalAttributeChanged
public void fireGraphicalAttributeChanged(BusChangeEvent event)
Description copied from interface:BusPrimitive
Invoked when one of the graphical attributes of this element has changed, except those that change the bounding boxes.This function does not call
BoundedGISElement.resetBoundingBox()
.In the implementation of a MapElement, prefers to call
fireGraphicalAttributeChanged()
orBusPrimitive.fireShapeChanged()
instead ofBoundedGISElement.resetBoundingBox()
.If the attributes that change concern the shape (bounding box) of the element, prefers an invocation of
BusPrimitive.fireShapeChanged()
instead offireGraphicalAttributeChanged()
- Specified by:
fireGraphicalAttributeChanged
in interfaceBusPrimitive<CONTAINER extends BusContainer<?>>
- Overrides:
fireGraphicalAttributeChanged
in classAbstractBusPrimitive<CONTAINER extends BusContainer<?>>
- Parameters:
event
- the event.
-
onBusPrimitiveShapeChanged
public void onBusPrimitiveShapeChanged(BusChangeEvent event)
Description copied from interface:BusChangeListener
Invoked each time the bus primitive topology changed.A bus network topology is composed of the bus lines, the bus itineraries, the bus stops and the bus stations.
- Specified by:
onBusPrimitiveShapeChanged
in interfaceBusChangeListener
- Parameters:
event
- the event.
-
onBusPrimitiveGraphicalAttributeChanged
public void onBusPrimitiveGraphicalAttributeChanged(BusChangeEvent event)
Description copied from interface:BusChangeListener
Invoked each time the bus primitive graphical attributes changed.- Specified by:
onBusPrimitiveGraphicalAttributeChanged
in interfaceBusChangeListener
- Parameters:
event
- the event.
-
onBusPrimitiveChanged
public void onBusPrimitiveChanged(BusChangeEvent event)
Description copied from interface:BusChangeListener
Invoked each time the bus primitive changed (excepts for graphical attributes).- Specified by:
onBusPrimitiveChanged
in interfaceBusChangeListener
- Parameters:
event
- the event.
-
revalidate
public void revalidate()
Description copied from interface:BusPrimitive
Check if the validity of this primitive is correctly set and change its values if necessary. This function revalidate also all the primitives inside this primitive.- Specified by:
revalidate
in interfaceBusPrimitive<CONTAINER extends BusContainer<?>>
- Overrides:
revalidate
in classAbstractBusPrimitive<CONTAINER extends BusContainer<?>>
-
-