diff --git a/src/main/java/edu/mit/blocks/codeblocks/BlockLink.java b/src/main/java/edu/mit/blocks/codeblocks/BlockLink.java index 9f401a4d89ad2377407c6d73725729ae42f939c8..5f4db9f791710d2b9f8efb89be74cb5fefc9ef07 100644 --- a/src/main/java/edu/mit/blocks/codeblocks/BlockLink.java +++ b/src/main/java/edu/mit/blocks/codeblocks/BlockLink.java @@ -149,7 +149,8 @@ public class BlockLink { // the plug shouldn't be connected by the time we reach here. This // exception will only be thrown if the plug is connected even // after any insertion-esq links were broken above - throw new RuntimeException("trying to link a plug that's already connected somewhere."); + + throw new RuntimeException("trying to link a plug that's already connected somewhere."); } // actually form the connection diff --git a/src/main/java/edu/mit/blocks/codeblocks/CommandRule.java b/src/main/java/edu/mit/blocks/codeblocks/CommandRule.java index c0f0312f4ccecbc8eda0bb92ecaf5d514792c88e..6b2ee74c37f227afad322e25408c118dbbceaa09 100644 --- a/src/main/java/edu/mit/blocks/codeblocks/CommandRule.java +++ b/src/main/java/edu/mit/blocks/codeblocks/CommandRule.java @@ -48,7 +48,13 @@ public class CommandRule implements LinkRule, WorkspaceListener { } link = BlockLink.getBlockLink(workspace, top, bottom, top.getAfterConnector(), bottom.getBeforeConnector()); - link.connect(); + try{ + link.connect(); + }catch (RuntimeException re) { + //added by letsgoING + //No Output needed -> it works + //System.out.println("catched Exeption: "+ re); + } } } } diff --git a/src/main/java/edu/mit/blocks/codeblockutil/LabelWidget.java b/src/main/java/edu/mit/blocks/codeblockutil/LabelWidget.java index e234f568c8399d88e098c7b582db08ed822ea8c6..ba2d67c8f9c9e772bfc8b16c76a2fabeb9273cae 100644 --- a/src/main/java/edu/mit/blocks/codeblockutil/LabelWidget.java +++ b/src/main/java/edu/mit/blocks/codeblockutil/LabelWidget.java @@ -381,7 +381,7 @@ public abstract class LabelWidget extends JComponent { * BlockLabelTextField is a java JtextField that internally handles various events * and provides the semantic to interface with the user. Unlike typical JTextFields, * the blockLabelTextField allows clients to only enter certain keys board input. - * It also reacts to enters and escapse by delegating the KeyEvent to the parent + * It also reacts to enters and escape by delegating the KeyEvent to the parent * RenderableBlock. */ private class BlockLabelTextField extends JTextField implements MouseListener, DocumentListener, FocusListener, ActionListener { @@ -397,7 +397,9 @@ public abstract class LabelWidget extends JComponent { 'G', 'H', 'J', 'K', 'L', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '\'', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', '-', '=', '{', '}', '|', '[', ']', '\\', ' ', - ':', '"', ';', '\'', '<', '>', '?', ',', '.', '/', '`', '~'}; + ':', '"', ';', '\'', '<', '>', '?', ',', '.', '/', '`', '~', + 'ä', 'ö', 'ü', 'Ä', 'Ö', 'Ü', 'ß'}; + /** These Key inputs are processed by all this text field */ @SuppressWarnings("deprecation") private final int[] validMasks = {KeyEvent.VK_BACK_SPACE,