Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22581/src/net/sourceforge/bprocessor/gl/view
Modified Files:
View.java
Log Message:
changed drawing of space-path
Index: View.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v
retrieving revision 1.279
retrieving revision 1.280
diff -C2 -d -r1.279 -r1.280
*** View.java 22 Jul 2008 13:19:52 -0000 1.279
--- View.java 29 Aug 2008 09:42:19 -0000 1.280
***************
*** 709,713 ****
}
!
drawSpacePath(hitdetection);
--- 709,713 ----
}
! //drawObscureBox();
drawSpacePath(hitdetection);
***************
*** 843,846 ****
--- 843,891 ----
}
+ private void drawObscureBox(double x, double y,
+ double w, double h, float l, float alpha) {
+
+ gl.glColor4f(l, l, l, alpha);
+ gl.glPushMatrix();
+ gl.glTranslated(0, 0, 0.4);
+ gl.glBegin(GL.GL_POLYGON);
+ gl.glVertex3d(x, y, 0);
+ gl.glVertex3d(x + w, y, 0);
+ gl.glVertex3d(x + w, y + h, 0);
+ gl.glVertex3d(x, y + h, 0);
+ gl.glEnd();
+ gl.glPushMatrix();
+ gl.glColor3f(1, 1, 1);
+ gl.glRasterPos3d(x + w / 2 - 10, y + h / 2, 0);
+ glut.glutBitmapString(GLUT.BITMAP_HELVETICA_12, "ABC");
+ gl.glPopMatrix();
+ gl.glPopMatrix();
+ }
+
+ private void drawBox(double x, double y,
+ double w, double h) {
+ gl.glBegin(GL.GL_POLYGON);
+ gl.glVertex3d(x, y, 0);
+ gl.glVertex3d(x + w, y, 0);
+ gl.glVertex3d(x + w, y + h, 0);
+ gl.glVertex3d(x, y + h, 0);
+ gl.glEnd();
+ }
+
+
+ private void drawObscureBox() {
+ double w = width / 10;
+ double h = height / 10;
+ for (int i = 0; i < 10; i++) {
+ for (int j = 0; j < 10; j++) {
+ double x = i * w;
+ double y = j * h;
+ float alpha = (i + 1) / 10.0f;
+ float level = (j + 1) / 10.0f;
+ drawObscureBox(x, y, w, h, level, alpha);
+ }
+ }
+ }
+
private void drawPath(LinkedList<Container> path, boolean selection) {
LinkedList<Label> labels = new LinkedList<Label>();
***************
*** 855,858 ****
--- 900,916 ----
}
+
+ {
+ double w = 0;
+ for (Label label : labels) {
+ w += label.width() + 6;
+ }
+ double h = 17;
+ double x = 3;
+ double y = height - 20;
+ gl.glColor4f(0.4f, 0.4f, 0.4f, 0.7f);
+ drawBox(x, y, w, h);
+ }
+
int x = 5;
int y = (int) height - 15;
***************
*** 863,867 ****
}
! gl.glColor3f(1, 0, 0);
gl.glPushMatrix();
gl.glTranslated(0, 0, 0.5);
--- 921,925 ----
}
! gl.glColor3f(1, 1, 1);
gl.glPushMatrix();
gl.glTranslated(0, 0, 0.5);
***************
*** 880,884 ****
/**
* Draw the space path
! * @param selection wherther or not we are drawing for selection
*/
private void drawSpacePath(boolean selection) {
--- 938,942 ----
/**
* Draw the space path
! * @param selection true if drawing for hit-detection
*/
private void drawSpacePath(boolean selection) {
|