title: Mapping mouse event coordinates
body: <p>I've implemented a <code>JLayer&lt;JPanel&gt;</code> component which paint a zoomed <code>Graphics</code> of itself, so all his descending components will be zoomed too.
  This JLayer is applied as ContentPane to a JFrame component.</p>
  <p>The main problem is that all the zoom applies, indeed, only to the graphic and the actual size and position of the components remain the same. This implies that all the mouse events happen in the wrong position respectively to what the user see.</p>
  <p>I've king of tweaked it defining a <code>GlassPane</code> <code>JComponent</code> at the top of the frame which has it's own <code>MouseInputAdapter</code> which redispatch the <code>MouseEvent</code>s to the underlying components using <code>SwingUtilities.getDeepestComponentAt()</code>. This is accomplished by creating a new <code>MouseEvent</code> with the mouse coordinates mapped depending on the zoom value. (obtained modifying the <a href="https://docs.oracle.com/javase/tutorial/uiswing/components/rootpane.html" rel="nofollow noreferrer">How to use RootPanes</a> tutorial)</p>
  <p>This method is obviously not satisfying because a lot of events simply can't be fired (for example the <code>MOUSE_ENTERED</code> events fired by all the descending components).
  On the other hand using the <code>LayerUI.paint()</code> override implies that i have to have something which remap all the mouse coordinates.</p>
  <ol>
  <li><p>Is there a way to map the mouse coordinates without breaking the inner <code>MouseEvent</code> processing?</p>
  <p>or</p>
  </li>
  <li><p>Is there another way to zoom in the <strong>bitmap</strong> of the components while modifying also the real position and size? I've kind of tried this but calling the <code>setSize()</code> of an inner component seems to someway call the <code>LayerUi.paint()</code> a second time so all that i get is some bigger graphic disconnected from the actual widget position</p>
  </li>
  </ol>