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
Chartis 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 ICanvascanvasprotected ArrayList<AbstractCameraController>controllersstatic QualityDEFAULT_QUALITYprotected IChartFactoryfactoryprotected ICameraKeyControllerkeyboardprotected ICameraMouseControllermouseprotected IMousePickingControllermousePickingprotected Coord3dpreviousViewPointFreeprotected Coord3dpreviousViewPointProfileprotected Coord3dpreviousViewPointTopprotected Qualityqualityprotected ChartScenesceneprotected IScreenshotKeyControllerscreenshotKeyprotected Viewview
-
Constructor Summary
Constructors Modifier Constructor Description protectedChart()Chart(IChartFactory factory, Quality quality)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Chartadd(List<? extends Drawable> drawables)Add a list of drawables and refresh the view of the scene once they are all added.Chartadd(Drawable drawable)Add a drawable and refresh the view of the scene once it is added.Chartadd(Drawable drawable, boolean updateView)Add a drawable to the scene graph of the chart.voidaddController(AbstractCameraController controller)Add aAbstractCameraControllerto thisChart.ICameraKeyControlleraddKeyboardCameraController()IScreenshotKeyControlleraddKeyboardScreenshotController()LightaddLight(Coord3d position)LightaddLight(Coord3d position, Color ambiant, Color diffuse, Color specular, float radius)ICameraMouseControlleraddMouseCameraController()IMousePickingControlleraddMousePickingController(int clickWidth)Chartblack()voidclear()protected voidclearControllerList()protected voidconfigureKeyboardWithAnimator()Switch between on demand/continuous rendering keep to false if animated to avoid double rendering keep to true otherwise the mouse does not updateprotected voidconfigureMouseWithAnimator()Switch between on demand/continuous rendering keep to false if animated to avoid double rendering keep to true otherwise the mouse does not updateIFramedisplay(Rectangle rectangle, String title)voiddispose()floatflip(float y)IAxisLayoutgetAxisLayout()ICanvasgetCanvas()List<AbstractCameraController>getControllers()IChartFactorygetFactory()ICameraKeyControllergetKeyboard()ICameraMouseControllergetMouse()IMousePickingControllergetMousePicking()IPaintergetPainter()QualitygetQuality()ScalegetScale()ChartScenegetScene()IScreenshotKeyControllergetScreenshotKey()CameraThreadControllergetThread()ViewgetView()ViewPositionModegetViewMode()Coord3dgetViewPoint()ViewnewView()IFrameopen()IFrameopen(int width, int height)IFrameopen(String title)IFrameopen(String title, int width, int height)IFrameopen(String title, Rectangle rect)Open the frame if it was not opened beforevoidremove(Drawable drawable)voidremove(Drawable drawable, boolean updateViews)voidremoveController(AbstractCameraController controller)voidrender()Trigger a chart rendering.Objectscreenshot()voidscreenshot(File file)Compute screenshot and save to filevoidsetAnimated(boolean status)voidsetAxeDisplayed(boolean status)voidsetQuality(Quality quality)voidsetScale(Scale scale)voidsetScale(Scale scale, boolean notify)voidsetViewMode(ViewPositionMode mode)voidsetViewPoint(Coord3d viewPoint)IFrameshow(Rectangle rectangle, String title)Alias fordisplay()voidstartAnimation()voidstopAllThreads()voidstopAnimation()protected voidupdateAnimationThreadWithQualitySettings()voidupdateProjectionsAndRender()Viewview()Chartview2d()Chartwhite()
-
-
-
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 aAbstractCameraControllerto thisChart. Warning: theChartis 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)
-
-