/**
* Java Swing GUI panel that contains canvas for 3D rendering.
+ * Usually it is used as a part of {@link ViewFrame}.
*/
public class ViewPanel extends JPanel implements ComponentListener {
private static final long serialVersionUID = 1683277888885045387L;
* It tells view to update itself. View can decide if actual re-rendering of
* graphics is needed.
*/
- void updateView() {
+ void ensureThatViewIsUpToDate() {
maintainRenderingContext();
final int millisecondsPassedSinceLastUpdate = getMillisecondsPassedSinceLastUpdate();
return;
}
+ // create new rendering context if window size has changed
if ((renderingContext == null)
|| (renderingContext.width != panelWidth)
|| (renderingContext.height != panelHeight)) {