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 doubleThe 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 aGraphics2Dinstance.Returns the dimensions of the 3D object.doubleReturns the projection distance.Returns the 2D offset for the scene.Returns the view point.voidsetProjDistance(double dist) Sets the projection distance.voidsetTranslate2D(Offset2D offset) Sets the translation offset.voidsetViewPoint(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 (nullnot permitted).
-
-
Method Details
-
getDimensions
Returns the dimensions of the 3D object.- Specified by:
getDimensionsin interfaceDrawable3D- Returns:
- The dimensions.
-
getViewPoint
Returns the view point.- Specified by:
getViewPointin interfaceDrawable3D- Returns:
- The view point (never
null).
-
setViewPoint
Sets the view point.- Specified by:
setViewPointin interfaceDrawable3D- Parameters:
viewPoint- the view point (nullnot 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:
getProjDistancein interfaceDrawable3D- Returns:
- The projection distance.
- Since:
- 1.2
-
setProjDistance
Sets the projection distance.- Specified by:
setProjDistancein interfaceDrawable3D- Parameters:
dist- the distance.- Since:
- 1.2
-
getTranslate2D
Description copied from interface:Drawable3DReturns the 2D offset for the scene. Normally this will default to(0, 0).- Specified by:
getTranslate2Din interfaceDrawable3D- Returns:
- The translation offset (never
null).
-
setTranslate2D
Description copied from interface:Drawable3DSets 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:
setTranslate2Din interfaceDrawable3D- Parameters:
offset- the translation offset (nullnot permitted).
-
draw
Draws the current view to aGraphics2Dinstance.- Specified by:
drawin interfaceDrawable3D- Parameters:
g2- the graphics target (nullnot permitted).bounds- the bounds (nullnot permitted).- Returns:
- The rendering state.
-