projects
/
sixth-3d.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refactoring.
[sixth-3d.git]
/
src
/
main
/
java
/
eu
/
svjatoslav
/
sixth
/
e3d
/
gui
/
View.java
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/gui/View.java
b/src/main/java/eu/svjatoslav/sixth/e3d/gui/View.java
index
ecd0e9d
..
6f1b474
100755
(executable)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/gui/View.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/gui/View.java
@@
-1,10
+1,10
@@
/*
/*
- * Sixth - System for data storage, computation, exploration and interaction.
- * Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
+ * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 3 of the GNU Lesser General Public License
* or later as published by the Free Software Foundation.
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 3 of the GNU Lesser General Public License
* or later as published by the Free Software Foundation.
+ *
*/
package eu.svjatoslav.sixth.e3d.gui;
*/
package eu.svjatoslav.sixth.e3d.gui;
@@
-31,7
+31,7
@@
public class View extends JPanel implements ComponentListener {
long lastUpdateMillis = 0;
private Timer canvasUpdateTimer;
private ViewUpdateTimerTask canvasUpdateTimerTask;
long lastUpdateMillis = 0;
private Timer canvasUpdateTimer;
private ViewUpdateTimerTask canvasUpdateTimerTask;
- private RenderingContext renderingContext = n
ew RenderingContext(1, 1, null)
;
+ private RenderingContext renderingContext = n
ull
;
private MouseInteractionController currentMouseOverComponent;
/**
* Currently target FPS for this view. It might change at runtime.
private MouseInteractionController currentMouseOverComponent;
/**
* Currently target FPS for this view. It might change at runtime.
@@
-153,8
+153,7
@@
public class View extends JPanel implements ComponentListener {
if ((renderingContext == null)
|| (renderingContext.width != getWidth())
|| (renderingContext.height != getHeight()))
if ((renderingContext == null)
|| (renderingContext.width != getWidth())
|| (renderingContext.height != getHeight()))
- renderingContext = new RenderingContext(getWidth(), getHeight(),
- renderingContext);
+ renderingContext = new RenderingContext(getWidth(), getHeight());
// clear drawing area
{
// clear drawing area
{
@@
-219,8
+218,10
@@
public class View extends JPanel implements ComponentListener {
* graphics is needed.
*/
public void updateView() {
* graphics is needed.
*/
public void updateView() {
- renderingContext.mouseClick = null;
- renderingContext.clickedItem = null;
+ if (renderingContext != null){
+ renderingContext.mouseClick = null;
+ renderingContext.clickedItem = null;
+ }
// compute time passed since last view update
final long currentTime = System.currentTimeMillis();
// compute time passed since last view update
final long currentTime = System.currentTimeMillis();
@@
-234,12
+235,12
@@
public class View extends JPanel implements ComponentListener {
lastUpdateMillis = currentTime;
// notify update listeners
lastUpdateMillis = currentTime;
// notify update listeners
- boolean re
renderView
= false;
+ boolean re
RenderFrame
= false;
for (final ViewUpdateListener listener : viewUpdateListeners)
if (listener.beforeViewUpdate(context,
millisecondsPassedSinceLastUpdate))
for (final ViewUpdateListener listener : viewUpdateListeners)
if (listener.beforeViewUpdate(context,
millisecondsPassedSinceLastUpdate))
- re
renderView
= true;
+ re
RenderFrame
= true;
// abort rendering if window size is invalid
if ((getWidth() <= 0) || (getHeight() <= 0))
// abort rendering if window size is invalid
if ((getWidth() <= 0) || (getHeight() <= 0))
@@
-247,10
+248,10
@@
public class View extends JPanel implements ComponentListener {
if (repaintDuringNextViewUpdate) {
repaintDuringNextViewUpdate = false;
if (repaintDuringNextViewUpdate) {
repaintDuringNextViewUpdate = false;
- re
renderView
= true;
+ re
RenderFrame
= true;
}
}
- if (re
renderView
) {
+ if (re
RenderFrame
) {
renderFrame();
handleDetectedComponentMouseEvents();
}
renderFrame();
handleDetectedComponentMouseEvents();
}