test case:
- select several blocks by mouse dragging
- ENTER
Change-Id: I01ac1ff17a847f4796d79b217f0e30ba8cdbca33
*/
@Override
public void keyPressed(KeyEvent e) {
- /** add the current block to the most recent diagram **/
+ /** add the selected blocks into the most recent diagram **/
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
final List<XcosDiagram> allDiagrams = Xcos.getInstance().openedDiagrams();
final PaletteBlockCtrl control = ((PaletteBlockView) e.getSource()).getController();
@Override
public void mouseReleased(MouseEvent e) {
super.mouseReleased(e);
- ((PaletteView) e.getSource()).setSelectionRectangle(null);
+ PaletteView view = (PaletteView) e.getSource();
+ view.setSelectionRectangle(null);
+ Component[] blocks = view.getComponents();
+ if (blocks.length > 0) {
+ blocks[0].requestFocus();
+ }
}
}