Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10665/src/net/sourceforge/bprocessor/gui
Modified Files:
PopupMenu.java
Log Message:
offset command improved
Index: PopupMenu.java
===================================================================
RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v
retrieving revision 1.71
retrieving revision 1.72
diff -C2 -d -r1.71 -r1.72
*** PopupMenu.java 16 Nov 2007 13:15:04 -0000 1.71
--- PopupMenu.java 16 Nov 2007 14:26:26 -0000 1.72
***************
*** 12,15 ****
--- 12,16 ----
import java.util.Iterator;
import java.util.LinkedList;
+ import java.util.List;
import java.util.Set;
***************
*** 125,135 ****
public static JPopupMenu getEdgeMenu(Collection edges) {
JPopupMenu menu = getGeometricMenu(edges);
! AbstractAction action = new GeometricMenuAction(edges, "Split...") {
! public void actionPerformed(ActionEvent event) {
! Command command = new Command.Split((Edge) entities.iterator().next());
! AttributeView.instance().display(command);
! }
! };
! menu.add(action);
return menu;
}
--- 126,157 ----
public static JPopupMenu getEdgeMenu(Collection edges) {
JPopupMenu menu = getGeometricMenu(edges);
! {
! AbstractAction action = new GeometricMenuAction(edges, "Split...") {
! public void actionPerformed(ActionEvent event) {
! Command command = new Command.Split((Edge) entities.iterator().next());
! AttributeView.instance().display(command);
! }
! };
! menu.add(action);
! }
! {
! AbstractAction action = new GeometricMenuAction(edges, "Offset...") {
! public void actionPerformed(ActionEvent event) {
! LinkedList<Edge> edges = new LinkedList(entities);
! if (edges.size() > 1) {
! List<Edge> ordered = Command.Offset.order(edges);
! if (ordered != null) {
! Command command = new Command.Offset(ordered);
! AttributeView.instance().display(command);
! } else {
! GUI.getInstance().alert("Select a connected set of edges");
! }
! } else {
! GUI.getInstance().alert("Select more than one edge");
! }
! }
! };
! menu.add(action);
! }
return menu;
}
|