mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 19:44:41 +02:00
Merge
This commit is contained in:
commit
1d92a8874c
380 changed files with 3072 additions and 1780 deletions
|
@ -40,6 +40,7 @@ allfonts.devanagari=Mangal
|
|||
allfonts.dingbats=Wingdings
|
||||
allfonts.lucida=Lucida Sans Regular
|
||||
allfonts.symbol=Symbol
|
||||
allfonts.symbols=Segoe UI Symbol
|
||||
allfonts.thai=Lucida Sans Regular
|
||||
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.fallback=lucida,\
|
||||
sequence.fallback=lucida,symbols,\
|
||||
chinese-ms950,chinese-hkscs,chinese-ms936,chinese-gb18030,\
|
||||
japanese,korean,chinese-ms950-extb,chinese-ms936-extb,georgian
|
||||
|
||||
|
@ -298,3 +299,4 @@ filename.Symbol=SYMBOL.TTF
|
|||
filename.Wingdings=WINGDING.TTF
|
||||
|
||||
filename.Sylfaen=sylfaen.ttf
|
||||
filename.Segoe_UI_Symbol=SEGUISYM.TTF
|
||||
|
|
|
@ -959,10 +959,9 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
|
|||
$(X_CFLAGS) \
|
||||
$(X_LIBS) \
|
||||
$(LIBAWT_LWAWT_CFLAGS), \
|
||||
DISABLED_WARNINGS_clang := incomplete-implementation \
|
||||
DISABLED_WARNINGS_clang := incomplete-implementation enum-conversion \
|
||||
deprecated-declarations objc-method-access bitwise-op-parentheses \
|
||||
incompatible-pointer-types parentheses-equality extra-tokens, \
|
||||
WARNINGS_AS_ERRORS_clang := false, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN) \
|
||||
-L$(INSTALL_LIBRARIES_HERE), \
|
||||
|
|
|
@ -504,11 +504,11 @@ class Atom {
|
|||
|
||||
private static Applet applet;
|
||||
private static byte[] data;
|
||||
private final static int R = 40;
|
||||
private final static int hx = 15;
|
||||
private final static int hy = 15;
|
||||
private final static int bgGrey = 192;
|
||||
private final static int nBalls = 16;
|
||||
private static final int R = 40;
|
||||
private static final int hx = 15;
|
||||
private static final int hy = 15;
|
||||
private static final int bgGrey = 192;
|
||||
private static final int nBalls = 16;
|
||||
private static int maxr;
|
||||
private int Rl;
|
||||
private int Gl;
|
||||
|
|
|
@ -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) {
|
||||
super(parent, nodeName, desc,
|
||||
new Modifier.Filter() {
|
||||
|
|
|
@ -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) {
|
||||
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) {
|
||||
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) {
|
||||
super(dbtestroot, nodeName, description);
|
||||
}
|
||||
|
|
|
@ -161,7 +161,7 @@ abstract class InputTests extends IIOTests {
|
|||
}
|
||||
}
|
||||
|
||||
protected static abstract class Context {
|
||||
protected abstract static class Context {
|
||||
int size;
|
||||
Object input;
|
||||
int inputType;
|
||||
|
|
|
@ -156,7 +156,7 @@ abstract class OutputTests extends IIOTests {
|
|||
}
|
||||
}
|
||||
|
||||
protected static abstract class Context {
|
||||
protected abstract static class Context {
|
||||
int size;
|
||||
Object output;
|
||||
int outputType;
|
||||
|
|
|
@ -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) {
|
||||
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) {
|
||||
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) {
|
||||
super(parent, nodeName, description);
|
||||
}
|
||||
|
|
|
@ -143,11 +143,11 @@ public class FileChooserDemo extends JPanel implements ActionListener {
|
|||
private JTextField customField;
|
||||
private final ExampleFileView fileView;
|
||||
private final ExampleFileSystemView fileSystemView;
|
||||
private final static Dimension hpad10 = new Dimension(10, 1);
|
||||
private final static Dimension vpad20 = new Dimension(1, 20);
|
||||
private final static Dimension vpad7 = new Dimension(1, 7);
|
||||
private final static Dimension vpad4 = new Dimension(1, 4);
|
||||
private final static Insets insets = new Insets(5, 10, 0, 10);
|
||||
private static final Dimension hpad10 = new Dimension(10, 1);
|
||||
private static final Dimension vpad20 = new Dimension(1, 20);
|
||||
private static final Dimension vpad7 = new Dimension(1, 7);
|
||||
private static final Dimension vpad4 = new Dimension(1, 4);
|
||||
private static final Insets insets = new Insets(5, 10, 0, 10);
|
||||
private final FilePreviewer previewer;
|
||||
private final JFileChooser chooser;
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ class Notepad extends JPanel {
|
|||
|
||||
protected static Properties properties;
|
||||
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 final String[] MENUBAR_KEYS = {"file", "edit", "debug"};
|
||||
|
|
|
@ -127,7 +127,7 @@ public class DataFlavor implements Externalizable, Cloneable {
|
|||
* @return the class loaded
|
||||
* @exception ClassNotFoundException if class is not found
|
||||
*/
|
||||
protected final static Class<?> tryToLoadClass(String className,
|
||||
protected static final Class<?> tryToLoadClass(String className,
|
||||
ClassLoader fallback)
|
||||
throws ClassNotFoundException
|
||||
{
|
||||
|
@ -163,7 +163,7 @@ public class DataFlavor implements Externalizable, Cloneable {
|
|||
/*
|
||||
* private initializer
|
||||
*/
|
||||
static private DataFlavor createConstant(Class<?> rc, String prn) {
|
||||
private static DataFlavor createConstant(Class<?> rc, String prn) {
|
||||
try {
|
||||
return new DataFlavor(rc, prn);
|
||||
} catch (Exception e) {
|
||||
|
@ -174,7 +174,7 @@ public class DataFlavor implements Externalizable, Cloneable {
|
|||
/*
|
||||
* private initializer
|
||||
*/
|
||||
static private DataFlavor createConstant(String mt, String prn) {
|
||||
private static DataFlavor createConstant(String mt, String prn) {
|
||||
try {
|
||||
return new DataFlavor(mt, prn);
|
||||
} catch (Exception e) {
|
||||
|
@ -185,7 +185,7 @@ public class DataFlavor implements Externalizable, Cloneable {
|
|||
/*
|
||||
* private initializer
|
||||
*/
|
||||
static private DataFlavor initHtmlDataFlavor(String htmlFlavorType) {
|
||||
private static DataFlavor initHtmlDataFlavor(String htmlFlavorType) {
|
||||
try {
|
||||
return new DataFlavor ("text/html; class=java.lang.String;document=" +
|
||||
htmlFlavorType + ";charset=Unicode");
|
||||
|
|
|
@ -62,7 +62,7 @@ class _AppEventHandler {
|
|||
private static native void nativeReplyToAppShouldTerminate(final boolean shouldTerminate);
|
||||
private static native void nativeRegisterForNotification(final int notification);
|
||||
|
||||
final static _AppEventHandler instance = new _AppEventHandler();
|
||||
static final _AppEventHandler instance = new _AppEventHandler();
|
||||
static _AppEventHandler getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
|
|
@ -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 Update 1 - 1.6
|
||||
*/
|
||||
public final static short kOnAppropriateDisk = -32767;
|
||||
public static final short kOnAppropriateDisk = -32767;
|
||||
/**
|
||||
* Read-only system hierarchy.
|
||||
* @since Java for Mac OS X 10.5 - 1.5
|
||||
* @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.
|
||||
* @since Java for Mac OS X 10.5 - 1.5
|
||||
* @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.
|
||||
* @since Java for Mac OS X 10.5 - 1.5
|
||||
* @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.
|
||||
* @since Java for Mac OS X 10.5 - 1.5
|
||||
* @since Java for Mac OS X 10.5 Update 1 - 1.6
|
||||
*/
|
||||
public final static short kUserDomain = -32763;
|
||||
public static final short kUserDomain = -32763;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -38,17 +38,17 @@ import com.apple.laf.AquaUtils.*;
|
|||
|
||||
public abstract class AquaButtonBorder extends AquaBorder implements Border, UIResource {
|
||||
public static final RecyclableSingleton<Dynamic> fDynamic = new RecyclableSingletonFromDefaultConstructor<Dynamic>(Dynamic.class);
|
||||
static public AquaButtonBorder getDynamicButtonBorder() {
|
||||
public static AquaButtonBorder getDynamicButtonBorder() {
|
||||
return fDynamic.get();
|
||||
}
|
||||
|
||||
private static final RecyclableSingleton<Toggle> fToggle = new RecyclableSingletonFromDefaultConstructor<Toggle>(Toggle.class);
|
||||
static public AquaButtonBorder getToggleButtonBorder() {
|
||||
public static AquaButtonBorder getToggleButtonBorder() {
|
||||
return fToggle.get();
|
||||
}
|
||||
|
||||
public static final RecyclableSingleton<Toolbar> fToolBar = new RecyclableSingletonFromDefaultConstructor<Toolbar>(Toolbar.class);
|
||||
static public Border getToolBarButtonBorder() {
|
||||
public static Border getToolBarButtonBorder() {
|
||||
return fToolBar.get();
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ public class AquaButtonExtendedTypes {
|
|||
return logicalPosition;
|
||||
}
|
||||
|
||||
static abstract class TypeSpecifier {
|
||||
abstract static class TypeSpecifier {
|
||||
final String name;
|
||||
final boolean setIconFont;
|
||||
|
||||
|
@ -138,7 +138,7 @@ public class AquaButtonExtendedTypes {
|
|||
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() {
|
||||
return getAllTypes();
|
||||
}
|
||||
|
|
|
@ -221,7 +221,7 @@ public abstract class AquaButtonLabeledUI extends AquaButtonToggleUI implements
|
|||
return new Dimension(width, height);
|
||||
}
|
||||
|
||||
public static abstract class LabeledButtonBorder extends AquaButtonBorder {
|
||||
public abstract static class LabeledButtonBorder extends AquaButtonBorder {
|
||||
public LabeledButtonBorder(final SizeDescriptor sizeDescriptor) {
|
||||
super(sizeDescriptor);
|
||||
}
|
||||
|
|
|
@ -462,7 +462,7 @@ public class AquaButtonUI extends BasicButtonUI implements Sizeable {
|
|||
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() {
|
||||
return fHierListener.get();
|
||||
}
|
||||
|
|
|
@ -35,10 +35,10 @@ import apple.laf.JRSUIConstants.*;
|
|||
|
||||
@SuppressWarnings("serial") // Superclass is not serializable across versions
|
||||
class AquaComboBoxButton extends JButton {
|
||||
final protected JComboBox<Object> comboBox;
|
||||
final protected JList<?> list;
|
||||
final protected CellRendererPane rendererPane;
|
||||
final protected AquaComboBoxUI ui;
|
||||
protected final JComboBox<Object> comboBox;
|
||||
protected final JList<?> list;
|
||||
protected final CellRendererPane rendererPane;
|
||||
protected final AquaComboBoxUI ui;
|
||||
|
||||
protected final AquaPainter<JRSUIState> painter = AquaPainter.create(JRSUIState.getInstance());
|
||||
boolean isPopDown;
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
package com.apple.laf;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Insets;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.event.*;
|
||||
|
||||
import javax.swing.*;
|
||||
|
@ -195,24 +197,14 @@ class AquaComboBoxPopup extends BasicComboPopup {
|
|||
final GraphicsDevice[] gs = ge.getScreenDevices();
|
||||
//System.err.println(" gs.length = " + gs.length);
|
||||
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) {
|
||||
final GraphicsConfiguration[] gc = gd.getConfigurations();
|
||||
for (final GraphicsConfiguration element0 : gc) {
|
||||
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();
|
||||
for (final GraphicsConfiguration element0 : gc) {
|
||||
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;
|
||||
}
|
||||
|
||||
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
|
||||
protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
|
||||
final int itemCount = comboBox.getModel().getSize();
|
||||
|
|
|
@ -57,8 +57,8 @@ class AquaFileSystemModel extends AbstractTableModel implements PropertyChangeLi
|
|||
// private boolean fSortAscending = true;
|
||||
private boolean fSortNames = true;
|
||||
private final String[] fColumnNames;
|
||||
public final static String SORT_BY_CHANGED = "sortByChanged";
|
||||
public final static String SORT_ASCENDING_CHANGED = "sortAscendingChanged";
|
||||
public static final String SORT_BY_CHANGED = "sortByChanged";
|
||||
public static final String SORT_ASCENDING_CHANGED = "sortAscendingChanged";
|
||||
|
||||
public AquaFileSystemModel(final JFileChooser filechooser, final JTable filelist, final String[] colNames) {
|
||||
fileCacheLock = new Object();
|
||||
|
|
|
@ -73,7 +73,7 @@ public class AquaIcon {
|
|||
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());
|
||||
|
||||
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 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 height;
|
||||
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 height;
|
||||
|
||||
|
|
|
@ -229,9 +229,9 @@ public class AquaInternalFrameDockIconUI extends DesktopIconUI implements MouseL
|
|||
|
||||
@SuppressWarnings("serial") // Superclass is not serializable across versions
|
||||
class DockLabel extends JLabel {
|
||||
final static int NUB_HEIGHT = 7;
|
||||
final static int ROUND_ADDITIONAL_HEIGHT = 8;
|
||||
final static int ROUND_ADDITIONAL_WIDTH = 12;
|
||||
static final int NUB_HEIGHT = 7;
|
||||
static final int ROUND_ADDITIONAL_HEIGHT = 8;
|
||||
static final int ROUND_ADDITIONAL_WIDTH = 12;
|
||||
|
||||
DockLabel(final String text) {
|
||||
super(text);
|
||||
|
|
|
@ -529,7 +529,7 @@ public class AquaKeyBindings {
|
|||
|
||||
// extracted and adapted from DefaultEditorKit in 1.6
|
||||
@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 void actionPerformed(final ActionEvent e) {
|
||||
|
|
|
@ -48,7 +48,7 @@ import com.apple.laf.AquaUtils.RecyclableSingletonFromDefaultConstructor;
|
|||
public class AquaRootPaneUI extends BasicRootPaneUI implements AncestorListener, WindowListener, ContainerListener {
|
||||
private static final RecyclableSingleton<AquaRootPaneUI> sRootPaneUI = new RecyclableSingletonFromDefaultConstructor<AquaRootPaneUI>(AquaRootPaneUI.class);
|
||||
|
||||
final static int kDefaultButtonPaintDelayBetweenFrames = 50;
|
||||
static final int kDefaultButtonPaintDelayBetweenFrames = 50;
|
||||
JButton fCurrentDefaultButton = null;
|
||||
Timer fTimer = null;
|
||||
static final boolean sUseScreenMenuBar = AquaMenuBarUI.getScreenMenuBarProperty();
|
||||
|
|
|
@ -2011,20 +2011,20 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing
|
|||
}
|
||||
|
||||
private static class Actions extends UIAction {
|
||||
final static String NEXT = "navigateNext";
|
||||
final static String PREVIOUS = "navigatePrevious";
|
||||
final static String RIGHT = "navigateRight";
|
||||
final static String LEFT = "navigateLeft";
|
||||
final static String UP = "navigateUp";
|
||||
final static String DOWN = "navigateDown";
|
||||
final static String PAGE_UP = "navigatePageUp";
|
||||
final static String PAGE_DOWN = "navigatePageDown";
|
||||
final static String REQUEST_FOCUS = "requestFocus";
|
||||
final static String REQUEST_FOCUS_FOR_VISIBLE = "requestFocusForVisibleComponent";
|
||||
final static String SET_SELECTED = "setSelectedIndex";
|
||||
final static String SELECT_FOCUSED = "selectTabWithFocus";
|
||||
final static String SCROLL_FORWARD = "scrollTabsForwardAction";
|
||||
final static String SCROLL_BACKWARD = "scrollTabsBackwardAction";
|
||||
static final String NEXT = "navigateNext";
|
||||
static final String PREVIOUS = "navigatePrevious";
|
||||
static final String RIGHT = "navigateRight";
|
||||
static final String LEFT = "navigateLeft";
|
||||
static final String UP = "navigateUp";
|
||||
static final String DOWN = "navigateDown";
|
||||
static final String PAGE_UP = "navigatePageUp";
|
||||
static final String PAGE_DOWN = "navigatePageDown";
|
||||
static final String REQUEST_FOCUS = "requestFocus";
|
||||
static final String REQUEST_FOCUS_FOR_VISIBLE = "requestFocusForVisibleComponent";
|
||||
static final String SET_SELECTED = "setSelectedIndex";
|
||||
static final String SELECT_FOCUSED = "selectTabWithFocus";
|
||||
static final String SCROLL_FORWARD = "scrollTabsForwardAction";
|
||||
static final String SCROLL_BACKWARD = "scrollTabsBackwardAction";
|
||||
|
||||
Actions(final String key) {
|
||||
super(key);
|
||||
|
|
|
@ -67,7 +67,7 @@ public class AquaTableHeaderUI extends BasicTableHeaderUI {
|
|||
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
|
||||
@SuppressWarnings("unchecked")
|
||||
protected ClientPropertyApplicator<JTableHeader, JTableHeader> getInstance() {
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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.beans.*;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.Border;
|
||||
|
@ -38,16 +37,20 @@ import apple.laf.JRSUIConstants.*;
|
|||
|
||||
import com.apple.laf.AquaUtils.RecyclableSingleton;
|
||||
import com.apple.laf.AquaUtils.RecyclableSingletonFromDefaultConstructor;
|
||||
import sun.security.action.GetPropertyAction;
|
||||
|
||||
import static java.security.AccessController.*;
|
||||
|
||||
public class AquaUtilControlSize {
|
||||
protected final static String CLIENT_PROPERTY_KEY = "JComponent.sizeVariant";
|
||||
protected final static String SYSTEM_PROPERTY_KEY = "swing.component.sizevariant";
|
||||
protected static final String CLIENT_PROPERTY_KEY = "JComponent.sizeVariant";
|
||||
protected static final String SYSTEM_PROPERTY_KEY = "swing.component.sizevariant";
|
||||
|
||||
interface Sizeable {
|
||||
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() {
|
||||
return sizeListener.get();
|
||||
}
|
||||
|
@ -70,13 +73,13 @@ public class AquaUtilControlSize {
|
|||
}
|
||||
|
||||
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);
|
||||
if (size != null) return size;
|
||||
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) {
|
||||
final Object sizeProp = c.getClientProperty(CLIENT_PROPERTY_KEY);
|
||||
if (sizeProp == null) return defaultSize;
|
||||
|
@ -85,20 +88,32 @@ public class AquaUtilControlSize {
|
|||
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 size = sizeFromUser == null ? JRSUIConstants.Size.REGULAR : sizeFromUser;
|
||||
final JRSUIConstants.Size size = sizeFromUser == null
|
||||
? JRSUIConstants.Size.REGULAR
|
||||
: sizeFromUser;
|
||||
painter.state.set(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();
|
||||
|
||||
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.SMALL) return initialFont.deriveFont(AquaFonts.getSmallControlTextFont().getSize2D());
|
||||
if (size == JRSUIConstants.Size.MINI) {
|
||||
return initialFont.deriveFont(
|
||||
AquaFonts.getMiniControlTextFont().getSize2D());
|
||||
}
|
||||
if (size == JRSUIConstants.Size.SMALL) {
|
||||
return initialFont.deriveFont(
|
||||
AquaFonts.getSmallControlTextFont().getSize2D());
|
||||
}
|
||||
|
||||
return initialFont.deriveFont(AquaFonts.getControlTextFont().getSize2D());
|
||||
}
|
||||
|
@ -115,25 +130,8 @@ public class AquaUtilControlSize {
|
|||
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 {
|
||||
@Override
|
||||
public void propertyChange(final PropertyChangeEvent evt) {
|
||||
final String key = evt.getPropertyName();
|
||||
if (!CLIENT_PROPERTY_KEY.equalsIgnoreCase(key)) return;
|
||||
|
@ -154,7 +152,10 @@ public class AquaUtilControlSize {
|
|||
|
||||
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();
|
||||
if (!(priorFont instanceof FontUIResource)) return;
|
||||
|
@ -200,6 +201,7 @@ public class AquaUtilControlSize {
|
|||
return regular;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "regular[" + regular + "] small[" + small + "] mini[" + mini + "]";
|
||||
}
|
||||
|
@ -223,8 +225,14 @@ public class AquaUtilControlSize {
|
|||
|
||||
public SizeVariant(final SizeVariant desc){
|
||||
this.size = desc.size;
|
||||
this.insets = new InsetsUIResource(desc.insets.top, 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.insets = new InsetsUIResource(desc.insets.top,
|
||||
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.w = desc.w;
|
||||
this.h = desc.h;
|
||||
|
@ -241,7 +249,8 @@ public class AquaUtilControlSize {
|
|||
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);
|
||||
return this;
|
||||
}
|
||||
|
@ -251,7 +260,8 @@ public class AquaUtilControlSize {
|
|||
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);
|
||||
return this;
|
||||
}
|
||||
|
@ -273,8 +283,12 @@ public class AquaUtilControlSize {
|
|||
// return this;
|
||||
// }
|
||||
|
||||
static Insets generateInsets(final Insets i, final int top, final int left, final int bottom, final int right) {
|
||||
if (i == null) return new InsetsUIResource(top, left, bottom, right);
|
||||
static Insets generateInsets(final Insets i, final int top,
|
||||
final int left, final int bottom,
|
||||
final int right) {
|
||||
if (i == null) {
|
||||
return new InsetsUIResource(top, left, bottom, right);
|
||||
}
|
||||
i.top += top;
|
||||
i.left += left;
|
||||
i.bottom += bottom;
|
||||
|
@ -282,8 +296,10 @@ public class AquaUtilControlSize {
|
|||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "insets:" + insets + ", margins:" + margins + ", fontSize:" + fontSize;// + ", textBaseline:" + textBaseline;
|
||||
return "insets:" + insets + ", margins:" + margins + ", fontSize:"
|
||||
+ fontSize;// + ", textBaseline:" + textBaseline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ import sun.java2d.pipe.*;
|
|||
import sun.lwawt.macosx.*;
|
||||
|
||||
public class CRenderer implements PixelDrawPipe, PixelFillPipe, ShapeDrawPipe, DrawImagePipe {
|
||||
native static void init();
|
||||
static native void init();
|
||||
|
||||
// cache of the runtime options
|
||||
static {
|
||||
|
|
|
@ -35,8 +35,8 @@ import sun.java2d.loops.*;
|
|||
import sun.java2d.pipe.*;
|
||||
|
||||
public class CompositeCRenderer extends CRenderer implements PixelDrawPipe, PixelFillPipe, ShapeDrawPipe, DrawImagePipe, TextPipe {
|
||||
final static int fPadding = 4;
|
||||
final static int fPaddingHalf = fPadding / 2;
|
||||
static final int fPadding = 4;
|
||||
static final int fPaddingHalf = fPadding / 2;
|
||||
|
||||
private static AffineTransform sIdentityMatrix = new AffineTransform();
|
||||
|
||||
|
|
|
@ -43,8 +43,8 @@ import java.lang.annotation.Native;
|
|||
* This is the SurfaceData for a CGContextRef.
|
||||
*/
|
||||
public abstract class OSXSurfaceData extends BufImgSurfaceData {
|
||||
final static float UPPER_BND = Float.MAX_VALUE / 2.0f;
|
||||
final static float LOWER_BND = -UPPER_BND;
|
||||
static final float UPPER_BND = Float.MAX_VALUE / 2.0f;
|
||||
static final float LOWER_BND = -UPPER_BND;
|
||||
|
||||
protected static CRenderer sQuartzPipe = null;
|
||||
protected static CTextPipe sCocoaTextPipe = null;
|
||||
|
|
|
@ -365,7 +365,7 @@ public abstract class CGLSurfaceData extends OGLSurfaceData {
|
|||
// Mac OS X specific APIs for JOGL/Java2D bridge...
|
||||
|
||||
// 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);
|
||||
|
||||
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
|
||||
native static boolean makeCGLContextCurrentOnSurface(CGLSurfaceData sd,
|
||||
static native boolean makeCGLContextCurrentOnSurface(CGLSurfaceData sd,
|
||||
long ctx);
|
||||
|
||||
public static boolean makeOGLContextCurrentOnSurface(Graphics g, long ctx) {
|
||||
|
@ -393,7 +393,7 @@ public abstract class CGLSurfaceData extends OGLSurfaceData {
|
|||
}
|
||||
|
||||
// additional cleanup
|
||||
private native static void destroyCGLContext(long ctx);
|
||||
private static native void destroyCGLContext(long ctx);
|
||||
|
||||
public static void destroyOGLContext(long ctx) {
|
||||
if (ctx != 0L) {
|
||||
|
|
|
@ -43,12 +43,12 @@ import static sun.lwawt.LWWindowPeer.PeerType;
|
|||
|
||||
public abstract class LWToolkit extends SunToolkit implements Runnable {
|
||||
|
||||
private final static int STATE_NONE = 0;
|
||||
private final static int STATE_INIT = 1;
|
||||
private final static int STATE_MESSAGELOOP = 2;
|
||||
private final static int STATE_SHUTDOWN = 3;
|
||||
private final static int STATE_CLEANUP = 4;
|
||||
private final static int STATE_DONE = 5;
|
||||
private static final int STATE_NONE = 0;
|
||||
private static final int STATE_INIT = 1;
|
||||
private static final int STATE_MESSAGELOOP = 2;
|
||||
private static final int STATE_SHUTDOWN = 3;
|
||||
private static final int STATE_CLEANUP = 4;
|
||||
private static final int STATE_DONE = 5;
|
||||
|
||||
private int runState = STATE_NONE;
|
||||
|
||||
|
@ -454,14 +454,14 @@ public abstract class LWToolkit extends SunToolkit implements Runnable {
|
|||
/*
|
||||
* Expose non-public targetToPeer() method.
|
||||
*/
|
||||
public final static Object targetToPeer(Object target) {
|
||||
public static final Object targetToPeer(Object target) {
|
||||
return SunToolkit.targetToPeer(target);
|
||||
}
|
||||
|
||||
/*
|
||||
* 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);
|
||||
}
|
||||
|
||||
|
|
|
@ -558,9 +558,9 @@ class CAccessibility implements PropertyChangeListener {
|
|||
|
||||
// Duplicated from JavaComponentAccessibility
|
||||
// Note that values >=0 are indexes into the child array
|
||||
final static int JAVA_AX_ALL_CHILDREN = -1;
|
||||
final static int JAVA_AX_SELECTED_CHILDREN = -2;
|
||||
final static int JAVA_AX_VISIBLE_CHILDREN = -3;
|
||||
static final int JAVA_AX_ALL_CHILDREN = -1;
|
||||
static final int JAVA_AX_SELECTED_CHILDREN = -2;
|
||||
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
|
||||
public static Object[] getChildrenAndRoles(final Accessible a, final Component c, final int whichChildren, final boolean allowIgnored) {
|
||||
|
|
|
@ -171,7 +171,7 @@ public class CDataTransferer extends DataTransferer {
|
|||
}
|
||||
|
||||
@Override
|
||||
synchronized protected Long getFormatForNativeAsLong(String str) {
|
||||
protected synchronized Long getFormatForNativeAsLong(String str) {
|
||||
Long format = predefinedClipboardNameMap.get(str);
|
||||
|
||||
if (format == null) {
|
||||
|
|
|
@ -422,7 +422,7 @@ public class CInputMethod extends InputMethodAdapter {
|
|||
* 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.
|
||||
*/
|
||||
synchronized private void insertText(String aString) {
|
||||
private synchronized void insertText(String aString) {
|
||||
AttributedString attribString = new AttributedString(aString);
|
||||
|
||||
// Set locale information on the new string.
|
||||
|
@ -447,11 +447,11 @@ public class CInputMethod extends InputMethodAdapter {
|
|||
fCurrentTextLength = rawText.length();
|
||||
}
|
||||
|
||||
static private final int kCaretPosition = 0;
|
||||
static private final int kRawText = 1;
|
||||
static private final int kSelectedRawText = 2;
|
||||
static private final int kConvertedText = 3;
|
||||
static private final int kSelectedConvertedText = 4;
|
||||
private static final int kCaretPosition = 0;
|
||||
private static final int kRawText = 1;
|
||||
private static final int kSelectedRawText = 2;
|
||||
private static final int kConvertedText = 3;
|
||||
private static final int kSelectedConvertedText = 4;
|
||||
|
||||
/**
|
||||
* 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?
|
||||
*/
|
||||
synchronized private void unmarkText() {
|
||||
private synchronized void unmarkText() {
|
||||
if (fCurrentText == null)
|
||||
return;
|
||||
|
||||
|
@ -574,7 +574,7 @@ public class CInputMethod extends InputMethodAdapter {
|
|||
fCurrentTextLength = 0;
|
||||
}
|
||||
|
||||
synchronized private boolean hasMarkedText() {
|
||||
private synchronized boolean hasMarkedText() {
|
||||
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
|
||||
* 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];
|
||||
|
||||
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
|
||||
* potentially incorrect.
|
||||
*/
|
||||
synchronized private int[] selectedRange() {
|
||||
private synchronized int[] selectedRange() {
|
||||
final int[] returnValue = new int[2];
|
||||
|
||||
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
|
||||
* return null.
|
||||
*/
|
||||
synchronized private int[] markedRange() {
|
||||
private synchronized int[] markedRange() {
|
||||
if (fCurrentText == 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
|
||||
* 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];
|
||||
|
||||
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
|
||||
* 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 int[] insertPositionOffset = new int[1];
|
||||
|
||||
|
|
|
@ -45,8 +45,8 @@ public final class CWarningWindow extends CPlatformWindow
|
|||
private static class Lock {}
|
||||
private final Lock lock = new Lock();
|
||||
|
||||
private final static int SHOWING_DELAY = 300;
|
||||
private final static int HIDING_DELAY = 2000;
|
||||
private static final int SHOWING_DELAY = 300;
|
||||
private static final int HIDING_DELAY = 2000;
|
||||
|
||||
private Rectangle bounds = new Rectangle();
|
||||
private final WeakReference<LWWindowPeer> ownerPeer;
|
||||
|
@ -406,7 +406,7 @@ public final class CWarningWindow extends CPlatformWindow
|
|||
private final Lock taskLock = new Lock();
|
||||
private CancelableRunnable showHideTask;
|
||||
|
||||
private static abstract class CancelableRunnable implements Runnable {
|
||||
private abstract static class CancelableRunnable implements Runnable {
|
||||
private volatile boolean perform = true;
|
||||
|
||||
public final void cancel() {
|
||||
|
|
|
@ -30,35 +30,35 @@ public final class CocoaConstants {
|
|||
private CocoaConstants(){}
|
||||
|
||||
//from the NSEvent class reference:
|
||||
public final static int NSLeftMouseDown = 1;
|
||||
public final static int NSLeftMouseUp = 2;
|
||||
public final static int NSRightMouseDown = 3;
|
||||
public final static int NSRightMouseUp = 4;
|
||||
public final static int NSMouseMoved = 5;
|
||||
public final static int NSLeftMouseDragged = 6;
|
||||
public final static int NSRightMouseDragged = 7;
|
||||
public final static int NSMouseEntered = 8;
|
||||
public final static int NSMouseExited = 9;
|
||||
public final static int NSKeyDown = 10;
|
||||
public final static int NSKeyUp = 11;
|
||||
public final static int NSFlagsChanged = 12;
|
||||
public static final int NSLeftMouseDown = 1;
|
||||
public static final int NSLeftMouseUp = 2;
|
||||
public static final int NSRightMouseDown = 3;
|
||||
public static final int NSRightMouseUp = 4;
|
||||
public static final int NSMouseMoved = 5;
|
||||
public static final int NSLeftMouseDragged = 6;
|
||||
public static final int NSRightMouseDragged = 7;
|
||||
public static final int NSMouseEntered = 8;
|
||||
public static final int NSMouseExited = 9;
|
||||
public static final int NSKeyDown = 10;
|
||||
public static final int NSKeyUp = 11;
|
||||
public static final int NSFlagsChanged = 12;
|
||||
|
||||
public final static int NSScrollWheel = 22;
|
||||
public final static int NSOtherMouseDown = 25;
|
||||
public final static int NSOtherMouseUp = 26;
|
||||
public final static int NSOtherMouseDragged = 27;
|
||||
public static final int NSScrollWheel = 22;
|
||||
public static final int NSOtherMouseDown = 25;
|
||||
public static final int NSOtherMouseUp = 26;
|
||||
public static final int NSOtherMouseDragged = 27;
|
||||
|
||||
public final static int AllLeftMouseEventsMask =
|
||||
public static final int AllLeftMouseEventsMask =
|
||||
1 << NSLeftMouseDown |
|
||||
1 << NSLeftMouseUp |
|
||||
1 << NSLeftMouseDragged;
|
||||
|
||||
public final static int AllRightMouseEventsMask =
|
||||
public static final int AllRightMouseEventsMask =
|
||||
1 << NSRightMouseDown |
|
||||
1 << NSRightMouseUp |
|
||||
1 << NSRightMouseDragged;
|
||||
|
||||
public final static int AllOtherMouseEventsMask =
|
||||
public static final int AllOtherMouseEventsMask =
|
||||
1 << NSOtherMouseDown |
|
||||
1 << NSOtherMouseUp |
|
||||
1 << NSOtherMouseDragged;
|
||||
|
@ -82,24 +82,24 @@ public final class CocoaConstants {
|
|||
|
||||
// See http://developer.apple.com/library/mac/#documentation/Carbon/Reference/QuartzEventServicesRef/Reference/reference.html
|
||||
|
||||
public final static int kCGMouseButtonLeft = 0;
|
||||
public final static int kCGMouseButtonRight = 1;
|
||||
public final static int kCGMouseButtonCenter = 2;
|
||||
public static final int kCGMouseButtonLeft = 0;
|
||||
public static final int kCGMouseButtonRight = 1;
|
||||
public static final int kCGMouseButtonCenter = 2;
|
||||
|
||||
// See https://wiki.mozilla.org/NPAPI:CocoaEventModel
|
||||
|
||||
public final static int NPCocoaEventDrawRect = 1;
|
||||
public final static int NPCocoaEventMouseDown = 2;
|
||||
public final static int NPCocoaEventMouseUp = 3;
|
||||
public final static int NPCocoaEventMouseMoved = 4;
|
||||
public final static int NPCocoaEventMouseEntered = 5;
|
||||
public final static int NPCocoaEventMouseExited = 6;
|
||||
public final static int NPCocoaEventMouseDragged = 7;
|
||||
public final static int NPCocoaEventKeyDown = 8;
|
||||
public final static int NPCocoaEventKeyUp = 9;
|
||||
public final static int NPCocoaEventFlagsChanged = 10;
|
||||
public final static int NPCocoaEventFocusChanged = 11;
|
||||
public final static int NPCocoaEventWindowFocusChanged = 12;
|
||||
public final static int NPCocoaEventScrollWheel = 13;
|
||||
public final static int NPCocoaEventTextInput = 14;
|
||||
public static final int NPCocoaEventDrawRect = 1;
|
||||
public static final int NPCocoaEventMouseDown = 2;
|
||||
public static final int NPCocoaEventMouseUp = 3;
|
||||
public static final int NPCocoaEventMouseMoved = 4;
|
||||
public static final int NPCocoaEventMouseEntered = 5;
|
||||
public static final int NPCocoaEventMouseExited = 6;
|
||||
public static final int NPCocoaEventMouseDragged = 7;
|
||||
public static final int NPCocoaEventKeyDown = 8;
|
||||
public static final int NPCocoaEventKeyUp = 9;
|
||||
public static final int NPCocoaEventFlagsChanged = 10;
|
||||
public static final int NPCocoaEventFocusChanged = 11;
|
||||
public static final int NPCocoaEventWindowFocusChanged = 12;
|
||||
public static final int NPCocoaEventScrollWheel = 13;
|
||||
public static final int NPCocoaEventTextInput = 14;
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
private final static int NUM_APPLE_COLORS = 3;
|
||||
public final static int KEYBOARD_FOCUS_COLOR = 0;
|
||||
public final static int INACTIVE_SELECTION_BACKGROUND_COLOR = 1;
|
||||
public final static int INACTIVE_SELECTION_FOREGROUND_COLOR = 2;
|
||||
private static final int NUM_APPLE_COLORS = 3;
|
||||
public static final int KEYBOARD_FOCUS_COLOR = 0;
|
||||
public static final int INACTIVE_SELECTION_BACKGROUND_COLOR = 1;
|
||||
public static final int INACTIVE_SELECTION_FOREGROUND_COLOR = 2;
|
||||
private static int[] appleColors = {
|
||||
0xFF808080, // keyboardFocusColor = Color.gray;
|
||||
0xFFC0C0C0, // secondarySelectedControlColor
|
||||
|
@ -681,7 +681,7 @@ public final class LWCToolkit extends LWToolkit {
|
|||
* @param r a {@code Runnable} to execute
|
||||
* @param delay a delay in milliseconds
|
||||
*/
|
||||
native static void performOnMainThreadAfterDelay(Runnable r, long delay);
|
||||
static native void performOnMainThreadAfterDelay(Runnable r, long delay);
|
||||
|
||||
// DnD support
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -26,8 +26,6 @@
|
|||
#ifndef __AWTEVENT_H
|
||||
#define __AWTEVENT_H
|
||||
|
||||
#import "LWCToolkit.h"
|
||||
|
||||
jlong UTC(NSEvent *event);
|
||||
void DeliverJavaKeyEvent(JNIEnv *env, NSEvent *event, jobject peer);
|
||||
void DeliverJavaMouseEvent(JNIEnv *env, NSEvent *event, jobject peer);
|
||||
|
|
|
@ -23,18 +23,15 @@
|
|||
* 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_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.
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -24,7 +24,6 @@
|
|||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||
|
||||
#import "CDragSource.h"
|
||||
#import "CDropTarget.h"
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -23,22 +23,17 @@
|
|||
* questions.
|
||||
*/
|
||||
|
||||
#import "CGLGraphicsConfig.h"
|
||||
|
||||
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||
#import <JavaRuntimeSupport/JavaRuntimeSupport.h>
|
||||
#import "jni_util.h"
|
||||
|
||||
#import "ThreadUtilities.h"
|
||||
#import "CGLGraphicsConfig.h"
|
||||
#import "AWTView.h"
|
||||
#import "AWTEvent.h"
|
||||
#import "AWTWindow.h"
|
||||
#import "LWCToolkit.h"
|
||||
#import "JavaComponentAccessibility.h"
|
||||
#import "JavaTextAccessibility.h"
|
||||
#import "GeomUtilities.h"
|
||||
#import "OSVersion.h"
|
||||
#import "CGLLayer.h"
|
||||
#import "ThreadUtilities.h"
|
||||
|
||||
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||
|
||||
@interface AWTView()
|
||||
@property (retain) CDropTarget *_dropTarget;
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -27,13 +27,12 @@
|
|||
#define _AWTWINDOW_H
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||
|
||||
#import "CMenuBar.h"
|
||||
#import "LWCToolkit.h"
|
||||
|
||||
|
||||
@class AWTView;
|
||||
@class JNFWeakJObjectWrapper;
|
||||
|
||||
@interface AWTWindow : NSObject <NSWindowDelegate> {
|
||||
@private
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||
#import <JavaRuntimeSupport/JavaRuntimeSupport.h>
|
||||
|
||||
#import "sun_lwawt_macosx_CPlatformWindow.h"
|
||||
#import "com_apple_eawt_event_GestureHandler.h"
|
||||
|
@ -34,12 +33,8 @@
|
|||
|
||||
#import "AWTWindow.h"
|
||||
#import "AWTView.h"
|
||||
#import "CMenu.h"
|
||||
#import "CMenuBar.h"
|
||||
#import "LWCToolkit.h"
|
||||
#import "GeomUtilities.h"
|
||||
#import "ThreadUtilities.h"
|
||||
#import "OSVersion.h"
|
||||
|
||||
#define MASK(KEY) \
|
||||
(sun_lwawt_macosx_CPlatformWindow_ ## KEY)
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -26,11 +26,9 @@
|
|||
#import "CDataTransferer.h"
|
||||
#include "sun_lwawt_macosx_CDataTransferer.h"
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||
#import "jni_util.h"
|
||||
|
||||
#include "ThreadUtilities.h"
|
||||
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||
|
||||
|
||||
// ***** NOTE ***** This dictionary corresponds to the static array predefinedClipboardNames
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "GeomUtilities.h"
|
||||
|
||||
#include "sun_awt_CGraphicsConfig.h"
|
||||
|
||||
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||
|
||||
/*
|
||||
* Class: sun_awt_CGraphicsConfig
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#import "LWCToolkit.h"
|
||||
#import "ThreadUtilities.h"
|
||||
|
||||
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||
|
||||
/*
|
||||
* 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) {
|
||||
NSDictionary *screenInfo = [screen deviceDescription];
|
||||
NSNumber *screenID = [screenInfo objectForKey:@"NSScreenNumber"];
|
||||
if ([screenID pointerValue] == displayID){
|
||||
if ([screenID unsignedIntValue] == displayID){
|
||||
frame = [screen frame];
|
||||
visibleFrame = [screen visibleFrame];
|
||||
break;
|
||||
|
@ -333,7 +335,7 @@ JNF_COCOA_ENTER(env);
|
|||
for (NSScreen *screen in screens) {
|
||||
NSDictionary *screenInfo = [screen deviceDescription];
|
||||
NSNumber *screenID = [screenInfo objectForKey:@"NSScreenNumber"];
|
||||
if ([screenID pointerValue] == displayID){
|
||||
if ([screenID unsignedIntValue] == displayID){
|
||||
if ([screen respondsToSelector:@selector(backingScaleFactor)]) {
|
||||
ret = [screen backingScaleFactor];
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -23,12 +23,11 @@
|
|||
* questions.
|
||||
*/
|
||||
|
||||
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||
|
||||
#import "jni_util.h"
|
||||
#import "LWCToolkit.h"
|
||||
#import "AWT_debug.h"
|
||||
|
||||
#import "jni_util.h"
|
||||
|
||||
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||
|
||||
#define MAX_DISPLAYS 64
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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);
|
||||
|
||||
|
||||
#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)
|
||||
{
|
||||
NSPrintInfo* defaultPrintInfo = [[NSPrintInfo sharedPrintInfo] copy];
|
||||
|
@ -143,12 +151,12 @@ static void nsPrintInfoToJavaPaper(JNIEnv* env, NSPrintInfo* src, jobject dst)
|
|||
|
||||
NSSize paperSize = [src paperSize];
|
||||
switch ([src orientation]) {
|
||||
case NSPortraitOrientation:
|
||||
case NS_PORTRAIT:
|
||||
jPaperW = paperSize.width;
|
||||
jPaperH = paperSize.height;
|
||||
break;
|
||||
|
||||
case NSLandscapeOrientation:
|
||||
case NS_LANDSCAPE:
|
||||
jPaperW = paperSize.height;
|
||||
jPaperH = paperSize.width;
|
||||
break;
|
||||
|
@ -217,13 +225,12 @@ static void nsPrintInfoToJavaPageFormat(JNIEnv* env, NSPrintInfo* src, jobject d
|
|||
static JNF_CTOR_CACHE(jm_Paper_ctor, sjc_Paper, "()V");
|
||||
|
||||
jint jOrientation;
|
||||
NSPrintingOrientation nsOrientation = [src orientation];
|
||||
switch (nsOrientation) {
|
||||
case NSPortraitOrientation:
|
||||
switch ([src orientation]) {
|
||||
case NS_PORTRAIT:
|
||||
jOrientation = java_awt_print_PageFormat_PORTRAIT;
|
||||
break;
|
||||
|
||||
case NSLandscapeOrientation:
|
||||
case NS_LANDSCAPE:
|
||||
jOrientation = java_awt_print_PageFormat_LANDSCAPE; //+++gdb Are LANDSCAPE and REVERSE_LANDSCAPE still inverted?
|
||||
break;
|
||||
|
||||
|
@ -273,20 +280,20 @@ static void javaPageFormatToNSPrintInfo(JNIEnv* env, jobject srcPrintJob, jobjec
|
|||
|
||||
switch (JNFCallIntMethod(env, srcPageFormat, jm_getOrientation)) { // AWT_THREADING Safe (!appKit)
|
||||
case java_awt_print_PageFormat_PORTRAIT:
|
||||
[dstPrintInfo setOrientation:NSPortraitOrientation];
|
||||
[dstPrintInfo setOrientation:NS_PORTRAIT];
|
||||
break;
|
||||
|
||||
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;
|
||||
|
||||
// AppKit printing doesn't support REVERSE_LANDSCAPE. Radar 2960295.
|
||||
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;
|
||||
|
||||
default:
|
||||
[dstPrintInfo setOrientation:NSPortraitOrientation];
|
||||
[dstPrintInfo setOrientation:NS_PORTRAIT];
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -23,9 +23,10 @@
|
|||
* questions.
|
||||
*/
|
||||
|
||||
#import "jni_util.h"
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||
#import "jni_util.h"
|
||||
|
||||
#import "CTrayIcon.h"
|
||||
#import "ThreadUtilities.h"
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -24,8 +24,7 @@
|
|||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||
|
||||
#include "jni.h"
|
||||
|
||||
jobject CGToJavaRect(JNIEnv *env, CGRect rect);
|
||||
CGRect JavaToCGRect(JNIEnv *env, jobject rect);
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -24,6 +24,7 @@
|
|||
*/
|
||||
|
||||
#import "GeomUtilities.h"
|
||||
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||
|
||||
static JNF_CLASS_CACHE(sjc_Point2D, "java/awt/geom/Point2D");
|
||||
static JNF_MEMBER_CACHE(jm_pt_getX, sjc_Point2D, "getX", "()D");
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -23,9 +23,9 @@
|
|||
* questions.
|
||||
*/
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||
#include "jni.h"
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
|
||||
//#define JAVA_AX_DEBUG 1
|
||||
//#define JAVA_AX_NO_IGNORES 1
|
||||
|
|
|
@ -23,11 +23,12 @@
|
|||
* questions.
|
||||
*/
|
||||
|
||||
#include "jni.h"
|
||||
|
||||
#import <pthread.h>
|
||||
#import <assert.h>
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||
|
||||
#define DEBUG 1
|
||||
|
||||
|
|
|
@ -28,15 +28,10 @@
|
|||
#import <objc/runtime.h>
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <Security/AuthSession.h>
|
||||
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||
#import <JavaRuntimeSupport/JavaRuntimeSupport.h>
|
||||
|
||||
#include "jni_util.h"
|
||||
#import "CMenuBar.h"
|
||||
#import "InitIDs.h"
|
||||
#import "LWCToolkit.h"
|
||||
#import "ThreadUtilities.h"
|
||||
#import "AWT_debug.h"
|
||||
#import "CSystemColors.h"
|
||||
#import "NSApplicationAWT.h"
|
||||
#import "PropertiesUtilities.h"
|
||||
|
@ -46,6 +41,8 @@
|
|||
|
||||
#import "sizecalc.h"
|
||||
|
||||
#import <JavaRuntimeSupport/JavaRuntimeSupport.h>
|
||||
|
||||
int gNumberOfButtons;
|
||||
jint* gButtonDownMasks;
|
||||
|
||||
|
@ -529,7 +526,7 @@ JNF_COCOA_ENTER(env);
|
|||
// Processing all events excluding NSApplicationDefined which need to be processed
|
||||
// on the main loop only (those events are intended for disposing resources)
|
||||
NSEvent *event;
|
||||
if ((event = [NSApp nextEventMatchingMask:(NSAnyEventMask & ~NSApplicationDefined)
|
||||
if ((event = [NSApp nextEventMatchingMask:(NSAnyEventMask & ~NSApplicationDefinedMask)
|
||||
untilDate:nil
|
||||
inMode:NSDefaultRunLoopMode
|
||||
dequeue:YES]) != nil) {
|
||||
|
|
|
@ -23,20 +23,17 @@
|
|||
* questions.
|
||||
*/
|
||||
|
||||
#import "sun_java2d_opengl_CGLGraphicsConfig.h"
|
||||
|
||||
#import "CGLGraphicsConfig.h"
|
||||
#import "CGLSurfaceData.h"
|
||||
#import "ThreadUtilities.h"
|
||||
|
||||
#import <stdlib.h>
|
||||
#import <string.h>
|
||||
#import <ApplicationServices/ApplicationServices.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 "--- Mac OS X specific methods for GL pipeline ---"
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -26,7 +26,7 @@
|
|||
#ifndef CGLLayer_h_Included
|
||||
#define CGLLayer_h_Included
|
||||
|
||||
#import "AWTView.h"
|
||||
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||
|
||||
@interface CGLLayer : CAOpenGLLayer
|
||||
{
|
||||
|
|
|
@ -24,16 +24,13 @@
|
|||
*/
|
||||
|
||||
#import <stdlib.h>
|
||||
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||
|
||||
#import "sun_java2d_opengl_CGLSurfaceData.h"
|
||||
|
||||
#import "jni.h"
|
||||
#import "jni_util.h"
|
||||
#import "OGLRenderQueue.h"
|
||||
#import "CGLGraphicsConfig.h"
|
||||
#import "CGLSurfaceData.h"
|
||||
#import "CGLLayer.h"
|
||||
#import "ThreadUtilities.h"
|
||||
|
||||
/* JDK's glext.h is already included and will prevent the Apple glext.h
|
||||
|
|
|
@ -32,7 +32,7 @@ package com.sun.beans.editors;
|
|||
|
||||
import java.beans.*;
|
||||
|
||||
abstract public class NumberEditor extends PropertyEditorSupport {
|
||||
public abstract class NumberEditor extends PropertyEditorSupport {
|
||||
|
||||
public String getJavaInitializationString() {
|
||||
Object value = getValue();
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
package com.sun.imageio.plugins.common;
|
||||
|
||||
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) {
|
||||
return getString("com.sun.imageio.plugins.common.I18N", resource_name, key);
|
||||
}
|
||||
|
|
|
@ -37,16 +37,16 @@ import java.io.PrintStream;
|
|||
**/
|
||||
public class LZWStringTable {
|
||||
/** 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 final static short NEXT_FIRST = (short)0xFFFF;
|
||||
private static final short HASH_FREE = (short)0xFFFF;
|
||||
private static final short NEXT_FIRST = (short)0xFFFF;
|
||||
|
||||
private final static int MAXBITS = 12;
|
||||
private final static int MAXSTR = (1 << MAXBITS);
|
||||
private static final int MAXBITS = 12;
|
||||
private static final int MAXSTR = (1 << MAXBITS);
|
||||
|
||||
private final static short HASHSIZE = 9973;
|
||||
private final static short HASHSTEP = 2039;
|
||||
private static final short HASHSIZE = 9973;
|
||||
private static final short HASHSTEP = 2039;
|
||||
|
||||
byte[] strChr; // after predecessor character
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -1773,7 +1773,7 @@ class ImageTypeProducer {
|
|||
private static final ImageTypeProducer [] defaultTypes =
|
||||
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) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ import sun.swing.ImageCache;
|
|||
*/
|
||||
class GTKEngine {
|
||||
|
||||
final static GTKEngine INSTANCE = new GTKEngine();
|
||||
static final GTKEngine INSTANCE = new GTKEngine();
|
||||
|
||||
/** Size of the image cache */
|
||||
private static final int CACHE_SIZE = 50;
|
||||
|
@ -523,7 +523,7 @@ class GTKEngine {
|
|||
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
|
||||
new DirectColorModel(24, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000),
|
||||
// Transparency.BITMASK
|
||||
|
@ -532,7 +532,7 @@ class GTKEngine {
|
|||
ColorModel.getRGBdefault(),
|
||||
};
|
||||
|
||||
private final static int[][] BAND_OFFSETS = {
|
||||
private static final int[][] BAND_OFFSETS = {
|
||||
{ 0x00ff0000, 0x0000ff00, 0x000000ff }, // OPAQUE
|
||||
{ 0x00ff0000, 0x0000ff00, 0x000000ff, 0x01000000 }, // BITMASK
|
||||
{ 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 } // TRANSLUCENT
|
||||
|
|
|
@ -63,8 +63,8 @@ class GTKPainter extends SynthPainter {
|
|||
ShadowType.ETCHED_IN, ShadowType.OUT
|
||||
};
|
||||
|
||||
private final static GTKEngine ENGINE = GTKEngine.INSTANCE;
|
||||
final static GTKPainter INSTANCE = new GTKPainter();
|
||||
private static final GTKEngine ENGINE = GTKEngine.INSTANCE;
|
||||
static final GTKPainter INSTANCE = new GTKPainter();
|
||||
|
||||
private GTKPainter() {
|
||||
}
|
||||
|
|
|
@ -263,7 +263,7 @@ public class MotifBorders {
|
|||
Color frameShadow;
|
||||
|
||||
// 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>.
|
||||
*/
|
||||
|
@ -446,7 +446,7 @@ public class MotifBorders {
|
|||
JInternalFrame frame;
|
||||
|
||||
// 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
|
||||
* <b>aFrame</b>.
|
||||
|
@ -634,10 +634,10 @@ public class MotifBorders {
|
|||
protected Color highlightColor;
|
||||
|
||||
// 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
|
||||
static protected final int GROOVE_HEIGHT = 2;
|
||||
protected static final int GROOVE_HEIGHT = 2;
|
||||
|
||||
/**
|
||||
* Creates a MotifPopupMenuBorder instance
|
||||
|
|
|
@ -49,7 +49,7 @@ public class MotifCheckBoxUI extends MotifRadioButtonUI {
|
|||
|
||||
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;
|
||||
|
||||
|
|
|
@ -59,10 +59,10 @@ public class MotifDesktopIconUI extends BasicDesktopIconUI
|
|||
JPopupMenu systemMenu;
|
||||
EventListener mml;
|
||||
|
||||
final static int LABEL_HEIGHT = 18;
|
||||
final static int LABEL_DIVIDER = 4; // padding between icon and label
|
||||
static final int LABEL_HEIGHT = 18;
|
||||
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);
|
||||
|
||||
public static ComponentUI createUI(JComponent c) {
|
||||
|
|
|
@ -306,7 +306,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
|||
}
|
||||
|
||||
@SuppressWarnings("serial") // anonymous class
|
||||
JTextField tmp1 = new JTextField(curDirName) {
|
||||
JTextField tmp1 = new JTextField(curDirName, 35) {
|
||||
public Dimension getMaximumSize() {
|
||||
Dimension d = super.getMaximumSize();
|
||||
d.height = getPreferredSize().height;
|
||||
|
@ -420,7 +420,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
|
|||
interior.add(fileNameLabel);
|
||||
|
||||
@SuppressWarnings("serial") // anonymous class
|
||||
JTextField tmp3 = new JTextField() {
|
||||
JTextField tmp3 = new JTextField(35) {
|
||||
public Dimension getMaximumSize() {
|
||||
Dimension d = super.getMaximumSize();
|
||||
d.height = getPreferredSize().height;
|
||||
|
|
|
@ -93,7 +93,7 @@ public class MotifIconFactory implements Serializable
|
|||
|
||||
@SuppressWarnings("serial") // Same-version serialization only
|
||||
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 foreground = UIManager.getColor("CheckBox.foreground");
|
||||
|
|
|
@ -56,7 +56,7 @@ public class MotifInternalFrameTitlePane
|
|||
Color shadow;
|
||||
|
||||
// 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) {
|
||||
|
|
|
@ -47,9 +47,9 @@ import java.beans.PropertyChangeListener;
|
|||
*/
|
||||
public class MotifScrollPaneUI extends BasicScrollPaneUI
|
||||
{
|
||||
private final static Border vsbMarginBorderR = new EmptyBorder(0, 4, 0, 0);
|
||||
private final static Border vsbMarginBorderL = new EmptyBorder(0, 0, 0, 4);
|
||||
private final static Border hsbMarginBorder = new EmptyBorder(4, 0, 0, 0);
|
||||
private static final Border vsbMarginBorderR = new EmptyBorder(0, 4, 0, 0);
|
||||
private static final Border vsbMarginBorderL = new EmptyBorder(0, 0, 0, 4);
|
||||
private static final Border hsbMarginBorder = new EmptyBorder(4, 0, 0, 0);
|
||||
|
||||
private CompoundBorder vsbBorder;
|
||||
private CompoundBorder hsbBorder;
|
||||
|
|
|
@ -69,11 +69,11 @@ import sun.awt.AppContext;
|
|||
*/
|
||||
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"));
|
||||
|
||||
|
||||
private final static Object ANIMATION_CONTROLLER_KEY =
|
||||
private static final Object ANIMATION_CONTROLLER_KEY =
|
||||
new StringBuilder("ANIMATION_CONTROLLER_KEY");
|
||||
|
||||
private final Map<JComponent, Map<Part, AnimationState>> animationStateMap =
|
||||
|
|
|
@ -53,7 +53,7 @@ public class WindowsCheckBoxUI extends WindowsRadioButtonUI
|
|||
|
||||
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;
|
||||
|
||||
|
|
|
@ -1017,7 +1017,7 @@ public class WindowsFileChooserUI extends BasicFileChooserUI {
|
|||
}
|
||||
}
|
||||
|
||||
final static int space = 10;
|
||||
static final int space = 10;
|
||||
class IndentIcon implements Icon {
|
||||
|
||||
Icon icon = null;
|
||||
|
|
|
@ -321,7 +321,7 @@ public class WindowsIconFactory implements Serializable
|
|||
@SuppressWarnings("serial") // Same-version serialization only
|
||||
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) {
|
||||
JCheckBox cb = (JCheckBox) c;
|
||||
ButtonModel model = cb.getModel();
|
||||
|
|
|
@ -2271,7 +2271,7 @@ public class WindowsLookAndFeel extends BasicLookAndFeel
|
|||
protected Object classicValue, xpValue;
|
||||
|
||||
// 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) {
|
||||
this.xpValue = xpValue;
|
||||
|
|
|
@ -70,7 +70,7 @@ import javax.swing.plaf.basic.ComboPopup;
|
|||
*/
|
||||
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();
|
||||
|
||||
public static ComponentUI createUI(JComponent c) {
|
||||
|
|
|
@ -106,8 +106,8 @@ public class WindowsTreeUI extends BasicTreeUI {
|
|||
}
|
||||
}
|
||||
|
||||
static protected final int HALF_SIZE = 4;
|
||||
static protected final int SIZE = 9;
|
||||
protected static final int HALF_SIZE = 4;
|
||||
protected static final int SIZE = 9;
|
||||
|
||||
/**
|
||||
* 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
|
||||
public static class ExpandedIcon implements Icon, Serializable {
|
||||
|
||||
static public Icon createExpandedIcon() {
|
||||
public static Icon createExpandedIcon() {
|
||||
return new ExpandedIcon();
|
||||
}
|
||||
|
||||
|
@ -182,7 +182,7 @@ public class WindowsTreeUI extends BasicTreeUI {
|
|||
*/
|
||||
@SuppressWarnings("serial") // Superclass is not serializable across versions
|
||||
public static class CollapsedIcon extends ExpandedIcon {
|
||||
static public Icon createCollapsedIcon() {
|
||||
public static Icon createCollapsedIcon() {
|
||||
return new CollapsedIcon();
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ import javax.sound.sampled.AudioSystem;
|
|||
public final class AuFileWriter extends SunFileWriter {
|
||||
|
||||
//$$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.
|
||||
|
|
|
@ -53,11 +53,11 @@ public abstract class AudioFloatConverter {
|
|||
|
||||
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;
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ import java.util.List;
|
|||
*/
|
||||
public final class DLSRegion {
|
||||
|
||||
public final static int OPTION_SELFNONEXCLUSIVE = 0x0001;
|
||||
public static final int OPTION_SELFNONEXCLUSIVE = 0x0001;
|
||||
List<DLSModulator> modulators = new ArrayList<DLSModulator>();
|
||||
int keyfrom;
|
||||
int keyto;
|
||||
|
|
|
@ -31,8 +31,8 @@ package com.sun.media.sound;
|
|||
*/
|
||||
public final class DLSSampleLoop {
|
||||
|
||||
public final static int LOOP_TYPE_FORWARD = 0;
|
||||
public final static int LOOP_TYPE_RELEASE = 1;
|
||||
public static final int LOOP_TYPE_FORWARD = 0;
|
||||
public static final int LOOP_TYPE_RELEASE = 1;
|
||||
long type;
|
||||
long start;
|
||||
long length;
|
||||
|
|
|
@ -53,7 +53,7 @@ import javax.sound.sampled.AudioFormat.Encoding;
|
|||
*/
|
||||
public final class DLSSoundbank implements Soundbank {
|
||||
|
||||
static private class DLSID {
|
||||
private static class DLSID {
|
||||
long i1;
|
||||
int s1;
|
||||
int s2;
|
||||
|
@ -548,7 +548,7 @@ public final class DLSSoundbank implements Soundbank {
|
|||
long count = riff.readUnsignedInt();
|
||||
|
||||
if (size - 8 != 0)
|
||||
riff.skipBytes(size - 8);
|
||||
riff.skip(size - 8);
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
DLSModulator modulator = new DLSModulator();
|
||||
|
@ -568,7 +568,7 @@ public final class DLSSoundbank implements Soundbank {
|
|||
long count = riff.readUnsignedInt();
|
||||
|
||||
if (size - 8 != 0)
|
||||
riff.skipBytes(size - 8);
|
||||
riff.skip(size - 8);
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
DLSModulator modulator = new DLSModulator();
|
||||
|
@ -661,7 +661,7 @@ public final class DLSSoundbank implements Soundbank {
|
|||
long loops = riff.readInt();
|
||||
|
||||
if (size > 20)
|
||||
riff.skipBytes(size - 20);
|
||||
riff.skip(size - 20);
|
||||
|
||||
for (int i = 0; i < loops; i++) {
|
||||
DLSSampleLoop loop = new DLSSampleLoop();
|
||||
|
@ -671,7 +671,7 @@ public final class DLSSoundbank implements Soundbank {
|
|||
loop.length = riff.readUnsignedInt();
|
||||
sampleOptions.loops.add(loop);
|
||||
if (size2 > 16)
|
||||
riff.skipBytes(size2 - 16);
|
||||
riff.skip(size2 - 16);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ import javax.sound.sampled.AudioFormat;
|
|||
*/
|
||||
public final class EmergencySoundbank {
|
||||
|
||||
private final static String[] general_midi_instruments = {
|
||||
private static final String[] general_midi_instruments = {
|
||||
"Acoustic Grand Piano",
|
||||
"Bright Acoustic Piano",
|
||||
"Electric Grand Piano",
|
||||
|
@ -2564,11 +2564,11 @@ public final class EmergencySoundbank {
|
|||
return ins;
|
||||
}
|
||||
|
||||
static public void ifft(double[] data) {
|
||||
public static void ifft(double[] 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);
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
double phase = Math.random() * 2 * Math.PI;
|
||||
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) {
|
||||
double phase = random.nextDouble() * 2 * Math.PI;
|
||||
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;
|
||||
for (int i = 0; i < data.length; i++) {
|
||||
if (data[i] > maxvalue)
|
||||
|
@ -2613,7 +2613,7 @@ public final class EmergencySoundbank {
|
|||
data[i] *= gain;
|
||||
}
|
||||
|
||||
static public void normalize(float[] data, double target) {
|
||||
public static void normalize(float[] data, double target) {
|
||||
double maxvalue = 0.5;
|
||||
for (int i = 0; i < data.length; i++) {
|
||||
if (data[i * 2] > maxvalue)
|
||||
|
@ -2626,7 +2626,7 @@ public final class EmergencySoundbank {
|
|||
data[i * 2] *= gain;
|
||||
}
|
||||
|
||||
static public double[] realPart(double[] in) {
|
||||
public static double[] realPart(double[] in) {
|
||||
double[] out = new double[in.length / 2];
|
||||
for (int i = 0; i < out.length; i++) {
|
||||
out[i] = in[i * 2];
|
||||
|
@ -2634,7 +2634,7 @@ public final class EmergencySoundbank {
|
|||
return out;
|
||||
}
|
||||
|
||||
static public double[] imgPart(double[] in) {
|
||||
public static double[] imgPart(double[] in) {
|
||||
double[] out = new double[in.length / 2];
|
||||
for (int i = 0; i < out.length; i++) {
|
||||
out[i] = in[i * 2];
|
||||
|
@ -2642,7 +2642,7 @@ public final class EmergencySoundbank {
|
|||
return out;
|
||||
}
|
||||
|
||||
static public float[] toFloat(double[] in) {
|
||||
public static float[] toFloat(double[] in) {
|
||||
float[] out = new float[in.length];
|
||||
for (int i = 0; i < out.length; i++) {
|
||||
out[i] = (float) in[i];
|
||||
|
@ -2650,24 +2650,24 @@ public final class EmergencySoundbank {
|
|||
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()];
|
||||
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;
|
||||
for (int i = 0; i < samples; i++)
|
||||
data[i] *= i / dsamples;
|
||||
}
|
||||
|
||||
static public void fadeUp(float[] data, int samples) {
|
||||
public static void fadeUp(float[] data, int samples) {
|
||||
double dsamples = samples;
|
||||
for (int i = 0; i < samples; i++)
|
||||
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];
|
||||
int p_len = data.length;
|
||||
int p_ps = 0;
|
||||
|
@ -2680,7 +2680,7 @@ public final class EmergencySoundbank {
|
|||
return outdata;
|
||||
}
|
||||
|
||||
static public float[] loopExtend(float[] data, int newsize) {
|
||||
public static float[] loopExtend(float[] data, int newsize) {
|
||||
float[] outdata = new float[newsize];
|
||||
int p_len = data.length;
|
||||
int p_ps = 0;
|
||||
|
|
|
@ -88,9 +88,9 @@ public final class JavaSoundAudioClip implements AudioClip, MetaEventListener, L
|
|||
* 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 int STREAM_BUFFER_SIZE = 1024;
|
||||
private static final int STREAM_BUFFER_SIZE = 1024;
|
||||
|
||||
public JavaSoundAudioClip(InputStream in) throws IOException {
|
||||
if (DEBUG || Printer.debug)Printer.debug("JavaSoundAudioClip.<init>");
|
||||
|
|
|
@ -42,7 +42,7 @@ public final class MidiOutDeviceProvider extends AbstractMidiDeviceProvider {
|
|||
/** Cache of open MIDI output devices on the system. */
|
||||
private static MidiDevice[] devices = null;
|
||||
|
||||
private final static boolean enabled;
|
||||
private static final boolean enabled;
|
||||
|
||||
// STATIC
|
||||
|
||||
|
|
|
@ -44,9 +44,9 @@ import javax.sound.midi.Track;
|
|||
*/
|
||||
public final class MidiUtils {
|
||||
|
||||
public final static int DEFAULT_TEMPO_MPQ = 500000; // 120bpm
|
||||
public final static int META_END_OF_TRACK_TYPE = 0x2F;
|
||||
public final static int META_TEMPO_TYPE = 0x51;
|
||||
public static final int DEFAULT_TEMPO_MPQ = 500000; // 120bpm
|
||||
public static final int META_END_OF_TRACK_TYPE = 0x2F;
|
||||
public static final int META_TEMPO_TYPE = 0x51;
|
||||
|
||||
/**
|
||||
* Suppresses default constructor, ensuring non-instantiability.
|
||||
|
|
|
@ -39,7 +39,7 @@ public final class ModelConnectionBlock {
|
|||
//
|
||||
// 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 double scale = 1;
|
||||
private ModelDestination destination;
|
||||
|
|
|
@ -31,5 +31,5 @@ package com.sun.media.sound;
|
|||
*/
|
||||
public interface ModelTransform {
|
||||
|
||||
abstract public double transform(double value);
|
||||
public abstract double transform(double value);
|
||||
}
|
||||
|
|
|
@ -169,9 +169,9 @@ final class Platform {
|
|||
}
|
||||
|
||||
// the following native methods are implemented in Platform.c
|
||||
private native static boolean nIsBigEndian();
|
||||
private native static String nGetExtraLibraries();
|
||||
private native static int nGetLibraryForFeature(int feature);
|
||||
private static native boolean nIsBigEndian();
|
||||
private static native String nGetExtraLibraries();
|
||||
private static native int nGetLibraryForFeature(int feature);
|
||||
|
||||
/**
|
||||
* Read the required system properties.
|
||||
|
|
|
@ -422,7 +422,7 @@ final class PortMixer extends AbstractMixer {
|
|||
private boolean closed = false;
|
||||
|
||||
// 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,
|
||||
FloatControl.Type.BALANCE,
|
||||
FloatControl.Type.MASTER_GAIN,
|
||||
|
|
|
@ -118,6 +118,7 @@ public final class RIFFReader extends InputStream {
|
|||
return ckSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read() throws IOException {
|
||||
if (avail == 0) {
|
||||
return -1;
|
||||
|
@ -132,6 +133,7 @@ public final class RIFFReader extends InputStream {
|
|||
return b;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read(byte[] b, int offset, int len) throws IOException {
|
||||
if (avail == 0) {
|
||||
return -1;
|
||||
|
@ -172,49 +174,45 @@ public final class RIFFReader extends InputStream {
|
|||
}
|
||||
}
|
||||
|
||||
public long skipBytes(long n) throws IOException {
|
||||
if (n < 0)
|
||||
@Override
|
||||
public long skip(final long n) throws IOException {
|
||||
if (n <= 0 || avail == 0) {
|
||||
return 0;
|
||||
long skipped = 0;
|
||||
while (skipped != n) {
|
||||
long s = skip(n - skipped);
|
||||
if (s < 0)
|
||||
break;
|
||||
if (s == 0)
|
||||
Thread.yield();
|
||||
skipped += s;
|
||||
}
|
||||
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;
|
||||
return len;
|
||||
} else {
|
||||
long ret = stream.skip(n);
|
||||
if (ret == -1) {
|
||||
// will not skip more than
|
||||
long remaining = Math.min(n, avail);
|
||||
while (remaining > 0) {
|
||||
// Some input streams like FileInputStream can return more bytes,
|
||||
// when EOF is reached.
|
||||
long ret = Math.min(stream.skip(remaining), remaining);
|
||||
if (ret == 0) {
|
||||
// EOF or not? we need to check.
|
||||
Thread.yield();
|
||||
if (stream.read() == -1) {
|
||||
avail = 0;
|
||||
break;
|
||||
}
|
||||
ret = 1;
|
||||
} else if (ret < 0) {
|
||||
// the skip should not return negative value, but check it also
|
||||
avail = 0;
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
remaining -= ret;
|
||||
avail -= ret;
|
||||
filepointer += ret;
|
||||
return ret;
|
||||
}
|
||||
return n - remaining;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int available() {
|
||||
return (int)avail;
|
||||
}
|
||||
|
||||
public void finish() throws IOException {
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
finish();
|
||||
if (this == root)
|
||||
|
|
|
@ -51,8 +51,8 @@ final class RealTimeSequencer extends AbstractMidiDevice
|
|||
// STATIC VARIABLES
|
||||
|
||||
/** debugging flags */
|
||||
private final static boolean DEBUG_PUMP = false;
|
||||
private final static boolean DEBUG_PUMP_ALL = false;
|
||||
private static final boolean DEBUG_PUMP = false;
|
||||
private static final boolean DEBUG_PUMP_ALL = false;
|
||||
|
||||
/**
|
||||
* Event Dispatcher thread. Should be using a shared event
|
||||
|
|
|
@ -31,24 +31,24 @@ package com.sun.media.sound;
|
|||
*/
|
||||
public final class SF2Modulator {
|
||||
|
||||
public final static int SOURCE_NONE = 0;
|
||||
public final static int SOURCE_NOTE_ON_VELOCITY = 2;
|
||||
public final static int SOURCE_NOTE_ON_KEYNUMBER = 3;
|
||||
public final static int SOURCE_POLY_PRESSURE = 10;
|
||||
public final static int SOURCE_CHANNEL_PRESSURE = 13;
|
||||
public final static int SOURCE_PITCH_WHEEL = 14;
|
||||
public final static int SOURCE_PITCH_SENSITIVITY = 16;
|
||||
public final static int SOURCE_MIDI_CONTROL = 128 * 1;
|
||||
public final static int SOURCE_DIRECTION_MIN_MAX = 256 * 0;
|
||||
public final static int SOURCE_DIRECTION_MAX_MIN = 256 * 1;
|
||||
public final static int SOURCE_POLARITY_UNIPOLAR = 512 * 0;
|
||||
public final static int SOURCE_POLARITY_BIPOLAR = 512 * 1;
|
||||
public final static int SOURCE_TYPE_LINEAR = 1024 * 0;
|
||||
public final static int SOURCE_TYPE_CONCAVE = 1024 * 1;
|
||||
public final static int SOURCE_TYPE_CONVEX = 1024 * 2;
|
||||
public final static int SOURCE_TYPE_SWITCH = 1024 * 3;
|
||||
public final static int TRANSFORM_LINEAR = 0;
|
||||
public final static int TRANSFORM_ABSOLUTE = 2;
|
||||
public static final int SOURCE_NONE = 0;
|
||||
public static final int SOURCE_NOTE_ON_VELOCITY = 2;
|
||||
public static final int SOURCE_NOTE_ON_KEYNUMBER = 3;
|
||||
public static final int SOURCE_POLY_PRESSURE = 10;
|
||||
public static final int SOURCE_CHANNEL_PRESSURE = 13;
|
||||
public static final int SOURCE_PITCH_WHEEL = 14;
|
||||
public static final int SOURCE_PITCH_SENSITIVITY = 16;
|
||||
public static final int SOURCE_MIDI_CONTROL = 128 * 1;
|
||||
public static final int SOURCE_DIRECTION_MIN_MAX = 256 * 0;
|
||||
public static final int SOURCE_DIRECTION_MAX_MIN = 256 * 1;
|
||||
public static final int SOURCE_POLARITY_UNIPOLAR = 512 * 0;
|
||||
public static final int SOURCE_POLARITY_BIPOLAR = 512 * 1;
|
||||
public static final int SOURCE_TYPE_LINEAR = 1024 * 0;
|
||||
public static final int SOURCE_TYPE_CONCAVE = 1024 * 1;
|
||||
public static final int SOURCE_TYPE_CONVEX = 1024 * 2;
|
||||
public static final int SOURCE_TYPE_SWITCH = 1024 * 3;
|
||||
public static final int TRANSFORM_LINEAR = 0;
|
||||
public static final int TRANSFORM_ABSOLUTE = 2;
|
||||
int sourceOperator;
|
||||
int destinationOperator;
|
||||
short amount;
|
||||
|
|
|
@ -36,67 +36,67 @@ import java.util.Map;
|
|||
*/
|
||||
public class SF2Region {
|
||||
|
||||
public final static int GENERATOR_STARTADDRSOFFSET = 0;
|
||||
public final static int GENERATOR_ENDADDRSOFFSET = 1;
|
||||
public final static int GENERATOR_STARTLOOPADDRSOFFSET = 2;
|
||||
public final static int GENERATOR_ENDLOOPADDRSOFFSET = 3;
|
||||
public final static int GENERATOR_STARTADDRSCOARSEOFFSET = 4;
|
||||
public final static int GENERATOR_MODLFOTOPITCH = 5;
|
||||
public final static int GENERATOR_VIBLFOTOPITCH = 6;
|
||||
public final static int GENERATOR_MODENVTOPITCH = 7;
|
||||
public final static int GENERATOR_INITIALFILTERFC = 8;
|
||||
public final static int GENERATOR_INITIALFILTERQ = 9;
|
||||
public final static int GENERATOR_MODLFOTOFILTERFC = 10;
|
||||
public final static int GENERATOR_MODENVTOFILTERFC = 11;
|
||||
public final static int GENERATOR_ENDADDRSCOARSEOFFSET = 12;
|
||||
public final static int GENERATOR_MODLFOTOVOLUME = 13;
|
||||
public final static int GENERATOR_UNUSED1 = 14;
|
||||
public final static int GENERATOR_CHORUSEFFECTSSEND = 15;
|
||||
public final static int GENERATOR_REVERBEFFECTSSEND = 16;
|
||||
public final static int GENERATOR_PAN = 17;
|
||||
public final static int GENERATOR_UNUSED2 = 18;
|
||||
public final static int GENERATOR_UNUSED3 = 19;
|
||||
public final static int GENERATOR_UNUSED4 = 20;
|
||||
public final static int GENERATOR_DELAYMODLFO = 21;
|
||||
public final static int GENERATOR_FREQMODLFO = 22;
|
||||
public final static int GENERATOR_DELAYVIBLFO = 23;
|
||||
public final static int GENERATOR_FREQVIBLFO = 24;
|
||||
public final static int GENERATOR_DELAYMODENV = 25;
|
||||
public final static int GENERATOR_ATTACKMODENV = 26;
|
||||
public final static int GENERATOR_HOLDMODENV = 27;
|
||||
public final static int GENERATOR_DECAYMODENV = 28;
|
||||
public final static int GENERATOR_SUSTAINMODENV = 29;
|
||||
public final static int GENERATOR_RELEASEMODENV = 30;
|
||||
public final static int GENERATOR_KEYNUMTOMODENVHOLD = 31;
|
||||
public final static int GENERATOR_KEYNUMTOMODENVDECAY = 32;
|
||||
public final static int GENERATOR_DELAYVOLENV = 33;
|
||||
public final static int GENERATOR_ATTACKVOLENV = 34;
|
||||
public final static int GENERATOR_HOLDVOLENV = 35;
|
||||
public final static int GENERATOR_DECAYVOLENV = 36;
|
||||
public final static int GENERATOR_SUSTAINVOLENV = 37;
|
||||
public final static int GENERATOR_RELEASEVOLENV = 38;
|
||||
public final static int GENERATOR_KEYNUMTOVOLENVHOLD = 39;
|
||||
public final static int GENERATOR_KEYNUMTOVOLENVDECAY = 40;
|
||||
public final static int GENERATOR_INSTRUMENT = 41;
|
||||
public final static int GENERATOR_RESERVED1 = 42;
|
||||
public final static int GENERATOR_KEYRANGE = 43;
|
||||
public final static int GENERATOR_VELRANGE = 44;
|
||||
public final static int GENERATOR_STARTLOOPADDRSCOARSEOFFSET = 45;
|
||||
public final static int GENERATOR_KEYNUM = 46;
|
||||
public final static int GENERATOR_VELOCITY = 47;
|
||||
public final static int GENERATOR_INITIALATTENUATION = 48;
|
||||
public final static int GENERATOR_RESERVED2 = 49;
|
||||
public final static int GENERATOR_ENDLOOPADDRSCOARSEOFFSET = 50;
|
||||
public final static int GENERATOR_COARSETUNE = 51;
|
||||
public final static int GENERATOR_FINETUNE = 52;
|
||||
public final static int GENERATOR_SAMPLEID = 53;
|
||||
public final static int GENERATOR_SAMPLEMODES = 54;
|
||||
public final static int GENERATOR_RESERVED3 = 55;
|
||||
public final static int GENERATOR_SCALETUNING = 56;
|
||||
public final static int GENERATOR_EXCLUSIVECLASS = 57;
|
||||
public final static int GENERATOR_OVERRIDINGROOTKEY = 58;
|
||||
public final static int GENERATOR_UNUSED5 = 59;
|
||||
public final static int GENERATOR_ENDOPR = 60;
|
||||
public static final int GENERATOR_STARTADDRSOFFSET = 0;
|
||||
public static final int GENERATOR_ENDADDRSOFFSET = 1;
|
||||
public static final int GENERATOR_STARTLOOPADDRSOFFSET = 2;
|
||||
public static final int GENERATOR_ENDLOOPADDRSOFFSET = 3;
|
||||
public static final int GENERATOR_STARTADDRSCOARSEOFFSET = 4;
|
||||
public static final int GENERATOR_MODLFOTOPITCH = 5;
|
||||
public static final int GENERATOR_VIBLFOTOPITCH = 6;
|
||||
public static final int GENERATOR_MODENVTOPITCH = 7;
|
||||
public static final int GENERATOR_INITIALFILTERFC = 8;
|
||||
public static final int GENERATOR_INITIALFILTERQ = 9;
|
||||
public static final int GENERATOR_MODLFOTOFILTERFC = 10;
|
||||
public static final int GENERATOR_MODENVTOFILTERFC = 11;
|
||||
public static final int GENERATOR_ENDADDRSCOARSEOFFSET = 12;
|
||||
public static final int GENERATOR_MODLFOTOVOLUME = 13;
|
||||
public static final int GENERATOR_UNUSED1 = 14;
|
||||
public static final int GENERATOR_CHORUSEFFECTSSEND = 15;
|
||||
public static final int GENERATOR_REVERBEFFECTSSEND = 16;
|
||||
public static final int GENERATOR_PAN = 17;
|
||||
public static final int GENERATOR_UNUSED2 = 18;
|
||||
public static final int GENERATOR_UNUSED3 = 19;
|
||||
public static final int GENERATOR_UNUSED4 = 20;
|
||||
public static final int GENERATOR_DELAYMODLFO = 21;
|
||||
public static final int GENERATOR_FREQMODLFO = 22;
|
||||
public static final int GENERATOR_DELAYVIBLFO = 23;
|
||||
public static final int GENERATOR_FREQVIBLFO = 24;
|
||||
public static final int GENERATOR_DELAYMODENV = 25;
|
||||
public static final int GENERATOR_ATTACKMODENV = 26;
|
||||
public static final int GENERATOR_HOLDMODENV = 27;
|
||||
public static final int GENERATOR_DECAYMODENV = 28;
|
||||
public static final int GENERATOR_SUSTAINMODENV = 29;
|
||||
public static final int GENERATOR_RELEASEMODENV = 30;
|
||||
public static final int GENERATOR_KEYNUMTOMODENVHOLD = 31;
|
||||
public static final int GENERATOR_KEYNUMTOMODENVDECAY = 32;
|
||||
public static final int GENERATOR_DELAYVOLENV = 33;
|
||||
public static final int GENERATOR_ATTACKVOLENV = 34;
|
||||
public static final int GENERATOR_HOLDVOLENV = 35;
|
||||
public static final int GENERATOR_DECAYVOLENV = 36;
|
||||
public static final int GENERATOR_SUSTAINVOLENV = 37;
|
||||
public static final int GENERATOR_RELEASEVOLENV = 38;
|
||||
public static final int GENERATOR_KEYNUMTOVOLENVHOLD = 39;
|
||||
public static final int GENERATOR_KEYNUMTOVOLENVDECAY = 40;
|
||||
public static final int GENERATOR_INSTRUMENT = 41;
|
||||
public static final int GENERATOR_RESERVED1 = 42;
|
||||
public static final int GENERATOR_KEYRANGE = 43;
|
||||
public static final int GENERATOR_VELRANGE = 44;
|
||||
public static final int GENERATOR_STARTLOOPADDRSCOARSEOFFSET = 45;
|
||||
public static final int GENERATOR_KEYNUM = 46;
|
||||
public static final int GENERATOR_VELOCITY = 47;
|
||||
public static final int GENERATOR_INITIALATTENUATION = 48;
|
||||
public static final int GENERATOR_RESERVED2 = 49;
|
||||
public static final int GENERATOR_ENDLOOPADDRSCOARSEOFFSET = 50;
|
||||
public static final int GENERATOR_COARSETUNE = 51;
|
||||
public static final int GENERATOR_FINETUNE = 52;
|
||||
public static final int GENERATOR_SAMPLEID = 53;
|
||||
public static final int GENERATOR_SAMPLEMODES = 54;
|
||||
public static final int GENERATOR_RESERVED3 = 55;
|
||||
public static final int GENERATOR_SCALETUNING = 56;
|
||||
public static final int GENERATOR_EXCLUSIVECLASS = 57;
|
||||
public static final int GENERATOR_OVERRIDINGROOTKEY = 58;
|
||||
public static final int GENERATOR_UNUSED5 = 59;
|
||||
public static final int GENERATOR_ENDOPR = 60;
|
||||
protected Map<Integer, Short> generators = new HashMap<Integer, Short>();
|
||||
protected List<SF2Modulator> modulators = new ArrayList<SF2Modulator>();
|
||||
|
||||
|
@ -108,7 +108,7 @@ public class SF2Region {
|
|||
return generators.containsKey(generator);
|
||||
}
|
||||
|
||||
static public short getDefaultValue(int generator) {
|
||||
public static short getDefaultValue(int generator) {
|
||||
if (generator == 8) return (short)13500;
|
||||
if (generator == 21) return (short)-12000;
|
||||
if (generator == 23) return (short)-12000;
|
||||
|
|
|
@ -31,15 +31,15 @@ package com.sun.media.sound;
|
|||
*/
|
||||
public final class SoftEnvelopeGenerator implements SoftProcess {
|
||||
|
||||
public final static int EG_OFF = 0;
|
||||
public final static int EG_DELAY = 1;
|
||||
public final static int EG_ATTACK = 2;
|
||||
public final static int EG_HOLD = 3;
|
||||
public final static int EG_DECAY = 4;
|
||||
public final static int EG_SUSTAIN = 5;
|
||||
public final static int EG_RELEASE = 6;
|
||||
public final static int EG_SHUTDOWN = 7;
|
||||
public final static int EG_END = 8;
|
||||
public static final int EG_OFF = 0;
|
||||
public static final int EG_DELAY = 1;
|
||||
public static final int EG_ATTACK = 2;
|
||||
public static final int EG_HOLD = 3;
|
||||
public static final int EG_DECAY = 4;
|
||||
public static final int EG_SUSTAIN = 5;
|
||||
public static final int EG_RELEASE = 6;
|
||||
public static final int EG_SHUTDOWN = 7;
|
||||
public static final int EG_END = 8;
|
||||
int max_count = 10;
|
||||
int used_count = 0;
|
||||
private final int[] stage = new int[max_count];
|
||||
|
|
|
@ -35,13 +35,13 @@ package com.sun.media.sound;
|
|||
*/
|
||||
public final class SoftFilter {
|
||||
|
||||
public final static int FILTERTYPE_LP6 = 0x00;
|
||||
public final static int FILTERTYPE_LP12 = 0x01;
|
||||
public final static int FILTERTYPE_HP12 = 0x11;
|
||||
public final static int FILTERTYPE_BP12 = 0x21;
|
||||
public final static int FILTERTYPE_NP12 = 0x31;
|
||||
public final static int FILTERTYPE_LP24 = 0x03;
|
||||
public final static int FILTERTYPE_HP24 = 0x13;
|
||||
public static final int FILTERTYPE_LP6 = 0x00;
|
||||
public static final int FILTERTYPE_LP12 = 0x01;
|
||||
public static final int FILTERTYPE_HP12 = 0x11;
|
||||
public static final int FILTERTYPE_BP12 = 0x21;
|
||||
public static final int FILTERTYPE_NP12 = 0x31;
|
||||
public static final int FILTERTYPE_LP24 = 0x03;
|
||||
public static final int FILTERTYPE_HP24 = 0x13;
|
||||
|
||||
//
|
||||
// 0x0 = 1st-order, 6 dB/oct
|
||||
|
|
|
@ -53,20 +53,20 @@ public final class SoftMainMixer {
|
|||
SoftAudioBuffer[] buffers;
|
||||
}
|
||||
|
||||
public final static int CHANNEL_LEFT = 0;
|
||||
public final static int CHANNEL_RIGHT = 1;
|
||||
public final static int CHANNEL_MONO = 2;
|
||||
public final static int CHANNEL_DELAY_LEFT = 3;
|
||||
public final static int CHANNEL_DELAY_RIGHT = 4;
|
||||
public final static int CHANNEL_DELAY_MONO = 5;
|
||||
public final static int CHANNEL_EFFECT1 = 6;
|
||||
public final static int CHANNEL_EFFECT2 = 7;
|
||||
public final static int CHANNEL_DELAY_EFFECT1 = 8;
|
||||
public final static int CHANNEL_DELAY_EFFECT2 = 9;
|
||||
public final static int CHANNEL_LEFT_DRY = 10;
|
||||
public final static int CHANNEL_RIGHT_DRY = 11;
|
||||
public final static int CHANNEL_SCRATCH1 = 12;
|
||||
public final static int CHANNEL_SCRATCH2 = 13;
|
||||
public static final int CHANNEL_LEFT = 0;
|
||||
public static final int CHANNEL_RIGHT = 1;
|
||||
public static final int CHANNEL_MONO = 2;
|
||||
public static final int CHANNEL_DELAY_LEFT = 3;
|
||||
public static final int CHANNEL_DELAY_RIGHT = 4;
|
||||
public static final int CHANNEL_DELAY_MONO = 5;
|
||||
public static final int CHANNEL_EFFECT1 = 6;
|
||||
public static final int CHANNEL_EFFECT2 = 7;
|
||||
public static final int CHANNEL_DELAY_EFFECT1 = 8;
|
||||
public static final int CHANNEL_DELAY_EFFECT2 = 9;
|
||||
public static final int CHANNEL_LEFT_DRY = 10;
|
||||
public static final int CHANNEL_RIGHT_DRY = 11;
|
||||
public static final int CHANNEL_SCRATCH1 = 12;
|
||||
public static final int CHANNEL_SCRATCH2 = 13;
|
||||
boolean active_sensing_on = false;
|
||||
private long msec_last_activity = -1;
|
||||
private boolean pusher_silent = false;
|
||||
|
|
|
@ -39,29 +39,29 @@ import javax.sound.sampled.AudioSystem;
|
|||
*/
|
||||
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;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
public final class SoftReverb implements SoftAudioProcessor {
|
||||
|
||||
private final static class Delay {
|
||||
private static final class Delay {
|
||||
|
||||
private float[] delaybuffer;
|
||||
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 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 int delaybuffersize;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue