Class FeatureEdge
- java.lang.Object
-
- com.neotropic.flow.component.olmap.Feature
-
- com.neotropic.kuwaiba.modules.commercial.ospman.providers.ol.FeatureEdge
-
- All Implemented Interfaces:
com.neotropic.flow.component.olmap.OlMapType<elemental.json.JsonObject>
,ClickEventDispatcher
,EventDispatcher
,ModifyEndEventDispatcher
,RightClickEventDispatcher
,MapEdge
public class FeatureEdge extends com.neotropic.flow.component.olmap.Feature implements MapEdge, ClickEventDispatcher, RightClickEventDispatcher, ModifyEndEventDispatcher
A edge wrapper to features with geometry of type LineString- Author:
- Johny Andres Ortega Ruiz <johny.ortega@kuwaiba.org>
-
-
Constructor Summary
Constructors Constructor Description FeatureEdge(BusinessObjectViewEdge viewEdge, MapProvider mapProvider, com.neotropic.flow.component.olmap.VectorSource vectorSource, MetadataEntityManager mem, TranslationService ts, String textBackgroundFillColor, String styleTextFillColor, String selectedStyleTextBackgroundFillColor, String styleTextFontSize, double styleTextMinZoom)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addClickEventListener(ClickEvent.ClickEventListener clickEventListener)
Adds a click event listener.void
addPathChangedEventListener(PathChangedEvent.PathChangedEventListener pathChangedEventListener)
Adds a path changed event listener.void
addRightClickEventListener(RightClickEvent.RightClickEventListener rightClickEventListener)
Adds a right click event listener.void
computeLength(List<GeoCoordinate> controlPoints, Consumer<Double> consumerLength)
Computes edge length.void
fireClickEvent()
Dispatches the click event.void
fireModifyEndEvent(elemental.json.JsonObject feature)
Dispatches the modify end event.void
fireRightClickEvent()
Dispatches the right click event.boolean
getClickableEdge()
Gets if the edge can receives mouse events.String
getColor()
String
getEdgeLabel()
Gets the edge label.void
getEdgeLabelPosition(Consumer<GeoCoordinate> consumerEdgeLabelPosition)
Gets the label position.boolean
getEdgeVisible()
If true, the edge is visible.boolean
getEditableEdge()
Gets if the edge can be edited.Double
getLength()
Gets the edge length.boolean
getPlayAnimation()
Gets if animation is played.com.neotropic.flow.component.olmap.style.Stroke
getStroke()
BusinessObjectViewEdge
getViewEdge()
Gets the view edge.void
removeAllClickEventListeners()
Removes all click event listener.void
removeAllPathChangedEventListeners()
Removes all path changed event listener.void
removeAllRightClickEventListeners()
Removes all right click event listener.void
removeClickEventListener(ClickEvent.ClickEventListener clickEventListener)
Removes a click event listener.void
removePathChangedEventListener(PathChangedEvent.PathChangedEventListener pathChangedEventListener)
Removes a path changed event listener.void
removeRightClickEventListener(RightClickEvent.RightClickEventListener rightClickEventListener)
Removes a right click event listener.void
setClickableEdge(boolean clickable)
Sets if the edge can receives mouse events.void
setControlPoints(List<GeoCoordinate> controlPoints)
Sets the edge control points.void
setEdgeLabel(String label)
Sets the edge label.void
setEdgeVisible(boolean visible)
If true, the edge is visible.void
setEditableEdge(boolean editable)
Sets if the edge can be edited.void
setLength(Double length)
Sets the edge length.void
setPlayAnimation(boolean playAnimation)
Sets true to play animation.
-
-
-
Constructor Detail
-
FeatureEdge
public FeatureEdge(BusinessObjectViewEdge viewEdge, MapProvider mapProvider, com.neotropic.flow.component.olmap.VectorSource vectorSource, MetadataEntityManager mem, TranslationService ts, String textBackgroundFillColor, String styleTextFillColor, String selectedStyleTextBackgroundFillColor, String styleTextFontSize, double styleTextMinZoom)
-
-
Method Detail
-
getColor
public String getColor()
-
getStroke
public com.neotropic.flow.component.olmap.style.Stroke getStroke()
-
getViewEdge
public BusinessObjectViewEdge getViewEdge()
Description copied from interface:MapEdge
Gets the view edge.- Specified by:
getViewEdge
in interfaceMapEdge
- Returns:
- the view edge.
-
getEdgeLabel
public String getEdgeLabel()
Description copied from interface:MapEdge
Gets the edge label.- Specified by:
getEdgeLabel
in interfaceMapEdge
- Returns:
- Edge label.
-
setEdgeLabel
public void setEdgeLabel(String label)
Description copied from interface:MapEdge
Sets the edge label.- Specified by:
setEdgeLabel
in interfaceMapEdge
- Parameters:
label
- Edge label.
-
setControlPoints
public void setControlPoints(List<GeoCoordinate> controlPoints)
Description copied from interface:MapEdge
Sets the edge control points.- Specified by:
setControlPoints
in interfaceMapEdge
- Parameters:
controlPoints
- The edge control points.
-
getClickableEdge
public boolean getClickableEdge()
Description copied from interface:MapEdge
Gets if the edge can receives mouse events.- Specified by:
getClickableEdge
in interfaceMapEdge
- Returns:
- If true, the edge can receives mouse events.
-
setClickableEdge
public void setClickableEdge(boolean clickable)
Description copied from interface:MapEdge
Sets if the edge can receives mouse events.- Specified by:
setClickableEdge
in interfaceMapEdge
- Parameters:
clickable
- True to receives mouse events.
-
getEditableEdge
public boolean getEditableEdge()
Description copied from interface:MapEdge
Gets if the edge can be edited.- Specified by:
getEditableEdge
in interfaceMapEdge
- Returns:
- If true, the edge can be edited.
-
setEditableEdge
public void setEditableEdge(boolean editable)
Description copied from interface:MapEdge
Sets if the edge can be edited.- Specified by:
setEditableEdge
in interfaceMapEdge
- Parameters:
editable
- True to edit the edge.
-
getPlayAnimation
public boolean getPlayAnimation()
Description copied from interface:MapEdge
Gets if animation is played.- Specified by:
getPlayAnimation
in interfaceMapEdge
- Returns:
- If animation is played.
-
setPlayAnimation
public void setPlayAnimation(boolean playAnimation)
Description copied from interface:MapEdge
Sets true to play animation.- Specified by:
setPlayAnimation
in interfaceMapEdge
- Parameters:
playAnimation
- True to play animation.
-
getEdgeLabelPosition
public void getEdgeLabelPosition(Consumer<GeoCoordinate> consumerEdgeLabelPosition)
Description copied from interface:MapEdge
Gets the label position.- Specified by:
getEdgeLabelPosition
in interfaceMapEdge
-
getEdgeVisible
public boolean getEdgeVisible()
Description copied from interface:MapEdge
If true, the edge is visible.- Specified by:
getEdgeVisible
in interfaceMapEdge
- Returns:
- If true, the edge is visible.
-
setEdgeVisible
public void setEdgeVisible(boolean visible)
Description copied from interface:MapEdge
If true, the edge is visible.- Specified by:
setEdgeVisible
in interfaceMapEdge
- Parameters:
visible
- If true, the edge is visible.
-
getLength
public Double getLength()
Description copied from interface:MapEdge
Gets the edge length.
-
setLength
public void setLength(Double length)
Description copied from interface:MapEdge
Sets the edge length.
-
computeLength
public void computeLength(List<GeoCoordinate> controlPoints, Consumer<Double> consumerLength)
Description copied from interface:MapEdge
Computes edge length.- Specified by:
computeLength
in interfaceMapEdge
- Parameters:
controlPoints
- Set of control points.consumerLength
- Accepted on compute length end.
-
addClickEventListener
public void addClickEventListener(ClickEvent.ClickEventListener clickEventListener)
Description copied from interface:MapEdge
Adds a click event listener.- Specified by:
addClickEventListener
in interfaceMapEdge
- Parameters:
clickEventListener
- Callback executed on edge click.
-
removeClickEventListener
public void removeClickEventListener(ClickEvent.ClickEventListener clickEventListener)
Description copied from interface:MapEdge
Removes a click event listener.- Specified by:
removeClickEventListener
in interfaceMapEdge
- Parameters:
clickEventListener
- Callback executed on edge click.
-
removeAllClickEventListeners
public void removeAllClickEventListeners()
Description copied from interface:MapEdge
Removes all click event listener.- Specified by:
removeAllClickEventListeners
in interfaceMapEdge
-
addRightClickEventListener
public void addRightClickEventListener(RightClickEvent.RightClickEventListener rightClickEventListener)
Description copied from interface:MapEdge
Adds a right click event listener.- Specified by:
addRightClickEventListener
in interfaceMapEdge
- Parameters:
rightClickEventListener
- Callback executed on edge right click.
-
removeRightClickEventListener
public void removeRightClickEventListener(RightClickEvent.RightClickEventListener rightClickEventListener)
Description copied from interface:MapEdge
Removes a right click event listener.- Specified by:
removeRightClickEventListener
in interfaceMapEdge
- Parameters:
rightClickEventListener
- Callback executed on edge right click.
-
removeAllRightClickEventListeners
public void removeAllRightClickEventListeners()
Description copied from interface:MapEdge
Removes all right click event listener.- Specified by:
removeAllRightClickEventListeners
in interfaceMapEdge
-
addPathChangedEventListener
public void addPathChangedEventListener(PathChangedEvent.PathChangedEventListener pathChangedEventListener)
Description copied from interface:MapEdge
Adds a path changed event listener.- Specified by:
addPathChangedEventListener
in interfaceMapEdge
- Parameters:
pathChangedEventListener
- Callback executed on edge path changed.
-
removePathChangedEventListener
public void removePathChangedEventListener(PathChangedEvent.PathChangedEventListener pathChangedEventListener)
Description copied from interface:MapEdge
Removes a path changed event listener.- Specified by:
removePathChangedEventListener
in interfaceMapEdge
- Parameters:
pathChangedEventListener
- Callback executed on edge path changed.
-
removeAllPathChangedEventListeners
public void removeAllPathChangedEventListeners()
Description copied from interface:MapEdge
Removes all path changed event listener.- Specified by:
removeAllPathChangedEventListeners
in interfaceMapEdge
-
fireClickEvent
public void fireClickEvent()
Description copied from interface:ClickEventDispatcher
Dispatches the click event.- Specified by:
fireClickEvent
in interfaceClickEventDispatcher
-
fireRightClickEvent
public void fireRightClickEvent()
Description copied from interface:RightClickEventDispatcher
Dispatches the right click event.- Specified by:
fireRightClickEvent
in interfaceRightClickEventDispatcher
-
fireModifyEndEvent
public void fireModifyEndEvent(elemental.json.JsonObject feature)
Description copied from interface:ModifyEndEventDispatcher
Dispatches the modify end event.- Specified by:
fireModifyEndEvent
in interfaceModifyEndEventDispatcher
-
-