Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Automatic merge of client:master into master
  • Loading branch information
duke committed Aug 25, 2020
2 parents 8421533 + 655b45f commit 3282e70c551b1a9020a1db874e23841affc58935
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -142,4 +142,9 @@ public class VoiceStatus {
* @see #active
*/
public int volume = 0;

/**
* Constructs a {@code VoiceStatus}.
*/
public VoiceStatus() {}
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -38,6 +38,11 @@
*/
public abstract class MidiDeviceProvider {

/**
* Constructs a {@code MidiDeviceProvider}.
*/
protected MidiDeviceProvider() {}

/**
* Indicates whether the device provider supports the device represented by
* the specified device info object.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,11 @@
*/
public abstract class MidiFileReader {

/**
* Constructs a {@code MidiFileReader}.
*/
protected MidiFileReader() {}

/**
* Obtains the MIDI file format of the input stream provided. The stream
* must point to valid MIDI file data. In general, MIDI file readers may
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,11 @@
*/
public abstract class MidiFileWriter {

/**
* Constructs a {@code MidiFileWriter}.
*/
protected MidiFileWriter() {}

/**
* Obtains the set of MIDI file types for which file writing support is
* provided by this file writer.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -44,6 +44,11 @@
*/
public abstract class SoundbankReader {

/**
* Constructs a {@code SoundbankReader}.
*/
protected SoundbankReader() {}

/**
* Obtains a soundbank object from the {@code URL} provided.
*
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -44,6 +44,11 @@
*/
public abstract class AudioFileReader {

/**
* Constructs an {@code AudioFileReader}.
*/
protected AudioFileReader() {}

/**
* Obtains the audio file format of the input stream provided. The stream
* must point to valid audio file data. In general, audio file readers may
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,11 @@
*/
public abstract class AudioFileWriter {

/**
* Constructs an {@code AudioFileWriter}.
*/
protected AudioFileWriter() {}

/**
* Obtains the file types for which file writing support is provided by this
* audio file writer.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -51,6 +51,11 @@
*/
public abstract class FormatConversionProvider {

/**
* Constructs a {@code FormatConversionProvider}.
*/
protected FormatConversionProvider() {}

/**
* Obtains the set of source format encodings from which format conversion
* services are provided by this provider.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,11 @@
*/
public abstract class MixerProvider {

/**
* Constructs a {@code MixerProvider}.
*/
protected MixerProvider() {}

/**
* Indicates whether the mixer provider supports the mixer represented by
* the specified mixer info object.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -102,10 +102,10 @@ protected void uninstallListeners() {

private void updateStyle(JToolBar c) {
SynthContext context = getContext(
c, Region.TOOL_BAR_CONTENT, null, ENABLED);
c, Region.TOOL_BAR_CONTENT, contentStyle, ENABLED);
contentStyle = SynthLookAndFeel.updateStyle(context, this);

context = getContext(c, Region.TOOL_BAR_DRAG_WINDOW, null, ENABLED);
context = getContext(c, Region.TOOL_BAR_DRAG_WINDOW, dragWindowStyle, ENABLED);
dragWindowStyle = SynthLookAndFeel.updateStyle(context, this);

context = getContext(c, ENABLED);
@@ -0,0 +1,101 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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.
*/

/**
* @test
* @bug 8136363
* @key headful
* @summary Verifies background color of a component does not change after setting name.
* @run main ComponentSetNameTest
*/

import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JMenu;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JSlider;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.SwingUtilities;
import javax.swing.JToolBar;
import javax.swing.UnsupportedLookAndFeelException;
import java.awt.Color;

public class ComponentSetNameTest {

public static void main(String[] args) throws Exception {
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
UIManager.LookAndFeelInfo[] looks = UIManager.getInstalledLookAndFeels();
for (UIManager.LookAndFeelInfo look : looks) {
try {
UIManager.setLookAndFeel(look.getClassName());
} catch (ClassNotFoundException | InstantiationException |
UnsupportedLookAndFeelException |
IllegalAccessException e) {
throw new RuntimeException("Failed to set LookAndFeel "
+ look.getClassName(), e);
}
final JComponent[] components = {
new JTextArea(), new JTextField(), new JComboBox(),
new JCheckBox(), new JRadioButton(), new JButton(),
new JPanel(), new JTable(), new JTabbedPane(),
new JScrollPane(), new JSlider(), new JMenu(),
new JToolBar()};
for (JComponent component : components) {
testSetName(component, look.getClassName());
}
}

}
});
}

private static void testSetName(JComponent component, String looknFeelClassName) {
Color bg1 = component.getBackground();
if (bg1 == null) {
printTestInfo(component, looknFeelClassName);
throw new RuntimeException("background is null");
}

component.setName("noname");
Color bg2 = component.getBackground();
if (bg2 != bg1) {
printTestInfo(component, looknFeelClassName);
throw new RuntimeException("background changed after setting name");
}
}

private static void printTestInfo(JComponent component, String looknFeelClassName) {
System.err.println("Test fails");
System.err.println("LookAndFeel " + looknFeelClassName);
System.err.println("JComponent " + component.getClass());
}
}

0 comments on commit 3282e70

Please sign in to comment.