1. /*
  2. * @(#)ComponentPeer.java 1.31 00/02/02
  3. *
  4. * Copyright 1995-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.awt.peer;
  11. import java.awt.*;
  12. import java.awt.event.PaintEvent;
  13. import java.awt.image.ImageProducer;
  14. import java.awt.image.ImageObserver;
  15. import java.awt.image.ColorModel;
  16. import java.awt.GraphicsConfiguration;
  17. import java.awt.dnd.peer.DropTargetPeer;
  18. /**
  19. * The peer interfaces are intended only for use in porting
  20. * the AWT. They are not intended for use by application
  21. * developers, and developers should not implement peers
  22. * nor invoke any of the peer methods directly on the peer
  23. * instances.
  24. */
  25. public interface ComponentPeer {
  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. java.awt.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 setCursor(Cursor cursor);
  46. void requestFocus();
  47. boolean isFocusTraversable();
  48. Image createImage(ImageProducer producer);
  49. Image createImage(int width, int height);
  50. boolean prepareImage(Image img, int w, int h, ImageObserver o);
  51. int checkImage(Image img, int w, int h, ImageObserver o);
  52. GraphicsConfiguration getGraphicsConfiguration();
  53. /**
  54. * DEPRECATED: Replaced by getPreferredSize().
  55. */
  56. Dimension preferredSize();
  57. /**
  58. * DEPRECATED: Replaced by getMinimumSize().
  59. */
  60. Dimension minimumSize();
  61. /**
  62. * DEPRECATED: Replaced by setVisible(boolean).
  63. */
  64. void show();
  65. /**
  66. * DEPRECATED: Replaced by setVisible(boolean).
  67. */
  68. void hide();
  69. /**
  70. * DEPRECATED: Replaced by setEnabled(boolean).
  71. */
  72. void enable();
  73. /**
  74. * DEPRECATED: Replaced by setEnabled(boolean).
  75. */
  76. void disable();
  77. /**
  78. * DEPRECATED: Replaced by setBounds(int, int, int, int).
  79. */
  80. void reshape(int x, int y, int width, int height);
  81. }