]> gerrit.simantics Code Review - simantics/3d.git/blob - vtk.rendering/src/vtk/rendering/awt/vtkInternalAwtComponent.java
Take values from pipe run as defaults for reducers
[simantics/3d.git] / vtk.rendering / src / vtk / rendering / awt / vtkInternalAwtComponent.java
1 package vtk.rendering.awt;
2
3 import java.awt.Canvas;
4 import java.awt.Graphics;
5
6 import vtk.vtkRenderWindow;
7
8 public class vtkInternalAwtComponent extends Canvas {
9   protected native int RenderCreate(vtkRenderWindow renderWindow);
10
11   private static final long serialVersionUID = -7756069664577797620L;
12   private vtkAwtComponent parent;
13
14   public vtkInternalAwtComponent(vtkAwtComponent parent) {
15     this.parent = parent;
16     this.addMouseListener(this.parent.getInteractorForwarder());
17     this.addMouseMotionListener(this.parent.getInteractorForwarder());
18     this.addMouseWheelListener(this.parent.getInteractorForwarder());
19     this.addKeyListener(this.parent.getInteractorForwarder());
20   }
21
22   public void addNotify() {
23     super.addNotify();
24     parent.isWindowCreated = false;
25     parent.getRenderWindow().SetForceMakeCurrent();
26     parent.updateInRenderCall(false);
27   }
28
29   public void removeNotify() {
30     parent.updateInRenderCall(true);
31     super.removeNotify();
32   }
33
34   public void paint(Graphics g) {
35     parent.Render();
36   }
37
38   public void update(Graphics g) {
39     parent.Render();
40   }
41 }