java.lang.Object
org.jfree.chart3d.graphics3d.DefaultDrawable3D
- All Implemented Interfaces:
Drawable3D
Provides a default implementation of the
Drawable3D
interface.
This is not used directly in Orson Charts, since the Chart3D
class
implements the Drawable3D
interface itself. However, it is used
in testing to ensure that the org.jfree.chart3d.graphics3d
package can function on a stand-alone basis.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final double
The default projection distance. -
Constructor Summary
ConstructorsConstructorDescriptionDefaultDrawable3D
(World world) Creates a new instance to display the content of the specifiedworld
. -
Method Summary
Modifier and TypeMethodDescriptiondraw
(Graphics2D g2, Rectangle2D bounds) Draws the current view to aGraphics2D
instance.Returns the dimensions of the 3D object.double
Returns the projection distance.Returns the 2D offset for the scene.Returns the view point.void
setProjDistance
(double dist) Sets the projection distance.void
setTranslate2D
(Offset2D offset) Sets the translation offset.void
setViewPoint
(ViewPoint3D viewPoint) Sets the view point.
-
Field Details
-
DEFAULT_PROJ_DIST
The default projection distance.- Since:
- 1.2
- See Also:
-
-
Constructor Details
-
DefaultDrawable3D
Creates a new instance to display the content of the specifiedworld
.- Parameters:
world
- the world to view (null
not permitted).
-
-
Method Details
-
getDimensions
Returns the dimensions of the 3D object.- Specified by:
getDimensions
in interfaceDrawable3D
- Returns:
- The dimensions.
-
getViewPoint
Returns the view point.- Specified by:
getViewPoint
in interfaceDrawable3D
- Returns:
- The view point (never
null
).
-
setViewPoint
Sets the view point.- Specified by:
setViewPoint
in interfaceDrawable3D
- Parameters:
viewPoint
- the view point (null
not permitted).
-
getProjDistance
Returns the projection distance. The default value isDEFAULT_PROJ_DIST
, higher numbers flatten out the perspective and reduce distortion in the projected image.- Specified by:
getProjDistance
in interfaceDrawable3D
- Returns:
- The projection distance.
- Since:
- 1.2
-
setProjDistance
Sets the projection distance.- Specified by:
setProjDistance
in interfaceDrawable3D
- Parameters:
dist
- the distance.- Since:
- 1.2
-
getTranslate2D
Description copied from interface:Drawable3D
Returns the 2D offset for the scene. Normally this will default to(0, 0)
.- Specified by:
getTranslate2D
in interfaceDrawable3D
- Returns:
- The translation offset (never
null
).
-
setTranslate2D
Description copied from interface:Drawable3D
Sets the translation offset. This is typically used to allow the user to modify the offset of a 2D projection on-screen by dragging with the mouse.- Specified by:
setTranslate2D
in interfaceDrawable3D
- Parameters:
offset
- the translation offset (null
not permitted).
-
draw
Draws the current view to aGraphics2D
instance.- Specified by:
draw
in interfaceDrawable3D
- Parameters:
g2
- the graphics target (null
not permitted).bounds
- the bounds (null
not permitted).- Returns:
- The rendering state.
-