Back to index

moin  1.9.0~rc2
Public Member Functions | Private Attributes | Static Private Attributes
CH.ifa.draw.standard.BufferedUpdateStrategy Class Reference

The BufferedUpdateStrategy implements an update strategy that first draws a view into a buffer followed by copying the buffer to the DrawingView. More...

Collaboration diagram for CH.ifa.draw.standard.BufferedUpdateStrategy:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void draw (Graphics g, DrawingView view)
 Draws the view contents.

Private Attributes

transient Image fOffscreen
 The offscreen image.
int fImagewidth = -1
int fImageheight = -1
int bufferedUpdateSerializedDataVersion = 1

Static Private Attributes

static final long serialVersionUID = 6489532222954612824L

Detailed Description

The BufferedUpdateStrategy implements an update strategy that first draws a view into a buffer followed by copying the buffer to the DrawingView.

See also:
DrawingView

Definition at line 19 of file BufferedUpdateStrategy.java.


Member Function Documentation

void CH.ifa.draw.standard.BufferedUpdateStrategy.draw ( Graphics  g,
DrawingView  view 
) [inline]

Draws the view contents.

Definition at line 38 of file BufferedUpdateStrategy.java.

                                                   {
        // create the buffer if necessary
        Dimension d = view.getSize();
        if ((fOffscreen == null) || (d.width != fImagewidth)
            || (d.height != fImageheight)) {
            fOffscreen = view.createImage(d.width, d.height);
            fImagewidth = d.width;
            fImageheight = d.height;
        }

        // let the view draw on offscreen buffer
        Graphics g2 = fOffscreen.getGraphics();
        view.drawAll(g2);

        g.drawImage(fOffscreen, 0, 0, view);
    }

Member Data Documentation

Definition at line 33 of file BufferedUpdateStrategy.java.

Definition at line 27 of file BufferedUpdateStrategy.java.

Definition at line 26 of file BufferedUpdateStrategy.java.

The offscreen image.

Definition at line 25 of file BufferedUpdateStrategy.java.

final long CH.ifa.draw.standard.BufferedUpdateStrategy.serialVersionUID = 6489532222954612824L [static, private]

Definition at line 32 of file BufferedUpdateStrategy.java.


The documentation for this class was generated from the following file: