1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
//Fonction de zoom de mon GLJPanel
public void mouseWheelMoved(MouseWheelEvent arg0) {
if (arg0.getWheelRotation() == -1) {
zoom -= 0.1;
} else {
zoom += 0.1;
}
this.gltest.refresh();
this.gltest.getGLPJPanel().scrollRectToVisible(this.rectangle);
System.out.println(this.rectangle.width+" Vs "+this.gltest.getWidth());
System.out.println(this.rectangle.height+" Vs "+this.gltest.getHeight());
System.out.println();
if(this.rectangle.width>this.gltest.getWidth() || this.rectangle.height>this.gltest.getHeight()){
//System.out.println("Scroll");
this.gltest.setPreferredSize(new Dimension(this.rectangle.width, this.rectangle.height));
this.gltest.getGLPJPanel().revalidate();
}
} |
Partager