List of usage examples for javax.swing SwingUtilities convertRectangle
public static Rectangle convertRectangle(Component source, Rectangle aRectangle, Component destination)
aRectangle
in source
coordinate system to destination
coordinate system. From source file:org.eclipse.wb.internal.swing.utils.SwingImageUtils.java
private static void fetchMenuVisualData_JMenuBar(MenuVisualData menuData, Container menuObject, Container parent) throws Exception { if (parent != null) { menuData.m_menuBounds = CoordinateUtils .get(SwingUtilities.convertRectangle(menuObject, menuObject.getBounds(), parent)); } else {/*from ww w . j a v a2 s . c o m*/ // image { JFrame frame = new JFrame(); frame.setBounds(menuObject.getBounds()); frame.setJMenuBar((JMenuBar) menuObject); frame.pack(); prepareForPrinting(frame); try { menuData.m_menuImage = createComponentShot(menuObject); } finally { setVisible(frame, false); frame.dispose(); } } // bounds menuData.m_menuBounds = CoordinateUtils.get(menuObject.getBounds()); } // items fetchMenuVisualData_items(menuData, menuObject); }