projects
/
anneal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
checkpoint
[anneal.git]
/
src
/
edu
/
berkeley
/
qfat
/
InteractiveMeshViewer.java
diff --git
a/src/edu/berkeley/qfat/InteractiveMeshViewer.java
b/src/edu/berkeley/qfat/InteractiveMeshViewer.java
index
ed23803
..
e024d04
100644
(file)
--- a/
src/edu/berkeley/qfat/InteractiveMeshViewer.java
+++ b/
src/edu/berkeley/qfat/InteractiveMeshViewer.java
@@
-11,27
+11,36
@@
import java.util.*;
import edu.berkeley.qfat.geom.*;
import edu.berkeley.qfat.geom.Point;
import edu.berkeley.qfat.geom.*;
import edu.berkeley.qfat.geom.Point;
-public class InteractiveMeshViewer extends MeshViewer {
+public class InteractiveMeshViewer extends JPanel {
public Mesh tile;
public Mesh goal;
public Mesh tile;
public Mesh goal;
+
+ private MeshViewer mv;
+
public InteractiveMeshViewer(JFrame f) {
public InteractiveMeshViewer(JFrame f) {
- super(f);
+ mv = new MeshViewer();
+ setLayout(new BorderLayout());
+ this.add(mv, BorderLayout.CENTER);
setTile(new Mesh(false));
setGoal(new Mesh(false));
}
setTile(new Mesh(false));
setGoal(new Mesh(false));
}
+ public void repaint() {
+ if (mv != null) mv.repaint();
+ }
+
public void setTile(Mesh tile) {
public void setTile(Mesh tile) {
- removeMesh(this.tile);
+ mv.removeMesh(this.tile);
this.tile = tile;
this.tile = tile;
- addMesh(this.tile);
+ mv.addMesh(this.tile);
}
public void setGoal(Mesh goal) {
}
public void setGoal(Mesh goal) {
- removeMesh(this.goal);
+ mv.removeMesh(this.goal);
this.goal = goal;
goal.option_selectable = false;
goal.option_wireframe = true;
this.goal = goal;
goal.option_selectable = false;
goal.option_wireframe = true;
- addMesh(this.goal);
+ mv.addMesh(this.goal);
}
public synchronized void dump() {
}
public synchronized void dump() {
@@
-75,7
+84,7
@@
public class InteractiveMeshViewer extends MeshViewer {
public int vertss;
public void keyPressed(KeyEvent e) {
public int vertss;
public void keyPressed(KeyEvent e) {
- super.keyPressed(e);
+ //super.keyPressed(e);
switch(e.getKeyCode()) {
case KeyEvent.VK_SPACE: breaks++; force = true; break;
case KeyEvent.VK_UP: temp = temp * 2; break;
switch(e.getKeyCode()) {
case KeyEvent.VK_SPACE: breaks++; force = true; break;
case KeyEvent.VK_UP: temp = temp * 2; break;