This commit is contained in:
David Dehaven 2015-10-05 13:45:50 -07:00
commit 1d92a8874c
380 changed files with 3072 additions and 1780 deletions

View file

@ -40,6 +40,7 @@ allfonts.devanagari=Mangal
allfonts.dingbats=Wingdings allfonts.dingbats=Wingdings
allfonts.lucida=Lucida Sans Regular allfonts.lucida=Lucida Sans Regular
allfonts.symbol=Symbol allfonts.symbol=Symbol
allfonts.symbols=Segoe UI Symbol
allfonts.thai=Lucida Sans Regular allfonts.thai=Lucida Sans Regular
allfonts.georgian=Sylfaen allfonts.georgian=Sylfaen
@ -236,7 +237,7 @@ sequence.dialoginput.x-windows-949=alphabetic,korean,dingbats,symbol
sequence.allfonts.x-windows-874=alphabetic,thai,dingbats,symbol sequence.allfonts.x-windows-874=alphabetic,thai,dingbats,symbol
sequence.fallback=lucida,\ sequence.fallback=lucida,symbols,\
chinese-ms950,chinese-hkscs,chinese-ms936,chinese-gb18030,\ chinese-ms950,chinese-hkscs,chinese-ms936,chinese-gb18030,\
japanese,korean,chinese-ms950-extb,chinese-ms936-extb,georgian japanese,korean,chinese-ms950-extb,chinese-ms936-extb,georgian
@ -298,3 +299,4 @@ filename.Symbol=SYMBOL.TTF
filename.Wingdings=WINGDING.TTF filename.Wingdings=WINGDING.TTF
filename.Sylfaen=sylfaen.ttf filename.Sylfaen=sylfaen.ttf
filename.Segoe_UI_Symbol=SEGUISYM.TTF

View file

@ -959,10 +959,9 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
$(X_CFLAGS) \ $(X_CFLAGS) \
$(X_LIBS) \ $(X_LIBS) \
$(LIBAWT_LWAWT_CFLAGS), \ $(LIBAWT_LWAWT_CFLAGS), \
DISABLED_WARNINGS_clang := incomplete-implementation \ DISABLED_WARNINGS_clang := incomplete-implementation enum-conversion \
deprecated-declarations objc-method-access bitwise-op-parentheses \ deprecated-declarations objc-method-access bitwise-op-parentheses \
incompatible-pointer-types parentheses-equality extra-tokens, \ incompatible-pointer-types parentheses-equality extra-tokens, \
WARNINGS_AS_ERRORS_clang := false, \
LDFLAGS := $(LDFLAGS_JDKLIB) \ LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN) \ $(call SET_SHARED_LIBRARY_ORIGIN) \
-L$(INSTALL_LIBRARIES_HERE), \ -L$(INSTALL_LIBRARIES_HERE), \

View file

