[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view ViewToolbarFactory.java, 1.6, 1.7 Vie
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2007-11-18 21:30:14
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16012/src/net/sourceforge/bprocessor/gl/view Modified Files: ViewToolbarFactory.java View.java Log Message: Renamed GLView to Editor Index: ViewToolbarFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/ViewToolbarFactory.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ViewToolbarFactory.java 18 Nov 2007 20:32:47 -0000 1.6 --- ViewToolbarFactory.java 18 Nov 2007 21:30:16 -0000 1.7 *************** *** 17,22 **** import javax.swing.JToggleButton; - import org.apache.log4j.Logger; - import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gui.Toolbar; --- 17,20 ---- *************** *** 26,42 **** */ public class ViewToolbarFactory { - /** The logger */ - private static Logger log = Logger.getLogger(ViewToolbarFactory.class); - /** * Registers the buttons in the toolbar ! * @param glv the GLView object the buttons should have effect on */ ! public void registerToolbar(Editor glv) { Toolbar tb = Toolbar.getInstance(); tb.addSeparator(5); ButtonGroup bg = new ButtonGroup(); ! JToggleButton but = tb.registerAction(new ViewLighting(glv)); bg.add(but); but.setToolTipText("Shading"); --- 24,37 ---- */ public class ViewToolbarFactory { /** * Registers the buttons in the toolbar ! * @param editor the GLView object the buttons should have effect on */ ! public void registerToolbar(Editor editor) { Toolbar tb = Toolbar.getInstance(); tb.addSeparator(5); ButtonGroup bg = new ButtonGroup(); ! JToggleButton but = tb.registerAction(new ViewLighting(editor)); bg.add(but); but.setToolTipText("Shading"); *************** *** 44,53 **** but.setSelected(true); ! but = tb.registerAction(new ViewSolid(glv)); bg.add(but); but.setToolTipText("Solid"); but.setMnemonic(KeyEvent.VK_F7); ! but = tb.registerAction(new ViewWireframe(glv)); bg.add(but); but.setToolTipText("Wireframe"); --- 39,48 ---- but.setSelected(true); ! but = tb.registerAction(new ViewSolid(editor)); bg.add(but); but.setToolTipText("Solid"); but.setMnemonic(KeyEvent.VK_F7); ! but = tb.registerAction(new ViewWireframe(editor)); bg.add(but); but.setToolTipText("Wireframe"); *************** *** 56,70 **** tb.addSeparator(5); ! but = tb.registerAction(new ViewNoRaster(glv)); but.setSelected(true); but.setToolTipText("Shading no raster"); but.setMnemonic(KeyEvent.VK_F6); ! but = tb.registerAction(new ViewGrid(glv)); but.setToolTipText("Grid"); but.setSelected(true); ! but = tb.registerAction(new ViewEdges(glv)); but.setToolTipText("Edges"); but.setSelected(true); --- 51,65 ---- tb.addSeparator(5); ! but = tb.registerAction(new ViewNoRaster(editor)); but.setSelected(true); but.setToolTipText("Shading no raster"); but.setMnemonic(KeyEvent.VK_F6); ! but = tb.registerAction(new ViewGrid(editor)); but.setToolTipText("Grid"); but.setSelected(true); ! but = tb.registerAction(new ViewEdges(editor)); but.setToolTipText("Edges"); but.setSelected(true); *************** *** 73,80 **** class ViewEdges extends AbstractAction { ! private Editor glv; ! ViewEdges(Editor glv) { ! this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconedges.gif"); --- 68,75 ---- class ViewEdges extends AbstractAction { ! private Editor editor; ! ViewEdges(Editor editor) { ! this.editor = editor; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconedges.gif"); *************** *** 87,103 **** JToggleButton button = (JToggleButton) event.getSource(); if (button.isSelected()) { ! glv.getView().enableEdges(); } else { ! glv.getView().disableEdges(); } ! glv.repaint(); } } class ViewGrid extends AbstractAction { ! private Editor glv; ! ViewGrid(Editor glv) { ! this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Bgrid.gif"); --- 82,98 ---- JToggleButton button = (JToggleButton) event.getSource(); if (button.isSelected()) { ! editor.getView().enableEdges(); } else { ! editor.getView().disableEdges(); } ! editor.repaint(); } } class ViewGrid extends AbstractAction { ! private Editor editor; ! ViewGrid(Editor editor) { ! this.editor = editor; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Bgrid.gif"); *************** *** 110,118 **** JToggleButton button = (JToggleButton) event.getSource(); if (button.isSelected()) { ! glv.getView().enableGrid(); } else { ! glv.getView().disableGrid(); } ! glv.repaint(); } } --- 105,113 ---- JToggleButton button = (JToggleButton) event.getSource(); if (button.isSelected()) { ! editor.getView().enableGrid(); } else { ! editor.getView().disableGrid(); } ! editor.repaint(); } } *************** *** 122,137 **** */ class ViewWireframe extends AbstractAction { - /** */ - private static final long serialVersionUID = 1L; - /** The GLView */ ! private Editor glv = null; /** * Constructor ! * @param glv TheGLView */ ! ViewWireframe(Editor glv) { ! this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconwire.gif"); --- 117,129 ---- */ class ViewWireframe extends AbstractAction { /** The GLView */ ! private Editor editor = null; /** * Constructor ! * @param editor TheGLView */ ! ViewWireframe(Editor editor) { ! this.editor = editor; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconwire.gif"); *************** *** 145,150 **** */ public void actionPerformed(ActionEvent e) { ! glv.getView().changeDrawMode(View.WIREFRAME_MODE); ! glv.repaint(true); } } --- 137,142 ---- */ public void actionPerformed(ActionEvent e) { ! editor.getView().changeDrawMode(View.WIREFRAME_MODE); ! editor.repaint(true); } } *************** *** 158,169 **** /** The GLView */ ! private Editor glv = null; /** * Constructor ! * @param glv TheGLView */ ! ViewNoRaster(Editor glv) { ! this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconlight.gif"); --- 150,161 ---- /** The GLView */ ! private Editor editor = null; /** * Constructor ! * @param editor TheGLView */ ! ViewNoRaster(Editor editor) { ! this.editor = editor; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconlight.gif"); *************** *** 177,188 **** */ public void actionPerformed(ActionEvent event) { - //glv.getView().changeDrawMode(View.SPACE_ASSGN_MODE); JToggleButton button = (JToggleButton) event.getSource(); if (button.isSelected()) { ! glv.getView().showTransparent(); } else { ! glv.getView().hideTransparent(); } ! glv.repaint(true); } } --- 169,179 ---- */ public void actionPerformed(ActionEvent event) { JToggleButton button = (JToggleButton) event.getSource(); if (button.isSelected()) { ! editor.getView().showTransparent(); } else { ! editor.getView().hideTransparent(); } ! editor.repaint(true); } } *************** *** 196,207 **** /** The GLView */ ! private Editor glv = null; /** * Constructor ! * @param glv TheGLView */ ! ViewSolid(Editor glv) { ! this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconsolid.gif"); --- 187,198 ---- /** The GLView */ ! private Editor editor = null; /** * Constructor ! * @param editor TheGLView */ ! ViewSolid(Editor editor) { ! this.editor = editor; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconsolid.gif"); *************** *** 215,220 **** */ public void actionPerformed(ActionEvent e) { ! glv.getView().changeDrawMode(View.SOLID_MODE); ! glv.repaint(true); } } --- 206,211 ---- */ public void actionPerformed(ActionEvent e) { ! editor.getView().changeDrawMode(View.SOLID_MODE); ! editor.repaint(true); } } *************** *** 228,239 **** /** The GLView */ ! private Editor glv = null; /** * Constructor ! * @param glv TheGLView */ ! ViewLighting(Editor glv) { ! this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconlight.gif"); --- 219,230 ---- /** The GLView */ ! private Editor editor = null; /** * Constructor ! * @param editor TheGLView */ ! ViewLighting(Editor editor) { ! this.editor = editor; ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Biconlight.gif"); *************** *** 247,252 **** */ public void actionPerformed(ActionEvent e) { ! glv.getView().changeDrawMode(View.LIGHTING_MODE); ! glv.repaint(true); } } --- 238,243 ---- */ public void actionPerformed(ActionEvent e) { ! editor.getView().changeDrawMode(View.LIGHTING_MODE); ! editor.repaint(true); } } Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.261 retrieving revision 1.262 diff -C2 -d -r1.261 -r1.262 *** View.java 18 Nov 2007 20:32:47 -0000 1.261 --- View.java 18 Nov 2007 21:30:17 -0000 1.262 *************** *** 220,224 **** /** The GLView */ ! protected Editor glv = null; /** Flag for when to use SELECT render mode */ --- 220,224 ---- /** The GLView */ ! protected Editor editor = null; /** Flag for when to use SELECT render mode */ *************** *** 394,398 **** byte b3 = (byte) 0x00; for (int i = 0; i < highlight.length; i++) { ! int d = ((int)(i / 4)) % 4; if (d == 0) { --- 394,398 ---- byte b3 = (byte) 0x00; for (int i = 0; i < highlight.length; i++) { ! int d = ((i / 4)) % 4; if (d == 0) { *************** *** 432,439 **** /** * The constructor ! * @param glv The glview */ ! public View(Editor glv) { ! this.glv = glv; bgColor = BACKGROUND_COLOR; lineColor = STD_LINE_COLOR; --- 432,439 ---- /** * The constructor ! * @param editor The glview */ ! public View(Editor editor) { ! this.editor = editor; bgColor = BACKGROUND_COLOR; lineColor = STD_LINE_COLOR; *************** *** 453,457 **** tickler = new Timer(300, new ActionListener() { public void actionPerformed(ActionEvent e) { ! View.this.glv.repaint(); } }); --- 453,457 ---- tickler = new Timer(300, new ActionListener() { public void actionPerformed(ActionEvent e) { ! View.this.editor.repaint(); } }); *************** *** 703,707 **** gl.glLoadIdentity(); ! if (glv.getTool() instanceof SpaceTool) { labelSelection(hitdetection); } --- 703,707 ---- gl.glLoadIdentity(); ! if (editor.getTool() instanceof SpaceTool) { labelSelection(hitdetection); } *************** *** 1561,1565 **** excluded = unWantedEntities; ! glv.repaint(true); Object object = processSelect(unWantedEntities, mode == INTERSECTIONS, xy); --- 1561,1565 ---- excluded = unWantedEntities; ! editor.repaint(true); Object object = processSelect(unWantedEntities, mode == INTERSECTIONS, xy); *************** *** 1637,1641 **** int lengthTemp = selectionLength; selectionLength = 2056; ! glv.repaint(true); List selection = getAllGeometryInSelection(); selectionLength = lengthTemp; --- 1637,1641 ---- int lengthTemp = selectionLength; selectionLength = 2056; ! editor.repaint(true); List selection = getAllGeometryInSelection(); selectionLength = lengthTemp; |