Skip to content

Commit

Permalink
Remove BrowserPanel and SplitPanel from app
Browse files Browse the repository at this point in the history
  • Loading branch information
Skaty committed Oct 21, 2016
1 parent dd3625e commit c5af20d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 31 deletions.
14 changes: 2 additions & 12 deletions src/main/java/seedu/task/ui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public class MainWindow extends UiPart {
private Logic logic;

// Independent Ui parts residing in this Ui container
private BrowserPanel browserPanel;
private TaskListPanel taskListPanel;
private ResultDisplay resultDisplay;
private StatusBarFooter statusBarFooter;
Expand All @@ -42,9 +41,9 @@ public class MainWindow extends UiPart {
private Scene scene;

private String taskManagerName;

@FXML
private AnchorPane browserPlaceholder;
private VBox taskList;

@FXML
private AnchorPane commandBoxPlaceholder;
Expand Down Expand Up @@ -108,7 +107,6 @@ private void setAccelerators() {
}

void fillInnerParts() {
browserPanel = BrowserPanel.load(browserPlaceholder);
taskListPanel = TaskListPanel.load(primaryStage, getTaskListPlaceholder(), logic.getFilteredTaskList());
resultDisplay = ResultDisplay.load(primaryStage, getResultDisplayPlaceholder());
statusBarFooter = StatusBarFooter.load(primaryStage, getStatusbarPlaceholder(), config.getTaskManagerFilePath());
Expand Down Expand Up @@ -185,12 +183,4 @@ private void handleExit() {
public TaskListPanel getTaskListPanel() {
return this.taskListPanel;
}

public void loadTaskPage(ReadOnlyTask task) {
browserPanel.loadTaskPage(task);
}

public void releaseResources() {
browserPanel.freeResources();
}
}
2 changes: 0 additions & 2 deletions src/main/java/seedu/task/ui/UiManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public void start(Stage primaryStage) {
public void stop() {
prefs.updateLastUsedGuiSetting(mainWindow.getCurrentGuiSetting());
mainWindow.hide();
mainWindow.releaseResources();
}

private void showFileOperationAlertAndWait(String description, String details, Throwable cause) {
Expand Down Expand Up @@ -120,7 +119,6 @@ private void handleJumpToListRequestEvent(JumpToListRequestEvent event) {
@Subscribe
private void handleTaskPanelSelectionChangedEvent(TaskPanelSelectionChangedEvent event){
logger.info(LogsCenter.getEventHandlingLogMessage(event));
mainWindow.loadTaskPage(event.getNewSelection());
}

}
25 changes: 8 additions & 17 deletions src/main/resources/view/MainWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,14 @@
</Menu>
</menus>
</MenuBar>
<SplitPane id="splitPane" fx:id="splitPane" dividerPositions="0.4" VBox.vgrow="ALWAYS">
<items>
<VBox fx:id="taskList" minWidth="340" prefWidth="340">
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
</padding>
<children>
<AnchorPane fx:id="taskListPanelPlaceholder" VBox.vgrow="ALWAYS"/>
</children>
</VBox>
<AnchorPane fx:id="browserPlaceholder" prefWidth="340" >
<padding>
<Insets top="10" bottom="10" left="10" right="10"/>
</padding>
</AnchorPane>
</items>
</SplitPane>
<VBox fx:id="taskList" styleClass="background" minWidth="340" prefWidth="340" VBox.vgrow="ALWAYS">
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
</padding>
<children>
<AnchorPane fx:id="taskListPanelPlaceholder" VBox.vgrow="ALWAYS"/>
</children>
</VBox>
<AnchorPane VBox.vgrow="NEVER" fx:id="resultDisplayPlaceholder" styleClass="anchor-pane-with-border" minHeight="100" prefHeight="100" maxHeight="100">
<padding>
<Insets top="5.0" bottom="5.0" left="10.0" right="10.0"/>
Expand Down

0 comments on commit c5af20d

Please sign in to comment.