I have seen the term several times, what does it mean?
A graphics context defines basic drawing attributes such as the colors to use when drawing, the clipping area, line width and style information, font information, compositing options, and several others.
A Graphics object encapsulates state information needed for the basic rendering operations that Java supports. This state information includes the following properties: The Component object on which to draw. A translation origin for rendering and clipping coordinates.
Because the Graphics class is an abstract base class, it cannot be instantiated directly. An instance is typically created by a component, and handed to the program as an argument to a component's update() and paint() methods. These two methods, along with the repaint() method, are discussed in the next section.
"Context" is a generic name that many java developers use for classes that carry state information. So are bound to see a lot of different class names containing context.
Graphic context in desktop Java usually means java.awt.Graphics or java.awt.Graphics2D classes. They carry information about drawing properties: colors, line properties, clipping regions, etc..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With