@ -504,11 +504,11 @@ class Atom {
private static Applet applet; private static Applet applet;
private static byte[] data; private static byte[] data;
private final static int R = 40; private static final int R = 40;
private final static int hx = 15; private static final int hx = 15;
private final static int hy = 15; private static final int hy = 15;
private final static int bgGrey = 192; private static final int bgGrey = 192;
private final static int nBalls = 16; private static final int nBalls = 16;
private static int maxr; private static int maxr;
private int Rl; private int Rl;
private int Gl; private int Gl;

View file

@ -771,7 +771,7 @@ public abstract class ImageTests extends GraphicsTests {
} }
} }
private static abstract class ImageOpTests extends ImageTests { private abstract static class ImageOpTests extends ImageTests {
ImageOpTests(Group parent, String nodeName, String desc) { ImageOpTests(Group parent, String nodeName, String desc) {
super(parent, nodeName, desc, super(parent, nodeName, desc,
new Modifier.Filter() { new Modifier.Filter() {

View file

@ -245,7 +245,7 @@ public abstract class PixelTests extends Test {
} }
} }
public static abstract class BufImgTest extends PixelTests { public abstract static class BufImgTest extends PixelTests {
public BufImgTest(String nodeName, String description) { public BufImgTest(String nodeName, String description) {
super(bufimgtestroot, nodeName, description); super(bufimgtestroot, nodeName, description);
} }
@ -281,7 +281,7 @@ public abstract class PixelTests extends Test {
} }
} }
public static abstract class RasTest extends PixelTests { public abstract static class RasTest extends PixelTests {
public RasTest(String nodeName, String description) { public RasTest(String nodeName, String description) {
super(rastertestroot, nodeName, description); super(rastertestroot, nodeName, description);
} }
@ -355,7 +355,7 @@ public abstract class PixelTests extends Test {
} }
} }
public static abstract class DataBufTest extends PixelTests { public abstract static class DataBufTest extends PixelTests {
public DataBufTest(String nodeName, String description) { public DataBufTest(String nodeName, String description) {
super(dbtestroot, nodeName, description); super(dbtestroot, nodeName, description);
} }

View file

@ -161,7 +161,7 @@ abstract class InputTests extends IIOTests {
} }
} }
protected static abstract class Context { protected abstract static class Context {
int size; int size;
Object input; Object input;
int inputType; int inputType;

View file

@ -156,7 +156,7 @@ abstract class OutputTests extends IIOTests {
} }
} }
protected static abstract class Context { protected abstract static class Context {
int size; int size;
Object output; Object output;
int outputType; int outputType;

View file

@ -232,7 +232,7 @@ public abstract class TextMeasureTests extends TextTests {
} }
} }
public static abstract class GVMeasureTest extends TextMeasureTests { public abstract static class GVMeasureTest extends TextMeasureTests {
protected GVMeasureTest(Group parent, String nodeName, String description) { protected GVMeasureTest(Group parent, String nodeName, String description) {
super(parent, nodeName, description); super(parent, nodeName, description);
} }
@ -431,7 +431,7 @@ public abstract class TextMeasureTests extends TextTests {
} }
} }
public static abstract class TLMeasureTest extends TextMeasureTests { public abstract static class TLMeasureTest extends TextMeasureTests {
protected TLMeasureTest(Group parent, String nodeName, String description) { protected TLMeasureTest(Group parent, String nodeName, String description) {
super(parent, nodeName, description); super(parent, nodeName, description);
} }
@ -506,7 +506,7 @@ public abstract class TextMeasureTests extends TextTests {
} }
} }
public static abstract class TLExtendedMeasureTest extends TLMeasureTest { public abstract static class TLExtendedMeasureTest extends TLMeasureTest {
protected TLExtendedMeasureTest(Group parent, String nodeName, String description) { protected TLExtendedMeasureTest(Group parent, String nodeName, String description) {
super(parent, nodeName, description); super(parent, nodeName, description);
} }

View file

@ -143,11 +143,11 @@ public class FileChooserDemo extends JPanel implements ActionListener {
private JTextField customField; private JTextField customField;
private final ExampleFileView fileView; private final ExampleFileView fileView;
private final ExampleFileSystemView fileSystemView; private final ExampleFileSystemView fileSystemView;
private final static Dimension hpad10 = new Dimension(10, 1); private static final Dimension hpad10 = new Dimension(10, 1);
private final static Dimension vpad20 = new Dimension(1, 20); private static final Dimension vpad20 = new Dimension(1, 20);
private final static Dimension vpad7 = new Dimension(1, 7); private static final Dimension vpad7 = new Dimension(1, 7);
private final static Dimension vpad4 = new Dimension(1, 4); private static final Dimension vpad4 = new Dimension(1, 4);
private final static Insets insets = new Insets(5, 10, 0, 10); private static final Insets insets = new Insets(5, 10, 0, 10);
private final FilePreviewer previewer; private final FilePreviewer previewer;
private final JFileChooser chooser; private final JFileChooser chooser;

View file

@ -64,7 +64,7 @@ class Notepad extends JPanel {
protected static Properties properties; protected static Properties properties;
private static ResourceBundle resources; private static ResourceBundle resources;
private final static String EXIT_AFTER_PAINT = "-exit"; private static final String EXIT_AFTER_PAINT = "-exit";
private static boolean exitAfterFirstPaint; private static boolean exitAfterFirstPaint;
private static final String[] MENUBAR_KEYS = {"file", "edit", "debug"}; private static final String[] MENUBAR_KEYS = {"file", "edit", "debug"};

View file

@ -127,7 +127,7 @@ public class DataFlavor implements Externalizable, Cloneable {
* @return the class loaded * @return the class loaded
* @exception ClassNotFoundException if class is not found * @exception ClassNotFoundException if class is not found
*/ */
protected final static Class<?> tryToLoadClass(String className, protected static final Class<?> tryToLoadClass(String className,
ClassLoader fallback) ClassLoader fallback)
throws ClassNotFoundException throws ClassNotFoundException
{ {
@ -163,7 +163,7 @@ public class DataFlavor implements Externalizable, Cloneable {
/* /*
* private initializer * private initializer
*/ */
static private DataFlavor createConstant(Class<?> rc, String prn) { private static DataFlavor createConstant(Class<?> rc, String prn) {
try { try {
return new DataFlavor(rc, prn); return new DataFlavor(rc, prn);
} catch (Exception e) { } catch (Exception e) {
@ -174,7 +174,7 @@ public class DataFlavor implements Externalizable, Cloneable {
/* /*
* private initializer * private initializer
*/ */
static private DataFlavor createConstant(String mt, String prn) { private static DataFlavor createConstant(String mt, String prn) {
try { try {
return new DataFlavor(mt, prn); return new DataFlavor(mt, prn);
} catch (Exception e) { } catch (Exception e) {
@ -185,7 +185,7 @@ public class DataFlavor implements Externalizable, Cloneable {
/* /*
* private initializer * private initializer
*/ */
static private DataFlavor initHtmlDataFlavor(String htmlFlavorType) { private static DataFlavor initHtmlDataFlavor(String htmlFlavorType) {
try { try {
return new DataFlavor ("text/html; class=java.lang.String;document=" + return new DataFlavor ("text/html; class=java.lang.String;document=" +
htmlFlavorType + ";charset=Unicode"); htmlFlavorType + ";charset=Unicode");

View file

@ -62,7 +62,7 @@ class _AppEventHandler {
private static native void nativeReplyToAppShouldTerminate(final boolean shouldTerminate); private static native void nativeReplyToAppShouldTerminate(final boolean shouldTerminate);
private static native void nativeRegisterForNotification(final int notification); private static native void nativeRegisterForNotification(final int notification);
final static _AppEventHandler instance = new _AppEventHandler(); static final _AppEventHandler instance = new _AppEventHandler();
static _AppEventHandler getInstance() { static _AppEventHandler getInstance() {
return instance; return instance;
} }

View file

@ -69,31 +69,31 @@ public class FileManager {
* @since Java for Mac OS X 10.5 - 1.5 * @since Java for Mac OS X 10.5 - 1.5
* @since Java for Mac OS X 10.5 Update 1 - 1.6 * @since Java for Mac OS X 10.5 Update 1 - 1.6
*/ */
public final static short kOnAppropriateDisk = -32767; public static final short kOnAppropriateDisk = -32767;
/** /**
* Read-only system hierarchy. * Read-only system hierarchy.
* @since Java for Mac OS X 10.5 - 1.5 * @since Java for Mac OS X 10.5 - 1.5
* @since Java for Mac OS X 10.5 Update 1 - 1.6 * @since Java for Mac OS X 10.5 Update 1 - 1.6
*/ */
public final static short kSystemDomain = -32766; public static final short kSystemDomain = -32766;
/** /**
* All users of a single machine have access to these resources. * All users of a single machine have access to these resources.
* @since Java for Mac OS X 10.5 - 1.5 * @since Java for Mac OS X 10.5 - 1.5
* @since Java for Mac OS X 10.5 Update 1 - 1.6 * @since Java for Mac OS X 10.5 Update 1 - 1.6
*/ */
public final static short kLocalDomain = -32765; public static final short kLocalDomain = -32765;
/** /**
* All users configured to use a common network server has access to these resources. * All users configured to use a common network server has access to these resources.
* @since Java for Mac OS X 10.5 - 1.5 * @since Java for Mac OS X 10.5 - 1.5
* @since Java for Mac OS X 10.5 Update 1 - 1.6 * @since Java for Mac OS X 10.5 Update 1 - 1.6
*/ */
public final static short kNetworkDomain = -32764; public static final short kNetworkDomain = -32764;
/** /**
* Read/write. Resources that are private to the user. * Read/write. Resources that are private to the user.
* @since Java for Mac OS X 10.5 - 1.5 * @since Java for Mac OS X 10.5 - 1.5
* @since Java for Mac OS X 10.5 Update 1 - 1.6 * @since Java for Mac OS X 10.5 Update 1 - 1.6
*/ */
public final static short kUserDomain = -32763; public static final short kUserDomain = -32763;
/** /**

View file

@ -38,17 +38,17 @@ import com.apple.laf.AquaUtils.*;
public abstract class AquaButtonBorder extends AquaBorder implements Border, UIResource { public abstract class AquaButtonBorder extends AquaBorder implements Border, UIResource {
public static final RecyclableSingleton<Dynamic> fDynamic = new RecyclableSingletonFromDefaultConstructor<Dynamic>(Dynamic.class); public static final RecyclableSingleton<Dynamic> fDynamic = new RecyclableSingletonFromDefaultConstructor<Dynamic>(Dynamic.class);
static public AquaButtonBorder getDynamicButtonBorder() { public static AquaButtonBorder getDynamicButtonBorder() {
return fDynamic.get(); return fDynamic.get();
} }
private static final RecyclableSingleton<Toggle> fToggle = new RecyclableSingletonFromDefaultConstructor<Toggle>(Toggle.class); private static final RecyclableSingleton<Toggle> fToggle = new RecyclableSingletonFromDefaultConstructor<Toggle>(Toggle.class);
static public AquaButtonBorder getToggleButtonBorder() { public static AquaButtonBorder getToggleButtonBorder() {
return fToggle.get(); return fToggle.get();
} }
public static final RecyclableSingleton<Toolbar> fToolBar = new RecyclableSingletonFromDefaultConstructor<Toolbar>(Toolbar.class); public static final RecyclableSingleton<Toolbar> fToolBar = new RecyclableSingletonFromDefaultConstructor<Toolbar>(Toolbar.class);
static public Border getToolBarButtonBorder() { public static Border getToolBarButtonBorder() {
return fToolBar.get(); return fToolBar.get();
} }

View file

@ -63,7 +63,7 @@ public class AquaButtonExtendedTypes {
return logicalPosition; return logicalPosition;
} }
static abstract class TypeSpecifier { abstract static class TypeSpecifier {
final String name; final String name;
final boolean setIconFont; final boolean setIconFont;
@ -138,7 +138,7 @@ public class AquaButtonExtendedTypes {
return typeDefinitions.get().get(name); return typeDefinitions.get().get(name);
} }
protected final static RecyclableSingleton<Map<String, TypeSpecifier>> typeDefinitions = new RecyclableSingleton<Map<String, TypeSpecifier>>() { protected static final RecyclableSingleton<Map<String, TypeSpecifier>> typeDefinitions = new RecyclableSingleton<Map<String, TypeSpecifier>>() {
protected Map<String, TypeSpecifier> getInstance() { protected Map<String, TypeSpecifier> getInstance() {
return getAllTypes(); return getAllTypes();
} }

View file

@ -221,7 +221,7 @@ public abstract class AquaButtonLabeledUI extends AquaButtonToggleUI implements
return new Dimension(width, height); return new Dimension(width, height);
} }
public static abstract class LabeledButtonBorder extends AquaButtonBorder { public abstract static class LabeledButtonBorder extends AquaButtonBorder {
public LabeledButtonBorder(final SizeDescriptor sizeDescriptor) { public LabeledButtonBorder(final SizeDescriptor sizeDescriptor) {
super(sizeDescriptor); super(sizeDescriptor);
} }

View file

@ -462,7 +462,7 @@ public class AquaButtonUI extends BasicButtonUI implements Sizeable {
return d; return d;
} }
final static RecyclableSingleton<AquaHierarchyButtonListener> fHierListener = new RecyclableSingletonFromDefaultConstructor<AquaHierarchyButtonListener>(AquaHierarchyButtonListener.class); static final RecyclableSingleton<AquaHierarchyButtonListener> fHierListener = new RecyclableSingletonFromDefaultConstructor<AquaHierarchyButtonListener>(AquaHierarchyButtonListener.class);
static AquaHierarchyButtonListener getAquaHierarchyButtonListener() { static AquaHierarchyButtonListener getAquaHierarchyButtonListener() {
return fHierListener.get(); return fHierListener.get();
} }

View file

@ -35,10 +35,10 @@ import apple.laf.JRSUIConstants.*;
@SuppressWarnings("serial") // Superclass is not serializable across versions @SuppressWarnings("serial") // Superclass is not serializable across versions
class AquaComboBoxButton extends JButton { class AquaComboBoxButton extends JButton {
final protected JComboBox<Object> comboBox; protected final JComboBox<Object> comboBox;
final protected JList<?> list; protected final JList<?> list;
final protected CellRendererPane rendererPane; protected final CellRendererPane rendererPane;
final protected AquaComboBoxUI ui; protected final AquaComboBoxUI ui;
protected final AquaPainter<JRSUIState> painter = AquaPainter.create(JRSUIState.getInstance()); protected final AquaPainter<JRSUIState> painter = AquaPainter.create(JRSUIState.getInstance());
boolean isPopDown; boolean isPopDown;

View file

@ -26,6 +26,8 @@
package com.apple.laf; package com.apple.laf;
import java.awt.*; import java.awt.*;
import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.event.*; import java.awt.event.*;
import javax.swing.*; import javax.swing.*;
@ -195,24 +197,14 @@ class AquaComboBoxPopup extends BasicComboPopup {
final GraphicsDevice[] gs = ge.getScreenDevices(); final GraphicsDevice[] gs = ge.getScreenDevices();
//System.err.println(" gs.length = " + gs.length); //System.err.println(" gs.length = " + gs.length);
final Rectangle comboBoxBounds = comboBox.getBounds(); final Rectangle comboBoxBounds = comboBox.getBounds();
if (gs.length == 1) {
final Dimension scrSize = Toolkit.getDefaultToolkit().getScreenSize();
//System.err.println(" scrSize: "+ scrSize);
// If the combo box is totally off screen, don't show a popup
if ((p.x + comboBoxBounds.width < 0) || (p.y + comboBoxBounds.height < 0) || (p.x > scrSize.width) || (p.y > scrSize.height)) {
return null;
}
Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(comboBox.getGraphicsConfiguration());
return new Rectangle(0, insets.top, scrSize.width, scrSize.height - insets.top - insets.bottom);
}
for (final GraphicsDevice gd : gs) { for (final GraphicsDevice gd : gs) {
final GraphicsConfiguration[] gc = gd.getConfigurations(); final GraphicsConfiguration[] gc = gd.getConfigurations();
for (final GraphicsConfiguration element0 : gc) { for (final GraphicsConfiguration element0 : gc) {
final Rectangle gcBounds = element0.getBounds(); final Rectangle gcBounds = element0.getBounds();
if (gcBounds.contains(p)) return gcBounds; if (gcBounds.contains(p)) {
return getAvailableScreenArea(gcBounds, element0);
}
} }
} }
@ -222,13 +214,24 @@ class AquaComboBoxPopup extends BasicComboPopup {
final GraphicsConfiguration[] gc = gd.getConfigurations(); final GraphicsConfiguration[] gc = gd.getConfigurations();
for (final GraphicsConfiguration element0 : gc) { for (final GraphicsConfiguration element0 : gc) {
final Rectangle gcBounds = element0.getBounds(); final Rectangle gcBounds = element0.getBounds();
if (gcBounds.intersects(comboBoxBounds)) return gcBounds; if (gcBounds.intersects(comboBoxBounds)) {
if (gcBounds.contains(p)) {
return getAvailableScreenArea(gcBounds, element0);
}
}
} }
} }
return null; return null;
} }
private Rectangle getAvailableScreenArea(Rectangle bounds,
GraphicsConfiguration gc) {
Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(gc);
return new Rectangle(0, insets.top, bounds.width,
bounds.height - insets.top);
}
@Override @Override
protected Rectangle computePopupBounds(int px, int py, int pw, int ph) { protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
final int itemCount = comboBox.getModel().getSize(); final int itemCount = comboBox.getModel().getSize();

View file

@ -57,8 +57,8 @@ class AquaFileSystemModel extends AbstractTableModel implements PropertyChangeLi
// private boolean fSortAscending = true; // private boolean fSortAscending = true;
private boolean fSortNames = true; private boolean fSortNames = true;
private final String[] fColumnNames; private final String[] fColumnNames;
public final static String SORT_BY_CHANGED = "sortByChanged"; public static final String SORT_BY_CHANGED = "sortByChanged";
public final static String SORT_ASCENDING_CHANGED = "sortAscendingChanged"; public static final String SORT_ASCENDING_CHANGED = "sortAscendingChanged";
public AquaFileSystemModel(final JFileChooser filechooser, final JTable filelist, final String[] colNames) { public AquaFileSystemModel(final JFileChooser filechooser, final JTable filelist, final String[] colNames) {
fileCacheLock = new Object(); fileCacheLock = new Object();

View file

@ -73,7 +73,7 @@ public class AquaIcon {
public void initIconPainter(final AquaPainter<? extends JRSUIState> painter); public void initIconPainter(final AquaPainter<? extends JRSUIState> painter);
} }
static abstract class JRSUIIcon implements Icon, UIResource { abstract static class JRSUIIcon implements Icon, UIResource {
protected final AquaPainter<JRSUIState> painter = AquaPainter.create(JRSUIState.getInstance()); protected final AquaPainter<JRSUIState> painter = AquaPainter.create(JRSUIState.getInstance());
public void paintIcon(final Component c, final Graphics g, final int x, final int y) { public void paintIcon(final Component c, final Graphics g, final int x, final int y) {
@ -81,7 +81,7 @@ public class AquaIcon {
} }
} }
static abstract class DynamicallySizingJRSUIIcon extends JRSUIIcon { abstract static class DynamicallySizingJRSUIIcon extends JRSUIIcon {
protected final SizeDescriptor sizeDescriptor; protected final SizeDescriptor sizeDescriptor;
protected SizeVariant sizeVariant; protected SizeVariant sizeVariant;
@ -109,7 +109,7 @@ public class AquaIcon {
} }
} }
static abstract class CachingScalingIcon implements Icon, UIResource { abstract static class CachingScalingIcon implements Icon, UIResource {
int width; int width;
int height; int height;
Image image; Image image;
@ -167,7 +167,7 @@ public class AquaIcon {
} }
static abstract class ScalingJRSUIIcon implements Icon, UIResource { abstract static class ScalingJRSUIIcon implements Icon, UIResource {
final int width; final int width;
final int height; final int height;

View file

@ -229,9 +229,9 @@ public class AquaInternalFrameDockIconUI extends DesktopIconUI implements MouseL
@SuppressWarnings("serial") // Superclass is not serializable across versions @SuppressWarnings("serial") // Superclass is not serializable across versions
class DockLabel extends JLabel { class DockLabel extends JLabel {
final static int NUB_HEIGHT = 7; static final int NUB_HEIGHT = 7;
final static int ROUND_ADDITIONAL_HEIGHT = 8; static final int ROUND_ADDITIONAL_HEIGHT = 8;
final static int ROUND_ADDITIONAL_WIDTH = 12; static final int ROUND_ADDITIONAL_WIDTH = 12;
DockLabel(final String text) { DockLabel(final String text) {
super(text); super(text);

View file

@ -529,7 +529,7 @@ public class AquaKeyBindings {
// extracted and adapted from DefaultEditorKit in 1.6 // extracted and adapted from DefaultEditorKit in 1.6
@SuppressWarnings("serial") // Superclass is not serializable across versions @SuppressWarnings("serial") // Superclass is not serializable across versions
static abstract class DeleteWordAction extends TextAction { abstract static class DeleteWordAction extends TextAction {
public DeleteWordAction(final String name) { super(name); } public DeleteWordAction(final String name) { super(name); }
public void actionPerformed(final ActionEvent e) { public void actionPerformed(final ActionEvent e) {

View file

@ -48,7 +48,7 @@ import com.apple.laf.AquaUtils.RecyclableSingletonFromDefaultConstructor;
public class AquaRootPaneUI extends BasicRootPaneUI implements AncestorListener, WindowListener, ContainerListener { public class AquaRootPaneUI extends BasicRootPaneUI implements AncestorListener, WindowListener, ContainerListener {
private static final RecyclableSingleton<AquaRootPaneUI> sRootPaneUI = new RecyclableSingletonFromDefaultConstructor<AquaRootPaneUI>(AquaRootPaneUI.class); private static final RecyclableSingleton<AquaRootPaneUI> sRootPaneUI = new RecyclableSingletonFromDefaultConstructor<AquaRootPaneUI>(AquaRootPaneUI.class);
final static int kDefaultButtonPaintDelayBetweenFrames = 50; static final int kDefaultButtonPaintDelayBetweenFrames = 50;
JButton fCurrentDefaultButton = null; JButton fCurrentDefaultButton = null;
Timer fTimer = null; Timer fTimer = null;
static final boolean sUseScreenMenuBar = AquaMenuBarUI.getScreenMenuBarProperty(); static final boolean sUseScreenMenuBar = AquaMenuBarUI.getScreenMenuBarProperty();

View file

@ -2011,20 +2011,20 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing
} }
private static class Actions extends UIAction { private static class Actions extends UIAction {
final static String NEXT = "navigateNext"; static final String NEXT = "navigateNext";
final static String PREVIOUS = "navigatePrevious"; static final String PREVIOUS = "navigatePrevious";
final static String RIGHT = "navigateRight"; static final String RIGHT = "navigateRight";
final static String LEFT = "navigateLeft"; static final String LEFT = "navigateLeft";
final static String UP = "navigateUp"; static final String UP = "navigateUp";
final static String DOWN = "navigateDown"; static final String DOWN = "navigateDown";
final static String PAGE_UP = "navigatePageUp"; static final String PAGE_UP = "navigatePageUp";
final static String PAGE_DOWN = "navigatePageDown"; static final String PAGE_DOWN = "navigatePageDown";
final static String REQUEST_FOCUS = "requestFocus"; static final String REQUEST_FOCUS = "requestFocus";
final static String REQUEST_FOCUS_FOR_VISIBLE = "requestFocusForVisibleComponent"; static final String REQUEST_FOCUS_FOR_VISIBLE = "requestFocusForVisibleComponent";
final static String SET_SELECTED = "setSelectedIndex"; static final String SET_SELECTED = "setSelectedIndex";
final static String SELECT_FOCUSED = "selectTabWithFocus"; static final String SELECT_FOCUSED = "selectTabWithFocus";
final static String SCROLL_FORWARD = "scrollTabsForwardAction"; static final String SCROLL_FORWARD = "scrollTabsForwardAction";
final static String SCROLL_BACKWARD = "scrollTabsBackwardAction"; static final String SCROLL_BACKWARD = "scrollTabsBackwardAction";
Actions(final String key) { Actions(final String key) {
super(key); super(key);

View file

@ -67,7 +67,7 @@ public class AquaTableHeaderUI extends BasicTableHeaderUI {
super.uninstallDefaults(); super.uninstallDefaults();
} }
final static RecyclableSingleton<ClientPropertyApplicator<JTableHeader, JTableHeader>> TABLE_HEADER_APPLICATORS = new RecyclableSingleton<ClientPropertyApplicator<JTableHeader, JTableHeader>>() { static final RecyclableSingleton<ClientPropertyApplicator<JTableHeader, JTableHeader>> TABLE_HEADER_APPLICATORS = new RecyclableSingleton<ClientPropertyApplicator<JTableHeader, JTableHeader>>() {
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
protected ClientPropertyApplicator<JTableHeader, JTableHeader> getInstance() { protected ClientPropertyApplicator<JTableHeader, JTableHeader> getInstance() {

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -27,7 +27,6 @@ package com.apple.laf;
import java.awt.*; import java.awt.*;
import java.beans.*; import java.beans.*;
import java.lang.reflect.Method;
import javax.swing.*; import javax.swing.*;
import javax.swing.border.Border; import javax.swing.border.Border;
@ -38,16 +37,20 @@ import apple.laf.JRSUIConstants.*;
import com.apple.laf.AquaUtils.RecyclableSingleton; import com.apple.laf.AquaUtils.RecyclableSingleton;
import com.apple.laf.AquaUtils.RecyclableSingletonFromDefaultConstructor; import com.apple.laf.AquaUtils.RecyclableSingletonFromDefaultConstructor;
import sun.security.action.GetPropertyAction;
import static java.security.AccessController.*;
public class AquaUtilControlSize { public class AquaUtilControlSize {
protected final static String CLIENT_PROPERTY_KEY = "JComponent.sizeVariant"; protected static final String CLIENT_PROPERTY_KEY = "JComponent.sizeVariant";
protected final static String SYSTEM_PROPERTY_KEY = "swing.component.sizevariant"; protected static final String SYSTEM_PROPERTY_KEY = "swing.component.sizevariant";
interface Sizeable { interface Sizeable {
void applySizeFor(final JComponent c, final Size size); void applySizeFor(final JComponent c, final Size size);
} }
protected static final RecyclableSingleton<PropertySizeListener> sizeListener = new RecyclableSingletonFromDefaultConstructor<PropertySizeListener>(PropertySizeListener.class); protected static final RecyclableSingleton<PropertySizeListener> sizeListener
= new RecyclableSingletonFromDefaultConstructor<>(PropertySizeListener.class);
protected static PropertySizeListener getSizeListener() { protected static PropertySizeListener getSizeListener() {
return sizeListener.get(); return sizeListener.get();
} }
@ -70,13 +73,13 @@ public class AquaUtilControlSize {
} }
private static Size getDefaultSize() { private static Size getDefaultSize() {
final String sizeProperty = java.security.AccessController.doPrivileged(new sun.security.action.GetPropertyAction(SYSTEM_PROPERTY_KEY)); final String sizeProperty = doPrivileged(new GetPropertyAction(SYSTEM_PROPERTY_KEY));
final JRSUIConstants.Size size = getSizeFromString(sizeProperty); final JRSUIConstants.Size size = getSizeFromString(sizeProperty);
if (size != null) return size; if (size != null) return size;
return JRSUIConstants.Size.REGULAR; return JRSUIConstants.Size.REGULAR;
} }
protected final static JRSUIConstants.Size defaultSize = getDefaultSize(); protected static final JRSUIConstants.Size defaultSize = getDefaultSize();
protected static JRSUIConstants.Size getUserSizeFrom(final JComponent c) { protected static JRSUIConstants.Size getUserSizeFrom(final JComponent c) {
final Object sizeProp = c.getClientProperty(CLIENT_PROPERTY_KEY); final Object sizeProp = c.getClientProperty(CLIENT_PROPERTY_KEY);
if (sizeProp == null) return defaultSize; if (sizeProp == null) return defaultSize;
@ -85,20 +88,32 @@ public class AquaUtilControlSize {
return size; return size;
} }
protected static JRSUIConstants.Size applySizeForControl(final JComponent c, final AquaPainter<? extends JRSUIState> painter) { protected static JRSUIConstants.Size applySizeForControl(final JComponent c,
final AquaPainter<? extends JRSUIState> painter) {
final JRSUIConstants.Size sizeFromUser = getUserSizeFrom(c); final JRSUIConstants.Size sizeFromUser = getUserSizeFrom(c);
final JRSUIConstants.Size size = sizeFromUser == null ? JRSUIConstants.Size.REGULAR : sizeFromUser; final JRSUIConstants.Size size = sizeFromUser == null
? JRSUIConstants.Size.REGULAR
: sizeFromUser;
painter.state.set(size); painter.state.set(size);
return size; return size;
} }
protected static Font getFontForSize(final Component c, final JRSUIConstants.Size size) { protected static Font getFontForSize(final Component c,
final JRSUIConstants.Size size) {
final Font initialFont = c.getFont(); final Font initialFont = c.getFont();
if (size == null || !(initialFont instanceof UIResource)) return initialFont; if (size == null || !(initialFont instanceof UIResource)) {
return initialFont;
}
if (size == JRSUIConstants.Size.MINI) return initialFont.deriveFont(AquaFonts.getMiniControlTextFont().getSize2D()); if (size == JRSUIConstants.Size.MINI) {
if (size == JRSUIConstants.Size.SMALL) return initialFont.deriveFont(AquaFonts.getSmallControlTextFont().getSize2D()); return initialFont.deriveFont(
AquaFonts.getMiniControlTextFont().getSize2D());
}
if (size == JRSUIConstants.Size.SMALL) {
return initialFont.deriveFont(
AquaFonts.getSmallControlTextFont().getSize2D());
}
return initialFont.deriveFont(AquaFonts.getControlTextFont().getSize2D()); return initialFont.deriveFont(AquaFonts.getControlTextFont().getSize2D());
} }
@ -115,25 +130,8 @@ public class AquaUtilControlSize {
c.setBorder(derivedBorder); c.setBorder(derivedBorder);
} }
// call JComponent.getUI() if it exists, then call Sizeable.applySizeFor() if the UI is "Sizeable"
// next best thing to -respondsToSelector: :-P
private static void applyUISizing(final JComponent c, final Size size) {
try {
// see if this component has a "getUI" method
final Class<? extends JComponent> clazz = c.getClass();
final Method getUIMethod = clazz.getMethod("getUI", new Class<?>[0]);
// see if that UI is one of ours that understands sizing
final Object ui = getUIMethod.invoke(c, new Object[0]);
if (!(ui instanceof Sizeable)) return;
// size it!
final Sizeable sizeable = (Sizeable)ui;
sizeable.applySizeFor(c, size);
} catch (final Throwable e) { return; }
}
protected static class PropertySizeListener implements PropertyChangeListener { protected static class PropertySizeListener implements PropertyChangeListener {
@Override
public void propertyChange(final PropertyChangeEvent evt) { public void propertyChange(final PropertyChangeEvent evt) {
final String key = evt.getPropertyName(); final String key = evt.getPropertyName();
if (!CLIENT_PROPERTY_KEY.equalsIgnoreCase(key)) return; if (!CLIENT_PROPERTY_KEY.equalsIgnoreCase(key)) return;
@ -154,7 +152,10 @@ public class AquaUtilControlSize {
applyBorderForSize(c, size); applyBorderForSize(c, size);
applyUISizing(c, size); final Object ui = c.getUI();
if (ui instanceof Sizeable) {
((Sizeable) ui).applySizeFor(c, size);
}
final Font priorFont = c.getFont(); final Font priorFont = c.getFont();
if (!(priorFont instanceof FontUIResource)) return; if (!(priorFont instanceof FontUIResource)) return;
@ -200,6 +201,7 @@ public class AquaUtilControlSize {
return regular; return regular;
} }
@Override
public String toString() { public String toString() {
return "regular[" + regular + "] small[" + small + "] mini[" + mini + "]"; return "regular[" + regular + "] small[" + small + "] mini[" + mini + "]";
} }
@ -223,8 +225,14 @@ public class AquaUtilControlSize {
public SizeVariant(final SizeVariant desc){ public SizeVariant(final SizeVariant desc){
this.size = desc.size; this.size = desc.size;
this.insets = new InsetsUIResource(desc.insets.top, desc.insets.left, desc.insets.bottom, desc.insets.right); this.insets = new InsetsUIResource(desc.insets.top,
this.margins = new InsetsUIResource(desc.margins.top, desc.margins.left, desc.margins.bottom, desc.margins.right); desc.insets.left,
desc.insets.bottom,
desc.insets.right);
this.margins = new InsetsUIResource(desc.margins.top,
desc.margins.left,
desc.margins.bottom,
desc.margins.right);
this.fontSize = desc.fontSize; this.fontSize = desc.fontSize;
this.w = desc.w; this.w = desc.w;
this.h = desc.h; this.h = desc.h;
@ -241,7 +249,8 @@ public class AquaUtilControlSize {
return this; return this;
} }
public SizeVariant alterInsets(final int top, final int left, final int bottom, final int right) { public SizeVariant alterInsets(final int top, final int left,
final int bottom, final int right) {
insets = generateInsets(insets, top, left, bottom, right); insets = generateInsets(insets, top, left, bottom, right);
return this; return this;
} }
@ -251,7 +260,8 @@ public class AquaUtilControlSize {
return this; return this;
} }
public SizeVariant alterMargins(final int top, final int left, final int bottom, final int right) { public SizeVariant alterMargins(final int top, final int left,
final int bottom, final int right) {
margins = generateInsets(margins, top, left, bottom, right); margins = generateInsets(margins, top, left, bottom, right);
return this; return this;
} }
@ -273,8 +283,12 @@ public class AquaUtilControlSize {
// return this; // return this;
// } // }
static Insets generateInsets(final Insets i, final int top, final int left, final int bottom, final int right) { static Insets generateInsets(final Insets i, final int top,
if (i == null) return new InsetsUIResource(top, left, bottom, right); final int left, final int bottom,
final int right) {
if (i == null) {
return new InsetsUIResource(top, left, bottom, right);
}
i.top += top; i.top += top;
i.left += left; i.left += left;
i.bottom += bottom; i.bottom += bottom;
@ -282,8 +296,10 @@ public class AquaUtilControlSize {
return i; return i;
} }
@Override
public String toString() { public String toString() {
return "insets:" + insets + ", margins:" + margins + ", fontSize:" + fontSize;// + ", textBaseline:" + textBaseline; return "insets:" + insets + ", margins:" + margins + ", fontSize:"
+ fontSize;// + ", textBaseline:" + textBaseline;
} }
} }
} }

View file

@ -36,7 +36,7 @@ import sun.java2d.pipe.*;
import sun.lwawt.macosx.*; import sun.lwawt.macosx.*;
public class CRenderer implements PixelDrawPipe, PixelFillPipe, ShapeDrawPipe, DrawImagePipe { public class CRenderer implements PixelDrawPipe, PixelFillPipe, ShapeDrawPipe, DrawImagePipe {
native static void init(); static native void init();
// cache of the runtime options // cache of the runtime options
static { static {

View file

@ -35,8 +35,8 @@ import sun.java2d.loops.*;
import sun.java2d.pipe.*; import sun.java2d.pipe.*;
public class CompositeCRenderer extends CRenderer implements PixelDrawPipe, PixelFillPipe, ShapeDrawPipe, DrawImagePipe, TextPipe { public class CompositeCRenderer extends CRenderer implements PixelDrawPipe, PixelFillPipe, ShapeDrawPipe, DrawImagePipe, TextPipe {
final static int fPadding = 4; static final int fPadding = 4;
final static int fPaddingHalf = fPadding / 2; static final int fPaddingHalf = fPadding / 2;
private static AffineTransform sIdentityMatrix = new AffineTransform(); private static AffineTransform sIdentityMatrix = new AffineTransform();

View file

@ -43,8 +43,8 @@ import java.lang.annotation.Native;
* This is the SurfaceData for a CGContextRef. * This is the SurfaceData for a CGContextRef.
*/ */
public abstract class OSXSurfaceData extends BufImgSurfaceData { public abstract class OSXSurfaceData extends BufImgSurfaceData {
final static float UPPER_BND = Float.MAX_VALUE / 2.0f; static final float UPPER_BND = Float.MAX_VALUE / 2.0f;
final static float LOWER_BND = -UPPER_BND; static final float LOWER_BND = -UPPER_BND;
protected static CRenderer sQuartzPipe = null; protected static CRenderer sQuartzPipe = null;
protected static CTextPipe sCocoaTextPipe = null; protected static CTextPipe sCocoaTextPipe = null;

View file

@ -365,7 +365,7 @@ public abstract class CGLSurfaceData extends OGLSurfaceData {
// Mac OS X specific APIs for JOGL/Java2D bridge... // Mac OS X specific APIs for JOGL/Java2D bridge...
// given a surface create and attach GL context, then return it // given a surface create and attach GL context, then return it
private native static long createCGLContextOnSurface(CGLSurfaceData sd, private static native long createCGLContextOnSurface(CGLSurfaceData sd,
long sharedContext); long sharedContext);
public static long createOGLContextOnSurface(Graphics g, long sharedContext) { public static long createOGLContextOnSurface(Graphics g, long sharedContext) {
@ -379,7 +379,7 @@ public abstract class CGLSurfaceData extends OGLSurfaceData {
} }
// returns whether or not the makeCurrent operation succeeded // returns whether or not the makeCurrent operation succeeded
native static boolean makeCGLContextCurrentOnSurface(CGLSurfaceData sd, static native boolean makeCGLContextCurrentOnSurface(CGLSurfaceData sd,
long ctx); long ctx);
public static boolean makeOGLContextCurrentOnSurface(Graphics g, long ctx) { public static boolean makeOGLContextCurrentOnSurface(Graphics g, long ctx) {
@ -393,7 +393,7 @@ public abstract class CGLSurfaceData extends OGLSurfaceData {
} }
// additional cleanup // additional cleanup
private native static void destroyCGLContext(long ctx); private static native void destroyCGLContext(long ctx);
public static void destroyOGLContext(long ctx) { public static void destroyOGLContext(long ctx) {
if (ctx != 0L) { if (ctx != 0L) {

View file

@ -43,12 +43,12 @@ import static sun.lwawt.LWWindowPeer.PeerType;
public abstract class LWToolkit extends SunToolkit implements Runnable { public abstract class LWToolkit extends SunToolkit implements Runnable {
private final static int STATE_NONE = 0; private static final int STATE_NONE = 0;
private final static int STATE_INIT = 1; private static final int STATE_INIT = 1;
private final static int STATE_MESSAGELOOP = 2; private static final int STATE_MESSAGELOOP = 2;
private final static int STATE_SHUTDOWN = 3; private static final int STATE_SHUTDOWN = 3;
private final static int STATE_CLEANUP = 4; private static final int STATE_CLEANUP = 4;
private final static int STATE_DONE = 5; private static final int STATE_DONE = 5;
private int runState = STATE_NONE; private int runState = STATE_NONE;
@ -454,14 +454,14 @@ public abstract class LWToolkit extends SunToolkit implements Runnable {
/* /*
* Expose non-public targetToPeer() method. * Expose non-public targetToPeer() method.
*/ */
public final static Object targetToPeer(Object target) { public static final Object targetToPeer(Object target) {
return SunToolkit.targetToPeer(target); return SunToolkit.targetToPeer(target);
} }
/* /*
* Expose non-public targetDisposedPeer() method. * Expose non-public targetDisposedPeer() method.
*/ */
public final static void targetDisposedPeer(Object target, Object peer) { public static final void targetDisposedPeer(Object target, Object peer) {
SunToolkit.targetDisposedPeer(target, peer); SunToolkit.targetDisposedPeer(target, peer);
} }

View file

@ -558,9 +558,9 @@ class CAccessibility implements PropertyChangeListener {
// Duplicated from JavaComponentAccessibility // Duplicated from JavaComponentAccessibility
// Note that values >=0 are indexes into the child array // Note that values >=0 are indexes into the child array
final static int JAVA_AX_ALL_CHILDREN = -1; static final int JAVA_AX_ALL_CHILDREN = -1;
final static int JAVA_AX_SELECTED_CHILDREN = -2; static final int JAVA_AX_SELECTED_CHILDREN = -2;
final static int JAVA_AX_VISIBLE_CHILDREN = -3; static final int JAVA_AX_VISIBLE_CHILDREN = -3;
// Each child takes up two entries in the array: one for itself and one for its role // Each child takes up two entries in the array: one for itself and one for its role
public static Object[] getChildrenAndRoles(final Accessible a, final Component c, final int whichChildren, final boolean allowIgnored) { public static Object[] getChildrenAndRoles(final Accessible a, final Component c, final int whichChildren, final boolean allowIgnored) {

View file

@ -171,7 +171,7 @@ public class CDataTransferer extends DataTransferer {
} }
@Override @Override
synchronized protected Long getFormatForNativeAsLong(String str) { protected synchronized Long getFormatForNativeAsLong(String str) {
Long format = predefinedClipboardNameMap.get(str); Long format = predefinedClipboardNameMap.get(str);
if (format == null) { if (format == null) {

View file

@ -422,7 +422,7 @@ public class CInputMethod extends InputMethodAdapter {
* Tell the component to commit all of the characters in the string to the current * Tell the component to commit all of the characters in the string to the current
* text view. This effectively wipes out any text in progress. * text view. This effectively wipes out any text in progress.
*/ */
synchronized private void insertText(String aString) { private synchronized void insertText(String aString) {
AttributedString attribString = new AttributedString(aString); AttributedString attribString = new AttributedString(aString);
// Set locale information on the new string. // Set locale information on the new string.
@ -447,11 +447,11 @@ public class CInputMethod extends InputMethodAdapter {
fCurrentTextLength = rawText.length(); fCurrentTextLength = rawText.length();
} }
static private final int kCaretPosition = 0; private static final int kCaretPosition = 0;
static private final int kRawText = 1; private static final int kRawText = 1;
static private final int kSelectedRawText = 2; private static final int kSelectedRawText = 2;
static private final int kConvertedText = 3; private static final int kConvertedText = 3;
static private final int kSelectedConvertedText = 4; private static final int kSelectedConvertedText = 4;
/** /**
* Convert Cocoa text highlight attributes into Java input method highlighting. * Convert Cocoa text highlight attributes into Java input method highlighting.
@ -556,7 +556,7 @@ public class CInputMethod extends InputMethodAdapter {
/** /**
* Frequent callbacks from NSTextInput. I think we're supposed to commit it here? * Frequent callbacks from NSTextInput. I think we're supposed to commit it here?
*/ */
synchronized private void unmarkText() { private synchronized void unmarkText() {
if (fCurrentText == null) if (fCurrentText == null)
return; return;
@ -574,7 +574,7 @@ public class CInputMethod extends InputMethodAdapter {
fCurrentTextLength = 0; fCurrentTextLength = 0;
} }
synchronized private boolean hasMarkedText() { private synchronized boolean hasMarkedText() {
return fCurrentText != null; return fCurrentText != null;
} }
@ -583,7 +583,7 @@ public class CInputMethod extends InputMethodAdapter {
* Java does not. So, we have to see where the request is and based on that return the right * Java does not. So, we have to see where the request is and based on that return the right
* substring. * substring.
*/ */
synchronized private String attributedSubstringFromRange(final int locationIn, final int lengthIn) { private synchronized String attributedSubstringFromRange(final int locationIn, final int lengthIn) {
final String[] retString = new String[1]; final String[] retString = new String[1];
try { try {
@ -635,7 +635,7 @@ public class CInputMethod extends InputMethodAdapter {
* for the fact that the insert point in Swing can come AFTER the selected text, making this * for the fact that the insert point in Swing can come AFTER the selected text, making this
* potentially incorrect. * potentially incorrect.
*/ */
synchronized private int[] selectedRange() { private synchronized int[] selectedRange() {
final int[] returnValue = new int[2]; final int[] returnValue = new int[2];
try { try {
@ -683,7 +683,7 @@ public class CInputMethod extends InputMethodAdapter {
* inserted, so we can return that position, and the length of the text in progress. If there is no marked text * inserted, so we can return that position, and the length of the text in progress. If there is no marked text
* return null. * return null.
*/ */
synchronized private int[] markedRange() { private synchronized int[] markedRange() {
if (fCurrentText == null) if (fCurrentText == null)
return null; return null;
@ -710,7 +710,7 @@ public class CInputMethod extends InputMethodAdapter {
* which is always in front of the in-progress text, we get the offset into the composed text, and we get * which is always in front of the in-progress text, we get the offset into the composed text, and we get
* that location from the input method context. * that location from the input method context.
*/ */
synchronized private int[] firstRectForCharacterRange(final int absoluteTextOffset) { private synchronized int[] firstRectForCharacterRange(final int absoluteTextOffset) {
final int[] rect = new int[4]; final int[] rect = new int[4];
try { try {
@ -753,7 +753,7 @@ public class CInputMethod extends InputMethodAdapter {
* The coordinates are in Java screen coordinates. If no character in the composed text was hit, we return -1, indicating * The coordinates are in Java screen coordinates. If no character in the composed text was hit, we return -1, indicating
* not found. * not found.
*/ */
synchronized private int characterIndexForPoint(final int screenX, final int screenY) { private synchronized int characterIndexForPoint(final int screenX, final int screenY) {
final TextHitInfo[] offsetInfo = new TextHitInfo[1]; final TextHitInfo[] offsetInfo = new TextHitInfo[1];
final int[] insertPositionOffset = new int[1]; final int[] insertPositionOffset = new int[1];

View file

@ -45,8 +45,8 @@ public final class CWarningWindow extends CPlatformWindow
private static class Lock {} private static class Lock {}
private final Lock lock = new Lock(); private final Lock lock = new Lock();
private final static int SHOWING_DELAY = 300; private static final int SHOWING_DELAY = 300;
private final static int HIDING_DELAY = 2000; private static final int HIDING_DELAY = 2000;
private Rectangle bounds = new Rectangle(); private Rectangle bounds = new Rectangle();
private final WeakReference<LWWindowPeer> ownerPeer; private final WeakReference<LWWindowPeer> ownerPeer;
@ -406,7 +406,7 @@ public final class CWarningWindow extends CPlatformWindow
private final Lock taskLock = new Lock(); private final Lock taskLock = new Lock();
private CancelableRunnable showHideTask; private CancelableRunnable showHideTask;
private static abstract class CancelableRunnable implements Runnable { private abstract static class CancelableRunnable implements Runnable {
private volatile boolean perform = true; private volatile boolean perform = true;
public final void cancel() { public final void cancel() {

View file

@ -30,35 +30,35 @@ public final class CocoaConstants {
private CocoaConstants(){} private CocoaConstants(){}
//from the NSEvent class reference: //from the NSEvent class reference:
public final static int NSLeftMouseDown = 1; public static final int NSLeftMouseDown = 1;
public final static int NSLeftMouseUp = 2; public static final int NSLeftMouseUp = 2;
public final static int NSRightMouseDown = 3; public static final int NSRightMouseDown = 3;
public final static int NSRightMouseUp = 4; public static final int NSRightMouseUp = 4;
public final static int NSMouseMoved = 5; public static final int NSMouseMoved = 5;
public final static int NSLeftMouseDragged = 6; public static final int NSLeftMouseDragged = 6;
public final static int NSRightMouseDragged = 7; public static final int NSRightMouseDragged = 7;
public final static int NSMouseEntered = 8; public static final int NSMouseEntered = 8;
public final static int NSMouseExited = 9; public static final int NSMouseExited = 9;
public final static int NSKeyDown = 10; public static final int NSKeyDown = 10;
public final static int NSKeyUp = 11; public static final int NSKeyUp = 11;
public final static int NSFlagsChanged = 12; public static final int NSFlagsChanged = 12;
public final static int NSScrollWheel = 22; public static final int NSScrollWheel = 22;
public final static int NSOtherMouseDown = 25; public static final int NSOtherMouseDown = 25;
public final static int NSOtherMouseUp = 26; public static final int NSOtherMouseUp = 26;
public final static int NSOtherMouseDragged = 27; public static final int NSOtherMouseDragged = 27;
public final static int AllLeftMouseEventsMask = public static final int AllLeftMouseEventsMask =
1 << NSLeftMouseDown | 1 << NSLeftMouseDown |
1 << NSLeftMouseUp | 1 << NSLeftMouseUp |
1 << NSLeftMouseDragged; 1 << NSLeftMouseDragged;
public final static int AllRightMouseEventsMask = public static final int AllRightMouseEventsMask =
1 << NSRightMouseDown | 1 << NSRightMouseDown |
1 << NSRightMouseUp | 1 << NSRightMouseUp |
1 << NSRightMouseDragged; 1 << NSRightMouseDragged;
public final static int AllOtherMouseEventsMask = public static final int AllOtherMouseEventsMask =
1 << NSOtherMouseDown | 1 << NSOtherMouseDown |
1 << NSOtherMouseUp | 1 << NSOtherMouseUp |
1 << NSOtherMouseDragged; 1 << NSOtherMouseDragged;
@ -82,24 +82,24 @@ public final class CocoaConstants {
// See http://developer.apple.com/library/mac/#documentation/Carbon/Reference/QuartzEventServicesRef/Reference/reference.html // See http://developer.apple.com/library/mac/#documentation/Carbon/Reference/QuartzEventServicesRef/Reference/reference.html
public final static int kCGMouseButtonLeft = 0; public static final int kCGMouseButtonLeft = 0;
public final static int kCGMouseButtonRight = 1; public static final int kCGMouseButtonRight = 1;
public final static int kCGMouseButtonCenter = 2; public static final int kCGMouseButtonCenter = 2;
// See https://wiki.mozilla.org/NPAPI:CocoaEventModel // See https://wiki.mozilla.org/NPAPI:CocoaEventModel
public final static int NPCocoaEventDrawRect = 1; public static final int NPCocoaEventDrawRect = 1;
public final static int NPCocoaEventMouseDown = 2; public static final int NPCocoaEventMouseDown = 2;
public final static int NPCocoaEventMouseUp = 3; public static final int NPCocoaEventMouseUp = 3;
public final static int NPCocoaEventMouseMoved = 4; public static final int NPCocoaEventMouseMoved = 4;
public final static int NPCocoaEventMouseEntered = 5; public static final int NPCocoaEventMouseEntered = 5;
public final static int NPCocoaEventMouseExited = 6; public static final int NPCocoaEventMouseExited = 6;
public final static int NPCocoaEventMouseDragged = 7; public static final int NPCocoaEventMouseDragged = 7;
public final static int NPCocoaEventKeyDown = 8; public static final int NPCocoaEventKeyDown = 8;
public final static int NPCocoaEventKeyUp = 9; public static final int NPCocoaEventKeyUp = 9;
public final static int NPCocoaEventFlagsChanged = 10; public static final int NPCocoaEventFlagsChanged = 10;
public final static int NPCocoaEventFocusChanged = 11; public static final int NPCocoaEventFocusChanged = 11;
public final static int NPCocoaEventWindowFocusChanged = 12; public static final int NPCocoaEventWindowFocusChanged = 12;
public final static int NPCocoaEventScrollWheel = 13; public static final int NPCocoaEventScrollWheel = 13;
public final static int NPCocoaEventTextInput = 14; public static final int NPCocoaEventTextInput = 14;
} }

View file

@ -127,10 +127,10 @@ public final class LWCToolkit extends LWToolkit {
/* /*
* System colors with default initial values, overwritten by toolkit if system values differ and are available. * System colors with default initial values, overwritten by toolkit if system values differ and are available.
*/ */
private final static int NUM_APPLE_COLORS = 3; private static final int NUM_APPLE_COLORS = 3;
public final static int KEYBOARD_FOCUS_COLOR = 0; public static final int KEYBOARD_FOCUS_COLOR = 0;
public final static int INACTIVE_SELECTION_BACKGROUND_COLOR = 1; public static final int INACTIVE_SELECTION_BACKGROUND_COLOR = 1;
public final static int INACTIVE_SELECTION_FOREGROUND_COLOR = 2; public static final int INACTIVE_SELECTION_FOREGROUND_COLOR = 2;
private static int[] appleColors = { private static int[] appleColors = {
0xFF808080, // keyboardFocusColor = Color.gray; 0xFF808080, // keyboardFocusColor = Color.gray;
0xFFC0C0C0, // secondarySelectedControlColor 0xFFC0C0C0, // secondarySelectedControlColor
@ -681,7 +681,7 @@ public final class LWCToolkit extends LWToolkit {
* @param r a {@code Runnable} to execute * @param r a {@code Runnable} to execute
* @param delay a delay in milliseconds * @param delay a delay in milliseconds
*/ */
native static void performOnMainThreadAfterDelay(Runnable r, long delay); static native void performOnMainThreadAfterDelay(Runnable r, long delay);
// DnD support // DnD support

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -26,8 +26,6 @@
#ifndef __AWTEVENT_H #ifndef __AWTEVENT_H
#define __AWTEVENT_H #define __AWTEVENT_H
#import "LWCToolkit.h"
jlong UTC(NSEvent *event); jlong UTC(NSEvent *event);
void DeliverJavaKeyEvent(JNIEnv *env, NSEvent *event, jobject peer); void DeliverJavaKeyEvent(JNIEnv *env, NSEvent *event, jobject peer);
void DeliverJavaMouseEvent(JNIEnv *env, NSEvent *event, jobject peer); void DeliverJavaMouseEvent(JNIEnv *env, NSEvent *event, jobject peer);

View file

@ -23,18 +23,15 @@
* questions. * questions.
*/ */
#import <JavaNativeFoundation/JavaNativeFoundation.h>
#import <JavaRuntimeSupport/JavaRuntimeSupport.h>
#import <sys/time.h>
#include <Carbon/Carbon.h>
#import "jni_util.h"
#import "LWCToolkit.h"
#import "ThreadUtilities.h"
#import "java_awt_event_InputEvent.h" #import "java_awt_event_InputEvent.h"
#import "java_awt_event_KeyEvent.h" #import "java_awt_event_KeyEvent.h"
#import "java_awt_event_MouseEvent.h" #import "LWCToolkit.h"
#import "jni_util.h"
#import <JavaNativeFoundation/JavaNativeFoundation.h>
#import <sys/time.h>
#import <Carbon/Carbon.h>
/* /*
* Table to map typed characters to their Java virtual key equivalent and back. * Table to map typed characters to their Java virtual key equivalent and back.

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -24,7 +24,6 @@
*/ */
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import <JavaNativeFoundation/JavaNativeFoundation.h>
#import "CDragSource.h" #import "CDragSource.h"
#import "CDropTarget.h" #import "CDropTarget.h"

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,22 +23,17 @@
* questions. * questions.
*/ */
#import "CGLGraphicsConfig.h"
#import <JavaNativeFoundation/JavaNativeFoundation.h>
#import <JavaRuntimeSupport/JavaRuntimeSupport.h>
#import "jni_util.h" #import "jni_util.h"
#import "CGLGraphicsConfig.h"
#import "ThreadUtilities.h"
#import "AWTView.h" #import "AWTView.h"
#import "AWTEvent.h"
#import "AWTWindow.h" #import "AWTWindow.h"
#import "LWCToolkit.h"
#import "JavaComponentAccessibility.h" #import "JavaComponentAccessibility.h"
#import "JavaTextAccessibility.h" #import "JavaTextAccessibility.h"
#import "GeomUtilities.h" #import "GeomUtilities.h"
#import "OSVersion.h" #import "OSVersion.h"
#import "CGLLayer.h" #import "ThreadUtilities.h"
#import <JavaNativeFoundation/JavaNativeFoundation.h>
@interface AWTView() @interface AWTView()
@property (retain) CDropTarget *_dropTarget; @property (retain) CDropTarget *_dropTarget;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -27,13 +27,12 @@
#define _AWTWINDOW_H #define _AWTWINDOW_H
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import <JavaNativeFoundation/JavaNativeFoundation.h>
#import "CMenuBar.h" #import "CMenuBar.h"
#import "LWCToolkit.h" #import "LWCToolkit.h"
@class AWTView; @class AWTView;
@class JNFWeakJObjectWrapper;
@interface AWTWindow : NSObject <NSWindowDelegate> { @interface AWTWindow : NSObject <NSWindowDelegate> {
@private @private

View file

@ -25,7 +25,6 @@
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import <JavaNativeFoundation/JavaNativeFoundation.h> #import <JavaNativeFoundation/JavaNativeFoundation.h>
#import <JavaRuntimeSupport/JavaRuntimeSupport.h>
#import "sun_lwawt_macosx_CPlatformWindow.h" #import "sun_lwawt_macosx_CPlatformWindow.h"
#import "com_apple_eawt_event_GestureHandler.h" #import "com_apple_eawt_event_GestureHandler.h"
@ -34,12 +33,8 @@
#import "AWTWindow.h" #import "AWTWindow.h"
#import "AWTView.h" #import "AWTView.h"
#import "CMenu.h"
#import "CMenuBar.h"
#import "LWCToolkit.h"
#import "GeomUtilities.h" #import "GeomUtilities.h"
#import "ThreadUtilities.h" #import "ThreadUtilities.h"
#import "OSVersion.h"
#define MASK(KEY) \ #define MASK(KEY) \
(sun_lwawt_macosx_CPlatformWindow_ ## KEY) (sun_lwawt_macosx_CPlatformWindow_ ## KEY)

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -26,11 +26,9 @@
#import "CDataTransferer.h" #import "CDataTransferer.h"
#include "sun_lwawt_macosx_CDataTransferer.h" #include "sun_lwawt_macosx_CDataTransferer.h"
#import <AppKit/AppKit.h>
#import <JavaNativeFoundation/JavaNativeFoundation.h>
#import "jni_util.h" #import "jni_util.h"
#include "ThreadUtilities.h" #import <JavaNativeFoundation/JavaNativeFoundation.h>
// ***** NOTE ***** This dictionary corresponds to the static array predefinedClipboardNames // ***** NOTE ***** This dictionary corresponds to the static array predefinedClipboardNames

View file

@ -27,7 +27,7 @@
#include "GeomUtilities.h" #include "GeomUtilities.h"
#include "sun_awt_CGraphicsConfig.h" #include "sun_awt_CGraphicsConfig.h"
#import <JavaNativeFoundation/JavaNativeFoundation.h>
/* /*
* Class: sun_awt_CGraphicsConfig * Class: sun_awt_CGraphicsConfig

View file

@ -26,6 +26,8 @@
#import "LWCToolkit.h" #import "LWCToolkit.h"
#import "ThreadUtilities.h" #import "ThreadUtilities.h"
#import <JavaNativeFoundation/JavaNativeFoundation.h>
/* /*
* Convert the mode string to the more convinient bits per pixel value * Convert the mode string to the more convinient bits per pixel value
*/ */
@ -200,7 +202,7 @@ JNF_COCOA_ENTER(env);
for (NSScreen *screen in screens) { for (NSScreen *screen in screens) {
NSDictionary *screenInfo = [screen deviceDescription]; NSDictionary *screenInfo = [screen deviceDescription];
NSNumber *screenID = [screenInfo objectForKey:@"NSScreenNumber"]; NSNumber *screenID = [screenInfo objectForKey:@"NSScreenNumber"];
if ([screenID pointerValue] == displayID){ if ([screenID unsignedIntValue] == displayID){
frame = [screen frame]; frame = [screen frame];
visibleFrame = [screen visibleFrame]; visibleFrame = [screen visibleFrame];
break; break;
@ -333,7 +335,7 @@ JNF_COCOA_ENTER(env);
for (NSScreen *screen in screens) { for (NSScreen *screen in screens) {
NSDictionary *screenInfo = [screen deviceDescription]; NSDictionary *screenInfo = [screen deviceDescription];
NSNumber *screenID = [screenInfo objectForKey:@"NSScreenNumber"]; NSNumber *screenID = [screenInfo objectForKey:@"NSScreenNumber"];
if ([screenID pointerValue] == displayID){ if ([screenID unsignedIntValue] == displayID){
if ([screen respondsToSelector:@selector(backingScaleFactor)]) { if ([screen respondsToSelector:@selector(backingScaleFactor)]) {
ret = [screen backingScaleFactor]; ret = [screen backingScaleFactor];
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,12 +23,11 @@
* questions. * questions.
*/ */
#import <JavaNativeFoundation/JavaNativeFoundation.h>
#import "jni_util.h"
#import "LWCToolkit.h"
#import "AWT_debug.h" #import "AWT_debug.h"
#import "jni_util.h"
#import <JavaNativeFoundation/JavaNativeFoundation.h>
#define MAX_DISPLAYS 64 #define MAX_DISPLAYS 64

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -58,6 +58,14 @@ static void nsPrintInfoToJavaPrinterJob(JNIEnv* env, NSPrintInfo* src, jobject d
static void javaPrinterJobToNSPrintInfo(JNIEnv* env, jobject srcPrinterJob, jobject srcPageable, NSPrintInfo* dst); static void javaPrinterJobToNSPrintInfo(JNIEnv* env, jobject srcPrinterJob, jobject srcPageable, NSPrintInfo* dst);
#ifdef __MAC_10_9 // code for SDK 10.9 or newer
#define NS_PORTRAIT NSPaperOrientationPortrait
#define NS_LANDSCAPE NSPaperOrientationLandscape
#else // code for SDK 10.8 or older
#define NS_PORTRAIT NSPortraitOrientation
#define NS_LANDSCAPE NSLandscapeOrientation
#endif
static NSPrintInfo* createDefaultNSPrintInfo(JNIEnv* env, jstring printer) static NSPrintInfo* createDefaultNSPrintInfo(JNIEnv* env, jstring printer)
{ {
NSPrintInfo* defaultPrintInfo = [[NSPrintInfo sharedPrintInfo] copy]; NSPrintInfo* defaultPrintInfo = [[NSPrintInfo sharedPrintInfo] copy];
@ -143,12 +151,12 @@ static void nsPrintInfoToJavaPaper(JNIEnv* env, NSPrintInfo* src, jobject dst)
NSSize paperSize = [src paperSize]; NSSize paperSize = [src paperSize];
switch ([src orientation]) { switch ([src orientation]) {
case NSPortraitOrientation: case NS_PORTRAIT:
jPaperW = paperSize.width; jPaperW = paperSize.width;
jPaperH = paperSize.height; jPaperH = paperSize.height;
break; break;
case NSLandscapeOrientation: case NS_LANDSCAPE:
jPaperW = paperSize.height; jPaperW = paperSize.height;
jPaperH = paperSize.width; jPaperH = paperSize.width;
break; break;
@ -217,13 +225,12 @@ static void nsPrintInfoToJavaPageFormat(JNIEnv* env, NSPrintInfo* src, jobject d
static JNF_CTOR_CACHE(jm_Paper_ctor, sjc_Paper, "()V"); static JNF_CTOR_CACHE(jm_Paper_ctor, sjc_Paper, "()V");
jint jOrientation; jint jOrientation;
NSPrintingOrientation nsOrientation = [src orientation]; switch ([src orientation]) {
switch (nsOrientation) { case NS_PORTRAIT:
case NSPortraitOrientation:
jOrientation = java_awt_print_PageFormat_PORTRAIT; jOrientation = java_awt_print_PageFormat_PORTRAIT;
break; break;
case NSLandscapeOrientation: case NS_LANDSCAPE:
jOrientation = java_awt_print_PageFormat_LANDSCAPE; //+++gdb Are LANDSCAPE and REVERSE_LANDSCAPE still inverted? jOrientation = java_awt_print_PageFormat_LANDSCAPE; //+++gdb Are LANDSCAPE and REVERSE_LANDSCAPE still inverted?
break; break;
@ -273,20 +280,20 @@ static void javaPageFormatToNSPrintInfo(JNIEnv* env, jobject srcPrintJob, jobjec
switch (JNFCallIntMethod(env, srcPageFormat, jm_getOrientation)) { // AWT_THREADING Safe (!appKit) switch (JNFCallIntMethod(env, srcPageFormat, jm_getOrientation)) { // AWT_THREADING Safe (!appKit)
case java_awt_print_PageFormat_PORTRAIT: case java_awt_print_PageFormat_PORTRAIT:
[dstPrintInfo setOrientation:NSPortraitOrientation]; [dstPrintInfo setOrientation:NS_PORTRAIT];
break; break;
case java_awt_print_PageFormat_LANDSCAPE: case java_awt_print_PageFormat_LANDSCAPE:
[dstPrintInfo setOrientation:NSLandscapeOrientation]; //+++gdb Are LANDSCAPE and REVERSE_LANDSCAPE still inverted? [dstPrintInfo setOrientation:NS_LANDSCAPE]; //+++gdb Are LANDSCAPE and REVERSE_LANDSCAPE still inverted?
break; break;
// AppKit printing doesn't support REVERSE_LANDSCAPE. Radar 2960295. // AppKit printing doesn't support REVERSE_LANDSCAPE. Radar 2960295.
case java_awt_print_PageFormat_REVERSE_LANDSCAPE: case java_awt_print_PageFormat_REVERSE_LANDSCAPE:
[dstPrintInfo setOrientation:NSLandscapeOrientation]; //+++gdb Are LANDSCAPE and REVERSE_LANDSCAPE still inverted? [dstPrintInfo setOrientation:NS_LANDSCAPE]; //+++gdb Are LANDSCAPE and REVERSE_LANDSCAPE still inverted?
break; break;
default: default:
[dstPrintInfo setOrientation:NSPortraitOrientation]; [dstPrintInfo setOrientation:NS_PORTRAIT];
break; break;
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,9 +23,10 @@
* questions. * questions.
*/ */
#import "jni_util.h"
#import <AppKit/AppKit.h> #import <AppKit/AppKit.h>
#import <JavaNativeFoundation/JavaNativeFoundation.h> #import <JavaNativeFoundation/JavaNativeFoundation.h>
#import "jni_util.h"
#import "CTrayIcon.h" #import "CTrayIcon.h"
#import "ThreadUtilities.h" #import "ThreadUtilities.h"

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -24,8 +24,7 @@
*/ */
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import <JavaNativeFoundation/JavaNativeFoundation.h> #include "jni.h"
jobject CGToJavaRect(JNIEnv *env, CGRect rect); jobject CGToJavaRect(JNIEnv *env, CGRect rect);
CGRect JavaToCGRect(JNIEnv *env, jobject rect); CGRect JavaToCGRect(JNIEnv *env, jobject rect);

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -24,6 +24,7 @@
*/ */
#import "GeomUtilities.h" #import "GeomUtilities.h"
#import <JavaNativeFoundation/JavaNativeFoundation.h>
static JNF_CLASS_CACHE(sjc_Point2D, "java/awt/geom/Point2D"); static JNF_CLASS_CACHE(sjc_Point2D, "java/awt/geom/Point2D");
static JNF_MEMBER_CACHE(jm_pt_getX, sjc_Point2D, "getX", "()D"); static JNF_MEMBER_CACHE(jm_pt_getX, sjc_Point2D, "getX", "()D");

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,9 +23,9 @@
* questions. * questions.
*/ */
#import <AppKit/AppKit.h> #include "jni.h"
#import <JavaNativeFoundation/JavaNativeFoundation.h>
#import <AppKit/AppKit.h>
//#define JAVA_AX_DEBUG 1 //#define JAVA_AX_DEBUG 1
//#define JAVA_AX_NO_IGNORES 1 //#define JAVA_AX_NO_IGNORES 1

View file

@ -23,11 +23,12 @@
* questions. * questions.
*/ */
#include "jni.h"
#import <pthread.h> #import <pthread.h>
#import <assert.h> #import <assert.h>
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import <JavaNativeFoundation/JavaNativeFoundation.h>
#define DEBUG 1 #define DEBUG 1

View file

@ -28,15 +28,10 @@
#import <objc/runtime.h> #import <objc/runtime.h>
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import <Security/AuthSession.h> #import <Security/AuthSession.h>
#import <JavaNativeFoundation/JavaNativeFoundation.h>
#import <JavaRuntimeSupport/JavaRuntimeSupport.h>
#include "jni_util.h" #include "jni_util.h"
#import "CMenuBar.h"
#import "InitIDs.h"
#import "LWCToolkit.h" #import "LWCToolkit.h"
#import "ThreadUtilities.h" #import "ThreadUtilities.h"
#import "AWT_debug.h"
#import "CSystemColors.h" #import "CSystemColors.h"
#import "NSApplicationAWT.h" #import "NSApplicationAWT.h"
#import "PropertiesUtilities.h" #import "PropertiesUtilities.h"
@ -46,6 +41,8 @@
#import "sizecalc.h" #import "sizecalc.h"
#import <JavaRuntimeSupport/JavaRuntimeSupport.h>
int gNumberOfButtons; int gNumberOfButtons;
jint* gButtonDownMasks; jint* gButtonDownMasks;
@ -529,7 +526,7 @@ JNF_COCOA_ENTER(env);
// Processing all events excluding NSApplicationDefined which need to be processed // Processing all events excluding NSApplicationDefined which need to be processed
// on the main loop only (those events are intended for disposing resources) // on the main loop only (those events are intended for disposing resources)
NSEvent *event; NSEvent *event;
if ((event = [NSApp nextEventMatchingMask:(NSAnyEventMask & ~NSApplicationDefined) if ((event = [NSApp nextEventMatchingMask:(NSAnyEventMask & ~NSApplicationDefinedMask)
untilDate:nil untilDate:nil
inMode:NSDefaultRunLoopMode inMode:NSDefaultRunLoopMode
dequeue:YES]) != nil) { dequeue:YES]) != nil) {

View file

@ -23,20 +23,17 @@
* questions. * questions.
*/ */
#import "sun_java2d_opengl_CGLGraphicsConfig.h"
#import "CGLGraphicsConfig.h"
#import "CGLSurfaceData.h"
#import "ThreadUtilities.h"
#import <stdlib.h> #import <stdlib.h>
#import <string.h> #import <string.h>
#import <ApplicationServices/ApplicationServices.h> #import <ApplicationServices/ApplicationServices.h>
#import <JavaNativeFoundation/JavaNativeFoundation.h> #import <JavaNativeFoundation/JavaNativeFoundation.h>
#import "sun_java2d_opengl_CGLGraphicsConfig.h"
#import "jni.h"
#import "jni_util.h"
#import "CGLGraphicsConfig.h"
#import "CGLSurfaceData.h"
#import "LWCToolkit.h"
#import "ThreadUtilities.h"
#pragma mark - #pragma mark -
#pragma mark "--- Mac OS X specific methods for GL pipeline ---" #pragma mark "--- Mac OS X specific methods for GL pipeline ---"

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -26,7 +26,7 @@
#ifndef CGLLayer_h_Included #ifndef CGLLayer_h_Included
#define CGLLayer_h_Included #define CGLLayer_h_Included
#import "AWTView.h" #import <JavaNativeFoundation/JavaNativeFoundation.h>
@interface CGLLayer : CAOpenGLLayer @interface CGLLayer : CAOpenGLLayer
{ {

View file

@ -24,16 +24,13 @@
*/ */
#import <stdlib.h> #import <stdlib.h>
#import <JavaNativeFoundation/JavaNativeFoundation.h>
#import "sun_java2d_opengl_CGLSurfaceData.h" #import "sun_java2d_opengl_CGLSurfaceData.h"
#import "jni.h"
#import "jni_util.h" #import "jni_util.h"
#import "OGLRenderQueue.h" #import "OGLRenderQueue.h"
#import "CGLGraphicsConfig.h" #import "CGLGraphicsConfig.h"
#import "CGLSurfaceData.h" #import "CGLSurfaceData.h"
#import "CGLLayer.h"
#import "ThreadUtilities.h" #import "ThreadUtilities.h"
/* JDK's glext.h is already included and will prevent the Apple glext.h /* JDK's glext.h is already included and will prevent the Apple glext.h

View file

@ -32,7 +32,7 @@ package com.sun.beans.editors;
import java.beans.*; import java.beans.*;
abstract public class NumberEditor extends PropertyEditorSupport { public abstract class NumberEditor extends PropertyEditorSupport {
public String getJavaInitializationString() { public String getJavaInitializationString() {
Object value = getValue(); Object value = getValue();

View file

@ -26,7 +26,7 @@
package com.sun.imageio.plugins.common; package com.sun.imageio.plugins.common;
public final class I18N extends I18NImpl { public final class I18N extends I18NImpl {
private final static String resource_name = "iio-plugin.properties"; private static final String resource_name = "iio-plugin.properties";
public static String getString(String key) { public static String getString(String key) {
return getString("com.sun.imageio.plugins.common.I18N", resource_name, key); return getString("com.sun.imageio.plugins.common.I18N", resource_name, key);
} }

View file

@ -37,16 +37,16 @@ import java.io.PrintStream;
**/ **/
public class LZWStringTable { public class LZWStringTable {
/** codesize + Reserved Codes */ /** codesize + Reserved Codes */
private final static int RES_CODES = 2; private static final int RES_CODES = 2;
private final static short HASH_FREE = (short)0xFFFF; private static final short HASH_FREE = (short)0xFFFF;
private final static short NEXT_FIRST = (short)0xFFFF; private static final short NEXT_FIRST = (short)0xFFFF;
private final static int MAXBITS = 12; private static final int MAXBITS = 12;
private final static int MAXSTR = (1 << MAXBITS); private static final int MAXSTR = (1 << MAXBITS);
private final static short HASHSIZE = 9973; private static final short HASHSIZE = 9973;
private final static short HASHSTEP = 2039; private static final short HASHSTEP = 2039;
byte[] strChr; // after predecessor character byte[] strChr; // after predecessor character
short[] strNxt; // predecessor string short[] strNxt; // predecessor string
@ -142,7 +142,7 @@ public class LZWStringTable {
} }
} }
static public int hash(short index, byte lastbyte) { public static int hash(short index, byte lastbyte) {
return (((short)(lastbyte << 8) ^ index) & 0xFFFF) % HASHSIZE; return (((short)(lastbyte << 8) ^ index) & 0xFFFF) % HASHSIZE;
} }

View file

@ -1773,7 +1773,7 @@ class ImageTypeProducer {
private static final ImageTypeProducer [] defaultTypes = private static final ImageTypeProducer [] defaultTypes =
new ImageTypeProducer [JPEG.NUM_JCS_CODES]; new ImageTypeProducer [JPEG.NUM_JCS_CODES];
public synchronized static ImageTypeProducer getTypeProducer(int csCode) { public static synchronized ImageTypeProducer getTypeProducer(int csCode) {
if (csCode < 0 || csCode >= JPEG.NUM_JCS_CODES) { if (csCode < 0 || csCode >= JPEG.NUM_JCS_CODES) {
return null; return null;
} }

View file

@ -56,7 +56,7 @@ import sun.swing.ImageCache;
*/ */
class GTKEngine { class GTKEngine {
final static GTKEngine INSTANCE = new GTKEngine(); static final GTKEngine INSTANCE = new GTKEngine();
/** Size of the image cache */ /** Size of the image cache */
private static final int CACHE_SIZE = 50; private static final int CACHE_SIZE = 50;
@ -523,7 +523,7 @@ class GTKEngine {
native_paint_background(widget, state, x - x0, y - y0, w, h); native_paint_background(widget, state, x - x0, y - y0, w, h);
} }
private final static ColorModel[] COLOR_MODELS = { private static final ColorModel[] COLOR_MODELS = {
// Transparency.OPAQUE // Transparency.OPAQUE
new DirectColorModel(24, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000), new DirectColorModel(24, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000),
// Transparency.BITMASK // Transparency.BITMASK
@ -532,7 +532,7 @@ class GTKEngine {
ColorModel.getRGBdefault(), ColorModel.getRGBdefault(),
}; };
private final static int[][] BAND_OFFSETS = { private static final int[][] BAND_OFFSETS = {
{ 0x00ff0000, 0x0000ff00, 0x000000ff }, // OPAQUE { 0x00ff0000, 0x0000ff00, 0x000000ff }, // OPAQUE
{ 0x00ff0000, 0x0000ff00, 0x000000ff, 0x01000000 }, // BITMASK { 0x00ff0000, 0x0000ff00, 0x000000ff, 0x01000000 }, // BITMASK
{ 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 } // TRANSLUCENT { 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 } // TRANSLUCENT

View file

@ -63,8 +63,8 @@ class GTKPainter extends SynthPainter {
ShadowType.ETCHED_IN, ShadowType.OUT ShadowType.ETCHED_IN, ShadowType.OUT
}; };
private final static GTKEngine ENGINE = GTKEngine.INSTANCE; private static final GTKEngine ENGINE = GTKEngine.INSTANCE;
final static GTKPainter INSTANCE = new GTKPainter(); static final GTKPainter INSTANCE = new GTKPainter();
private GTKPainter() { private GTKPainter() {
} }

View file

@ -263,7 +263,7 @@ public class MotifBorders {
Color frameShadow; Color frameShadow;
// The width of the border // The width of the border
public final static int BORDER_SIZE = 5; public static final int BORDER_SIZE = 5;
/** Constructs an FrameBorder for the JComponent <b>comp</b>. /** Constructs an FrameBorder for the JComponent <b>comp</b>.
*/ */
@ -446,7 +446,7 @@ public class MotifBorders {
JInternalFrame frame; JInternalFrame frame;
// The size of the bounding box for Motif frame corners. // The size of the bounding box for Motif frame corners.
public final static int CORNER_SIZE = 24; public static final int CORNER_SIZE = 24;
/** Constructs an InternalFrameBorder for the InternalFrame /** Constructs an InternalFrameBorder for the InternalFrame
* <b>aFrame</b>. * <b>aFrame</b>.
@ -634,10 +634,10 @@ public class MotifBorders {
protected Color highlightColor; protected Color highlightColor;
// Space between the border and text // Space between the border and text
static protected final int TEXT_SPACING = 2; protected static final int TEXT_SPACING = 2;
// Space for the separator under the title // Space for the separator under the title
static protected final int GROOVE_HEIGHT = 2; protected static final int GROOVE_HEIGHT = 2;
/** /**
* Creates a MotifPopupMenuBorder instance * Creates a MotifPopupMenuBorder instance

View file

@ -49,7 +49,7 @@ public class MotifCheckBoxUI extends MotifRadioButtonUI {
private static final Object MOTIF_CHECK_BOX_UI_KEY = new Object(); private static final Object MOTIF_CHECK_BOX_UI_KEY = new Object();
private final static String propertyPrefix = "CheckBox" + "."; private static final String propertyPrefix = "CheckBox" + ".";
private boolean defaults_initialized = false; private boolean defaults_initialized = false;

View file

@ -59,10 +59,10 @@ public class MotifDesktopIconUI extends BasicDesktopIconUI
JPopupMenu systemMenu; JPopupMenu systemMenu;
EventListener mml; EventListener mml;
final static int LABEL_HEIGHT = 18; static final int LABEL_HEIGHT = 18;
final static int LABEL_DIVIDER = 4; // padding between icon and label static final int LABEL_DIVIDER = 4; // padding between icon and label
final static Font defaultTitleFont = static final Font defaultTitleFont =
new Font(Font.SANS_SERIF, Font.PLAIN, 12); new Font(Font.SANS_SERIF, Font.PLAIN, 12);
public static ComponentUI createUI(JComponent c) { public static ComponentUI createUI(JComponent c) {

View file

@ -306,7 +306,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
} }
@SuppressWarnings("serial") // anonymous class @SuppressWarnings("serial") // anonymous class
JTextField tmp1 = new JTextField(curDirName) { JTextField tmp1 = new JTextField(curDirName, 35) {
public Dimension getMaximumSize() { public Dimension getMaximumSize() {
Dimension d = super.getMaximumSize(); Dimension d = super.getMaximumSize();
d.height = getPreferredSize().height; d.height = getPreferredSize().height;
@ -420,7 +420,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
interior.add(fileNameLabel); interior.add(fileNameLabel);
@SuppressWarnings("serial") // anonymous class @SuppressWarnings("serial") // anonymous class
JTextField tmp3 = new JTextField() { JTextField tmp3 = new JTextField(35) {
public Dimension getMaximumSize() { public Dimension getMaximumSize() {
Dimension d = super.getMaximumSize(); Dimension d = super.getMaximumSize();
d.height = getPreferredSize().height; d.height = getPreferredSize().height;

View file

@ -93,7 +93,7 @@ public class MotifIconFactory implements Serializable
@SuppressWarnings("serial") // Same-version serialization only @SuppressWarnings("serial") // Same-version serialization only
private static class CheckBoxIcon implements Icon, UIResource, Serializable { private static class CheckBoxIcon implements Icon, UIResource, Serializable {
final static int csize = 13; static final int csize = 13;
private Color control = UIManager.getColor("control"); private Color control = UIManager.getColor("control");
private Color foreground = UIManager.getColor("CheckBox.foreground"); private Color foreground = UIManager.getColor("CheckBox.foreground");

View file

@ -56,7 +56,7 @@ public class MotifInternalFrameTitlePane
Color shadow; Color shadow;
// The width and height of a title pane button // The width and height of a title pane button
public final static int BUTTON_SIZE = 19; // 17 + 1 pixel border public static final int BUTTON_SIZE = 19; // 17 + 1 pixel border
public MotifInternalFrameTitlePane(JInternalFrame frame) { public MotifInternalFrameTitlePane(JInternalFrame frame) {

View file

@ -47,9 +47,9 @@ import java.beans.PropertyChangeListener;
*/ */
public class MotifScrollPaneUI extends BasicScrollPaneUI public class MotifScrollPaneUI extends BasicScrollPaneUI
{ {
private final static Border vsbMarginBorderR = new EmptyBorder(0, 4, 0, 0); private static final Border vsbMarginBorderR = new EmptyBorder(0, 4, 0, 0);
private final static Border vsbMarginBorderL = new EmptyBorder(0, 0, 0, 4); private static final Border vsbMarginBorderL = new EmptyBorder(0, 0, 0, 4);
private final static Border hsbMarginBorder = new EmptyBorder(4, 0, 0, 0); private static final Border hsbMarginBorder = new EmptyBorder(4, 0, 0, 0);
private CompoundBorder vsbBorder; private CompoundBorder vsbBorder;
private CompoundBorder hsbBorder; private CompoundBorder hsbBorder;

View file

@ -69,11 +69,11 @@ import sun.awt.AppContext;
*/ */
class AnimationController implements ActionListener, PropertyChangeListener { class AnimationController implements ActionListener, PropertyChangeListener {
private final static boolean VISTA_ANIMATION_DISABLED = private static final boolean VISTA_ANIMATION_DISABLED =
AccessController.doPrivileged(new GetBooleanAction("swing.disablevistaanimation")); AccessController.doPrivileged(new GetBooleanAction("swing.disablevistaanimation"));
private final static Object ANIMATION_CONTROLLER_KEY = private static final Object ANIMATION_CONTROLLER_KEY =
new StringBuilder("ANIMATION_CONTROLLER_KEY"); new StringBuilder("ANIMATION_CONTROLLER_KEY");
private final Map<JComponent, Map<Part, AnimationState>> animationStateMap = private final Map<JComponent, Map<Part, AnimationState>> animationStateMap =

View file

@ -53,7 +53,7 @@ public class WindowsCheckBoxUI extends WindowsRadioButtonUI
private static final Object WINDOWS_CHECK_BOX_UI_KEY = new Object(); private static final Object WINDOWS_CHECK_BOX_UI_KEY = new Object();
private final static String propertyPrefix = "CheckBox" + "."; private static final String propertyPrefix = "CheckBox" + ".";
private boolean defaults_initialized = false; private boolean defaults_initialized = false;

View file

@ -1017,7 +1017,7 @@ public class WindowsFileChooserUI extends BasicFileChooserUI {
} }
} }
final static int space = 10; static final int space = 10;
class IndentIcon implements Icon { class IndentIcon implements Icon {
Icon icon = null; Icon icon = null;

View file

@ -321,7 +321,7 @@ public class WindowsIconFactory implements Serializable
@SuppressWarnings("serial") // Same-version serialization only @SuppressWarnings("serial") // Same-version serialization only
private static class CheckBoxIcon implements Icon, Serializable private static class CheckBoxIcon implements Icon, Serializable
{ {
final static int csize = 13; static final int csize = 13;
public void paintIcon(Component c, Graphics g, int x, int y) { public void paintIcon(Component c, Graphics g, int x, int y) {
JCheckBox cb = (JCheckBox) c; JCheckBox cb = (JCheckBox) c;
ButtonModel model = cb.getModel(); ButtonModel model = cb.getModel();

View file

@ -2271,7 +2271,7 @@ public class WindowsLookAndFeel extends BasicLookAndFeel
protected Object classicValue, xpValue; protected Object classicValue, xpValue;
// A constant that lets you specify null when using XP styles. // A constant that lets you specify null when using XP styles.
private final static Object NULL_VALUE = new Object(); private static final Object NULL_VALUE = new Object();
XPValue(Object xpValue, Object classicValue) { XPValue(Object xpValue, Object classicValue) {
this.xpValue = xpValue; this.xpValue = xpValue;

View file

@ -70,7 +70,7 @@ import javax.swing.plaf.basic.ComboPopup;
*/ */
public class WindowsRootPaneUI extends BasicRootPaneUI { public class WindowsRootPaneUI extends BasicRootPaneUI {
private final static WindowsRootPaneUI windowsRootPaneUI = new WindowsRootPaneUI(); private static final WindowsRootPaneUI windowsRootPaneUI = new WindowsRootPaneUI();
static final AltProcessor altProcessor = new AltProcessor(); static final AltProcessor altProcessor = new AltProcessor();
public static ComponentUI createUI(JComponent c) { public static ComponentUI createUI(JComponent c) {

View file

@ -106,8 +106,8 @@ public class WindowsTreeUI extends BasicTreeUI {
} }
} }
static protected final int HALF_SIZE = 4; protected static final int HALF_SIZE = 4;
static protected final int SIZE = 9; protected static final int SIZE = 9;
/** /**
* Returns the default cell renderer that is used to do the * Returns the default cell renderer that is used to do the
@ -130,7 +130,7 @@ public class WindowsTreeUI extends BasicTreeUI {
@SuppressWarnings("serial") // Same-version serialization only @SuppressWarnings("serial") // Same-version serialization only
public static class ExpandedIcon implements Icon, Serializable { public static class ExpandedIcon implements Icon, Serializable {
static public Icon createExpandedIcon() { public static Icon createExpandedIcon() {
return new ExpandedIcon(); return new ExpandedIcon();
} }
@ -182,7 +182,7 @@ public class WindowsTreeUI extends BasicTreeUI {
*/ */
@SuppressWarnings("serial") // Superclass is not serializable across versions @SuppressWarnings("serial") // Superclass is not serializable across versions
public static class CollapsedIcon extends ExpandedIcon { public static class CollapsedIcon extends ExpandedIcon {
static public Icon createCollapsedIcon() { public static Icon createCollapsedIcon() {
return new CollapsedIcon(); return new CollapsedIcon();
} }

View file

@ -52,7 +52,7 @@ import javax.sound.sampled.AudioSystem;
public final class AuFileWriter extends SunFileWriter { public final class AuFileWriter extends SunFileWriter {
//$$fb value for length field if length is not known //$$fb value for length field if length is not known
public final static int UNKNOWN_SIZE=-1; public static final int UNKNOWN_SIZE=-1;
/** /**
* Constructs a new AuFileWriter object. * Constructs a new AuFileWriter object.

View file

@ -53,11 +53,11 @@ public abstract class AudioFloatConverter {
private final AudioFloatConverter converter; private final AudioFloatConverter converter;
final private int offset; private final int offset;
final private int stepsize; private final int stepsize;
final private byte mask; private final byte mask;
private byte[] mask_buffer; private byte[] mask_buffer;

View file

@ -38,7 +38,7 @@ import java.util.List;
*/ */
public final class DLSRegion { public final class DLSRegion {
public final static int OPTION_SELFNONEXCLUSIVE = 0x0001; public static final int OPTION_SELFNONEXCLUSIVE = 0x0001;
List<DLSModulator> modulators = new ArrayList<DLSModulator>(); List<DLSModulator> modulators = new ArrayList<DLSModulator>();
int keyfrom; int keyfrom;
int keyto; int keyto;

View file

@ -31,8 +31,8 @@ package com.sun.media.sound;
*/ */
public final class DLSSampleLoop { public final class DLSSampleLoop {
public final static int LOOP_TYPE_FORWARD = 0; public static final int LOOP_TYPE_FORWARD = 0;
public final static int LOOP_TYPE_RELEASE = 1; public static final int LOOP_TYPE_RELEASE = 1;
long type; long type;
long start; long start;
long length; long length;

View file

@ -53,7 +53,7 @@ import javax.sound.sampled.AudioFormat.Encoding;
*/ */
public final class DLSSoundbank implements Soundbank { public final class DLSSoundbank implements Soundbank {
static private class DLSID { private static class DLSID {
long i1; long i1;
int s1; int s1;
int s2; int s2;
@ -548,7 +548,7 @@ public final class DLSSoundbank implements Soundbank {
long count = riff.readUnsignedInt(); long count = riff.readUnsignedInt();
if (size - 8 != 0) if (size - 8 != 0)
riff.skipBytes(size - 8); riff.skip(size - 8);
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
DLSModulator modulator = new DLSModulator(); DLSModulator modulator = new DLSModulator();
@ -568,7 +568,7 @@ public final class DLSSoundbank implements Soundbank {
long count = riff.readUnsignedInt(); long count = riff.readUnsignedInt();
if (size - 8 != 0) if (size - 8 != 0)
riff.skipBytes(size - 8); riff.skip(size - 8);
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
DLSModulator modulator = new DLSModulator(); DLSModulator modulator = new DLSModulator();
@ -661,7 +661,7 @@ public final class DLSSoundbank implements Soundbank {
long loops = riff.readInt(); long loops = riff.readInt();
if (size > 20) if (size > 20)
riff.skipBytes(size - 20); riff.skip(size - 20);
for (int i = 0; i < loops; i++) { for (int i = 0; i < loops; i++) {
DLSSampleLoop loop = new DLSSampleLoop(); DLSSampleLoop loop = new DLSSampleLoop();
@ -671,7 +671,7 @@ public final class DLSSoundbank implements Soundbank {
loop.length = riff.readUnsignedInt(); loop.length = riff.readUnsignedInt();
sampleOptions.loops.add(loop); sampleOptions.loops.add(loop);
if (size2 > 16) if (size2 > 16)
riff.skipBytes(size2 - 16); riff.skip(size2 - 16);
} }
} }

View file

@ -37,7 +37,7 @@ import javax.sound.sampled.AudioFormat;
*/ */
public final class EmergencySoundbank { public final class EmergencySoundbank {
private final static String[] general_midi_instruments = { private static final String[] general_midi_instruments = {
"Acoustic Grand Piano", "Acoustic Grand Piano",
"Bright Acoustic Piano", "Bright Acoustic Piano",
"Electric Grand Piano", "Electric Grand Piano",
@ -2564,11 +2564,11 @@ public final class EmergencySoundbank {
return ins; return ins;
} }
static public void ifft(double[] data) { public static void ifft(double[] data) {
new FFT(data.length / 2, 1).transform(data); new FFT(data.length / 2, 1).transform(data);
} }
static public void fft(double[] data) { public static void fft(double[] data) {
new FFT(data.length / 2, -1).transform(data); new FFT(data.length / 2, -1).transform(data);
} }
@ -2580,7 +2580,7 @@ public final class EmergencySoundbank {
} }
} }
static public void randomPhase(double[] data) { public static void randomPhase(double[] data) {
for (int i = 0; i < data.length; i += 2) { for (int i = 0; i < data.length; i += 2) {
double phase = Math.random() * 2 * Math.PI; double phase = Math.random() * 2 * Math.PI;
double d = data[i]; double d = data[i];
@ -2589,7 +2589,7 @@ public final class EmergencySoundbank {
} }
} }
static public void randomPhase(double[] data, Random random) { public static void randomPhase(double[] data, Random random) {
for (int i = 0; i < data.length; i += 2) { for (int i = 0; i < data.length; i += 2) {
double phase = random.nextDouble() * 2 * Math.PI; double phase = random.nextDouble() * 2 * Math.PI;
double d = data[i]; double d = data[i];
@ -2598,7 +2598,7 @@ public final class EmergencySoundbank {
} }
} }
static public void normalize(double[] data, double target) { public static void normalize(double[] data, double target) {
double maxvalue = 0; double maxvalue = 0;
for (int i = 0; i < data.length; i++) { for (int i = 0; i < data.length; i++) {
if (data[i] > maxvalue) if (data[i] > maxvalue)
@ -2613,7 +2613,7 @@ public final class EmergencySoundbank {
data[i] *= gain; data[i] *= gain;
} }
static public void normalize(float[] data, double target) { public static void normalize(float[] data, double target) {
double maxvalue = 0.5; double maxvalue = 0.5;
for (int i = 0; i < data.length; i++) { for (int i = 0; i < data.length; i++) {
if (data[i * 2] > maxvalue) if (data[i * 2] > maxvalue)
@ -2626,7 +2626,7 @@ public final class EmergencySoundbank {
data[i * 2] *= gain; data[i * 2] *= gain;
} }
static public double[] realPart(double[] in) { public static double[] realPart(double[] in) {
double[] out = new double[in.length / 2]; double[] out = new double[in.length / 2];
for (int i = 0; i < out.length; i++) { for (int i = 0; i < out.length; i++) {
out[i] = in[i * 2]; out[i] = in[i * 2];
@ -2634,7 +2634,7 @@ public final class EmergencySoundbank {
return out; return out;
} }
static public double[] imgPart(double[] in) { public static double[] imgPart(double[] in) {
double[] out = new double[in.length / 2]; double[] out = new double[in.length / 2];
for (int i = 0; i < out.length; i++) { for (int i = 0; i < out.length; i++) {
out[i] = in[i * 2]; out[i] = in[i * 2];
@ -2642,7 +2642,7 @@ public final class EmergencySoundbank {
return out; return out;
} }
static public float[] toFloat(double[] in) { public static float[] toFloat(double[] in) {
float[] out = new float[in.length]; float[] out = new float[in.length];
for (int i = 0; i < out.length; i++) { for (int i = 0; i < out.length; i++) {
out[i] = (float) in[i]; out[i] = (float) in[i];
@ -2650,24 +2650,24 @@ public final class EmergencySoundbank {
return out; return out;
} }
static public byte[] toBytes(float[] in, AudioFormat format) { public static byte[] toBytes(float[] in, AudioFormat format) {
byte[] out = new byte[in.length * format.getFrameSize()]; byte[] out = new byte[in.length * format.getFrameSize()];
return AudioFloatConverter.getConverter(format).toByteArray(in, out); return AudioFloatConverter.getConverter(format).toByteArray(in, out);
} }
static public void fadeUp(double[] data, int samples) { public static void fadeUp(double[] data, int samples) {
double dsamples = samples; double dsamples = samples;
for (int i = 0; i < samples; i++) for (int i = 0; i < samples; i++)
data[i] *= i / dsamples; data[i] *= i / dsamples;
} }
static public void fadeUp(float[] data, int samples) { public static void fadeUp(float[] data, int samples) {
double dsamples = samples; double dsamples = samples;
for (int i = 0; i < samples; i++) for (int i = 0; i < samples; i++)
data[i] *= i / dsamples; data[i] *= i / dsamples;
} }
static public double[] loopExtend(double[] data, int newsize) { public static double[] loopExtend(double[] data, int newsize) {
double[] outdata = new double[newsize]; double[] outdata = new double[newsize];
int p_len = data.length; int p_len = data.length;
int p_ps = 0; int p_ps = 0;
@ -2680,7 +2680,7 @@ public final class EmergencySoundbank {
return outdata; return outdata;
} }
static public float[] loopExtend(float[] data, int newsize) { public static float[] loopExtend(float[] data, int newsize) {
float[] outdata = new float[newsize]; float[] outdata = new float[newsize];
int p_len = data.length; int p_len = data.length;
int p_ps = 0; int p_ps = 0;

View file

@ -88,9 +88,9 @@ public final class JavaSoundAudioClip implements AudioClip, MetaEventListener, L
* with the number of samples in the stream. * with the number of samples in the stream.
* *
*/ */
private final static long CLIP_THRESHOLD = 1048576; private static final long CLIP_THRESHOLD = 1048576;
//private final static long CLIP_THRESHOLD = 1; //private final static long CLIP_THRESHOLD = 1;
private final static int STREAM_BUFFER_SIZE = 1024; private static final int STREAM_BUFFER_SIZE = 1024;
public JavaSoundAudioClip(InputStream in) throws IOException { public JavaSoundAudioClip(InputStream in) throws IOException {
if (DEBUG || Printer.debug)Printer.debug("JavaSoundAudioClip.<init>"); if (DEBUG || Printer.debug)Printer.debug("JavaSoundAudioClip.<init>");

View file

@ -42,7 +42,7 @@ public final class MidiOutDeviceProvider extends AbstractMidiDeviceProvider {
/** Cache of open MIDI output devices on the system. */ /** Cache of open MIDI output devices on the system. */
private static MidiDevice[] devices = null; private static MidiDevice[] devices = null;
private final static boolean enabled; private static final boolean enabled;
// STATIC // STATIC

View file

@ -44,9 +44,9 @@ import javax.sound.midi.Track;
*/ */
public final class MidiUtils { public final class MidiUtils {
public final static int DEFAULT_TEMPO_MPQ = 500000; // 120bpm public static final int DEFAULT_TEMPO_MPQ = 500000; // 120bpm
public final static int META_END_OF_TRACK_TYPE = 0x2F; public static final int META_END_OF_TRACK_TYPE = 0x2F;
public final static int META_TEMPO_TYPE = 0x51; public static final int META_TEMPO_TYPE = 0x51;
/** /**
* Suppresses default constructor, ensuring non-instantiability. * Suppresses default constructor, ensuring non-instantiability.

View file

@ -39,7 +39,7 @@ public final class ModelConnectionBlock {
// //
// source1 * source2 * scale -> destination // source1 * source2 * scale -> destination
// //
private final static ModelSource[] no_sources = new ModelSource[0]; private static final ModelSource[] no_sources = new ModelSource[0];
private ModelSource[] sources = no_sources; private ModelSource[] sources = no_sources;
private double scale = 1; private double scale = 1;
private ModelDestination destination; private ModelDestination destination;

View file

@ -31,5 +31,5 @@ package com.sun.media.sound;
*/ */
public interface ModelTransform { public interface ModelTransform {
abstract public double transform(double value); public abstract double transform(double value);
} }

View file

@ -169,9 +169,9 @@ final class Platform {
} }
// the following native methods are implemented in Platform.c // the following native methods are implemented in Platform.c
private native static boolean nIsBigEndian(); private static native boolean nIsBigEndian();
private native static String nGetExtraLibraries(); private static native String nGetExtraLibraries();
private native static int nGetLibraryForFeature(int feature); private static native int nGetLibraryForFeature(int feature);
/** /**
* Read the required system properties. * Read the required system properties.

View file

@ -422,7 +422,7 @@ final class PortMixer extends AbstractMixer {
private boolean closed = false; private boolean closed = false;
// predefined float control types. See also Ports.h // predefined float control types. See also Ports.h
private final static FloatControl.Type[] FLOAT_CONTROL_TYPES = { private static final FloatControl.Type[] FLOAT_CONTROL_TYPES = {
null, null,
FloatControl.Type.BALANCE, FloatControl.Type.BALANCE,
FloatControl.Type.MASTER_GAIN, FloatControl.Type.MASTER_GAIN,

View file

@ -118,6 +118,7 @@ public final class RIFFReader extends InputStream {
return ckSize; return ckSize;
} }
@Override
public int read() throws IOException { public int read() throws IOException {
if (avail == 0) { if (avail == 0) {
return -1; return -1;
@ -132,6 +133,7 @@ public final class RIFFReader extends InputStream {
return b; return b;
} }
@Override
public int read(byte[] b, int offset, int len) throws IOException { public int read(byte[] b, int offset, int len) throws IOException {
if (avail == 0) { if (avail == 0) {
return -1; return -1;
@ -172,49 +174,45 @@ public final class RIFFReader extends InputStream {
} }
} }
public long skipBytes(long n) throws IOException { @Override
if (n < 0) public long skip(final long n) throws IOException {
if (n <= 0 || avail == 0) {
return 0; return 0;
long skipped = 0; }
while (skipped != n) { // will not skip more than
long s = skip(n - skipped); long remaining = Math.min(n, avail);
if (s < 0) while (remaining > 0) {
break; // Some input streams like FileInputStream can return more bytes,
if (s == 0) // when EOF is reached.
long ret = Math.min(stream.skip(remaining), remaining);
if (ret == 0) {
// EOF or not? we need to check.
Thread.yield(); Thread.yield();
skipped += s; if (stream.read() == -1) {
}
return skipped;
}
public long skip(long n) throws IOException {
if (avail == 0)
return -1;
if (n > avail) {
long len = stream.skip(avail);
if (len != -1)
filepointer += len;
avail = 0; avail = 0;
return len; break;
} else {
long ret = stream.skip(n);
if (ret == -1) {
avail = 0;
return -1;
} }
ret = 1;
} else if (ret < 0) {
// the skip should not return negative value, but check it also
avail = 0;
break;
}
remaining -= ret;
avail -= ret; avail -= ret;
filepointer += ret; filepointer += ret;
return ret;
} }
return n - remaining;
} }
@Override
public int available() { public int available() {
return (int)avail; return (int)avail;
} }
public void finish() throws IOException { public void finish() throws IOException {
if (avail != 0) { if (avail != 0) {
skipBytes(avail); skip(avail);
} }
} }
@ -337,6 +335,7 @@ public final class RIFFReader extends InputStream {
return ch1 + (ch2 << 8) | (ch3 << 16) | (ch4 << 24); return ch1 + (ch2 << 8) | (ch3 << 16) | (ch4 << 24);
} }
@Override
public void close() throws IOException { public void close() throws IOException {
finish(); finish();
if (this == root) if (this == root)

View file

@ -51,8 +51,8 @@ final class RealTimeSequencer extends AbstractMidiDevice
// STATIC VARIABLES // STATIC VARIABLES
/** debugging flags */ /** debugging flags */
private final static boolean DEBUG_PUMP = false; private static final boolean DEBUG_PUMP = false;
private final static boolean DEBUG_PUMP_ALL = false; private static final boolean DEBUG_PUMP_ALL = false;
/** /**
* Event Dispatcher thread. Should be using a shared event * Event Dispatcher thread. Should be using a shared event

View file

@ -31,24 +31,24 @@ package com.sun.media.sound;
*/ */
public final class SF2Modulator { public final class SF2Modulator {
public final static int SOURCE_NONE = 0; public static final int SOURCE_NONE = 0;
public final static int SOURCE_NOTE_ON_VELOCITY = 2; public static final int SOURCE_NOTE_ON_VELOCITY = 2;
public final static int SOURCE_NOTE_ON_KEYNUMBER = 3; public static final int SOURCE_NOTE_ON_KEYNUMBER = 3;
public final static int SOURCE_POLY_PRESSURE = 10; public static final int SOURCE_POLY_PRESSURE = 10;
public final static int SOURCE_CHANNEL_PRESSURE = 13; public static final int SOURCE_CHANNEL_PRESSURE = 13;
public final static int SOURCE_PITCH_WHEEL = 14; public static final int SOURCE_PITCH_WHEEL = 14;
public final static int SOURCE_PITCH_SENSITIVITY = 16; public static final int SOURCE_PITCH_SENSITIVITY = 16;
public final static int SOURCE_MIDI_CONTROL = 128 * 1; public static final int SOURCE_MIDI_CONTROL = 128 * 1;
public final static int SOURCE_DIRECTION_MIN_MAX = 256 * 0; public static final int SOURCE_DIRECTION_MIN_MAX = 256 * 0;
public final static int SOURCE_DIRECTION_MAX_MIN = 256 * 1; public static final int SOURCE_DIRECTION_MAX_MIN = 256 * 1;
public final static int SOURCE_POLARITY_UNIPOLAR = 512 * 0; public static final int SOURCE_POLARITY_UNIPOLAR = 512 * 0;
public final static int SOURCE_POLARITY_BIPOLAR = 512 * 1; public static final int SOURCE_POLARITY_BIPOLAR = 512 * 1;
public final static int SOURCE_TYPE_LINEAR = 1024 * 0; public static final int SOURCE_TYPE_LINEAR = 1024 * 0;
public final static int SOURCE_TYPE_CONCAVE = 1024 * 1; public static final int SOURCE_TYPE_CONCAVE = 1024 * 1;
public final static int SOURCE_TYPE_CONVEX = 1024 * 2; public static final int SOURCE_TYPE_CONVEX = 1024 * 2;
public final static int SOURCE_TYPE_SWITCH = 1024 * 3; public static final int SOURCE_TYPE_SWITCH = 1024 * 3;
public final static int TRANSFORM_LINEAR = 0; public static final int TRANSFORM_LINEAR = 0;
public final static int TRANSFORM_ABSOLUTE = 2; public static final int TRANSFORM_ABSOLUTE = 2;
int sourceOperator; int sourceOperator;
int destinationOperator; int destinationOperator;
short amount; short amount;

View file

@ -36,67 +36,67 @@ import java.util.Map;
*/ */
public class SF2Region { public class SF2Region {
public final static int GENERATOR_STARTADDRSOFFSET = 0; public static final int GENERATOR_STARTADDRSOFFSET = 0;
public final static int GENERATOR_ENDADDRSOFFSET = 1; public static final int GENERATOR_ENDADDRSOFFSET = 1;
public final static int GENERATOR_STARTLOOPADDRSOFFSET = 2; public static final int GENERATOR_STARTLOOPADDRSOFFSET = 2;
public final static int GENERATOR_ENDLOOPADDRSOFFSET = 3; public static final int GENERATOR_ENDLOOPADDRSOFFSET = 3;
public final static int GENERATOR_STARTADDRSCOARSEOFFSET = 4; public static final int GENERATOR_STARTADDRSCOARSEOFFSET = 4;
public final static int GENERATOR_MODLFOTOPITCH = 5; public static final int GENERATOR_MODLFOTOPITCH = 5;
public final static int GENERATOR_VIBLFOTOPITCH = 6; public static final int GENERATOR_VIBLFOTOPITCH = 6;
public final static int GENERATOR_MODENVTOPITCH = 7; public static final int GENERATOR_MODENVTOPITCH = 7;
public final static int GENERATOR_INITIALFILTERFC = 8; public static final int GENERATOR_INITIALFILTERFC = 8;
public final static int GENERATOR_INITIALFILTERQ = 9; public static final int GENERATOR_INITIALFILTERQ = 9;
public final static int GENERATOR_MODLFOTOFILTERFC = 10; public static final int GENERATOR_MODLFOTOFILTERFC = 10;
public final static int GENERATOR_MODENVTOFILTERFC = 11; public static final int GENERATOR_MODENVTOFILTERFC = 11;
public final static int GENERATOR_ENDADDRSCOARSEOFFSET = 12; public static final int GENERATOR_ENDADDRSCOARSEOFFSET = 12;
public final static int GENERATOR_MODLFOTOVOLUME = 13; public static final int GENERATOR_MODLFOTOVOLUME = 13;
public final static int GENERATOR_UNUSED1 = 14; public static final int GENERATOR_UNUSED1 = 14;
public final static int GENERATOR_CHORUSEFFECTSSEND = 15; public static final int GENERATOR_CHORUSEFFECTSSEND = 15;
public final static int GENERATOR_REVERBEFFECTSSEND = 16; public static final int GENERATOR_REVERBEFFECTSSEND = 16;
public final static int GENERATOR_PAN = 17; public static final int GENERATOR_PAN = 17;
public final static int GENERATOR_UNUSED2 = 18; public static final int GENERATOR_UNUSED2 = 18;
public final static int GENERATOR_UNUSED3 = 19; public static final int GENERATOR_UNUSED3 = 19;
public final static int GENERATOR_UNUSED4 = 20; public static final int GENERATOR_UNUSED4 = 20;
public final static int GENERATOR_DELAYMODLFO = 21; public static final int GENERATOR_DELAYMODLFO = 21;
public final static int GENERATOR_FREQMODLFO = 22; public static final int GENERATOR_FREQMODLFO = 22;
public final static int GENERATOR_DELAYVIBLFO = 23; public static final int GENERATOR_DELAYVIBLFO = 23;
public final static int GENERATOR_FREQVIBLFO = 24; public static final int GENERATOR_FREQVIBLFO = 24;
public final static int GENERATOR_DELAYMODENV = 25; public static final int GENERATOR_DELAYMODENV = 25;
public final static int GENERATOR_ATTACKMODENV = 26; public static final int GENERATOR_ATTACKMODENV = 26;
public final static int GENERATOR_HOLDMODENV = 27; public static final int GENERATOR_HOLDMODENV = 27;
public final static int GENERATOR_DECAYMODENV = 28; public static final int GENERATOR_DECAYMODENV = 28;
public final static int GENERATOR_SUSTAINMODENV = 29; public static final int GENERATOR_SUSTAINMODENV = 29;
public final static int GENERATOR_RELEASEMODENV = 30; public static final int GENERATOR_RELEASEMODENV = 30;
public final static int GENERATOR_KEYNUMTOMODENVHOLD = 31; public static final int GENERATOR_KEYNUMTOMODENVHOLD = 31;
public final static int GENERATOR_KEYNUMTOMODENVDECAY = 32; public static final int GENERATOR_KEYNUMTOMODENVDECAY = 32;
public final static int GENERATOR_DELAYVOLENV = 33; public static final int GENERATOR_DELAYVOLENV = 33;
public final static int GENERATOR_ATTACKVOLENV = 34; public static final int GENERATOR_ATTACKVOLENV = 34;
public final static int GENERATOR_HOLDVOLENV = 35; public static final int GENERATOR_HOLDVOLENV = 35;
public final static int GENERATOR_DECAYVOLENV = 36; public static final int GENERATOR_DECAYVOLENV = 36;
public final static int GENERATOR_SUSTAINVOLENV = 37; public static final int GENERATOR_SUSTAINVOLENV = 37;
public final static int GENERATOR_RELEASEVOLENV = 38; public static final int GENERATOR_RELEASEVOLENV = 38;
public final static int GENERATOR_KEYNUMTOVOLENVHOLD = 39; public static final int GENERATOR_KEYNUMTOVOLENVHOLD = 39;
public final static int GENERATOR_KEYNUMTOVOLENVDECAY = 40; public static final int GENERATOR_KEYNUMTOVOLENVDECAY = 40;
public final static int GENERATOR_INSTRUMENT = 41; public static final int GENERATOR_INSTRUMENT = 41;
public final static int GENERATOR_RESERVED1 = 42; public static final int GENERATOR_RESERVED1 = 42;
public final static int GENERATOR_KEYRANGE = 43; public static final int GENERATOR_KEYRANGE = 43;
public final static int GENERATOR_VELRANGE = 44; public static final int GENERATOR_VELRANGE = 44;
public final static int GENERATOR_STARTLOOPADDRSCOARSEOFFSET = 45; public static final int GENERATOR_STARTLOOPADDRSCOARSEOFFSET = 45;
public final static int GENERATOR_KEYNUM = 46; public static final int GENERATOR_KEYNUM = 46;
public final static int GENERATOR_VELOCITY = 47; public static final int GENERATOR_VELOCITY = 47;
public final static int GENERATOR_INITIALATTENUATION = 48; public static final int GENERATOR_INITIALATTENUATION = 48;
public final static int GENERATOR_RESERVED2 = 49; public static final int GENERATOR_RESERVED2 = 49;
public final static int GENERATOR_ENDLOOPADDRSCOARSEOFFSET = 50; public static final int GENERATOR_ENDLOOPADDRSCOARSEOFFSET = 50;
public final static int GENERATOR_COARSETUNE = 51; public static final int GENERATOR_COARSETUNE = 51;
public final static int GENERATOR_FINETUNE = 52; public static final int GENERATOR_FINETUNE = 52;
public final static int GENERATOR_SAMPLEID = 53; public static final int GENERATOR_SAMPLEID = 53;
public final static int GENERATOR_SAMPLEMODES = 54; public static final int GENERATOR_SAMPLEMODES = 54;
public final static int GENERATOR_RESERVED3 = 55; public static final int GENERATOR_RESERVED3 = 55;
public final static int GENERATOR_SCALETUNING = 56; public static final int GENERATOR_SCALETUNING = 56;
public final static int GENERATOR_EXCLUSIVECLASS = 57; public static final int GENERATOR_EXCLUSIVECLASS = 57;
public final static int GENERATOR_OVERRIDINGROOTKEY = 58; public static final int GENERATOR_OVERRIDINGROOTKEY = 58;
public final static int GENERATOR_UNUSED5 = 59; public static final int GENERATOR_UNUSED5 = 59;
public final static int GENERATOR_ENDOPR = 60; public static final int GENERATOR_ENDOPR = 60;
protected Map<Integer, Short> generators = new HashMap<Integer, Short>(); protected Map<Integer, Short> generators = new HashMap<Integer, Short>();
protected List<SF2Modulator> modulators = new ArrayList<SF2Modulator>(); protected List<SF2Modulator> modulators = new ArrayList<SF2Modulator>();
@ -108,7 +108,7 @@ public class SF2Region {
return generators.containsKey(generator); return generators.containsKey(generator);
} }
static public short getDefaultValue(int generator) { public static short getDefaultValue(int generator) {
if (generator == 8) return (short)13500; if (generator == 8) return (short)13500;
if (generator == 21) return (short)-12000; if (generator == 21) return (short)-12000;
if (generator == 23) return (short)-12000; if (generator == 23) return (short)-12000;

View file

@ -31,15 +31,15 @@ package com.sun.media.sound;
*/ */
public final class SoftEnvelopeGenerator implements SoftProcess { public final class SoftEnvelopeGenerator implements SoftProcess {
public final static int EG_OFF = 0; public static final int EG_OFF = 0;
public final static int EG_DELAY = 1; public static final int EG_DELAY = 1;
public final static int EG_ATTACK = 2; public static final int EG_ATTACK = 2;
public final static int EG_HOLD = 3; public static final int EG_HOLD = 3;
public final static int EG_DECAY = 4; public static final int EG_DECAY = 4;
public final static int EG_SUSTAIN = 5; public static final int EG_SUSTAIN = 5;
public final static int EG_RELEASE = 6; public static final int EG_RELEASE = 6;
public final static int EG_SHUTDOWN = 7; public static final int EG_SHUTDOWN = 7;
public final static int EG_END = 8; public static final int EG_END = 8;
int max_count = 10; int max_count = 10;
int used_count = 0; int used_count = 0;
private final int[] stage = new int[max_count]; private final int[] stage = new int[max_count];

View file

@ -35,13 +35,13 @@ package com.sun.media.sound;
*/ */
public final class SoftFilter { public final class SoftFilter {
public final static int FILTERTYPE_LP6 = 0x00; public static final int FILTERTYPE_LP6 = 0x00;
public final static int FILTERTYPE_LP12 = 0x01; public static final int FILTERTYPE_LP12 = 0x01;
public final static int FILTERTYPE_HP12 = 0x11; public static final int FILTERTYPE_HP12 = 0x11;
public final static int FILTERTYPE_BP12 = 0x21; public static final int FILTERTYPE_BP12 = 0x21;
public final static int FILTERTYPE_NP12 = 0x31; public static final int FILTERTYPE_NP12 = 0x31;
public final static int FILTERTYPE_LP24 = 0x03; public static final int FILTERTYPE_LP24 = 0x03;
public final static int FILTERTYPE_HP24 = 0x13; public static final int FILTERTYPE_HP24 = 0x13;
// //
// 0x0 = 1st-order, 6 dB/oct // 0x0 = 1st-order, 6 dB/oct

View file

@ -53,20 +53,20 @@ public final class SoftMainMixer {
SoftAudioBuffer[] buffers; SoftAudioBuffer[] buffers;
} }
public final static int CHANNEL_LEFT = 0; public static final int CHANNEL_LEFT = 0;
public final static int CHANNEL_RIGHT = 1; public static final int CHANNEL_RIGHT = 1;
public final static int CHANNEL_MONO = 2; public static final int CHANNEL_MONO = 2;
public final static int CHANNEL_DELAY_LEFT = 3; public static final int CHANNEL_DELAY_LEFT = 3;
public final static int CHANNEL_DELAY_RIGHT = 4; public static final int CHANNEL_DELAY_RIGHT = 4;
public final static int CHANNEL_DELAY_MONO = 5; public static final int CHANNEL_DELAY_MONO = 5;
public final static int CHANNEL_EFFECT1 = 6; public static final int CHANNEL_EFFECT1 = 6;
public final static int CHANNEL_EFFECT2 = 7; public static final int CHANNEL_EFFECT2 = 7;
public final static int CHANNEL_DELAY_EFFECT1 = 8; public static final int CHANNEL_DELAY_EFFECT1 = 8;
public final static int CHANNEL_DELAY_EFFECT2 = 9; public static final int CHANNEL_DELAY_EFFECT2 = 9;
public final static int CHANNEL_LEFT_DRY = 10; public static final int CHANNEL_LEFT_DRY = 10;
public final static int CHANNEL_RIGHT_DRY = 11; public static final int CHANNEL_RIGHT_DRY = 11;
public final static int CHANNEL_SCRATCH1 = 12; public static final int CHANNEL_SCRATCH1 = 12;
public final static int CHANNEL_SCRATCH2 = 13; public static final int CHANNEL_SCRATCH2 = 13;
boolean active_sensing_on = false; boolean active_sensing_on = false;
private long msec_last_activity = -1; private long msec_last_activity = -1;
private boolean pusher_silent = false; private boolean pusher_silent = false;

View file

@ -39,29 +39,29 @@ import javax.sound.sampled.AudioSystem;
*/ */
public final class SoftMixingMainMixer { public final class SoftMixingMainMixer {
public final static int CHANNEL_LEFT = 0; public static final int CHANNEL_LEFT = 0;
public final static int CHANNEL_RIGHT = 1; public static final int CHANNEL_RIGHT = 1;
public final static int CHANNEL_EFFECT1 = 2; public static final int CHANNEL_EFFECT1 = 2;
public final static int CHANNEL_EFFECT2 = 3; public static final int CHANNEL_EFFECT2 = 3;
public final static int CHANNEL_EFFECT3 = 4; public static final int CHANNEL_EFFECT3 = 4;
public final static int CHANNEL_EFFECT4 = 5; public static final int CHANNEL_EFFECT4 = 5;
public final static int CHANNEL_LEFT_DRY = 10; public static final int CHANNEL_LEFT_DRY = 10;
public final static int CHANNEL_RIGHT_DRY = 11; public static final int CHANNEL_RIGHT_DRY = 11;
public final static int CHANNEL_SCRATCH1 = 12; public static final int CHANNEL_SCRATCH1 = 12;
public final static int CHANNEL_SCRATCH2 = 13; public static final int CHANNEL_SCRATCH2 = 13;
public final static int CHANNEL_CHANNELMIXER_LEFT = 14; public static final int CHANNEL_CHANNELMIXER_LEFT = 14;
public final static int CHANNEL_CHANNELMIXER_RIGHT = 15; public static final int CHANNEL_CHANNELMIXER_RIGHT = 15;
private final SoftMixingMixer mixer; private final SoftMixingMixer mixer;

View file

@ -35,7 +35,7 @@ import java.util.Arrays;
*/ */
public final class SoftReverb implements SoftAudioProcessor { public final class SoftReverb implements SoftAudioProcessor {
private final static class Delay { private static final class Delay {
private float[] delaybuffer; private float[] delaybuffer;
private int rovepos = 0; private int rovepos = 0;
@ -70,7 +70,7 @@ public final class SoftReverb implements SoftAudioProcessor {
} }
} }
private final static class AllPass { private static final class AllPass {
private final float[] delaybuffer; private final float[] delaybuffer;
private final int delaybuffersize; private final int delaybuffersize;
@ -117,7 +117,7 @@ public final class SoftReverb implements SoftAudioProcessor {
} }
} }
private final static class Comb { private static final class Comb {
private final float[] delaybuffer; private final float[] delaybuffer;
private final int delaybuffersize; private final int delaybuffersize;

Some files were not shown because too many files have changed in this diff Show more