/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
boolean isPopDown;
boolean isSquare;
protected AquaComboBoxButton(final AquaComboBoxUI ui, final JComboBox comboBox, final CellRendererPane rendererPane, final JList list) {
super("");
this.rendererPane = rendererPane;
setModel(new DefaultButtonModel() {
}
});
}
public boolean isEnabled() {
}
public boolean isFocusTraversable() {
return false;
}
repaint();
}
repaint();
}
}
// Don't Paint the button as usual
// super.paintComponent( g );
int top = 0;
int left = 0;
g.setColor(getBackground());
}
return;
}
if (!editable) {
}
return;
}
if (editable) {
} else {
if (isPopDown) {
} else {
}
}
if (isSquare) {
} else {
}
// Let the renderer paint
}
}
protected void doRendererPaint(final Graphics g, final ButtonModel buttonModel, final boolean editable, final Insets insets, int left, int top, int width, int height) {
// fake it out! not renderPressed
final Component c = renderer.getListCellRendererComponent(list, comboBox.getSelectedItem(), -1, false, false);
// System.err.println("Renderer: " + renderer);
final int indentLeft = 10;
final int buttonWidth = 24;
// hardcoded for now. We should adjust as necessary.
top += 1;
height -= 4;
left += indentLeft;
}
if (isOpaque()) {
}
if (isOpaque()) {
}
} else {
}
// Sun Fix for 4238829: should lay out the JPanel.
boolean shouldValidate = false;
if (c instanceof JPanel) {
shouldValidate = true;
}
final int iconWidth = 0;
// fix for 3156483 we need to crop images that are too big.
// if (height > 18)
// always crop.
{
height = 19;
}
// It doesn't need to draw its background, we handled it
rendererPane.paintComponent(g, c, this, left, top, cWidth, height, shouldValidate); // h - (insets.top + insets.bottom) );
}
}