1. /*
  2. * @(#)ComponentPeer.java 1.41 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.awt.peer;
  8. import java.awt.*;
  9. import java.awt.event.PaintEvent;
  10. import java.awt.image.ImageProducer;
  11. import java.awt.image.ImageObserver;
  12. import java.awt.image.ColorModel;
  13. import java.awt.image.VolatileImage;
  14. import java.awt.GraphicsConfiguration;
  15. import java.awt.dnd.peer.DropTargetPeer;
  16. /**
  17. * The peer interfaces are intended only for use in porting
  18. * the AWT. They are not intended for use by application
  19. * developers, and developers should not implement peers
  20. * nor invoke any of the peer methods directly on the peer
  21. * instances.
  22. */
  23. public interface ComponentPeer {
  24. boolean isObscured();
  25. boolean canDetermineObscurity();
  26. void setVisible(boolean b);
  27. void setEnabled(boolean b);
  28. void paint(Graphics g);
  29. void repaint(long tm, int x, int y, int width, int height);
  30. void print(Graphics g);
  31. void setBounds(int x, int y, int width, int height);
  32. void handleEvent(AWTEvent e);
  33. void coalescePaintEvent(PaintEvent e);
  34. Point getLocationOnScreen();
  35. Dimension getPreferredSize();
  36. Dimension getMinimumSize();
  37. ColorModel getColorModel();
  38. Toolkit getToolkit();
  39. Graphics getGraphics();
  40. FontMetrics getFontMetrics(Font font);
  41. void dispose();
  42. void setForeground(Color c);
  43. void setBackground(Color c);
  44. void setFont(Font f);
  45. void updateCursorImmediately();
  46. boolean requestFocus(Component lightweightChild,
  47. boolean temporary,
  48. boolean focusedWindowChangeAllowed,
  49. long time);
  50. boolean isFocusable();
  51. Image createImage(ImageProducer producer);
  52. Image createImage(int width, int height);
  53. VolatileImage createVolatileImage(int width, int height);
  54. boolean prepareImage(Image img, int w, int h, ImageObserver o);
  55. int checkImage(Image img, int w, int h, ImageObserver o);
  56. GraphicsConfiguration getGraphicsConfiguration();
  57. boolean handlesWheelScrolling();
  58. void createBuffers(int numBuffers, BufferCapabilities caps)
  59. throws AWTException;
  60. Image getBackBuffer();
  61. void flip(BufferCapabilities.FlipContents flipAction);
  62. void destroyBuffers();
  63. /**
  64. * DEPRECATED: Replaced by getPreferredSize().
  65. */
  66. Dimension preferredSize();
  67. /**
  68. * DEPRECATED: Replaced by getMinimumSize().
  69. */
  70. Dimension minimumSize();
  71. /**
  72. * DEPRECATED: Replaced by setVisible(boolean).
  73. */
  74. void show();
  75. /**
  76. * DEPRECATED: Replaced by setVisible(boolean).
  77. */
  78. void hide();
  79. /**
  80. * DEPRECATED: Replaced by setEnabled(boolean).
  81. */
  82. void enable();
  83. /**
  84. * DEPRECATED: Replaced by setEnabled(boolean).
  85. */
  86. void disable();
  87. /**
  88. * DEPRECATED: Replaced by setBounds(int, int, int, int).
  89. */
  90. void reshape(int x, int y, int width, int height);
  91. }