public void setUseSelectedComponentSize(boolean useSelectedComponentSize) { if (this.useSelectedComponentSize != useSelectedComponentSize) { this.useSelectedComponentSize = useSelectedComponentSize; ComponentUtil.validate(container); /*if (container instanceof JComponent) ((JComponent)container).revalidate(); else container.validate();*/ } }
private int getComponentIndexAtPoint(Point p) { JComponent c = null; Point p2 = SwingUtilities.convertPoint(this, p, componentBox); Point p3 = SwingUtilities.convertPoint(componentBox, p, outerParentArea); if (outerParentArea.contains(p3)) c = (JComponent) ComponentUtil.getChildAtLine( componentBox, p2, getDirectionLayout().getDirection().isHorizontal()); return layoutOrderList.indexOf(c); }
public static void getComponentTreePosition(Component component, ArrayList pos) { if (component.getParent() == null) { return; } getComponentTreePosition(component.getParent(), pos); pos.add( new Integer( component.getParent().getComponentCount() - ComponentUtil.getComponentIndex(component))); }
public void showComponent(Component c) { final Component oldComponent = component; if (oldComponent == c) return; component = c; boolean hasFocus = oldComponent != null && LayoutUtil.isDescendingFrom( KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(), oldComponent); if (oldComponent != null) oldComponent.setVisible(false); if (component != null) { component.setVisible(true); if (hasFocus) // component.requestFocusInWindow(); ComponentUtil.smartRequestFocus(component); } /* if (oldComponent != null) { // oldComponent.setVisible(false); SwingUtilities.invokeLater(new Runnable() { public void run() { if (oldComponent.getParent() == container && oldComponent != component) { oldComponent.setVisible(false); } // FocusUtil.unblockFocusChanges(); } }); }*/ }