Skip to content

Commit

Permalink
Code reorganization
Browse files Browse the repository at this point in the history
  • Loading branch information
Chomusuke committed Apr 13, 2023
1 parent 6f54b6d commit fd9ae31
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 38 deletions.
10 changes: 5 additions & 5 deletions src/main/java/com/Chomusuke/Accountable.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@

import java.util.*;

import com.chomusuke.gui.pane.AccountPane;
import com.chomusuke.gui.pane.TransactionPane;
import com.chomusuke.gui.popup.AddAccountScreen;
import com.chomusuke.gui.popup.AddTransactionScreen;
import com.chomusuke.util.Time;
import javafx.application.Application;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
Expand All @@ -40,6 +35,11 @@
import javafx.scene.layout.Pane;
import javafx.stage.Stage;

import com.chomusuke.gui.pane.AccountPane;
import com.chomusuke.gui.pane.TransactionPane;
import com.chomusuke.gui.popup.AddAccountScreen;
import com.chomusuke.gui.popup.AddTransactionScreen;
import com.chomusuke.util.Time;
import com.chomusuke.logic.*;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@

package com.chomusuke.gui.element.tile;

import com.chomusuke.logic.Transaction;
import javafx.scene.paint.Color;

import com.chomusuke.logic.Transaction;

/**
* Provides a JavaFX Node that represents a transaction.
*/
Expand Down
15 changes: 8 additions & 7 deletions src/main/java/com/Chomusuke/gui/pane/AccountPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,21 @@

package com.chomusuke.gui.pane;

import com.chomusuke.Accountable.SceneID;
import com.chomusuke.gui.element.PlusButton;
import com.chomusuke.gui.element.tile.AccountTile;
import com.chomusuke.gui.popup.AddAccountScreen;
import com.chomusuke.logic.Account;
import com.chomusuke.logic.TransactionList;
import java.util.Map;

import javafx.beans.property.ObjectProperty;
import javafx.geometry.Insets;
import javafx.scene.control.Button;
import javafx.scene.control.ScrollPane;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;

import java.util.Map;
import com.chomusuke.Accountable.SceneID;
import com.chomusuke.gui.element.PlusButton;
import com.chomusuke.gui.element.tile.AccountTile;
import com.chomusuke.gui.popup.AddAccountScreen;
import com.chomusuke.logic.Account;
import com.chomusuke.logic.TransactionList;

/**
* Provides a JavaFX pane containing account information.
Expand Down
23 changes: 12 additions & 11 deletions src/main/java/com/Chomusuke/gui/pane/TransactionPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,8 @@

package com.chomusuke.gui.pane;

import com.chomusuke.Accountable.SceneID;
import com.chomusuke.gui.element.DateSelector;
import com.chomusuke.gui.element.PlusButton;
import com.chomusuke.gui.element.SquareButton;
import com.chomusuke.gui.element.tile.TransactionTile;
import com.chomusuke.gui.popup.AddFileScreen;
import com.chomusuke.gui.popup.AddTransactionScreen;
import com.chomusuke.logic.Account;
import com.chomusuke.logic.Transaction;
import com.chomusuke.logic.TransactionList;
import java.util.*;

import javafx.beans.property.ObjectProperty;
import javafx.beans.property.StringProperty;
import javafx.collections.ListChangeListener;
Expand All @@ -41,7 +33,16 @@
import javafx.scene.paint.Color;
import javafx.scene.text.Text;

import java.util.*;
import com.chomusuke.Accountable.SceneID;
import com.chomusuke.gui.element.DateSelector;
import com.chomusuke.gui.element.PlusButton;
import com.chomusuke.gui.element.SquareButton;
import com.chomusuke.gui.element.tile.TransactionTile;
import com.chomusuke.gui.popup.AddFileScreen;
import com.chomusuke.gui.popup.AddTransactionScreen;
import com.chomusuke.logic.Account;
import com.chomusuke.logic.Transaction;
import com.chomusuke.logic.TransactionList;

public class TransactionPane extends BorderPane{

Expand Down
13 changes: 7 additions & 6 deletions src/main/java/com/Chomusuke/gui/popup/AddAccountScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@

package com.chomusuke.gui.popup;

import com.chomusuke.logic.Account;
import com.chomusuke.logic.Storage;
import com.chomusuke.logic.Transaction;
import com.chomusuke.logic.TransactionList;
import java.util.Map;
import java.util.Random;

import javafx.scene.control.TextField;
import javafx.scene.control.TextFormatter;
import javafx.scene.layout.HBox;

import java.util.Map;
import java.util.Random;
import com.chomusuke.logic.Account;
import com.chomusuke.logic.Storage;
import com.chomusuke.logic.Transaction;
import com.chomusuke.logic.TransactionList;

/**
* This class provides a JavaFX stage used to add an account.
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/Chomusuke/gui/popup/AddTransactionScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@

package com.chomusuke.gui.popup;

import com.chomusuke.logic.Account;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

import javafx.collections.FXCollections;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.TextField;
Expand All @@ -26,14 +30,10 @@
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;

import com.chomusuke.logic.Account;
import com.chomusuke.logic.Transaction;
import com.chomusuke.logic.TransactionList;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

import static com.chomusuke.logic.Transaction.*;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/Chomusuke/logic/Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

package com.chomusuke.logic;

import com.chomusuke.util.Preconditions;

import java.io.*;
import java.nio.file.FileAlreadyExistsException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.*;

import com.chomusuke.util.Preconditions;

import static com.chomusuke.logic.Transaction.TransactionType;
import static com.chomusuke.logic.Transaction.ValueType;

Expand Down

0 comments on commit fd9ae31

Please sign in to comment.