Skip to content

Commit

Permalink
Added DeepBlue theme.
Browse files Browse the repository at this point in the history
  • Loading branch information
kfwong committed Oct 18, 2016
1 parent ebddb9b commit 5619e3c
Show file tree
Hide file tree
Showing 3 changed files with 291 additions and 159 deletions.
102 changes: 102 additions & 0 deletions src/main/java/harmony/mastermind/ui/MainWindow.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package harmony.mastermind.ui;

import java.util.Random;
import java.util.logging.Logger;

import org.ocpsoft.prettytime.PrettyTime;
Expand All @@ -22,6 +23,7 @@
import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.ContentDisplay;
import javafx.scene.control.MenuItem;
import javafx.scene.control.SplitPane;
import javafx.scene.control.TabPane;
Expand All @@ -34,6 +36,10 @@
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.text.Text;
import javafx.scene.text.TextFlow;
import javafx.stage.Stage;

/**
Expand Down Expand Up @@ -366,6 +372,28 @@ public void updateIndex(int index) {
private void initName(TableColumn<ReadOnlyTask, String> nameColumn) {
nameColumn.prefWidthProperty().bind(taskTableHome.widthProperty().multiply(WIDTH_MULTIPLIER_NAME));
nameColumn.setCellValueFactory(task -> new ReadOnlyStringWrapper(task.getValue().getName()));
nameColumn.setCellFactory( col -> new TableCell<ReadOnlyTask, String>(){

@Override
public void updateItem(String item , boolean isEmpty){
super.updateItem(item, isEmpty);
if(!isEmpty()){

TextFlow textFlow = new TextFlow();

Text taskName = new Text(item);
taskName.setStyle("-fx-font-weight: bold; -fx-font-size: 18px; -fx-fill: deepSkyBlue;");

textFlow.getChildren().add(taskName);


this.setGraphic(textFlow);
this.setPrefHeight(50);

}

}
});
}

/**
Expand All @@ -383,6 +411,37 @@ private void initStartDate(TableColumn<ReadOnlyTask, String> startDateColumn) {
return new ReadOnlyStringWrapper("");
}
});
startDateColumn.setCellFactory( col -> new TableCell<ReadOnlyTask, String>(){

@Override
public void updateItem(String item , boolean isEmpty){
super.updateItem(item, isEmpty);
if(!isEmpty()){

TextFlow textFlow = new TextFlow();

String[] dates = item.split("\n");

if(dates.length>1){

Text prettyDate = new Text(dates[0]);
prettyDate.setStyle("-fx-font-weight:bold; -fx-fill: white;");

Text uglyDate = new Text(dates[1]);
uglyDate.setStyle("fx-font-style: oblique; -fx-fill: deepSkyBlue; -fx-font-size: 10px;");

textFlow.getChildren().add(prettyDate);
textFlow.getChildren().add(new Text("\n"));
textFlow.getChildren().add(uglyDate);


this.setGraphic(textFlow);
this.setPrefHeight(50);
}
}

}
});
}

/**
Expand All @@ -400,6 +459,37 @@ private void initEndDate(TableColumn<ReadOnlyTask, String> endDateColumn) {
return new ReadOnlyStringWrapper("");
}
});
endDateColumn.setCellFactory( col -> new TableCell<ReadOnlyTask, String>(){

@Override
public void updateItem(String item , boolean isEmpty){
super.updateItem(item, isEmpty);
if(!isEmpty()){

TextFlow textFlow = new TextFlow();

String[] dates = item.split("\n");

if(dates.length>1){

Text prettyDate = new Text(dates[0]);
prettyDate.setStyle("-fx-font-weight:bold; -fx-fill: white;");

Text uglyDate = new Text(dates[1]);
uglyDate.setStyle("fx-font-style: oblique; -fx-fill: deepSkyBlue; -fx-font-size: 10px;");

textFlow.getChildren().add(prettyDate);
textFlow.getChildren().add(new Text("\n"));
textFlow.getChildren().add(uglyDate);


this.setGraphic(textFlow);
this.setPrefHeight(50);
}
}

}
});
}

/**
Expand All @@ -409,6 +499,18 @@ private void initEndDate(TableColumn<ReadOnlyTask, String> endDateColumn) {
private void initTags(TableColumn<ReadOnlyTask, String> tagsColumn) {
tagsColumn.prefWidthProperty().bind(taskTableHome.widthProperty().multiply(WIDTH_MULTIPLIER_TAGS));
tagsColumn.setCellValueFactory(task -> new ReadOnlyStringWrapper(task.getValue().getTags().toString()));
tagsColumn.setCellFactory( col -> new TableCell<ReadOnlyTask, String>(){

@Override
public void updateItem(String item , boolean isEmpty){
super.updateItem(item, isEmpty);
if(!isEmpty()){
this.setText(item.replace(',', ' '));
this.setStyle("-fx-font-weight:bold;");
this.setWrapText(true);
}
}
});
}


Expand Down
73 changes: 73 additions & 0 deletions src/main/resources/view/MainWindow.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
.table-view {
-fx-base: #1d1d1d;
-fx-control-inner-background: #1d1d1d;
-fx-background-color: #1d1d1d;
-fx-table-cell-border-color: transparent;
-fx-table-header-border-color: transparent;
-fx-padding: 5;
}

.table-view .column-header-background {
-fx-background-color: transparent;
}

.table-view .column-header, .table-view .filler {
-fx-size: 35;
-fx-border-insets: 0 10 1 0;
}

.table-view .column-header .label {
-fx-font-size: 10pt;
-fx-font-family: "Verdana";
-fx-text-fill: lightGray;
-fx-alignment: center;
-fx-opacity: 1;
}

.table-view:focused .table-row-cell:filled:focused:selected {
-fx-background-color: -fx-focus-color;
}
.table-row-cell {
-fx-cell-size: 50px;
}

.text-field{
-fx-background-color: #3f3f3f;
-fx-font-size: 12pt;
-fx-font-family: "Lucida Console";
-fx-text-fill: deepSkyBlue;
-fx-border-radius: 0 0 0 0;
-fx-background-radius: 0 0 0 0;
}

.tab-pane .tab-header-area .headers-region,
.tab-pane .tab-header-area .tab-header-background{
-fx-background-color: #1d1d1d;
}

.tab-pane .tab-header-area .tab{
-fx-background-color: #1d1d1d;
}

.tab-pane .tab-header-area .tab-label{
-fx-text-fill: lightGray;
-fx-font-weight: bold;
-fx-font-style: oblique;
}

.tab-pane .tab-header-area .tab:selected .tab-label{
-fx-text-fill: deepSkyBlue;
-fx-font-weight: bold;
}

.split-pane:horizontal > .split-pane-divider {
-fx-background-color: deepSkyBlue;
}

.text-area,
.text-area .content{
-fx-background-color: #1d1d1d;
-fx-font-size: 12pt;
-fx-font-family: "Lucida Console";
-fx-text-fill: deepSkyBlue;
}

0 comments on commit 5619e3c

Please sign in to comment.