forked from nus-cs2103-AY1819S1/addressbook-level4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request nus-cs2103-AY1819S1#68 from jiholim/master
Restore UI for V1.2
- Loading branch information
Showing
9 changed files
with
228 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/main/java/seedu/address/ui/WishDetailSavingAmount.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package seedu.address.ui; | ||
|
||
import java.util.logging.Logger; | ||
|
||
import com.google.common.eventbus.Subscribe; | ||
|
||
import javafx.fxml.FXML; | ||
import javafx.scene.control.Label; | ||
import javafx.scene.layout.Region; | ||
import seedu.address.commons.core.LogsCenter; | ||
import seedu.address.commons.events.ui.NewResultAvailableEvent; | ||
import seedu.address.commons.events.ui.WishPanelSelectionChangedEvent; | ||
import seedu.address.model.wish.Wish; | ||
|
||
/** | ||
* Panel containing the detail of wish. | ||
*/ | ||
public class WishDetailSavingAmount extends UiPart<Region> { | ||
|
||
private static final String FXML = "WishDetailSavingAmount.fxml"; | ||
|
||
private final Logger logger = LogsCenter.getLogger(WishDetailSavingAmount.class); | ||
|
||
@FXML | ||
private Label price; | ||
|
||
@FXML | ||
private Label savedAmount; | ||
|
||
public WishDetailSavingAmount() { | ||
super(FXML); | ||
|
||
loadDefaultDetails(); | ||
registerAsAnEventHandler(this); | ||
} | ||
|
||
/** | ||
* Load the default page. | ||
*/ | ||
public void loadDefaultDetails() { | ||
price.setText(""); | ||
savedAmount.setText(""); | ||
} | ||
|
||
/** | ||
* Load the page that shows the detail of wish. | ||
*/ | ||
private void loadWishDetails(Wish wish) { | ||
savedAmount.setText("$" + wish.getSavedAmount().toString()); | ||
price.setText("/ $" + wish.getPrice().toString()); | ||
} | ||
|
||
@Subscribe | ||
private void handleWishPanelSelectionChangedEvent(WishPanelSelectionChangedEvent event) { | ||
logger.info(LogsCenter.getEventHandlingLogMessage(event)); | ||
loadWishDetails(event.getNewSelection()); | ||
} | ||
|
||
@Subscribe | ||
private void handleNewResultAvailableEvent(NewResultAvailableEvent event) { | ||
logger.info("test" + event.message); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
src/main/java/seedu/address/ui/WishDetailSavingHistory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package seedu.address.ui; | ||
|
||
import java.util.logging.Logger; | ||
|
||
import com.google.common.eventbus.Subscribe; | ||
|
||
import javafx.fxml.FXML; | ||
import javafx.scene.layout.Region; | ||
import seedu.address.commons.core.LogsCenter; | ||
import seedu.address.commons.events.ui.WishPanelSelectionChangedEvent; | ||
import seedu.address.model.wish.Wish; | ||
|
||
/** | ||
* Panel containing the detail of wish. | ||
*/ | ||
public class WishDetailSavingHistory extends UiPart<Region> { | ||
|
||
private static final String FXML = "WishDetailSavingHistory.fxml"; | ||
|
||
private final Logger logger = LogsCenter.getLogger(getClass()); | ||
|
||
public WishDetailSavingHistory() { | ||
super(FXML); | ||
|
||
registerAsAnEventHandler(this); | ||
} | ||
|
||
/** | ||
* Load the page that shows the detail of wish. | ||
*/ | ||
private void loadWishDetails(Wish wish) { | ||
} | ||
|
||
@Subscribe | ||
private void handleWishPanelSelectionChangedEvent(WishPanelSelectionChangedEvent event) { | ||
logger.info(LogsCenter.getEventHandlingLogMessage(event)); | ||
loadWishDetails(event.getNewSelection()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.layout.StackPane?> | ||
<?import javafx.geometry.Insets?> | ||
<?import javafx.scene.control.Label?> | ||
<?import javafx.scene.layout.ColumnConstraints?> | ||
<?import javafx.scene.layout.GridPane?> | ||
<?import javafx.scene.layout.HBox?> | ||
<?import javafx.scene.layout.VBox?> | ||
|
||
<StackPane xmlns:fx="http://javafx.com/fxml/1"> | ||
<GridPane HBox.hgrow="ALWAYS"> | ||
<columnConstraints> | ||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10" prefWidth="150" /> | ||
</columnConstraints> | ||
<VBox minHeight="300" GridPane.columnIndex="0"> | ||
<padding> | ||
<Insets top="5" bottom="5" /> | ||
</padding> | ||
<Label styleClass="detail_sub_title_label"> | ||
Amount Saved | ||
</Label> | ||
<HBox spacing="15" alignment="CENTER_LEFT"> | ||
<Label fx:id="savedAmount" styleClass="saving_amount_label" text="\$savedAmount" /> | ||
<Label fx:id="price" styleClass="price_label" text="\$price" /> | ||
</HBox> | ||
</VBox> | ||
</GridPane> | ||
</StackPane> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.layout.StackPane?> | ||
<?import javafx.geometry.Insets?> | ||
<?import javafx.scene.control.Label?> | ||
<?import javafx.scene.layout.ColumnConstraints?> | ||
<?import javafx.scene.layout.GridPane?> | ||
<?import javafx.scene.layout.HBox?> | ||
<?import javafx.scene.layout.VBox?> | ||
|
||
<StackPane xmlns:fx="http://javafx.com/fxml/1"> | ||
<GridPane HBox.hgrow="ALWAYS"> | ||
<columnConstraints> | ||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10" prefWidth="150" /> | ||
</columnConstraints> | ||
<VBox minHeight="300" GridPane.columnIndex="0"> | ||
<padding> | ||
<Insets top="5" bottom="5" /> | ||
</padding> | ||
<Label styleClass="detail_sub_title_label"> | ||
Saving History | ||
</Label> | ||
</VBox> | ||
</GridPane> | ||
</StackPane> |