src/java.desktop/macosx/classes/sun/lwawt/LWCanvasPeer.java
author aghaisas
Mon, 10 Jun 2019 14:13:09 +0530
branchmetal-prototype-branch
changeset 57400 978ffc56771f
parent 47216 71c04702a3d5
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
     1
/*
20153
d5bf90bfcb6d 8005255: [macosx] Cleanup warnings in sun.lwawt
serb
parents: 14647
diff changeset
     2
 * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
     4
 *
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    10
 *
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    15
 * accompanied this code).
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    16
 *
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    20
 *
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    23
 * questions.
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    24
 */
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    25
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    26
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    27
package sun.lwawt;
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    28
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    29
import java.awt.Component;
13993
8b3fe3d8badb 7160627: [macosx] TextArea has wrong initial size
serb
parents: 12047
diff changeset
    30
import java.awt.Dimension;
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    31
import java.awt.GraphicsConfiguration;
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    32
import java.awt.peer.CanvasPeer;
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    33
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    34
import javax.swing.JComponent;
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    35
20153
d5bf90bfcb6d 8005255: [macosx] Cleanup warnings in sun.lwawt
serb
parents: 14647
diff changeset
    36
/**
d5bf90bfcb6d 8005255: [macosx] Cleanup warnings in sun.lwawt
serb
parents: 14647
diff changeset
    37
 * Lightweight implementation of {@link CanvasPeer}. This peer is empty, because
d5bf90bfcb6d 8005255: [macosx] Cleanup warnings in sun.lwawt
serb
parents: 14647
diff changeset
    38
 * all the components in lwawt use graphic object from the top level window.
d5bf90bfcb6d 8005255: [macosx] Cleanup warnings in sun.lwawt
serb
parents: 14647
diff changeset
    39
 */
13993
8b3fe3d8badb 7160627: [macosx] TextArea has wrong initial size
serb
parents: 12047
diff changeset
    40
class LWCanvasPeer<T extends Component, D extends JComponent>
8b3fe3d8badb 7160627: [macosx] TextArea has wrong initial size
serb
parents: 12047
diff changeset
    41
        extends LWComponentPeer<T, D> implements CanvasPeer {
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    42
13993
8b3fe3d8badb 7160627: [macosx] TextArea has wrong initial size
serb
parents: 12047
diff changeset
    43
    LWCanvasPeer(final T target, final PlatformComponent platformComponent) {
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    44
        super(target, platformComponent);
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    45
    }
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    46
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    47
    @Override
13993
8b3fe3d8badb 7160627: [macosx] TextArea has wrong initial size
serb
parents: 12047
diff changeset
    48
    public final GraphicsConfiguration getAppropriateGraphicsConfiguration(
14647
bacc2d4f4b27 7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents: 13993
diff changeset
    49
            final GraphicsConfiguration gc) {
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    50
        // TODO
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    51
        return gc;
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    52
    }
13993
8b3fe3d8badb 7160627: [macosx] TextArea has wrong initial size
serb
parents: 12047
diff changeset
    53
8b3fe3d8badb 7160627: [macosx] TextArea has wrong initial size
serb
parents: 12047
diff changeset
    54
    @Override
8b3fe3d8badb 7160627: [macosx] TextArea has wrong initial size
serb
parents: 12047
diff changeset
    55
    public final Dimension getPreferredSize() {
8b3fe3d8badb 7160627: [macosx] TextArea has wrong initial size
serb
parents: 12047
diff changeset
    56
        return getMinimumSize();
8b3fe3d8badb 7160627: [macosx] TextArea has wrong initial size
serb
parents: 12047
diff changeset
    57
    }
8b3fe3d8badb 7160627: [macosx] TextArea has wrong initial size
serb
parents: 12047
diff changeset
    58
8b3fe3d8badb 7160627: [macosx] TextArea has wrong initial size
serb
parents: 12047
diff changeset
    59
    @Override
8b3fe3d8badb 7160627: [macosx] TextArea has wrong initial size
serb
parents: 12047
diff changeset
    60
    public final Dimension getMinimumSize() {
8b3fe3d8badb 7160627: [macosx] TextArea has wrong initial size
serb
parents: 12047
diff changeset
    61
        return getBounds().getSize();
8b3fe3d8badb 7160627: [macosx] TextArea has wrong initial size
serb
parents: 12047
diff changeset
    62
    }
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    63
}