AnyLogic
Expand
Font size
All Implemented Interfaces:
AggregatableAnimationElement, AnimationStaticLocationProvider, HasLevel, IMarkupLibraryDescriptor, INetworkMarkupElement, INode<Node,​Path>, LevelElement, LevelMarkup, MarkupPort, com.anylogic.engine.markup.material_handling.IMaterialMarkupLibraryDescriptor, com.anylogic.engine.markup.material_handling.INodeDescriptor<Agent>, NetworkPort, SVGElement, java.io.Serializable

@AnyLogicInternalAPI
public class NetworkPortImpl
extends Node
implements NetworkPort
See Also:
Serialized Form

Constructor Summary

Constructors 
NetworkPortImpl​(Agent owner, ShapeDrawMode drawMode, boolean isPublic, PathEnd<Path> pathEnd)  
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods 
void addConnection​(Path path, PathEndType type)  
boolean contains​(double px, double py)
Test if the shape contains the point with the given coordinates (relative to this shape's container, i.e.
java.awt.Color getLineColor()
Returns the line color of the markup element, or null if markup element has no line color or has textured line (in this case Node.getLineTexture() should be used instead)
Texture getLineTexture()
Returns the line texture of the markup element, if the markup element has line texture
double getNearestPoint​(double x, double y, double z, Point output)
Calculates (using the output object) the point in this space markup element nearest to the given (x, y, z) point.
double getNearestPoint​(double x, double y, Point output)
Calculates (using the output object) the point in this space markup element nearest to the given (x, y) point.
MarkupPort getPairedPort()
Returns the paired port for this markup port.
Position getPosition()  
Position getPosition​(int index, int totalNumber, Position out)
Returns the item position with the given index.
In case of any wrong argument returns zero-index position (position for index=0 with totalNumber=1).
Position getPosition​(Position out)  
Point getXYZ()  
Point getXYZ​(Point out)  
double getZ()
Returns the z coordinate of the node.
Point randomPointInside​(java.util.Random rng, Point out)
Returns the randomly chosen point inside/along the given space markup element.
void setLineColor​(java.awt.Color lineColor)
Sets the line color of the markup element.
void setLineColor​(java.awt.Paint lineColor)
Sets the line color (or Texture) of the markup element.
void setPairedPort​(MarkupPort pairedPort)
Sets the paired port for this markup port.
Modifier and Type Method Description

Methods inherited from class com.anylogic.engine.markup.Node

getCompatibleAgentExtensionClass, getConnection, getConnectionsCount, getFillColor, getFillTexture, getMaterialLibraryDescriptor, getMaxSpeed, getNumberOfTransporters, getTransferDistance, getTransferPositionByPercent, getTransporter, getTransporters, isLimitSpeed, setFillColor, setFillColor, setLimitSpeed, setMaxSpeed

Methods inherited from class com.anylogic.engine.markup.NetworkMarkupElement

getDrawMode, getLevel, getNearestPoint, getNearestPoint, getNearestPoint, getNetwork, setLevel

Methods inherited from class com.anylogic.engine.markup.MarkupShape

error, getFullName, getOutsideLevelZ, getPresentable, getSpace, initialize, isClickHandled, isPublic, onClick, remove, setDrawMode, setOwner

Methods inherited from class com.anylogic.engine.markup.AbstractMarkup

discardOwner, executeUserAction, findSVGElement, getName, getSVGId, initializeInternal, isVisible, onAggregatorInitialized, onAggregatorVisibilityChanged, removeSVGFromOwner, resetSVGState, setVisible, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGProperties

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement

initializeInternal, onAggregatorVisibilityChanged, postInitialize

Methods inherited from interface com.anylogic.engine.markup.AnimationStaticLocationProvider

getSpace

Methods inherited from interface com.anylogic.engine.markup.HasLevel

getLevel

Methods inherited from interface com.anylogic.engine.markup.material_handling.IMaterialMarkupLibraryDescriptor

getMarkup, setMarkup

Methods inherited from interface com.anylogic.engine.markup.INetworkMarkupElement

getNearestPoint, getNetwork, getSpace, randomPointInside, randomPointInside, randomPointInside

Methods inherited from interface com.anylogic.engine.markup.INode

getName

Methods inherited from interface com.anylogic.engine.markup.LevelElement

setLevel

Methods inherited from interface com.anylogic.engine.markup.MarkupPort

getFullName, getLevel, getName

Methods inherited from interface com.anylogic.engine.markup.NetworkPort

getNetwork

Constructor Detail

NetworkPortImpl

@AnyLogicInternalAPI
public NetworkPortImpl​(Agent owner,
                       ShapeDrawMode drawMode,
                       boolean isPublic,
                       PathEnd<Path> pathEnd)

Method Detail

setPairedPort

@AnyLogicInternalCodegenAPI
public void setPairedPort​(MarkupPort pairedPort)
Description copied from interface: MarkupPort
Sets the paired port for this markup port.
Specified by:
setPairedPort in interface MarkupPort
Parameters:
pairedPort - - a markup port from another

getPairedPort

public MarkupPort getPairedPort()
Description copied from interface: MarkupPort
Returns the paired port for this markup port.
Specified by:
getPairedPort in interface MarkupPort
Returns:
the paired port for this markup port

addConnection

public void addConnection​(Path path,
                          PathEndType type)
Specified by:
addConnection in interface INode<Node,​Path>
Overrides:
addConnection in class Node

getXYZ

public Point getXYZ()
Specified by:
getXYZ in interface MarkupPort

getXYZ

public Point getXYZ​(Point out)

getPosition

public Position getPosition()

getPosition

public Position getPosition​(Position out)

randomPointInside

public Point randomPointInside​(java.util.Random rng,
                               Point out)
Description copied from interface: INetworkMarkupElement
Returns the randomly chosen point inside/along the given space markup element. This method utilises the given Random Number Generator.
Specified by:
randomPointInside in interface INetworkMarkupElement
Parameters:
rng - the random number generator.
out - output object to write to, may be null
Returns:
the randomly chosen point

getPosition

public Position getPosition​(int index,
                            int totalNumber,
                            Position out)
Description copied from interface: AnimationStaticLocationProvider
Returns the item position with the given index.
In case of any wrong argument returns zero-index position (position for index=0 with totalNumber=1).
Specified by:
getPosition in interface AnimationStaticLocationProvider
Parameters:
index - the index of some item positions, should be not negative and less than totalNumber
totalNumber - the total number of item positions, should be positive
out - output object to write to, may be null
Returns:
the Position object with coordinates of the requested item position

getNearestPoint

public double getNearestPoint​(double x,
                              double y,
                              Point output)
Description copied from class: NetworkMarkupElement
Calculates (using the output object) the point in this space markup element nearest to the given (x, y) point. Returns the square of distance to the point (in the XY-projection). All the calculations are performed in the horizontal projection (z-coordinates aren't used, as if all of the z coordinates were zero).
Specified by:
getNearestPoint in class NetworkMarkupElement
Parameters:
x - x coordinate of the point
y - y coordinate of the point
output - the output point to write result to. Note that output.z is left unchanged.
Returns:
the square of distance to the nearest point in the horizontal (XY) projection

getNearestPoint

public double getNearestPoint​(double x,
                              double y,
                              double z,
                              Point output)
Description copied from class: NetworkMarkupElement
Calculates (using the output object) the point in this space markup element nearest to the given (x, y, z) point. Returns the square of distance to the point.
Specified by:
getNearestPoint in class NetworkMarkupElement
Parameters:
x - x coordinate of the point
y - y coordinate of the point
z - z coordinate of the point
output - the output point to write result to.
Returns:
the square of distance to the nearest point

contains

public boolean contains​(double px,
                        double py)
Description copied from class: MarkupShape
Test if the shape contains the point with the given coordinates (relative to this shape's container, i.e. in the same system with the coordinates of this shape, x and y)
Specified by:
contains in interface INetworkMarkupElement
Specified by:
contains in class MarkupShape
Parameters:
px - the x coordinate relative to this shape's container
py - the y coordinate relative to this shape's container
Returns:
true if the shape contains the point with the given coordinates

getZ

public double getZ()
Description copied from class: Node
Returns the z coordinate of the node.
Specified by:
getZ in class Node
Returns:
the z coordinate of the node

setLineColor

public void setLineColor​(java.awt.Color lineColor)
Description copied from class: Node
Sets the line color of the markup element.
Specified by:
setLineColor in class Node
Parameters:
lineColor - the new line color, null = do not draw the markup element line

setLineColor

public void setLineColor​(java.awt.Paint lineColor)
Description copied from class: Node
Sets the line color (or Texture) of the markup element.
Specified by:
setLineColor in interface INode<Node,​Path>
Specified by:
setLineColor in class Node
Parameters:
lineColor - the new line color, null = do not draw the markup element line

getLineColor

public java.awt.Color getLineColor()
Description copied from class: Node
Returns the line color of the markup element, or null if markup element has no line color or has textured line (in this case Node.getLineTexture() should be used instead)
Specified by:
getLineColor in interface INode<Node,​Path>
Specified by:
getLineColor in class Node
Returns:
the line color of the markup element

getLineTexture

public Texture getLineTexture()
Description copied from class: Node
Returns the line texture of the markup element, if the markup element has line texture
Specified by:
getLineTexture in interface INode<Node,​Path>
Specified by:
getLineTexture in class Node
Returns:
the line texture of the markup element
How can we improve this article?