Skip to content

Commit

Permalink
Revert "fix #136 -- Shortcut for some entries in Edit Menu are not sh…
Browse files Browse the repository at this point in the history
…own". This clobbers copy/paste in derivations.

This reverts commit c5ea602.
  • Loading branch information
akissinger committed May 17, 2014
1 parent 075b07f commit a8a24ae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions scala/src/main/scala/quanto/gui/GraphEditController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -610,16 +610,16 @@ class GraphEditController(view: GraphView, undoStack: UndoStack, val readOnly: B
undoStack.commit()
case KeyPressed(_, Key.Minus, _, _) => view.zoom *= 0.6
case KeyPressed(_, Key.Equals, _, _) => view.zoom *= 1.6
// case KeyPressed(_, Key.C, modifiers, _) =>
// if ((modifiers & Globals.CommandDownMask) == Globals.CommandDownMask) { copySubgraph() }
// case KeyPressed(_, Key.X, modifiers, _) =>
// if ((modifiers & Globals.CommandDownMask) == Globals.CommandDownMask) { cutSubgraph() }
case KeyPressed(_, Key.C, modifiers, _) =>
if ((modifiers & Globals.CommandDownMask) == Globals.CommandDownMask) { copySubgraph() }
case KeyPressed(_, Key.X, modifiers, _) =>
if ((modifiers & Globals.CommandDownMask) == Globals.CommandDownMask) { cutSubgraph() }
case KeyPressed(_, Key.V, modifiers, _) =>
if (modifiers == 0) {
mouseState = AddVertexTool()
controlsOpt.map { c => c.setMouseState(mouseState) }
}
// else if ((modifiers & Globals.CommandDownMask) == Globals.CommandDownMask) { pasteSubgraph() }
else if ((modifiers & Globals.CommandDownMask) == Globals.CommandDownMask) { pasteSubgraph() }
case KeyPressed(_, Key.S, modifiers, _) =>
if (modifiers == 0) {
mouseState = SelectTool()
Expand All @@ -645,9 +645,9 @@ class GraphEditController(view: GraphView, undoStack: UndoStack, val readOnly: B
mouseState = AddBoundaryTool()
controlsOpt.map { c => c.setMouseState(mouseState) }
}
// case KeyPressed(_, Key.G, modifiers, _) =>
// if ((modifiers & Globals.CommandDownMask) == Globals.CommandDownMask) {
// snapToGrid()
// }
case KeyPressed(_, Key.G, modifiers, _) =>
if ((modifiers & Globals.CommandDownMask) == Globals.CommandDownMask) {
snapToGrid()
}
}
}
8 changes: 4 additions & 4 deletions scala/src/main/scala/quanto/gui/QuantoDerive.scala
Original file line number Diff line number Diff line change
Expand Up @@ -448,27 +448,27 @@ object QuantoDerive extends SimpleSwingApplication {

val CutAction = new Action("Cut") {
menu.contents += new MenuItem(this) { mnemonic = Key.U }
accelerator = Some(KeyStroke.getKeyStroke(KeyEvent.VK_X, CommandMask))
//accelerator = Some(KeyStroke.getKeyStroke(KeyEvent.VK_X, CommandMask))
def apply() { currentGraphController.map(_.cutSubgraph()) }
}

val CopyAction = new Action("Copy") {
menu.contents += new MenuItem(this) { mnemonic = Key.C }
accelerator = Some(KeyStroke.getKeyStroke(KeyEvent.VK_C, CommandMask))
//accelerator = Some(KeyStroke.getKeyStroke(KeyEvent.VK_C, CommandMask))
def apply() { currentGraphController.map(_.copySubgraph()) }
}

val PasteAction = new Action("Paste") {
menu.contents += new MenuItem(this) { mnemonic = Key.P }
accelerator = Some(KeyStroke.getKeyStroke(KeyEvent.VK_V, CommandMask))
//accelerator = Some(KeyStroke.getKeyStroke(KeyEvent.VK_V, CommandMask))
def apply() { currentGraphController.map(_.pasteSubgraph()) }
}

contents += new Separator

val SnapToGridAction = new Action("Snap to grid") {
menu.contents += new MenuItem(this) { mnemonic = Key.S }
accelerator = Some(KeyStroke.getKeyStroke(KeyEvent.VK_G, CommandMask))
//accelerator = Some(KeyStroke.getKeyStroke(KeyEvent.VK_G, CommandMask))
def apply() { currentGraphController.map(_.snapToGrid()) }
}

Expand Down

0 comments on commit a8a24ae

Please sign in to comment.