From 99250750faad8eaad457f4a0db7f1c66162507fb Mon Sep 17 00:00:00 2001 From: Ivan Date: Fri, 7 Nov 2014 21:21:08 +0100 Subject: [PATCH] ActionControl Anpassungen --- .../heatup/ui/actionPanel/ActionControl.java | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/HeatUp/src/de/heatup/ui/actionPanel/ActionControl.java b/HeatUp/src/de/heatup/ui/actionPanel/ActionControl.java index cbb1f2e..a3354ef 100644 --- a/HeatUp/src/de/heatup/ui/actionPanel/ActionControl.java +++ b/HeatUp/src/de/heatup/ui/actionPanel/ActionControl.java @@ -8,41 +8,41 @@ import javax.swing.*; import javax.swing.border.LineBorder; public class ActionControl { - private Smashing smashing; - private Keysequence keysequence; - private JPanel panel; - private JLabel comp; + private static Smashing smashing; + private static Keysequence keysequence; + private static JPanel panel; + private static JLabel comp; - public void setPanel(JPanel newPanel){ + public static void setPanel(JPanel newPanel){ panel = newPanel; + smashing = new Smashing(); + keysequence = new Keysequence(); + comp = new JLabel(); + panel.add(comp); } - public void setAction(String s){ - + public static void setAction(String s){ + System.out.println("prompt"); if(s.equals("smashing")){ - smashing = new Smashing(); - String tmp= "Bitte die Taste "+smashing.getKey()+" so schnell wie möglich drücken"; - comp = new JLabel(tmp); + String str= "Bitte die Taste "+smashing.getKey()+" so schnell wie möglich drücken"; + comp.setText(str); comp.setFont(new Font("Arial", Font.CENTER_BASELINE, 16)); comp.setBorder(new LineBorder(Color.BLACK, 1)); comp.setSize(100,10); - panel.add(comp); panel.setVisible(false); panel.setVisible(true); }else{ - keysequence = new Keysequence(); - String tmp="Bitte diese Tastenkombination "+keysequence.getKeySequence()[0]+" "+keysequence.getKeySequence()[1]+" "+keysequence.getKeySequence()[2]+" "+keysequence.getKeySequence()[3]+" "+" so schnell wie möglich drücken"; - comp = new JLabel(tmp); + char []tmp = keysequence.getKeySequence(); + String str="Bitte diese Tastenkombination \""+tmp[0]+" "+tmp[1]+" "+tmp[2]+" "+tmp[3]+"\" "+"so schnell wie möglich eingeben"; + comp.setText(str); comp.setFont(new Font("Arial", Font.CENTER_BASELINE, 16)); comp.setBorder(new LineBorder(Color.BLACK, 1)); comp.setSize(100,10); - panel.add(comp); panel.setVisible(false); panel.setVisible(true); - } } - public void wishPanel(){ - comp.setVisible(false); + public static void wishPanel(){ + comp.setText(""); } }