/*
* 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.
*/
/**
* Metal UI for JComboBox
* <p>
* <strong>Warning:</strong>
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is
* appropriate for short term storage or RMI between applications running
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans<sup><font size="-2">TM</font></sup>
* has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}.
*
* @see MetalComboBoxEditor
* @see MetalComboBoxButton
* @author Tom Santos
*/
return new MetalComboBoxUI();
}
if (MetalLookAndFeel.usingOcean()) {
super.paint(g, c);
}
}
/**
* If necessary paints the currently selected item.
*
* @param g Graphics to paint to
* @param bounds Region to paint current value to
* @param hasFocus whether or not the JComboBox has focus
* @throws NullPointerException if any of the arguments are null.
* @since 1.5
*/
boolean hasFocus) {
// This is really only called if we're using ocean.
if (MetalLookAndFeel.usingOcean()) {
bounds.x += 2;
if (arrowButton != null) {
}
else {
bounds.y += 2;
}
}
throw new NullPointerException(
"Must supply a non-null Graphics and Rectangle");
}
}
/**
* If necessary paints the background of the currently selected item.
*
* @param g Graphics to paint to
* @param bounds Region to paint background to
* @param hasFocus whether or not the JComboBox has focus
* @throws NullPointerException if any of the arguments are null.
* @since 1.5
*/
boolean hasFocus) {
// This is really only called if we're using ocean.
if (MetalLookAndFeel.usingOcean()) {
arrowButton != null) {
}
}
}
}
throw new NullPointerException(
"Must supply a non-null Graphics and Rectangle");
}
}
/**
* Returns the baseline.
*
* @throws NullPointerException {@inheritDoc}
* @throws IllegalArgumentException {@inheritDoc}
* @see javax.swing.JComponent#getBaseline(int, int)
* @since 1.6
*/
int baseline;
height -= 4;
if (baseline >= 0) {
baseline += 2;
}
}
else {
}
return baseline;
}
return new MetalComboBoxEditor.UIResource();
}
return super.createPopup();
}
new MetalComboBoxIcon(),
listBox );
if (MetalLookAndFeel.usingOcean()) {
// Disabled rollover effect.
}
return button;
}
/**
* Resets the necessary state on the ComboBoxButton for ocean.
*/
if (MetalLookAndFeel.usingOcean()) {
// Ocean renders the focus in a different way, this
// would be redundant.
}
}
return new MetalPropertyChangeListener();
}
/**
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of {@code MetalComboBoxUI}.
*/
super.propertyChange( e );
if ( propertyName == "editable" ) {
if(arrowButton instanceof MetalComboBoxButton) {
}
} else if ( propertyName == "background" ) {
} else if ( propertyName == "foreground" ) {
}
}
}
/**
* As of Java 2 platform v1.4 this method is no longer used. Do not call or
* override. All the functionality of this method is in the
* MetalPropertyChangeListener.
*
* @deprecated As of Java 2 platform v1.4.
*/
return new MetalComboBoxLayoutManager();
}
/**
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of {@code MetalComboBoxUI}.
*/
layoutComboBox( parent, this );
}
super.layoutContainer( parent );
}
}
// This is here because of a bug in the compiler.
// When a protected-inner-class-savvy compiler comes out we
// should move this into MetalComboBoxLayoutManager.
return;
}
if (arrowButton != null) {
if (MetalLookAndFeel.usingOcean() ) {
}
else {
}
}
}
}
/**
* As of Java 2 platform v1.4 this method is no
* longer used.
*
* @deprecated As of Java 2 platform v1.4.
*/
protected void removeListeners() {
if ( propertyChangeListener != null ) {
}
}
// These two methods were overloaded and made public. This was probably a
// mistake in the implementation. The functionality that they used to
// provide is no longer necessary and should be removed. However,
// removing them will create an uncompatible API change.
public void configureEditor() {
super.configureEditor();
}
public void unconfigureEditor() {
super.unconfigureEditor();
}
if ( !isMinimumSizeDirty ) {
return new Dimension( cachedMinimumSize );
}
if ( !comboBox.isEditable() &&
arrowButton != null) {
size = getDisplaySize();
}
else if ( comboBox.isEditable() &&
arrowButton != null &&
size = super.getMinimumSize( c );
}
else {
size = super.getMinimumSize( c );
}
isMinimumSizeDirty = false;
return new Dimension( cachedMinimumSize );
}
/**
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of {@code MetalComboBoxUI}.
*
* This class is now obsolete and doesn't do anything and
* is only included for backwards API compatibility. Do not call or
* override.
*
* @deprecated As of Java 2 platform v1.4.
*/
super( cBox );
}
// This method was overloaded and made public. This was probably
// mistake in the implementation. The functionality that they used to
// provide is no longer necessary and should be removed. However,
// removing them will create an uncompatible API change.
super.delegateFocus(e);
}
}
}