Interface BusPrimitive<CONTAINER extends BusContainer<?>>
-
- Type Parameters:
CONTAINER
- is the type of the object which could contains a instance of this class.
- All Superinterfaces:
AttributeCollection
,AttributeProvider
,BoundedElement2afp<Rectangle2d>
,BoundedGISElement
,Cloneable
,FlagContainer
,GISEditable
,GISElement
,GISFlagContainer
,GISPrimitive
,JsonableObject
,Serializable
- All Known Implementing Classes:
AbstractBusContainer
,AbstractBusPrimitive
,BusHub
,BusItinerary
,BusItineraryHalt
,BusLine
,BusNetwork
,BusStop
public interface BusPrimitive<CONTAINER extends BusContainer<?>> extends BoundedGISElement, GISEditable, GISFlagContainer
A bus primitive is an object which is composing a bus network.- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:56
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.gis
- Maven Artifact Id:
- gisbus
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTR_COLOR
Attribute: color of the element.static int
DEFAULT_COLOR
Default color of a map element.-
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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addBusChangeListener(BusChangeListener listener)
Add listener.void
addGISEditableChangeListener(GISEditableChangeListener listener)
Add listener.void
fireGraphicalAttributeChanged(String propertyName, Object oldValue, Object newValue)
Invoked when one of the graphical attributes of this element has changed, except those that change the bounding boxes.void
fireGraphicalAttributeChanged(BusChangeEvent event)
Invoked when one of the graphical attributes of this element has changed, except those that change the bounding boxes.void
firePrimitiveChanged(BusChangeEvent event)
Fire the event that indicates this object has changed.void
fireShapeChanged()
Invoked when the shape of this element changed.void
fireShapeChanged(BusChangeEvent event)
Invoked when the shape of this element changed.BusNetwork
getBusNetwork()
Replies the bus network in which this primitive is.BusPrimitiveInvalidity
getInvalidityReason()
Replies the explanation of the invalidity of the primitive.boolean
isValidPrimitive()
Replies if this primitive is marked as valid.void
rebuild()
Rebuild the primitive and all the primitive inside.void
rebuild(boolean fireEvents)
Rebuild the primitive and all the primitive inside.void
removeBusChangeListener(BusChangeListener listener)
Remove listener.void
removeGISEditableChangeListener(GISEditableChangeListener listener)
Remove listener.void
revalidate()
Check if the validity of this primitive is correctly set and change its values if necessary.-
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.primitive.FlagContainer
getFlags, hasFlag, setFlag, switchFlag, unsetFlag
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISEditable
getColor, getName, getRawColor, isReadOnlyObject, setColor, 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, getGeoLocation, getUUID
-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
-
-
-
Field Detail
-
ATTR_COLOR
static final String ATTR_COLOR
Attribute: color of the element.- See Also:
- Constant Field Values
-
DEFAULT_COLOR
static final int DEFAULT_COLOR
Default color of a map element.- See Also:
- Constant Field Values
-
-
Method Detail
-
isValidPrimitive
@Pure boolean isValidPrimitive()
Replies if this primitive is marked as valid.The validity of a primitive depends on the type of this primitive. Please refers to the documentation of that primitive.
- Returns:
true
if the primitive is valid, otherwisefalse
-
getInvalidityReason
@Pure BusPrimitiveInvalidity getInvalidityReason()
Replies the explanation of the invalidity of the primitive.- Returns:
- the invalidity reason.
-
revalidate
void revalidate()
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.
-
rebuild
void rebuild()
Rebuild the primitive and all the primitive inside. Rebuilding means to reset all the internal values and recompute their values.This function should be invoked when the bus primitive was construct with its flag replied by
AttributeCollection.isEventFirable()
set tofalse
. This function permits to finalize the construction.In addition, this function automatically invoke
BoundedGISElement.resetBoundingBox()
and does the same job asrevalidate()
(but does not invoke it). This function invokesAttributeCollection.setEventFirable(boolean)
withtrue
as parameter.This function does not fire any event is
AttributeCollection.isEventFirable()
repliestrue
whenrebuild()
is invoked- Since:
- 4.0
- See Also:
rebuild(boolean)
-
rebuild
void rebuild(boolean fireEvents)
Rebuild the primitive and all the primitive inside. Rebuilding means to reset all the internal values and recompute their values.This function should be invoked when the bus primitive was construct with its flag replied by
AttributeCollection.isEventFirable()
set tofalse
. This function permits to finalize the construction.In addition, this function automatically invoke
BoundedGISElement.resetBoundingBox()
and does the same job asrevalidate()
(but does not invoke it). This function invokesAttributeCollection.setEventFirable(boolean)
withtrue
as parameter.- Parameters:
fireEvents
- indicates if the events should be fired.- Since:
- 4.0
- See Also:
rebuild()
-
getBusNetwork
@Pure BusNetwork getBusNetwork()
Replies the bus network in which this primitive is.- Returns:
- the bus network in which this primitive is.
-
addGISEditableChangeListener
void addGISEditableChangeListener(GISEditableChangeListener listener)
Description copied from interface:GISEditable
Add listener.- Specified by:
addGISEditableChangeListener
in interfaceGISEditable
- Parameters:
listener
- the listener.
-
removeGISEditableChangeListener
void removeGISEditableChangeListener(GISEditableChangeListener listener)
Description copied from interface:GISEditable
Remove listener.- Specified by:
removeGISEditableChangeListener
in interfaceGISEditable
- Parameters:
listener
- the listener.
-
addBusChangeListener
void addBusChangeListener(BusChangeListener listener)
Add listener.- Parameters:
listener
- the listener.
-
removeBusChangeListener
void removeBusChangeListener(BusChangeListener listener)
Remove listener.- Parameters:
listener
- the listener.
-
firePrimitiveChanged
void firePrimitiveChanged(BusChangeEvent event)
Fire the event that indicates this object has changed.- Parameters:
event
- the event
-
fireGraphicalAttributeChanged
void fireGraphicalAttributeChanged(String propertyName, Object oldValue, Object newValue)
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()
orfireShapeChanged()
instead ofBoundedGISElement.resetBoundingBox()
.If the attributes that change concern the shape (bounding box) of the element, prefers an invocation of
fireShapeChanged()
instead offireGraphicalAttributeChanged()
- Parameters:
propertyName
- is the name of the graphical property.oldValue
- is the old value of the property.newValue
- is the new value of the property.
-
fireGraphicalAttributeChanged
void fireGraphicalAttributeChanged(BusChangeEvent event)
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()
orfireShapeChanged()
instead ofBoundedGISElement.resetBoundingBox()
.If the attributes that change concern the shape (bounding box) of the element, prefers an invocation of
fireShapeChanged()
instead offireGraphicalAttributeChanged()
- Parameters:
event
- the event.
-
fireShapeChanged
void fireShapeChanged()
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
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
fireGraphicalAttributeChanged(String, Object, Object)
instead offireShapeChanged()
-
fireShapeChanged
void fireShapeChanged(BusChangeEvent event)
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
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
fireGraphicalAttributeChanged(String, Object, Object)
instead offireShapeChanged()
- Parameters:
event
- the event.
-
-