Class AdaptiveMouseController
- java.lang.Object
-
- org.jzy3d.chart.controllers.AbstractController
-
- org.jzy3d.chart.controllers.camera.AbstractCameraController
-
- org.jzy3d.chart.controllers.mouse.camera.AWTCameraMouseController
-
- org.jzy3d.chart.controllers.mouse.camera.AdaptiveMouseController
-
- All Implemented Interfaces:
MouseListener,MouseMotionListener,MouseWheelListener,EventListener,ICameraMouseController
public class AdaptiveMouseController extends AWTCameraMouseController
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractAdativeRenderingHandleradaptByDroppingFaceprotected AdaptByDroppingFaceAndKeepingWireframeWithColoradaptByDroppingFaceAndColoringWireprotected AdaptByDroppingHiDPIadaptByDroppingHiDPIprotected AdaptByDroppingWireframeadaptByDroppingWireframeprotected ICanvascanvasprotected booleancurrentHiDPIprotected QualitycurrentQualityprotected List<Wireframeable>droppedFaceAndColoredWireframeToResetKeep track of drawable that have had their face disabled for optimization in order to re-activate at mouse release.protected List<Wireframeable>droppedWireframeToResetKeep track of drawable that have had their wireframe disabled for optimization in order to re-activate at mouse release.protected GLglprotected booleanisFirstDragKeep track if this is the first mouse drag event since the last mouse released event.protected booleanmustOptimizeMouseDragKeep track if optimization should be triggered or not.protected EmulGLPainterpainterprotected AdaptiveRenderingPolicypolicyAn optimization policy-
Fields inherited from class org.jzy3d.chart.controllers.mouse.camera.AWTCameraMouseController
rateLimiter
-
Fields inherited from class org.jzy3d.chart.controllers.camera.AbstractCameraController
prevMouse, threadController, updateViewDefault
-
Fields inherited from class org.jzy3d.chart.controllers.AbstractController
controllerListeners, targets
-
-
Constructor Summary
Constructors Constructor Description AdaptiveMouseController()AdaptiveMouseController(Chart chart)AdaptiveMouseController(Chart chart, AdaptiveRenderingPolicy policy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleandetectIfRenderingIsSlow(double lastRenderingTime)protected doublegetLastRenderingTimeFromCanvas()AdaptiveRenderingPolicygetPolicy()protected voidloadChartFields(Chart chart)voidmouseDragged(MouseEvent e)Compute shift or rotatevoidmousePressed(MouseEvent e)Handles toggle between mouse rotation/auto rotation: double-click starts the animated rotation, while simple click stops it.voidmouseReleased(MouseEvent e)voidsetPolicy(AdaptiveRenderingPolicy policy)protected voidstartNoHiDPI(Chart chart)protected voidstartOptimizations()protected voidstopNoHiDPI(Chart chart)protected voidstopOptimizations()-
Methods inherited from class org.jzy3d.chart.controllers.mouse.camera.AWTCameraMouseController
dispose, getRateLimiter, handleSlaveThread, mouseClicked, mouseEntered, mouseExited, mouseMoved, mouseWheelMoved, register, setRateLimiter, x, xy, y
-
Methods inherited from class org.jzy3d.chart.controllers.camera.AbstractCameraController
addSlaveThreadController, addThread, getSlaveThreadController, getThread, isUpdateViewDefault, removeSlaveThreadController, rotate, rotate, rotate, setUpdateViewDefault, shift, shift, startThreadController, stopThreadController, zoomX, zoomX, zoomY, zoomY, zoomZ, zoomZ
-
Methods inherited from class org.jzy3d.chart.controllers.AbstractController
addControllerEventListener, fireControllerEvent, getChart, getCharts, removeControllerEventListener, unregister
-
-
-
-
Field Detail
-
currentQuality
protected Quality currentQuality
-
currentHiDPI
protected boolean currentHiDPI
-
canvas
protected ICanvas canvas
-
gl
protected GL gl
-
painter
protected EmulGLPainter painter
-
policy
protected AdaptiveRenderingPolicy policy
An optimization policy
-
mustOptimizeMouseDrag
protected boolean mustOptimizeMouseDrag
Keep track if optimization should be triggered or not. Defined at mouse pressed.
-
isFirstDrag
protected boolean isFirstDrag
Keep track if this is the first mouse drag event since the last mouse released event. This is used to trigger optimization only once when multiple successive mouse drag events are received.
-
adaptByDroppingFace
protected AbstractAdativeRenderingHandler adaptByDroppingFace
-
adaptByDroppingFaceAndColoringWire
protected AdaptByDroppingFaceAndKeepingWireframeWithColor adaptByDroppingFaceAndColoringWire
-
adaptByDroppingWireframe
protected AdaptByDroppingWireframe adaptByDroppingWireframe
-
adaptByDroppingHiDPI
protected AdaptByDroppingHiDPI adaptByDroppingHiDPI
-
droppedWireframeToReset
protected List<Wireframeable> droppedWireframeToReset
Keep track of drawable that have had their wireframe disabled for optimization in order to re-activate at mouse release.
-
droppedFaceAndColoredWireframeToReset
protected List<Wireframeable> droppedFaceAndColoredWireframeToReset
Keep track of drawable that have had their face disabled for optimization in order to re-activate at mouse release.
-
-
Constructor Detail
-
AdaptiveMouseController
public AdaptiveMouseController()
-
AdaptiveMouseController
public AdaptiveMouseController(Chart chart, AdaptiveRenderingPolicy policy)
-
AdaptiveMouseController
public AdaptiveMouseController(Chart chart)
-
-
Method Detail
-
mousePressed
public void mousePressed(MouseEvent e)
Description copied from class:AWTCameraMouseControllerHandles toggle between mouse rotation/auto rotation: double-click starts the animated rotation, while simple click stops it.- Specified by:
mousePressedin interfaceMouseListener- Overrides:
mousePressedin classAWTCameraMouseController
-
mouseDragged
public void mouseDragged(MouseEvent e)
Description copied from class:AWTCameraMouseControllerCompute shift or rotate- Specified by:
mouseDraggedin interfaceMouseMotionListener- Overrides:
mouseDraggedin classAWTCameraMouseController
-
mouseReleased
public void mouseReleased(MouseEvent e)
- Specified by:
mouseReleasedin interfaceMouseListener- Overrides:
mouseReleasedin classAWTCameraMouseController
-
getLastRenderingTimeFromCanvas
protected double getLastRenderingTimeFromCanvas()
-
detectIfRenderingIsSlow
protected boolean detectIfRenderingIsSlow(double lastRenderingTime)
-
loadChartFields
protected void loadChartFields(Chart chart)
-
startOptimizations
protected void startOptimizations()
-
stopOptimizations
protected void stopOptimizations()
-
startNoHiDPI
protected void startNoHiDPI(Chart chart)
-
stopNoHiDPI
protected void stopNoHiDPI(Chart chart)
-
getPolicy
public AdaptiveRenderingPolicy getPolicy()
-
setPolicy
public void setPolicy(AdaptiveRenderingPolicy policy)
-
-