Package org.jzy3d.chart
Class Chart
- java.lang.Object
-
- org.jzy3d.chart.Chart
-
- Direct Known Subclasses:
AWTChart
,DepthPeelingChart
,GraphChart
,SWTChart
public class Chart extends Object
Chart
is a convenient object that gather all components required to render a 3d scene for plotting.- Author:
- Martin Pernollet
-
-
Field Summary
Fields Modifier and Type Field Description protected ICanvas
canvas
protected ArrayList<AbstractCameraController>
controllers
static Quality
DEFAULT_QUALITY
protected IChartFactory
factory
protected ICameraKeyController
keyboard
protected ICameraMouseController
mouse
protected IMousePickingController
mousePicking
protected Coord3d
previousViewPointFree
protected Coord3d
previousViewPointProfile
protected Coord3d
previousViewPointTop
protected Quality
quality
protected ChartScene
scene
protected IScreenshotKeyController
screenshotKey
protected View
view
-
Constructor Summary
Constructors Modifier Constructor Description protected
Chart()
Chart(IChartFactory factory, Quality quality)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Chart
add(List<? extends Drawable> drawables)
Add a list of drawables and refresh the view of the scene once they are all added.Chart
add(Drawable drawable)
Add a drawable and refresh the view of the scene once it is added.Chart
add(Drawable drawable, boolean updateView)
Add a drawable to the scene graph of the chart.void
addController(AbstractCameraController controller)
Add aAbstractCameraController
to thisChart
.ICameraKeyController
addKeyboardCameraController()
IScreenshotKeyController
addKeyboardScreenshotController()
Light
addLight(Coord3d position)
Light
addLight(Coord3d position, Color ambiant, Color diffuse, Color specular, float radius)
ICameraMouseController
addMouseCameraController()
IMousePickingController
addMousePickingController(int clickWidth)
Chart
black()
void
clear()
protected void
clearControllerList()
protected void
configureKeyboardWithAnimator()
Switch between on demand/continuous rendering keep to false if animated to avoid double rendering keep to true otherwise the mouse does not updateprotected void
configureMouseWithAnimator()
Switch between on demand/continuous rendering keep to false if animated to avoid double rendering keep to true otherwise the mouse does not updateIFrame
display(Rectangle rectangle, String title)
void
dispose()
float
flip(float y)
IAxisLayout
getAxisLayout()
ICanvas
getCanvas()
List<AbstractCameraController>
getControllers()
IChartFactory
getFactory()
ICameraKeyController
getKeyboard()
ICameraMouseController
getMouse()
IMousePickingController
getMousePicking()
IPainter
getPainter()
Quality
getQuality()
Scale
getScale()
ChartScene
getScene()
IScreenshotKeyController
getScreenshotKey()
CameraThreadController
getThread()
View
getView()
ViewPositionMode
getViewMode()
Coord3d
getViewPoint()
View
newView()
IFrame
open()
IFrame
open(int width, int height)
IFrame
open(String title)
IFrame
open(String title, int width, int height)
IFrame
open(String title, Rectangle rect)
Open the frame if it was not opened beforevoid
remove(Drawable drawable)
void
remove(Drawable drawable, boolean updateViews)
void
removeController(AbstractCameraController controller)
void
render()
Trigger a chart rendering.Object
screenshot()
void
screenshot(File file)
Compute screenshot and save to filevoid
setAnimated(boolean status)
void
setAxeDisplayed(boolean status)
void
setQuality(Quality quality)
void
setScale(Scale scale)
void
setScale(Scale scale, boolean notify)
void
setViewMode(ViewPositionMode mode)
void
setViewPoint(Coord3d viewPoint)
IFrame
show(Rectangle rectangle, String title)
Alias fordisplay()
void
startAnimation()
void
stopAllThreads()
void
stopAnimation()
protected void
updateAnimationThreadWithQualitySettings()
void
updateProjectionsAndRender()
View
view()
Chart
view2d()
Chart
white()
-
-
-
Field Detail
-
DEFAULT_QUALITY
public static final Quality DEFAULT_QUALITY
-
factory
protected IChartFactory factory
-
quality
protected Quality quality
-
scene
protected ChartScene scene
-
view
protected View view
-
canvas
protected ICanvas canvas
-
previousViewPointFree
protected Coord3d previousViewPointFree
-
previousViewPointTop
protected Coord3d previousViewPointTop
-
previousViewPointProfile
protected Coord3d previousViewPointProfile
-
controllers
protected ArrayList<AbstractCameraController> controllers
-
mouse
protected ICameraMouseController mouse
-
mousePicking
protected IMousePickingController mousePicking
-
keyboard
protected ICameraKeyController keyboard
-
screenshotKey
protected IScreenshotKeyController screenshotKey
-
-
Constructor Detail
-
Chart
public Chart(IChartFactory factory, Quality quality)
-
Chart
protected Chart()
-
-
Method Detail
-
black
public Chart black()
-
white
public Chart white()
-
view2d
public Chart view2d()
-
clear
public void clear()
-
dispose
public void dispose()
-
render
public void render()
Trigger a chart rendering. Only usefull if chart Quality.is
-
setAnimated
public void setAnimated(boolean status)
-
updateAnimationThreadWithQualitySettings
protected void updateAnimationThreadWithQualitySettings()
-
startAnimation
public void startAnimation()
-
stopAnimation
public void stopAnimation()
-
stopAllThreads
public void stopAllThreads()
-
screenshot
public void screenshot(File file) throws IOException
Compute screenshot and save to file- Throws:
IOException
-
screenshot
public Object screenshot() throws IOException
- Throws:
IOException
-
updateProjectionsAndRender
public void updateProjectionsAndRender()
-
newView
public View newView()
-
addMouseCameraController
public ICameraMouseController addMouseCameraController()
-
configureMouseWithAnimator
protected void configureMouseWithAnimator()
Switch between on demand/continuous rendering keep to false if animated to avoid double rendering keep to true otherwise the mouse does not update
-
addMousePickingController
public IMousePickingController addMousePickingController(int clickWidth)
-
addKeyboardCameraController
public ICameraKeyController addKeyboardCameraController()
-
configureKeyboardWithAnimator
protected void configureKeyboardWithAnimator()
Switch between on demand/continuous rendering keep to false if animated to avoid double rendering keep to true otherwise the mouse does not update
-
addKeyboardScreenshotController
public IScreenshotKeyController addKeyboardScreenshotController()
-
getMouse
public ICameraMouseController getMouse()
-
getThread
public CameraThreadController getThread()
-
getMousePicking
public IMousePickingController getMousePicking()
-
getKeyboard
public ICameraKeyController getKeyboard()
-
getScreenshotKey
public IScreenshotKeyController getScreenshotKey()
-
addController
public void addController(AbstractCameraController controller)
Add aAbstractCameraController
to thisChart
. Warning: theChart
is not the owner of the controller. Disposing the chart thus just unregisters the controllers, but does not handle stopping and disposing controllers.
-
removeController
public void removeController(AbstractCameraController controller)
-
clearControllerList
protected void clearControllerList()
-
open
public IFrame open()
-
open
public IFrame open(int width, int height)
-
open
public IFrame open(String title, Rectangle rect)
Open the frame if it was not opened before- Parameters:
title
-rect
-- Returns:
-
add
public Chart add(List<? extends Drawable> drawables)
Add a list of drawables and refresh the view of the scene once they are all added.- Parameters:
drawables
-- Returns:
-
add
public Chart add(Drawable drawable)
Add a drawable and refresh the view of the scene once it is added.- Parameters:
drawable
-- Returns:
-
add
public Chart add(Drawable drawable, boolean updateView)
Add a drawable to the scene graph of the chart. If the view holds aSpaceTransformer
, then it will be applied to the drawable. This can be reset by later calling {@link Drawable#setSpaceTransformer(null)}- Parameters:
drawable
-updateView
- states if the view should be updated immediately. Should be false if adding multiple drawable at the same time.- Returns:
-
remove
public void remove(Drawable drawable)
-
remove
public void remove(Drawable drawable, boolean updateViews)
-
addLight
public Light addLight(Coord3d position, Color ambiant, Color diffuse, Color specular, float radius)
-
setAxeDisplayed
public void setAxeDisplayed(boolean status)
-
setViewPoint
public void setViewPoint(Coord3d viewPoint)
-
getViewPoint
public Coord3d getViewPoint()
-
getViewMode
public ViewPositionMode getViewMode()
-
setScale
public void setScale(Scale scale, boolean notify)
-
setScale
public void setScale(Scale scale)
-
getScale
public Scale getScale()
-
getPainter
public IPainter getPainter()
-
setViewMode
public void setViewMode(ViewPositionMode mode)
-
flip
public float flip(float y)
-
view
public View view()
-
getView
public View getView()
-
getScene
public ChartScene getScene()
-
getCanvas
public ICanvas getCanvas()
-
getAxisLayout
public IAxisLayout getAxisLayout()
-
getFactory
public IChartFactory getFactory()
-
getControllers
public List<AbstractCameraController> getControllers()
-
getQuality
public Quality getQuality()
-
setQuality
public void setQuality(Quality quality)
-
-