package org.opentrafficsim.draw.network; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Graphics2D; import java.awt.geom.Ellipse2D; import java.awt.geom.GeneralPath; import java.awt.geom.Path2D; import java.awt.image.ImageObserver; import java.io.Serializable; import java.rmi.RemoteException; import javax.naming.NamingException; import org.opentrafficsim.core.geometry.Bounds; import org.opentrafficsim.core.geometry.DirectedPoint; import org.opentrafficsim.core.network.Link; import org.opentrafficsim.core.network.LinkType; import org.opentrafficsim.core.network.Node; import org.opentrafficsim.draw.core.ClonableRenderable2DInterface; import org.opentrafficsim.draw.core.TextAlignment; import org.opentrafficsim.draw.core.TextAnimation; import org.opentrafficsim.draw.core.TextAnimation.ScaleDependentRendering; import nl.tudelft.simulation.dsol.animation.Locatable; import nl.tudelft.simulation.dsol.animation.D2.Renderable2D; import nl.tudelft.simulation.dsol.simulators.SimulatorInterface; import nl.tudelft.simulation.introspection.DelegateIntrospection; /** *
* Copyright (c) 2013-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
* BSD-style license. See OpenTrafficSim License.
*
* $LastChangedDate: 2018-10-11 22:54:04 +0200 (Thu, 11 Oct 2018) $, @version $Revision: 4696 $, by $Author: averbraeck $,
* initial version Oct 17, 2014
* Copyright (c) 2013-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
*
* @author Alexander Verbraeck
*/
@SuppressWarnings("rawtypes")
public class NodeAnimation extends Renderable2D
* BSD-style license. See OpenTrafficSim License.
*
* @author Alexander Verbraeck
* @author Peter Knoppers
* @author Wouter Schakel
*/
public class Text extends TextAnimation
{
/** */
private static final long serialVersionUID = 20161211L;
/**
* @param source Locatable; the object for which the text is displayed
* @param text String; the text to display
* @param dx float; the horizontal movement of the text, in meters
* @param dy float; the vertical movement of the text, in meters
* @param textPlacement TextAlignment; where to place the text
* @param color Color; the color of the text
* @param simulator SimulatorInterface.TimeDoubleUnit; the simulator
* @param scaleDependentRendering ScaleDependendentRendering; size limiter for text animation
* @throws NamingException when animation context cannot be created or retrieved
* @throws RemoteException - when remote context cannot be found
*/
@SuppressWarnings("checkstyle:parameternumber")
public Text(final Locatable source, final String text, final float dx, final float dy,
final TextAlignment textPlacement, final Color color, final SimulatorInterface.TimeDoubleUnit simulator,
final ScaleDependentRendering scaleDependentRendering) throws RemoteException, NamingException
{
super(source, text, dx, dy, textPlacement, color, 2.0f, 12.0f, 50f, simulator, scaleDependentRendering);
setFlip(false);
setRotate(false);
}
/** {@inheritDoc} */
@Override
@SuppressWarnings("checkstyle:designforextension")
public TextAnimation clone(final Locatable newSource, final SimulatorInterface.TimeDoubleUnit newSimulator)
throws RemoteException, NamingException
{
return new Text(newSource, getText(), getDx(), getDy(), getTextAlignment(), getColor(), newSimulator,
getScaleDependentRendering());
}
/** {@inheritDoc} */
@Override
public final String toString()
{
return "NodeAnimation.Text []";
}
}
}