forked from se-edu/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 branch 'develop' into write-mark-as-important
- Loading branch information
Showing
9 changed files
with
183 additions
and
36 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
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,49 @@ | ||
package seedu.task.ui; | ||
|
||
import javafx.fxml.FXML; | ||
|
||
import javafx.scene.Node; | ||
import javafx.scene.control.Label; | ||
import javafx.scene.layout.VBox; | ||
import seedu.task.model.tag.Tag; | ||
|
||
public class TagCard extends UiPart{ | ||
|
||
private static final String FXML = "TagListCard.fxml"; | ||
|
||
@FXML | ||
private VBox tagCardPane; | ||
@FXML | ||
private Label name; | ||
|
||
private Tag tag; | ||
|
||
public TagCard(){ | ||
|
||
} | ||
|
||
public static TagCard load(Tag tag){ | ||
TagCard card = new TagCard(); | ||
card.tag = tag; | ||
return UiPartLoader.loadUiPart(card); | ||
} | ||
|
||
@FXML | ||
public void initialize() { | ||
name.setText(tag.tagName); | ||
} | ||
|
||
public VBox getLayout() { | ||
return tagCardPane; | ||
} | ||
|
||
@Override | ||
public void setNode(Node node) { | ||
tagCardPane = (VBox) node; | ||
} | ||
|
||
@Override | ||
public String getFxmlPath() { | ||
return FXML; | ||
} | ||
} |
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,65 @@ | ||
package seedu.task.ui; | ||
|
||
import javafx.collections.ObservableList; | ||
import javafx.scene.Node; | ||
import javafx.scene.control.SplitPane; | ||
import javafx.scene.layout.AnchorPane; | ||
import javafx.scene.layout.FlowPane; | ||
import javafx.stage.Stage; | ||
import seedu.task.commons.core.LogsCenter; | ||
import seedu.task.model.tag.Tag; | ||
|
||
import java.util.logging.Logger; | ||
|
||
/** | ||
* Panel for the tag list. | ||
*/ | ||
public class TagListPanel extends UiPart { | ||
private final Logger logger = LogsCenter.getLogger(TagListPanel.class); | ||
private static final String FXML = "TagListPanel.fxml"; | ||
private FlowPane panel; | ||
private AnchorPane placeHolderPane; | ||
|
||
public TagListPanel() { | ||
super(); | ||
} | ||
|
||
@Override | ||
public void setNode(Node node) { | ||
panel = (FlowPane) node; | ||
} | ||
|
||
@Override | ||
public String getFxmlPath() { | ||
return FXML; | ||
} | ||
|
||
@Override | ||
public void setPlaceholder(AnchorPane pane) { | ||
this.placeHolderPane = pane; | ||
} | ||
|
||
public static TagListPanel load(Stage primaryStage, AnchorPane taskListPlaceholder, | ||
ObservableList<Tag> tagList) { | ||
TagListPanel tagListPanel = | ||
UiPartLoader.loadUiPart(primaryStage, taskListPlaceholder, new TagListPanel()); | ||
tagListPanel.configure(tagList); | ||
return tagListPanel; | ||
} | ||
|
||
private void configure(ObservableList<Tag> tagList) { | ||
setConnections(tagList); | ||
addToPlaceholder(); | ||
} | ||
|
||
private void setConnections(ObservableList<Tag> taskList) { | ||
for (Tag tg : taskList) { | ||
panel.getChildren().add(TagCard.load(tg).getLayout()); | ||
} | ||
} | ||
|
||
private void addToPlaceholder() { | ||
SplitPane.setResizableWithParent(placeHolderPane, false); | ||
placeHolderPane.getChildren().add(panel); | ||
} | ||
} |
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,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.layout.VBox?> | ||
<?import javafx.scene.control.*?> | ||
|
||
<VBox id="tagCardPane" fx:id="tagCardPane" xmlns:fx="http://javafx.com/fxml/1"> | ||
<children> | ||
<Label id="tagName" fx:id="name" text="sample text" style="-fx-padding: 0 2.5 0 2.5;" /> | ||
</children> | ||
</VBox> | ||
|
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,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.layout.*?> | ||
<?import java.net.URL?> | ||
<FlowPane hgap="5" vgap="5" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seedu.task.ui.TagListPanel" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> | ||
<stylesheets> | ||
<URL value="@DarkTheme.css" /> | ||
<URL value="@Extensions.css" /> | ||
</stylesheets> | ||
<children> | ||
</children> | ||
</FlowPane> |
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