diff --git a/stirring-clicker/pom.xml b/stirring-clicker/pom.xml deleted file mode 100644 index b0d223016..000000000 --- a/stirring-clicker/pom.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - 4.0.0 - - ie.home.besok - move-clicker - 1.0 - - 1.8 - 1.8 - - - - - org.projectlombok - lombok - 1.18.10 - - - - junit - junit - 4.12 - - - \ No newline at end of file diff --git a/stirring-clicker/src/main/java/ie/home/besok/stirrings/Application.java b/stirring-clicker/src/main/java/ie/home/besok/stirrings/Application.java deleted file mode 100644 index 0835470bc..000000000 --- a/stirring-clicker/src/main/java/ie/home/besok/stirrings/Application.java +++ /dev/null @@ -1,15 +0,0 @@ -package ie.home.besok.stirrings; - -import java.awt.*; -import java.io.IOException; - -public class Application { - public static void main(String[] args) throws IOException { - FileStorage storage = new FileStorage(); - - EventQueue.invokeLater(() -> { - Gui gui = new Gui(storage); - gui.setVisible(true); - }); - } -} diff --git a/stirring-clicker/src/main/java/ie/home/besok/stirrings/Counter.java b/stirring-clicker/src/main/java/ie/home/besok/stirrings/Counter.java deleted file mode 100644 index b0f93f9d7..000000000 --- a/stirring-clicker/src/main/java/ie/home/besok/stirrings/Counter.java +++ /dev/null @@ -1,14 +0,0 @@ -package ie.home.besok.stirrings; - -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.util.List; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; - -public class Counter { - public Map count(List dates){ - return null; - } -} diff --git a/stirring-clicker/src/main/java/ie/home/besok/stirrings/FileStorage.java b/stirring-clicker/src/main/java/ie/home/besok/stirrings/FileStorage.java deleted file mode 100644 index c5784eb50..000000000 --- a/stirring-clicker/src/main/java/ie/home/besok/stirrings/FileStorage.java +++ /dev/null @@ -1,37 +0,0 @@ -package ie.home.besok.stirrings; - -import lombok.extern.slf4j.Slf4j; - -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.StandardOpenOption; -import java.time.LocalDateTime; -import java.util.List; - -public class FileStorage { - - private Path file; - - public FileStorage() throws IOException { - this.file = Paths.get("data.log"); - if(!Files.exists(file)){ - Files.createFile(file); - } - } - - public void plus() { - String line = LocalDateTime.now().toString()+System.lineSeparator(); - try { - Files.write(file, line.getBytes(), StandardOpenOption.APPEND); - } catch (IOException e) { - e.printStackTrace(); - } - } - - public List get() throws IOException { - return Files.readAllLines(file); - } - -} diff --git a/stirring-clicker/src/main/java/ie/home/besok/stirrings/Gui.java b/stirring-clicker/src/main/java/ie/home/besok/stirrings/Gui.java deleted file mode 100644 index 3df3e2131..000000000 --- a/stirring-clicker/src/main/java/ie/home/besok/stirrings/Gui.java +++ /dev/null @@ -1,73 +0,0 @@ -package ie.home.besok.stirrings; - -import javax.imageio.ImageIO; -import javax.swing.*; -import java.awt.*; -import java.io.IOException; -import java.net.URL; - -public class Gui extends JFrame { - - private FileStorage storage; - - public Gui(FileStorage storage) { - this.storage = storage; - try { - createUI(storage); - } catch (IOException e) { - e.printStackTrace(); - } - } - - private void createUI(FileStorage storage) throws IOException { - setTitle("Stirring counter"); - setSize(300, 300); - setLocationRelativeTo(null); - - - JButton button = createButton(storage); - JButton graphick = new JButton(); - graphick.setIcon(getIcon("3.jpg")); - - - Container pane = getContentPane(); - GroupLayout gl = new GroupLayout(pane); - pane.setLayout(gl); - - gl.setAutoCreateContainerGaps(true); - - gl.setHorizontalGroup( - gl.createSequentialGroup().addComponent(button).addComponent(graphick) - ); - - gl.setVerticalGroup(gl.createSequentialGroup().addComponent(button).addComponent(graphick)); - - - button.addActionListener((event) -> { - storage.plus(); - try { - JOptionPane.showMessageDialog(null,"","",JOptionPane.INFORMATION_MESSAGE, getIcon("2.jpg")); - } catch (IOException e) { - e.printStackTrace(); - } - }); - - setDefaultCloseOperation(EXIT_ON_CLOSE); - } - - private JButton createButton(FileStorage storage) throws IOException { - ImageIcon babyIcon = getIcon("1.png"); - - JButton button = new JButton(); - - button.setIcon(babyIcon); - return button; - } - - private ImageIcon getIcon(String name) throws IOException { - URL file = this.getClass().getClassLoader().getResource(name); - return new ImageIcon(ImageIO.read(file)); - } - - -} diff --git a/stirring-clicker/src/main/resources/1.png b/stirring-clicker/src/main/resources/1.png deleted file mode 100644 index 1ff5944d6..000000000 Binary files a/stirring-clicker/src/main/resources/1.png and /dev/null differ diff --git a/stirring-clicker/src/main/resources/2.jpg b/stirring-clicker/src/main/resources/2.jpg deleted file mode 100644 index 6220fba24..000000000 Binary files a/stirring-clicker/src/main/resources/2.jpg and /dev/null differ diff --git a/stirring-clicker/src/main/resources/3.jpg b/stirring-clicker/src/main/resources/3.jpg deleted file mode 100644 index f2b5f6443..000000000 Binary files a/stirring-clicker/src/main/resources/3.jpg and /dev/null differ diff --git a/stirring-clicker/src/test/java/ie/home/besok/stirrings/FileStorageTest.java b/stirring-clicker/src/test/java/ie/home/besok/stirrings/FileStorageTest.java deleted file mode 100644 index 1eaaba6d5..000000000 --- a/stirring-clicker/src/test/java/ie/home/besok/stirrings/FileStorageTest.java +++ /dev/null @@ -1,25 +0,0 @@ -package ie.home.besok.stirrings; - -import org.junit.Test; - -import java.io.IOException; -import java.util.List; - -import static org.junit.Assert.*; - -public class FileStorageTest { - - @Test - public void fsTest() throws IOException { - FileStorage fs = new FileStorage(); - List arrs = fs.get(); - int oldSize = arrs.size(); - fs.plus(); - fs.plus(); - fs.plus(); - fs.plus(); - arrs = fs.get(); - int newSize = arrs.size(); - assertEquals(4, newSize - oldSize); - } -} \ No newline at end of file