[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool SelectTool.java,1.26,1.27
Status: Pre-Alpha
Brought to you by:
henryml
From: Nordholt <nor...@us...> - 2005-10-01 05:20:19
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20958 Modified Files: SelectTool.java Log Message: Pressing the domain labels brins up the domain popup Index: SelectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectTool.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** SelectTool.java 30 Sep 2005 12:47:09 -0000 1.26 --- SelectTool.java 30 Sep 2005 17:54:36 -0000 1.27 *************** *** 9,12 **** --- 9,13 ---- import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.view.View; + import net.sourceforge.bprocessor.gl.DomainPopupListener; import net.sourceforge.bprocessor.kernel.notification.Notification; *************** *** 30,33 **** --- 31,38 ---- import java.awt.event.KeyEvent; import java.awt.event.InputEvent; + import java.awt.event.MouseListener; + + import javax.swing.JPopupMenu; + import javax.swing.JMenuItem; import java.util.Iterator; *************** *** 76,80 **** protected void moved(MouseEvent e) { //findTarget(e); ! target = null; } --- 81,85 ---- protected void moved(MouseEvent e) { //findTarget(e); ! //target = null; } *************** *** 85,89 **** protected void dragged(MouseEvent e) { //findTarget(e); ! target = null; } --- 90,94 ---- protected void dragged(MouseEvent e) { //findTarget(e); ! //target = null; } *************** *** 120,124 **** } else { findTarget(e); ! if (target == null) { Iterator it = new HashSet(selection).iterator(); while (it.hasNext()) { --- 125,153 ---- } else { findTarget(e); ! if (target instanceof String) { ! String side = (String)target; ! JPopupMenu pp = new JPopupMenu(side); ! Set domains = DomainFacade.getInstance().findAll(); ! Iterator domIt = domains.iterator(); ! Iterator selIt = new HashSet(selection).iterator(); ! Surface surface = null; ! if (selIt.hasNext()) { ! Object o = selIt.next(); ! if (o instanceof Surface) { ! surface = (Surface)o; ! } ! } ! while (domIt.hasNext()) { ! Domain domain = (Domain)domIt.next(); ! JMenuItem domainItem = new JMenuItem(domain.getName()); ! MouseListener ml = new DomainPopupListener(domain, ! surface, ! side.equals("front")); ! domainItem.addMouseListener(ml); ! pp.add(domainItem); ! } ! pp.pack(); ! glv.popup(pp, e.getX(), e.getY()); ! } else if (target == null) { Iterator it = new HashSet(selection).iterator(); while (it.hasNext()) { *************** *** 146,150 **** } } ! /** * Sends the notification for select --- 175,179 ---- } } ! /** * Sends the notification for select |