I have to change dynamically the border color of an agent. The agent is represented as the default circle on the display. The displayed color has to change according to a boolean variable defined inside the agent Class. When the agent is created and displayed for the first time, it has the correct style but when the boolen variable inside the agent class changes, the border color does not change. If I do the same for the fill color of the agent instead, it works fine. I put here the code I used:
public class NodeStyle extends DefaultStyleOGL2D{
@Override
public Color getBorderColor(Object agent) {
Color borderColor = Color.BLACK;
if(agent instanceof Process) {
Process p = (Process)agent;
if(p.isParticularNode) {
borderColor = Color.RED;
}
}
return borderColor;
}
}
When the agent is created and it is added to the context, it take the correct color but if isParticularNode
changes, the border color does not change.
I've tryed also to do the same importing the interface StyleOGL2D
but the problem remains