@Override public Dimension getPreferredSize() { if (isRightToLeft()) { if(editingComponent != null) { Dimension pSize = editingComponent.getPreferredSize(); pSize.width += offset + 5; Dimension rSize = (renderer != null) ? renderer.getPreferredSize() : null; if(rSize != null) pSize.height = Math.max(pSize.height, rSize.height); if(editingIcon != null) pSize.height = Math.max(pSize.height, editingIcon.getIconHeight()); // trying to enforce a minimum size leads to field being painted over the icon // Make sure width is at least 100. // pSize.width = Math.max(pSize.width, 100); return pSize; } return new Dimension(0, 0); } return super.getPreferredSize(); }
@Override public Dimension getPreferredSize() { if (isRightToLeft()) { if(editingComponent != null) { Dimension pSize = editingComponent.getPreferredSize(); pSize.width += offset + 5; Dimension rSize = (renderer != null) ? renderer.getPreferredSize() : null; if(rSize != null) pSize.height = Math.max(pSize.height, rSize.height); if(editingIcon != null) pSize.height = Math.max(pSize.height, editingIcon.getIconHeight()); // trying to enforce a minimum size leads to field being painted over the icon // Make sure width is at least 100. // pSize.width = Math.max(pSize.width, 100); return pSize; } return new Dimension(0, 0); } return super.getPreferredSize(); }
@Override public Dimension getPreferredSize() { if (isRightToLeft()) { if(editingComponent != null) { Dimension pSize = editingComponent.getPreferredSize(); pSize.width += offset + 5; Dimension rSize = (renderer != null) ? renderer.getPreferredSize() : null; if(rSize != null) pSize.height = Math.max(pSize.height, rSize.height); if(editingIcon != null) pSize.height = Math.max(pSize.height, editingIcon.getIconHeight()); // trying to enforce a minimum size leads to field being painted over the icon // Make sure width is at least 100. // pSize.width = Math.max(pSize.width, 100); return pSize; } return new Dimension(0, 0); } return super.getPreferredSize(); }
@Override public Dimension getPreferredSize() { if (isRightToLeft()) { if(editingComponent != null) { Dimension pSize = editingComponent.getPreferredSize(); pSize.width += offset + 5; Dimension rSize = (renderer != null) ? renderer.getPreferredSize() : null; if(rSize != null) pSize.height = Math.max(pSize.height, rSize.height); if(editingIcon != null) pSize.height = Math.max(pSize.height, editingIcon.getIconHeight()); // trying to enforce a minimum size leads to field being painted over the icon // Make sure width is at least 100. // pSize.width = Math.max(pSize.width, 100); return pSize; } return new Dimension(0, 0); } return super.getPreferredSize(); }
@Override public Dimension getPreferredSize() { if (isRightToLeft()) { if(editingComponent != null) { Dimension pSize = editingComponent.getPreferredSize(); pSize.width += offset + 5; Dimension rSize = (renderer != null) ? renderer.getPreferredSize() : null; if(rSize != null) pSize.height = Math.max(pSize.height, rSize.height); if(editingIcon != null) pSize.height = Math.max(pSize.height, editingIcon.getIconHeight()); // trying to enforce a minimum size leads to field being painted over the icon // Make sure width is at least 100. // pSize.width = Math.max(pSize.width, 100); return pSize; } return new Dimension(0, 0); } return super.getPreferredSize(); }
@Override public void paint(Graphics g) { if (isRightToLeft()) { Dimension size = getSize(); // Then the icon. if (editingIcon != null) { int yLoc = Math.max(0, (size.height - editingIcon .getIconHeight()) / 2); int xLoc = Math.max(0, size.width - offset); editingIcon.paintIcon(this, g, xLoc, yLoc); } // need to prevent super from painting the icon Icon rememberIcon = editingIcon; editingIcon = null; super.paint(g); editingIcon = rememberIcon; } else { super.paint(g); } }
@Override public void paint(Graphics g) { if (isRightToLeft()) { Dimension size = getSize(); // Then the icon. if (editingIcon != null) { int yLoc = Math.max(0, (size.height - editingIcon .getIconHeight()) / 2); int xLoc = Math.max(0, size.width - offset); editingIcon.paintIcon(this, g, xLoc, yLoc); } // need to prevent super from painting the icon Icon rememberIcon = editingIcon; editingIcon = null; super.paint(g); editingIcon = rememberIcon; } else { super.paint(g); } }
@Override public void paint(Graphics g) { if (isRightToLeft()) { Dimension size = getSize(); // Then the icon. if (editingIcon != null) { int yLoc = Math.max(0, (size.height - editingIcon .getIconHeight()) / 2); int xLoc = Math.max(0, size.width - offset); editingIcon.paintIcon(this, g, xLoc, yLoc); } // need to prevent super from painting the icon Icon rememberIcon = editingIcon; editingIcon = null; super.paint(g); editingIcon = rememberIcon; } else { super.paint(g); } }
@Override public void paint(Graphics g) { if (isRightToLeft()) { Dimension size = getSize(); // Then the icon. if (editingIcon != null) { int yLoc = Math.max(0, (size.height - editingIcon .getIconHeight()) / 2); int xLoc = Math.max(0, size.width - offset); editingIcon.paintIcon(this, g, xLoc, yLoc); } // need to prevent super from painting the icon Icon rememberIcon = editingIcon; editingIcon = null; super.paint(g); editingIcon = rememberIcon; } else { super.paint(g); } }
@Override public void paint(Graphics g) { if (isRightToLeft()) { Dimension size = getSize(); // Then the icon. if (editingIcon != null) { int yLoc = Math.max(0, (size.height - editingIcon .getIconHeight()) / 2); int xLoc = Math.max(0, size.width - offset); editingIcon.paintIcon(this, g, xLoc, yLoc); } // need to prevent super from painting the icon Icon rememberIcon = editingIcon; editingIcon = null; super.paint(g); editingIcon = rememberIcon; } else { super.paint(g); } }
@Override public void doLayout() { if (isRightToLeft()) { Dimension cSize = getSize(); editingComponent.getPreferredSize(); editingComponent.setLocation(0, 0); editingComponent.setBounds(0, 0, cSize.width - offset, cSize.height); } else { super.doLayout(); } }
@Override public void doLayout() { if (isRightToLeft()) { Dimension cSize = getSize(); editingComponent.getPreferredSize(); editingComponent.setLocation(0, 0); editingComponent.setBounds(0, 0, cSize.width - offset, cSize.height); } else { super.doLayout(); } }
@Override public void doLayout() { if (isRightToLeft()) { Dimension cSize = getSize(); editingComponent.getPreferredSize(); editingComponent.setLocation(0, 0); editingComponent.setBounds(0, 0, cSize.width - offset, cSize.height); } else { super.doLayout(); } }
@Override public void doLayout() { if (isRightToLeft()) { Dimension cSize = getSize(); editingComponent.getPreferredSize(); editingComponent.setLocation(0, 0); editingComponent.setBounds(0, 0, cSize.width - offset, cSize.height); } else { super.doLayout(); } }
@Override public void doLayout() { if (isRightToLeft()) { Dimension cSize = getSize(); editingComponent.getPreferredSize(); editingComponent.setLocation(0, 0); editingComponent.setBounds(0, 0, cSize.width - offset, cSize.height); } else { super.doLayout(); } }