[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view View.java, 1.277, 1.278
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2008-07-21 15:54:39
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22056/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Clean up of code Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.277 retrieving revision 1.278 diff -C2 -d -r1.277 -r1.278 *** View.java 15 Jan 2008 15:43:36 -0000 1.277 --- View.java 21 Jul 2008 15:54:45 -0000 1.278 *************** *** 8,12 **** import net.sourceforge.bprocessor.gl.Editor; - import net.sourceforge.bprocessor.gl.tool.AbstractTool; import net.sourceforge.bprocessor.gl.tool.SpaceTool; import net.sourceforge.bprocessor.gl.model.EdgeAttributes; --- 8,11 ---- *************** *** 43,48 **** import java.awt.Toolkit; - import java.awt.event.ActionEvent; - import java.awt.event.ActionListener; import java.nio.IntBuffer; --- 42,45 ---- *************** *** 53,57 **** import javax.media.opengl.glu.GLU; import javax.media.opengl.glu.GLUquadric; - import javax.swing.Timer; import org.apache.log4j.Logger; --- 50,53 ---- *************** *** 94,101 **** public static final float[] BACKGROUND_COLOR = new float[] {1.0f, 1.0f, 1.0f, 0.0f}; ! /** the std line color*/ public static final float[] STD_LINE_COLOR = new float[] {0.1f, 0.1f, 0.1f}; ! /** the std line color*/ public static final float[] GREY_LINE_COLOR = new float[] {0.7f, 0.7f, 0.7f}; --- 90,97 ---- public static final float[] BACKGROUND_COLOR = new float[] {1.0f, 1.0f, 1.0f, 0.0f}; ! /** the standard line color*/ public static final float[] STD_LINE_COLOR = new float[] {0.1f, 0.1f, 0.1f}; ! /** the standard line color*/ public static final float[] GREY_LINE_COLOR = new float[] {0.7f, 0.7f, 0.7f}; *************** *** 178,184 **** /** Flag for the solid style of view (no lighting) */ public static final int SOLID_MODE = 1; ! /** Flag for the wireframe style of view */ public static final int WIREFRAME_MODE = 2; ! /** Flag for the "space assignmened only" style of view. * This style of view will only show those surfaces that * have some space assignment*/ --- 174,180 ---- /** Flag for the solid style of view (no lighting) */ public static final int SOLID_MODE = 1; ! /** Flag for the wire frame style of view */ public static final int WIREFRAME_MODE = 2; ! /** Flag for the "space assignment only" style of view. * This style of view will only show those surfaces that * have some space assignment*/ *************** *** 272,281 **** private EdgeAttributes currentEdgeAttributes; - - /** - * Currently labeled surface - */ - private Surface labelSurface; - /** * Keeps track of the current stippling --- 268,271 ---- *************** *** 353,359 **** private List<Integer> deletedLists = new LinkedList<Integer>(); - - private Timer tickler; - private static final boolean TICKLE = false; static { --- 343,346 ---- *************** *** 454,463 **** glObjects3D = new HashSet<GlObject>(); widgets = new LinkedList<Widget>(); - tickler = new Timer(300, new ActionListener() { - public void actionPerformed(ActionEvent e) { - View.this.editor.repaint(); - } - }); - tickler.setRepeats(false); enabled = true; } --- 441,444 ---- *************** *** 712,716 **** if (editor.getTool() instanceof SpaceTool) { ! labelSelection(hitdetection); } --- 693,697 ---- if (editor.getTool() instanceof SpaceTool) { ! drawAssignmentWidget(hitdetection); } *************** *** 973,977 **** * @param clickable if true clicking the labels brings up dialog. */ ! private void labelSurface(Surface surface, boolean clickable) { Transformation transformation = transformation(); Vertex from = surface.center(); --- 954,958 ---- * @param clickable if true clicking the labels brings up dialog. */ ! private void drawAssignmentWidget(Surface surface, boolean clickable) { Transformation transformation = transformation(); Vertex from = surface.center(); *************** *** 1102,1139 **** * @param clickable if true clicking the labels brings up dialog. */ ! private void labelSelection(boolean clickable) { Geometric candidate = null; Collection<Geometric> selection = Selection.primary(); ! if (selection.size() == 0) { ! if (target instanceof Geometric) { ! candidate = (Geometric) target; ! } ! } else { candidate = selection.iterator().next(); ! } ! if (candidate instanceof Surface) { ! if (TICKLE) { ! long time = System.currentTimeMillis(); ! long elapsed = time - AbstractTool.getPressedTime(); ! long delay = 0; ! if (labelSurface == null) { ! delay = 120; ! } ! if (elapsed >= delay) { ! labelSurface = (Surface) candidate; ! labelSurface(labelSurface, clickable); ! } else { ! int when = (int) (delay - elapsed); ! tickler.stop(); ! tickler.setDelay(when); ! tickler.start(); ! } ! } else { ! labelSurface = (Surface) candidate; ! labelSurface(labelSurface, clickable); } - } else { - labelSurface = null; } } --- 1083,1095 ---- * @param clickable if true clicking the labels brings up dialog. */ ! private void drawAssignmentWidget(boolean clickable) { Geometric candidate = null; Collection<Geometric> selection = Selection.primary(); ! if (!selection.isEmpty()) { candidate = selection.iterator().next(); ! if (candidate instanceof Surface) { ! drawAssignmentWidget((Surface) candidate, clickable); } } } |