Thread: [Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool SelectTool.java,1.49,1.50
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2006-01-11 11:38:51
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20872/src/net/sourceforge/bprocessor/gl/tool Modified Files: SelectTool.java Log Message: Cleanup in SelectTool Index: SelectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectTool.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** SelectTool.java 6 Jan 2006 15:36:14 -0000 1.49 --- SelectTool.java 11 Jan 2006 11:38:41 -0000 1.50 *************** *** 20,24 **** import java.awt.event.MouseEvent; import java.awt.event.KeyEvent; - import java.awt.event.InputEvent; import javax.swing.JPopupMenu; --- 20,23 ---- *************** *** 38,44 **** /** The logger */ private static Logger log = Logger.getLogger(SelectTool.class); - - /** the Viewtype */ - protected int viewType; /** --- 37,40 ---- *************** *** 74,80 **** */ protected void pressed(MouseEvent e) { ! if (e.getButton() == MouseEvent.BUTTON3) { - findTarget(e); if (target != null) { if (target instanceof String) { --- 70,75 ---- */ protected void pressed(MouseEvent e) { ! findTarget(e); if (e.getButton() == MouseEvent.BUTTON3) { if (target != null) { if (target instanceof String) { *************** *** 86,138 **** if (e.getButton() == MouseEvent.BUTTON1) { if (e.getClickCount() >= 2 && target instanceof Surface) { ! Project df = Project.getInstance(); ! Set ds = new HashSet(); ! Surface surf = (Surface) target; ! if (surf.getBackDomain() != null) { ! ds.add(surf.getBackDomain()); ! } ! if (surf.getFrontDomain() != null) { ! ds.add(surf.getFrontDomain()); } ! if (!ds.isEmpty()) { ! Iterator dit = ds.iterator(); ! while (dit.hasNext()) { ! Space d = (Space)dit.next(); ! Set s = d.getSurfaces(); ! Iterator it = s.iterator(); ! while (it.hasNext()) { ! Surface surface = (Surface)it.next(); ! if (!selection.contains(surface)) { ! selection.add(surface); ! } ! } ! } } } else { - findTarget(e); if (target instanceof String) { String side = (String)target; glv.popup(makePopup(side), e.getX(), e.getY()); } else if (target == null) { - Iterator it = new HashSet(selection).iterator(); - while (it.hasNext()) { - deselect(it.next()); - } selection.clear(); ! } else if ((e.getModifiersEx() & InputEvent.SHIFT_DOWN_MASK) ! == InputEvent.SHIFT_DOWN_MASK) { if (!selection.contains(target)) { ! select(target); } else { ! deselect(target); } } else { if (!selection.contains(target)) { - Iterator it = new HashSet(selection).iterator(); - while (it.hasNext()) { - deselect(it.next()); - } selection.clear(); ! select(target); } } --- 81,107 ---- if (e.getButton() == MouseEvent.BUTTON1) { if (e.getClickCount() >= 2 && target instanceof Surface) { ! Surface surface = (Surface) target; ! if (surface.getBackDomain() != null) { ! selection.addAll(surface.getBackDomain().getSurfaces()); } ! if (surface.getFrontDomain() != null) { ! selection.addAll(surface.getFrontDomain().getSurfaces()); } } else { if (target instanceof String) { String side = (String)target; glv.popup(makePopup(side), e.getX(), e.getY()); } else if (target == null) { selection.clear(); ! } else if (e.isShiftDown()) { if (!selection.contains(target)) { ! selection.add(target); } else { ! selection.remove(target); } } else { if (!selection.contains(target)) { selection.clear(); ! selection.add(target); } } *************** *** 297,322 **** /** - * Sends the notification for select - * @param obj The selected object - */ - private void select(Object obj) { - selection.add(obj); - } - - /** - * Sends the notification for deselect - * @param obj The selected object - */ - private void deselect(Object obj) { - selection.remove(obj); - } - - /** * Invoked when a mouse button has been released on a component. * @param e The MouseEvent */ ! protected void released(MouseEvent e) { ! //findTarget(e); ! } /** --- 266,273 ---- /** * Invoked when a mouse button has been released on a component. * @param e The MouseEvent */ ! protected void released(MouseEvent e) { } /** |