-->
-->
Learning notes Java Graphic Design Volume I awt--3rd Chapter graphics
Before the monitor broke down, file://wrote preface: I think it is not to learn notes, like a tutorial. I wanted to get something, so I had a little detail.
Note 1: User interface artifacts (such as buttons, lists, menus, dialog boxes, and so on) provided in AWT do not contain similar purely object drawing objects (such as line or circle classes)
The original AWT does not allow pure drawing objects to be designed, so rectangle, polygon, and point do not have any ability to draw graphics. Other words
Rectangle, Polygon, and point do not have draw methods. What you can do is simply to set and get information about the geometric entities they represent.
To replace pure, graphically-drawn objects, AWT uses a simple-albeit inflexible and easily extensible-pattern:
Each AWT widget is entirely derived from its own JAVA.AWT.Graphics object, although some of its graphical operations can be implemented in the artifacts associated with it.
Graphics can also be drawn to a variety of output devices, such as external buffers and printers-see the 24th chapter, "Double Buffering Technology" and section 18.4, "print" related content.
Please look at both tables (ignoring the JAVA.AWT.peer method):
Table 3-1 The JDK method that passes a reference to graphics
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Package class method
────────── ───────────────────────
JAVA. AWT Canvas Paint (Graphics g)
Component paint (Graphics g)
Component Paintall (graphi CS g)
Component print (Graphics g)
Component printall (Graphics g)
Component Update (Graphics g)
Container paint (Graphics g)
Container paintcomponents (Graphics g)
Container print (Graphics g)
Container printcomponents (Graphics g)
ScrollPane p Rintcomponents (Graphics g)