[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view ViewToolbarFactory.java, 1.3, 1.4 Vie
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2007-10-12 11:06:54
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13721/src/net/sourceforge/bprocessor/gl/view Modified Files: ViewToolbarFactory.java View.java Display.java Log Message: Toolbar reorganized Index: ViewToolbarFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/ViewToolbarFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ViewToolbarFactory.java 3 Sep 2007 11:22:32 -0000 1.3 --- ViewToolbarFactory.java 12 Oct 2007 11:06:52 -0000 1.4 *************** *** 35,39 **** public void registerToolbar(GLView glv) { Toolbar tb = Toolbar.getInstance(); ! tb.addSeparator(3); ButtonGroup bg = new ButtonGroup(); --- 35,39 ---- public void registerToolbar(GLView glv) { Toolbar tb = Toolbar.getInstance(); ! tb.addSeparator(5); ButtonGroup bg = new ButtonGroup(); *************** *** 44,52 **** but.setSelected(true); - but = tb.registerAction(new ViewNoRaster(glv)); - bg.add(but); - but.setToolTipText("Shading no raster"); - but.setMnemonic(KeyEvent.VK_F6); - but = tb.registerAction(new ViewSolid(glv)); bg.add(but); --- 44,47 ---- *************** *** 59,62 **** --- 54,64 ---- but.setMnemonic(KeyEvent.VK_F8); + 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"); *************** *** 79,83 **** public void actionPerformed(ActionEvent event) { JToggleButton button = (JToggleButton) event.getSource(); - glv.getView(); if (button.isSelected()) { glv.getView().enableGrid(); --- 81,84 ---- *************** *** 145,152 **** /** * Called when the button is pressed ! * @param e The ActionEvent */ ! public void actionPerformed(ActionEvent e) { ! glv.getView().changeDrawMode(View.SPACE_ASSGN_MODE); glv.repaint(true); } --- 146,159 ---- /** * Called when the button is pressed ! * @param event The ActionEvent */ ! 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); } Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Display.java 12 Oct 2007 07:57:53 -0000 1.30 --- Display.java 12 Oct 2007 11:06:53 -0000 1.31 *************** *** 59,62 **** --- 59,63 ---- private static boolean construction; private static int mode; + private static boolean transparency; private static Project project; *************** *** 241,244 **** --- 242,261 ---- /** + * + * @return show transparent surfaces + */ + public static boolean transparency() { + return transparency; + } + + /** + * + * @param value show transparent surfaces + */ + public static void transparency(boolean value) { + transparency = value; + } + + /** * Sets the objects table * @param value ArrayList *************** *** 736,744 **** if (inside) { if (mode != View.WIREFRAME_MODE) { ! if (mode == View.LIGHTING_MODE) { ! selectSurfaces(surfaces, true); ! } else { ! selectSurfaces(surfaces, false); ! } } } --- 753,757 ---- if (inside) { if (mode != View.WIREFRAME_MODE) { ! selectSurfaces(surfaces, transparency); } } *************** *** 754,760 **** paintSurfaces(surfaces, alice); } else if (mode == View.LIGHTING_MODE) { ! paintSurfaces(surfaces, true); ! } else if (mode == View.SPACE_ASSGN_MODE) { ! paintSurfaces(surfaces, false); } else if (mode == View.WIREFRAME_MODE) { // do not paint surfaces --- 767,771 ---- paintSurfaces(surfaces, alice); } else if (mode == View.LIGHTING_MODE) { ! paintSurfaces(surfaces, transparency); } else if (mode == View.WIREFRAME_MODE) { // do not paint surfaces Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.246 retrieving revision 1.247 diff -C2 -d -r1.246 -r1.247 *** View.java 11 Oct 2007 13:12:12 -0000 1.246 --- View.java 12 Oct 2007 11:06:52 -0000 1.247 *************** *** 325,328 **** --- 325,330 ---- /** grid enabled */ private boolean gridEnabled; + + private boolean showTransparent = true; /** The mode of selecting. Either edges or surfaces */ *************** *** 628,631 **** --- 630,649 ---- /** + * + * + */ + public void showTransparent() { + showTransparent = true; + } + + /** + * + * + */ + public void hideTransparent() { + showTransparent = false; + } + + /** * Apply edge attributes * @param attributes the new attributes *************** *** 698,701 **** --- 716,720 ---- Display.construction(gridEnabled); Display.mode(drawMode); + Display.transparency(showTransparent); initNames(gl); Display.objects(objectTable); *************** *** 1192,1205 **** Collection<Surface> surfaces = space.getSurfaces(); switch (drawMode) { ! case SPACE_ASSGN_MODE: { ! Collection<Surface> temp = new HashSet<Surface>(); ! for (Surface s : surfaces) { ! if (isVisible(s)) { ! temp.add(s); } } - surfaces = temp; - } - case LIGHTING_MODE: { gl.glEnable(GL.GL_LIGHTING); gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); --- 1211,1224 ---- Collection<Surface> surfaces = space.getSurfaces(); switch (drawMode) { ! case LIGHTING_MODE: { ! if (!showTransparent) { ! Collection<Surface> temp = new HashSet<Surface>(); ! for (Surface s : surfaces) { ! if (isVisible(s)) { ! temp.add(s); ! } } + surfaces = temp; } gl.glEnable(GL.GL_LIGHTING); gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); *************** *** 2152,2156 **** if (drawMode == WIREFRAME_MODE) { surfaces = new HashSet<Surface>(); ! } else if (drawMode == SPACE_ASSGN_MODE) { Collection<Surface> temp = new LinkedList<Surface>(); for (Surface s : surfaces) { --- 2171,2175 ---- if (drawMode == WIREFRAME_MODE) { surfaces = new HashSet<Surface>(); ! } else if (drawMode == LIGHTING_MODE && !showTransparent) { Collection<Surface> temp = new LinkedList<Surface>(); for (Surface s : surfaces) { *************** *** 2935,2939 **** if (mode <= 3 && mode >= 0) { drawMode = mode; - log.info("drawmode:" + mode); } } --- 2954,2957 ---- |