Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tabbed panels #72

Merged
merged 8 commits into from Oct 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/java/seedu/address/model/Model.java
Expand Up @@ -5,6 +5,7 @@

import javafx.collections.ObservableList;
import seedu.address.commons.core.GuiSettings;
//import seedu.address.model.customer.Customer;
import seedu.address.model.person.Person;

/**
Expand Down
22 changes: 15 additions & 7 deletions src/main/java/seedu/address/ui/MainWindow.java
Expand Up @@ -31,22 +31,26 @@ public class MainWindow extends UiPart<Stage> {
private Logic logic;

// Independent Ui parts residing in this Ui container
private PersonListPanel personListPanel;
//private PersonListPanel personListPanel;
private ResultDisplay resultDisplay;
private HelpWindow helpWindow;
private TabPanel tabPanel;

@FXML
private StackPane commandBoxPlaceholder;

@FXML
private MenuItem helpMenuItem;

@FXML
/*@FXML
private StackPane personListPanelPlaceholder;

*/
@FXML
private StackPane resultDisplayPlaceholder;

@FXML
private StackPane tabPanelPlaceholder;

@FXML
private StackPane statusbarPlaceholder;

Expand Down Expand Up @@ -107,8 +111,12 @@ private void setAccelerator(MenuItem menuItem, KeyCombination keyCombination) {
* Fills up all the placeholders of this window.
*/
void fillInnerParts() {
personListPanel = new PersonListPanel(logic.getFilteredPersonList());
personListPanelPlaceholder.getChildren().add(personListPanel.getRoot());

tabPanel = new TabPanel(this.logic);
tabPanelPlaceholder.getChildren().add(tabPanel.getRoot());

//personListPanel = new PersonListPanel(logic.getFilteredPersonList());
//personListPanelPlaceholder.getChildren().add(personListPanel.getRoot());

resultDisplay = new ResultDisplay();
resultDisplayPlaceholder.getChildren().add(resultDisplay.getRoot());
Expand Down Expand Up @@ -160,9 +168,9 @@ private void handleExit() {
primaryStage.hide();
}

public PersonListPanel getPersonListPanel() {
/*public PersonListPanel getPersonListPanel() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to clean up commented-out lines later on.

return personListPanel;
}
}*/

/**
* Executes the command and returns the result.
Expand Down
52 changes: 52 additions & 0 deletions src/main/java/seedu/address/ui/TabPanel.java
@@ -0,0 +1,52 @@
package seedu.address.ui;

import javafx.fxml.FXML;
import javafx.scene.control.TabPane;
import javafx.scene.layout.Region;
import javafx.scene.layout.StackPane;
import seedu.address.logic.Logic;

/**
* class containing TabPane class
*/
public class TabPanel extends UiPart<Region> {
private static final String FXML = "TabPanel.fxml";

private PersonListPanel personListPanel;
private PersonListPanel personListPanel2;
private PersonListPanel personListPanel3;
private PersonListPanel personListPanel4;

@FXML
private StackPane phoneListPanelPlaceholder;

@FXML
private StackPane customerListPanelPlaceholder;

@FXML
private StackPane orderListPanelPlaceholder;
@FXML
private StackPane scheduleListPanelPlaceholder;

@FXML
private TabPane tabPanel;

public TabPanel(Logic logic) {
super(FXML);
personListPanel = new PersonListPanel(logic.getFilteredPersonList());
customerListPanelPlaceholder.getChildren().add(personListPanel.getRoot());

personListPanel2 = new PersonListPanel(logic.getFilteredPersonList());
phoneListPanelPlaceholder.getChildren().add(personListPanel2.getRoot());

personListPanel3 = new PersonListPanel(logic.getFilteredPersonList());
orderListPanelPlaceholder.getChildren().add(personListPanel3.getRoot());

personListPanel4 = new PersonListPanel(logic.getFilteredPersonList());
scheduleListPanelPlaceholder.getChildren().add(personListPanel4.getRoot());


tabPanel.setTabClosingPolicy(TabPane.TabClosingPolicy.UNAVAILABLE);
}

}
2 changes: 1 addition & 1 deletion src/main/resources/view/CustomerListPanel.fxml
Expand Up @@ -4,5 +4,5 @@
<?import javafx.scene.layout.VBox?>

<VBox xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<ListView fx:id="customerListView" VBox.vgrow="ALWAYS" styleClass="pane-with-border"/>
<ListView fx:id="personListView" VBox.vgrow="ALWAYS" styleClass="pane-with-border"/>
</VBox>
70 changes: 57 additions & 13 deletions src/main/resources/view/DarkTheme.css
Expand Up @@ -5,14 +5,14 @@

.label {
-fx-font-size: 11pt;
-fx-font-family: "Segoe UI Semibold";
-fx-font-family: "Segoe UI Light";
-fx-text-fill: #555555;
-fx-opacity: 0.9;
}

.label-bright {
-fx-font-size: 11pt;
-fx-font-family: "Segoe UI Semibold";
-fx-font-family: "Segoe UI Light";
-fx-text-fill: white;
-fx-opacity: 1;
}
Expand All @@ -26,17 +26,60 @@

.text-field {
-fx-font-size: 12pt;
-fx-font-family: "Segoe UI Semibold";
-fx-font-family: "Segoe UI Light";
}

.tab-pane {
-fx-padding: 0 0 0 1;

.tab-header-background {
-fx-background-color:transparent;

}

.tab-pane .tab-header-area {
-fx-padding: 0 0 0 0;
-fx-min-height: 0;
-fx-max-height: 0;
.tab-pane .tab-header-area .tab-header-background {
-fx-opacity: 0;
}

.tab-pane
{
-fx-tab-min-width: 200px;
/* 24 */

-fx-tab-max-width: 250px;
-fx-tab-min-height: 3em;
-fx-tab-max-height: 10em;
-fx-effect: dropShadow(gaussian, rgba(0, 0, 0, 0.3), 10, 0.5, 0.0, 0.0);
}

.tab{
-fx-background-insets: 0 1 0 1,0,0;
}
.tab-pane .tab
{
-fx-background-color: #e6e6e6;

}

.tab-pane .tab:selected
{
-fx-background-color: #3c3c3c;
}
.tab-pane:top *.tab-header-area {
-fx-background-insets: 0, 0 0 1 0;
-fx-padding: 0.416667em 0.166667em 0.0em 0.0em;
}

.tab .tab-label {
-fx-alignment: CENTER;
-fx-text-fill: black;
-fx-font-size: 15px;
-fx-font-family: "Segoe UI Light";
-fx-font-weight: bold;
}


.tab:selected .tab-label {
-fx-alignment: CENTER;
-fx-text-fill: white;
}

.table-view {
Expand Down Expand Up @@ -87,11 +130,12 @@
-fx-background-color: derive(#484B95, 20%);
}


.list-view {
-fx-background-insets: 0;
-fx-padding: 0;
-fx-background-color: derive(#484B95, 20%);
-fx-effect: dropshadow(gaussian, rgba(0, 0, 0, 0.3), 10, 0.5, 0.0, 0.0);
-fx-effect: dropShadow(gaussian, rgba(0, 0, 0, 0.3), 10, 0.5, 0.0, 0.0);
}

.list-cell {
Expand Down Expand Up @@ -136,6 +180,7 @@

.stack-pane {
-fx-background-color: derive(#484B95, 20%);
-fx-effect: dropshadow(gaussian, rgba(0, 0, 0, 0.3), 10, 0.5, 0.0, 0.0);


}
Expand All @@ -144,7 +189,6 @@
-fx-background-color: derive(white, 20%);
-fx-border-color: derive(white, 10%);
-fx-border-top-width: 1px;
-fx-effect: dropshadow(gaussian, rgba(0, 0, 0, 0.3), 10, 0.5, 0.0, 0.0);
}

.status-bar {
Expand All @@ -156,7 +200,7 @@
-fx-font-family: "Segoe UI Light";
-fx-font-size: 13pt;
-fx-text-fill: white;
-fx-effect: dropshadow(gaussian, rgba(0, 0, 0, 0.3), 10, 0.5, 0.0, 0.0);

}

.result-display .label {
Expand Down Expand Up @@ -328,7 +372,7 @@
-fx-background-insets: 0;
-fx-border-color: #383838 #383838 #ffffff #383838;
-fx-border-insets: 0;
-fx-border-width: 1;
-fx-border-width: 0;
-fx-font-family: "Segoe UI Light";
-fx-font-size: 13pt;
-fx-text-fill: white;
Expand Down
13 changes: 12 additions & 1 deletion src/main/resources/view/MainWindow.fxml
Expand Up @@ -11,6 +11,7 @@
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.VBox?>

<?import javafx.scene.control.TabPane?>
<fx:root type="javafx.stage.Stage" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
title="Address App" minWidth="450" minHeight="600" onCloseRequest="#handleExit">
<icons>
Expand Down Expand Up @@ -46,12 +47,22 @@
</padding>
</StackPane>

<VBox id="personList" styleClass="pane-with-border" minWidth="340" prefWidth="340" VBox.vgrow="ALWAYS">
<StackPane VBox.vgrow="ALWAYS" fx:id="tabPanelPlaceholder" styleClass="pane-with-border"
minHeight="200" >
<padding>
<Insets top="10" right="20" bottom="10" left="20" />
</padding>
</StackPane>
</VBox>
<!--
<VBox fx:id="personList" styleClass="pane-with-border" minWidth="340" prefWidth="340" VBox.vgrow="ALWAYS">
<padding>
<Insets top="100" right="20" bottom="5" left="20" />
<Insets top="5" right="20" bottom="5" left="20" />
</padding>
<StackPane fx:id="personListPanelPlaceholder" VBox.vgrow="ALWAYS"/>
</VBox>
-->

<StackPane fx:id="statusbarPlaceholder" VBox.vgrow="NEVER" />
</VBox>
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/view/PersonListPanel.fxml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.ListView?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.control.ListView?>
<?import javafx.scene.layout.VBox?>

<VBox xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<ListView fx:id="personListView" VBox.vgrow="ALWAYS" styleClass="pane-with-border"/>
<ListView fx:id="personListView" VBox.vgrow="ALWAYS" styleClass="pane-with-border"/>
</VBox>
2 changes: 1 addition & 1 deletion src/main/resources/view/ResultDisplay.fxml
Expand Up @@ -3,7 +3,7 @@
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.layout.StackPane?>

<StackPane fx:id="placeHolder" styleClass="pane-with-border" xmlns="http://javafx.com/javafx/8"
<StackPane fx:id="placeHolder" styleClass="stack-pane" xmlns="http://javafx.com/javafx/8"
xmlns:fx="http://javafx.com/fxml/1">
<TextArea fx:id="resultDisplay" editable="false" styleClass="result-display"/>
</StackPane>
59 changes: 59 additions & 0 deletions src/main/resources/view/TabPanel.fxml
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.Tab?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.VBox?>

<?import javafx.scene.layout.StackPane?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<VBox xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1">
<TabPane fx:id="tabPanel" styleClass="STYLE_CLASS_FLOATING stack-pane">
<tabs>
<Tab text="Customers" >
<content>
<VBox fx:id="customerList" styleClass="pane-with-border" minWidth="340" prefWidth="340" VBox.vgrow="ALWAYS">
<padding>
<Insets top="20" right="0" bottom="0" left="0" />
</padding>
<Label text="Customers"> </Label>
<StackPane fx:id="customerListPanelPlaceholder" VBox.vgrow="ALWAYS"/>
</VBox>
</content>
</Tab>
<Tab text="Phones">
<content>
<VBox fx:id="phoneList" styleClass="pane-with-border" minWidth="340" prefWidth="340" VBox.vgrow="ALWAYS">
<padding>
<Insets top="20" right="0" bottom="0" left="0" />
</padding>
<Label text="Phones"> </Label>
<StackPane fx:id="phoneListPanelPlaceholder" VBox.vgrow="ALWAYS"/>
</VBox>
</content>
</Tab>
<Tab text="Order">
<content>
<VBox fx:id="orderList" styleClass="pane-with-border" minWidth="340" prefWidth="340" VBox.vgrow="ALWAYS">
<padding>
<Insets top="20" right="0" bottom="0" left="0" />
</padding>
<Label text="Order"> </Label>
<StackPane fx:id="orderListPanelPlaceholder" VBox.vgrow="ALWAYS"/>
</VBox>
</content>
</Tab>
<Tab text="Schedule">
<content>
<VBox fx:id="scheduleList" styleClass="pane-with-border" minWidth="340" prefWidth="340" VBox.vgrow="ALWAYS">
<padding>
<Insets top="20" right="0" bottom="0" left="0" />
</padding>
<Label text="schedule"> </Label>
<StackPane fx:id="scheduleListPanelPlaceholder" VBox.vgrow="ALWAYS"/>
</VBox>
</content>
</Tab>
</tabs></TabPane>
</VBox>