Package org.djutils.draw
Interface Drawable<P extends Point<P>>
- Type Parameters:
P- The point type (2d or 3d)
- All Superinterfaces:
Iterable<P>,Serializable
- All Known Subinterfaces:
Bounds<B,,P> Drawable2d,Drawable3d,LineSegment<P,,D> Point<P>,PolyLine<L,P, R, D, LS>
- All Known Implementing Classes:
Bounds2d,Bounds3d,DirectedPoint2d,DirectedPoint3d,LineSegment2d,LineSegment3d,OrientedPoint3d,Point2d,Point3d,Polygon2d,Polygon3d,PolyLine2d,PolyLine3d,Ray2d,Ray3d,Surface3d
Drawable is an interface to indicate zero or more points can be retrieved to draw the object.
Copyright (c) 2020-2025 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUTILS License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Method Summary
Modifier and TypeMethodDescriptionintReturn the number of dimensions.Create a list of all points that make up this Drawable.intsize()Retrieve the number of points that make up the object.toString()Produce a string describing the Drawable using default conversion for the (double) coordinate values.default StringtoString(boolean doNotIncludeClassName) Produce a String describing the Drawable.default StringProduce a String describing the Drawable.Produce a String describing the Drawable.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
getPointList
Create a list of all points that make up this Drawable. This method is expensive as a new list is constructed on each invocation.- Returns:
- a list containing all points of this Drawable
-
size
int size()Retrieve the number of points that make up the object.- Returns:
- the number of points that make up the object
-
getDimensions
int getDimensions()Return the number of dimensions.- Returns:
- the number of dimensions
-
toString
String toString()Produce a string describing the Drawable using default conversion for the (double) coordinate values. Regrettably, it is not allowed to provide a default implementation here. -
toString
Produce a String describing the Drawable.- Parameters:
doubleFormat- a format string (something like "%6.3f") which will be used to render every coordinate value)doNotIncludeClassName- iftrue; the output oftoStringis not prefixed by the class name. This is useful for concatenating the textual representation of lots of Drawables (e.g. an array, or a List).- Returns:
- textual representation of the Drawable
-
toString
Produce a String describing the Drawable.- Parameters:
doubleFormat- a format string (something like "%6.3f") which will be used to render every coordinate value)- Returns:
- textual representation of the Drawable
-
toString
Produce a String describing the Drawable.- Parameters:
doNotIncludeClassName- iftrue; the output oftoStringis not prefixed by the class name. This is useful for concatenating the textual representation of lots of Drawables (e.g. an array, or a List).- Returns:
- textual representation of the Drawable
-