src/macosx/classes/sun/lwawt/LWCanvasPeer.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 24,53 **** */ package sun.lwawt; import java.awt.BufferCapabilities; - import java.awt.Canvas; import java.awt.Component; import java.awt.GraphicsConfiguration; import java.awt.Image; import java.awt.peer.CanvasPeer; import javax.swing.JComponent; ! final class LWCanvasPeer extends LWComponentPeer<Component, JComponent> ! implements CanvasPeer { ! LWCanvasPeer(final Canvas target, PlatformComponent platformComponent) { super(target, platformComponent); } - // ---- PEER METHODS ---- // @Override ! public void createBuffers(int numBuffers, BufferCapabilities caps) { // TODO } @Override public Image getBackBuffer() { --- 24,54 ---- */ package sun.lwawt; + import java.awt.AWTException; import java.awt.BufferCapabilities; import java.awt.Component; + import java.awt.Dimension; import java.awt.GraphicsConfiguration; import java.awt.Image; import java.awt.peer.CanvasPeer; import javax.swing.JComponent; ! class LWCanvasPeer<T extends Component, D extends JComponent> ! extends LWComponentPeer<T, D> implements CanvasPeer { ! LWCanvasPeer(final T target, final PlatformComponent platformComponent) { super(target, platformComponent); } // ---- PEER METHODS ---- // @Override ! public void createBuffers(int numBuffers, BufferCapabilities caps) ! throws AWTException { // TODO } @Override public Image getBackBuffer() {
*** 65,76 **** public void destroyBuffers() { // TODO } @Override ! public GraphicsConfiguration getAppropriateGraphicsConfiguration( GraphicsConfiguration gc) { // TODO return gc; } } --- 66,87 ---- public void destroyBuffers() { // TODO } @Override ! public final GraphicsConfiguration getAppropriateGraphicsConfiguration( GraphicsConfiguration gc) { // TODO return gc; } + + @Override + public final Dimension getPreferredSize() { + return getMinimumSize(); + } + + @Override + public final Dimension getMinimumSize() { + return getBounds().getSize(); + } }