1 2 3 4 5 6 7 8 9 10 11 12 13
|
JLayeredPane lp = lpList.get(this.tabbedPane.getSelectedIndex());
double zoom = zList.get(this.tabbedPane.getSelectedIndex());
zoom = zoom + 0.003;
zList.set(this.tabbedPane.getSelectedIndex(), zoom);
double z = zoom * zoom;
double currWidth = lp.getComponent(lp.getComponentCount() - 1).getWidth() * z;
double currHeight = lp.getComponent(lp.getComponentCount() - 1).getHeight() * z;
z = Math.max(0, z - 0.03 * e.getWheelRotation());
// en enlevant le getComponent(0) il ne se passe rien du tout..
lp.getComponent(0).setBounds((this.width - (int)currWidth) / 2, (this.height - (int)currHeight) / 2, (int)currWidth, (int)currHeight);
lp.repaint(); |
Partager