public class LinkToAgentImpl<T extends Agent,A extends Agent> extends java.lang.Object implements LinkToAgent<T,A>
Constructor and Description |
---|
LinkToAgentImpl(A owner,
LinkToAgentAnimationSettings commonAnimationSettings) |
Modifier and Type | Method and Description |
---|---|
void |
connectTo(T a)
Creates a uni-directional connection between this agent and a given
other agent.
|
void |
copyFrom_xjal(LinkToAgentAnimationSettings linkToAgentMyAnimationSettings) |
void |
deliver(java.lang.Object msg)
Delivers a message to connected given agent immediately during this method call.
|
boolean |
disconnect()
Disconnects this agent from another given agent.
|
void |
doConnect_xjal(T a)
This method is internal and shouldn't be called by user.
|
void |
doDisconnect_xjal(T a)
This method is internal and shouldn't be called by user.
|
double |
getArrowLocation() |
LineArrowStyle |
getArrowStyle() |
AbstractLinkToAgent<A,T> |
getBidirectionalPeer_xjal(T agent)
This method is internal and shouldn't be called by user.
|
T |
getConnectedAgent()
Returns connected agent
|
java.awt.Color |
getLineColor() |
LineStyle |
getLineStyle() |
double |
getLineWidth() |
LinkToAgentAnimationSettings |
getLinkToAgentCommonAnimationSettings()
Returns link animation settings shared by the all the agents having this link.
|
LinkToAgentAnimationSettings |
getLinkToAgentMyAnimationSettings()
Returns link animation settings for this particular agent.
|
A |
getOwner() |
boolean |
isConnected()
Tests if this link is connected to some agent.
|
boolean |
isDeliverToAgent_xjal()
Override this function for agent links which should call agent's "On Receive" code
(which is defined in a standard 'connections' link).
|
boolean |
isVisible() |
void |
onDestroy()
Discards the link and disconnects it if it is bidirectional.
|
void |
onDestroy(Agent agent) |
void |
onReceive(java.lang.Object msg,
Agent sender)
This method is internal and shouldn't be called by user.
|
void |
send(java.lang.Object msg)
Sends a message to connected agent.
|
void |
setArrowLocation(double arrowLocation) |
void |
setArrowStyle(LineArrowStyle arrowStyle) |
void |
setLineColor(java.awt.Color lineColor) |
void |
setLineStyle(LineStyle lineStyle) |
void |
setLineWidth(double lineWidth) |
void |
setVisible(boolean visible) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLinkToAgentCommonAnimationSettings, getLinkToAgentMyAnimationSettings, isDeliverToAgent_xjal
public LinkToAgentImpl(A owner, LinkToAgentAnimationSettings commonAnimationSettings)
public T getConnectedAgent()
LinkToAgent
getConnectedAgent
in interface LinkToAgent<T extends Agent,A extends Agent>
null
if this link isn't connectedpublic boolean isConnected()
LinkToAgent
isConnected
in interface LinkToAgent<T extends Agent,A extends Agent>
true
if the link is connected, false
otherwiseLinkToAgent.getConnectedAgent()
@AnyLogicInternalAPI public void doConnect_xjal(T a)
doConnect_xjal
in interface AbstractLinkToAgent<T extends Agent,A extends Agent>
@AnyLogicInternalAPI public void doDisconnect_xjal(T a)
doDisconnect_xjal
in interface AbstractLinkToAgent<T extends Agent,A extends Agent>
@AnyLogicInternalCodegenAPI public void onReceive(java.lang.Object msg, Agent sender)
public void connectTo(T a)
LinkToAgent
public boolean disconnect()
LinkToAgent
disconnect
in interface LinkToAgent<T extends Agent,A extends Agent>
true
if the agents were connected, false
otherwisepublic void send(java.lang.Object msg)
LinkToAgent
public void deliver(java.lang.Object msg)
LinkToAgent
@AnyLogicInternalCodegenAPI public AbstractLinkToAgent<A,T> getBidirectionalPeer_xjal(T agent)
AbstractLinkToAgent
getBidirectionalPeer_xjal
in interface AbstractLinkToAgent<T extends Agent,A extends Agent>
public A getOwner()
@AnyLogicInternalCodegenAPI public void onDestroy()
AbstractLinkToAgent
@AnyLogicInternalAPI public void onDestroy(Agent agent)
onDestroy
in interface AgentDestroyListener
public LinkToAgentAnimationSettings getLinkToAgentCommonAnimationSettings()
AbstractLinkToAgent
getLinkToAgentCommonAnimationSettings
in interface AbstractLinkToAgent<T extends Agent,A extends Agent>
getLinkToAgentCommonAnimationSettings
in interface LinkToAgentAnimationSettings
public LinkToAgentAnimationSettings getLinkToAgentMyAnimationSettings()
AbstractLinkToAgent
getLinkToAgentMyAnimationSettings
in interface AbstractLinkToAgent<T extends Agent,A extends Agent>
@AnyLogicInternalCodegenAPI public boolean isDeliverToAgent_xjal()
false
isDeliverToAgent_xjal
in interface AbstractLinkToAgent<T extends Agent,A extends Agent>
@AnyLogicInternalAPI public boolean isVisible()
isVisible
in interface LinkToAgentAnimationSettings
@AnyLogicInternalAPI public void setVisible(boolean visible)
setVisible
in interface LinkToAgentAnimationSettings
@AnyLogicInternalAPI public java.awt.Color getLineColor()
getLineColor
in interface LinkToAgentAnimationSettings
@AnyLogicInternalAPI public void setLineColor(java.awt.Color lineColor)
setLineColor
in interface LinkToAgentAnimationSettings
@AnyLogicInternalAPI public double getLineWidth()
getLineWidth
in interface LinkToAgentAnimationSettings
@AnyLogicInternalAPI public void setLineWidth(double lineWidth)
setLineWidth
in interface LinkToAgentAnimationSettings
@AnyLogicInternalAPI public LineStyle getLineStyle()
getLineStyle
in interface LinkToAgentAnimationSettings
@AnyLogicInternalAPI public void setLineStyle(LineStyle lineStyle)
setLineStyle
in interface LinkToAgentAnimationSettings
@AnyLogicInternalAPI public LineArrowStyle getArrowStyle()
getArrowStyle
in interface LinkToAgentAnimationSettings
@AnyLogicInternalAPI public void setArrowStyle(LineArrowStyle arrowStyle)
setArrowStyle
in interface LinkToAgentAnimationSettings
@AnyLogicInternalAPI public double getArrowLocation()
getArrowLocation
in interface LinkToAgentAnimationSettings
@AnyLogicInternalAPI public void setArrowLocation(double arrowLocation)
setArrowLocation
in interface LinkToAgentAnimationSettings
@AnyLogicInternalAPI public void copyFrom_xjal(LinkToAgentAnimationSettings linkToAgentMyAnimationSettings)
copyFrom_xjal
in interface LinkToAgentAnimationSettings
Copyright © AnyLogic North America, LLC. All Rights Reserved.