RepaintArea is a geometric construct created for the
purpose of holding the geometry of several coalesced paint events.
This geometry is accessed synchronously, although it is written such
that painting may still be executed asynchronously.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int | MAX_BENEFIT_RATIO
Maximum ratio of bounding rectangle to benefit for which both the vertical and horizontal unions are repainted. |
| private Rectangle[] | |
| private static final int | |
| private static final int | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public | |
| private | RepaintArea(RepaintArea
the ra)RepaintArea from which to copy initial
values to a newly constructed RepaintAreaConstructs a new |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | |
| private synchronized RepaintArea | Returns: ra a newRepaintArea having the same geometry as
this RepaintArea.Creates a new |
| public synchronized void | constrain(int x, int y, int w, int h)
Constrains the size of the repaint area to the passed in bounds. |
| public boolean | |
| public void | |
| protected void | |
| public synchronized void | |
| pack-priv static boolean | |
| public String | |
| protected void |
| HORIZONTAL | back to summary |
|---|---|
| private static final int HORIZONTAL | |
| MAX_BENEFIT_RATIO | back to summary |
|---|---|
| private static final int MAX_BENEFIT_RATIO Maximum ratio of bounding rectangle to benefit for which both the vertical and horizontal unions are repainted. For smaller ratios the whole bounding rectangle is repainted.
| |
| paintRects | back to summary |
|---|---|
| private Rectangle[] paintRects | |
| RECT_COUNT | back to summary |
|---|---|
| private static final int RECT_COUNT | |
| UPDATE | back to summary |
|---|---|
| private static final int UPDATE | |
| VERTICAL | back to summary |
|---|---|
| private static final int VERTICAL | |
| RepaintArea | back to summary |
|---|---|
| public RepaintArea() Constructs a new
| |
| RepaintArea | back to summary |
|---|---|
| private RepaintArea(RepaintArea ra) Constructs a new
| |
| add | back to summary |
|---|---|
| public synchronized void add(Rectangle r, int id) Adds a
| |
| cloneAndReset | back to summary |
|---|---|
| private synchronized RepaintArea cloneAndReset() Creates a new
| |
| constrain | back to summary |
|---|---|
| public synchronized void constrain(int x, int y, int w, int h) Constrains the size of the repaint area to the passed in bounds. | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() | |
| paint | back to summary |
|---|---|
| public void paint(Object target, boolean shouldClearRectBeforePaint) Invokes paint and update on target Component with optimal rectangular clip region. If PAINT bounding rectangle is less than MAX_BENEFIT_RATIO times the benefit, then the vertical and horizontal unions are painted separately. Otherwise the entire bounding rectangle is painted.
| |
| paintComponent | back to summary |
|---|---|
| protected void paintComponent(Component comp, Graphics g) Calls | |
| subtract | back to summary |
|---|---|
| public synchronized void subtract(int x, int y, int w, int h) Marks the passed in region as not needing to be painted. It's possible this will do nothing. | |
| subtract | back to summary |
|---|---|
| pack-priv static boolean subtract(Rectangle rect, Rectangle subtr) Subtracts subtr from rect. If the result is rectangle changes rect and returns true. Otherwise false. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| updateComponent | back to summary |
|---|---|
| protected void updateComponent(Component comp, Graphics g) Calls | |