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 AbstractAdativeRenderingHandler
adaptByDroppingFace
protected AdaptByDroppingFaceAndKeepingWireframeWithColor
adaptByDroppingFaceAndColoringWire
protected AdaptByDroppingHiDPI
adaptByDroppingHiDPI
protected AdaptByDroppingSmoothColor
adaptByDroppingSmoothColor
protected AdaptByDroppingWireframe
adaptByDroppingWireframe
protected AdaptByKeepingBoundingBoxOnly
adaptByKeepingBoundingBoxOnly
protected AdaptByPerformanceKnowledge
adaptByPerformanceKnowledge
protected ICanvas
canvas
protected boolean
currentHiDPI
protected Quality
currentQuality
protected List<Wireframeable>
droppedFaceAndColoredWireframeToReset
Keep track of drawable that have had their face disabled for optimization in order to re-activate at mouse release.protected List<Wireframeable>
droppedWireframeToReset
Keep track of drawable that have had their wireframe disabled for optimization in order to re-activate at mouse release.protected GL
gl
protected boolean
isFirstDrag
Keep track if this is the first mouse drag event since the last mouse released event.protected boolean
mustOptimizeMouseDrag
Keep track if optimization should be triggered or not.protected EmulGLPainter
painter
protected AdaptiveRenderingPolicy
policy
An optimization policy-
Fields inherited from class org.jzy3d.chart.controllers.mouse.camera.AWTCameraMouseController
rateLimiter
-
Fields inherited from class org.jzy3d.chart.controllers.camera.AbstractCameraController
perf, 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 boolean
detectIfRenderingIsSlow(double lastRenderingTime)
protected double
getLastRenderingTimeFromCanvas()
AdaptiveRenderingPolicy
getPolicy()
protected void
loadChartFields(Chart chart)
void
mouseDragged(MouseEvent e)
Compute shift or rotatevoid
mousePressed(MouseEvent e)
Handles toggle between mouse rotation/auto rotation: double-click starts the animated rotation, while simple click stops it.void
mouseReleased(MouseEvent e)
void
setPolicy(AdaptiveRenderingPolicy policy)
protected void
startOptimizations()
protected void
stopOptimizations()
-
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, getLODPerf, getSlaveThreadController, getThread, isUpdateViewDefault, removeSlaveThreadController, rotate, rotate, rotate, setLODPerf, 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
-
adaptByDroppingSmoothColor
protected AdaptByDroppingSmoothColor adaptByDroppingSmoothColor
-
adaptByKeepingBoundingBoxOnly
protected AdaptByKeepingBoundingBoxOnly adaptByKeepingBoundingBoxOnly
-
adaptByPerformanceKnowledge
protected AdaptByPerformanceKnowledge adaptByPerformanceKnowledge
-
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:AWTCameraMouseController
Handles toggle between mouse rotation/auto rotation: double-click starts the animated rotation, while simple click stops it.- Specified by:
mousePressed
in interfaceMouseListener
- Overrides:
mousePressed
in classAWTCameraMouseController
-
mouseDragged
public void mouseDragged(MouseEvent e)
Description copied from class:AWTCameraMouseController
Compute shift or rotate- Specified by:
mouseDragged
in interfaceMouseMotionListener
- Overrides:
mouseDragged
in classAWTCameraMouseController
-
mouseReleased
public void mouseReleased(MouseEvent e)
- Specified by:
mouseReleased
in interfaceMouseListener
- Overrides:
mouseReleased
in 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()
-
getPolicy
public AdaptiveRenderingPolicy getPolicy()
-
setPolicy
public void setPolicy(AdaptiveRenderingPolicy policy)
-
-