Skip to content

Commit

Permalink
Fix colon bug -Tyler + george
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharqosity committed Jan 31, 2017
1 parent 7044581 commit 458c9e6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 27 deletions.
1 change: 1 addition & 0 deletions src/main/java/WHS_planner/Calendar/CalendarUtility.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public CalendarBox[][] CalendarLoad(int startDay, int numberOfDays, JSON json,
System.out.println(rawTask[1].toString());

Task task = new Task(rawTask[0].toString().substring(21), "", rawTask[1].toString().substring(21));

tasks.add(task);
taskIndex ++;
}catch(Exception e){
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/WHS_planner/Calendar/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ public Pane getPane(CalendarBox box){

Text spaces = new Text(" ");


if (Class == null||Class.isEmpty()) //If there is no class
System.out.println("CLASS: " + Class);
String tester = Class;
if (Class == null||Class.isEmpty()||tester.replaceAll(" ", "").length() == 0||Class.equals("")) //If there is no class
{
Description = replaceBeginingSpace(Description);
label = new Text(Description);
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/WHS_planner/News/ui/NewsUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,13 @@ public class NewsUI extends Pane {

private static final double BOX_WIDTH = 250;
private static final double IMAGE_WIDTH = 250;
// private static final double IMAGE_HEIGHT = 200;

private RSSFeedParser parser = new RSSFeedParser("https://waylandstudentpress.com/feed/");
private Feed feed = parser.readFeed();
private List<FeedMessage> feedArray = feed.getMessages();
private VBox cardView = new VBox();

public NewsUI() {

cardView.getStylesheets().add("News" + File.separator + "NewsUI.css");

//Checks if feed sends back a connection error. If it doesn't, initialize cards as normal.
Expand Down
24 changes: 1 addition & 23 deletions src/main/java/WHS_planner/UI/Home.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class Home extends Pane {

Home(CalendarYear calendar, Pane newsUI) {
globalTime = new GlobalTime(calendar.getSchedule().getCheck());

File day = new File("Documents" + File.separator + "DayArray.json");
if(day.exists()) {
pc.readData();
Expand All @@ -57,14 +56,11 @@ class Home extends Pane {
progressBar.getStyleClass().setAll("progress-bar");
// progressBar.setScaleY(3);
hackTooltipStartTiming(tooltip);

//Force initial timer update
// progressBar.setProgress(100);
// progressBar.setProgress(0);
// String currentClass = calendar.getSchedule().getToday(globalTime.getLetterDay())[classIndex].getClassName();



//Initialize NEWS
ScrollPane newsScroll = new ScrollPane();
newsScroll.setContent(newsUI);
Expand All @@ -80,8 +76,6 @@ class Home extends Pane {
newsScroll.setMaxWidth(280);
newsScroll.setPrefHeight(this.getPrefHeight());



insidePane.setPadding(new Insets(0, 0, 5, 5)); //top, right, bottom, left

//Add Nodes to H/VBoxes
Expand All @@ -102,20 +96,16 @@ class Home extends Pane {
outsidePane.prefHeightProperty().bind(this.heightProperty());
outsidePane.prefWidthProperty().bind(this.widthProperty());


progressBar.prefWidthProperty().bind(insidePane.widthProperty());
// VBox parent = (VBox)progressBar.getParent();
// progressBar.setPrefWidth(parent.getWidth());
Platform.runLater(() -> {

// VBox parent = (VBox)progressBar.getParent();
// progressBar.setPrefWidth(parent.getWidth());

String today = (Calendar.getInstance().get(Calendar.MONTH) + 1) + "/" + Calendar.getInstance().get(Calendar.DAY_OF_MONTH);
double d = 1.0 - progressVal();
progressBar.setProgress(d);
int classIndex = globalTime.getClassIndex();

if(day.exists() && day.length() > 0 && calendar.getSchedule().isLoggedIn()) {
if (classIndex == -1 || pc.getDay(today).length() != 1) {
progressBar.setTooltip(null);
Expand Down Expand Up @@ -143,7 +133,6 @@ class Home extends Pane {
String today = (Calendar.getInstance().get(Calendar.MONTH) + 1) + "/" + Calendar.getInstance().get(Calendar.DAY_OF_MONTH);
double d = 1.0 - progressVal();
progressBar.setProgress(d);

int classIndex = globalTime.getClassIndex();
if (day.exists()&& day.length() > 0 && calendar.getSchedule().isLoggedIn()) {
if (classIndex == -1 || pc.getDay(today).length() != 1) {
Expand Down Expand Up @@ -171,12 +160,9 @@ class Home extends Pane {
checkBox = calendar.getSchedule().getCheck();
globalTime = new GlobalTime(checkBox);
checkBox.setOnAction(e -> Platform.runLater(() -> {


String today = (Calendar.getInstance().get(Calendar.MONTH) + 1) + "/" + Calendar.getInstance().get(Calendar.DAY_OF_MONTH);
double d = 1.0 - progressVal();
progressBar.setProgress(d);

int classIndex = globalTime.getClassIndex();
if (day.exists()&& day.length() > 0 && calendar.getSchedule().isLoggedIn()) {
if (classIndex == -1 || pc.getDay(today).length() != 1) {
Expand All @@ -199,7 +185,6 @@ class Home extends Pane {
// VBox parent = (VBox)progressBar.getParent();
// progressBar.setPrefWidth(parent.getWidth());
}));

this.getChildren().setAll(outsidePane);
}

Expand All @@ -219,13 +204,10 @@ private static void hackTooltipStartTiming(Tooltip tooltip) {
}

private double progressVal() {

int n = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
if(n == Calendar.SATURDAY || n == Calendar.SUNDAY)
{
if(n == Calendar.SATURDAY || n == Calendar.SUNDAY) {
return 1;
}

Date date = new Date();
DateFormat df = new SimpleDateFormat("HH:mm");
String dateS = df.format(date);
Expand Down Expand Up @@ -271,8 +253,6 @@ else if (checkBox.isSelected()) {
} else {
mod = 1;
}

// return 1;
}
//other days
else {
Expand Down Expand Up @@ -343,8 +323,6 @@ private int timeLeft() {
} else {
mod = 1;
}

// return 1;
} else {
if (num >= 450 && num < 512) {
mod = (512 - num);
Expand Down

0 comments on commit 458c9e6

Please sign in to comment.