diff --git a/SmartNotes/smartnotes/.gitignore b/SmartNotes/smartnotes/.gitignore
new file mode 100644
index 0000000..66892a0
--- /dev/null
+++ b/SmartNotes/smartnotes/.gitignore
@@ -0,0 +1,2 @@
+\.idea
+*\.iml
diff --git a/SmartNotes/smartnotes/pom.xml b/SmartNotes/smartnotes/pom.xml
index 8df9c24..7eeaa71 100644
--- a/SmartNotes/smartnotes/pom.xml
+++ b/SmartNotes/smartnotes/pom.xml
@@ -1,39 +1,41 @@
- 4.0.0
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 4.0.0
- com.madeorsk
- smartnotes
- 1.0
- jar
+ com.madeorsk
+ smartnotes
+ 0.5
+ jar
- SmartNotes
- https://smartnotes.madeorsk.com
+ SmartNotes
+ https://smartnotes.madeorsk.com
-
- UTF-8
-
+
+ UTF-8
+ 1.8
+ 1.8
+
-
-
- junit
- junit
- 3.8.1
- test
-
-
- com.vladsch.flexmark
- flexmark
- 0.26.2
-
-
- com.1stleg
- jnativehook
- 2.1.0
-
-
-
- Madeorsk
- https://madeorsk.com
-
+
+
+ junit
+ junit
+ 3.8.1
+ test
+
+
+ com.vladsch.flexmark
+ flexmark
+ 0.26.2
+
+
+ com.1stleg
+ jnativehook
+ 2.1.0
+
+
+
+ Madeorsk
+ https://madeorsk.com
+
diff --git a/SmartNotes/smartnotes/src/main/java/com/madeorsk/smartnotes/ExplorerItem.java b/SmartNotes/smartnotes/src/main/java/com/madeorsk/smartnotes/ExplorerItem.java
index 241bac7..fb99efb 100644
--- a/SmartNotes/smartnotes/src/main/java/com/madeorsk/smartnotes/ExplorerItem.java
+++ b/SmartNotes/smartnotes/src/main/java/com/madeorsk/smartnotes/ExplorerItem.java
@@ -3,7 +3,6 @@ package com.madeorsk.smartnotes;
import com.madeorsk.smartnotes.notes.Note;
import com.madeorsk.smartnotes.paths.FolderPath;
-import javafx.event.EventHandler;
import javafx.geometry.Pos;
import javafx.scene.Cursor;
import javafx.scene.control.Label;
@@ -16,31 +15,26 @@ public class ExplorerItem extends HBox
{
private boolean folder;
private Object item;
-
+
public ExplorerItem(boolean folder, Object item, final NotesExplorer explorer)
{
this.folder = folder;
this.item = item;
-
+
this.setCursor(Cursor.HAND);
- this.setOnMouseClicked(new EventHandler()
- {
- @Override
- public void handle(MouseEvent event)
+ this.setOnMouseClicked((MouseEvent event) -> {
+ if (ExplorerItem.this.folder)
+ explorer.goToFolder((FolderPath) ExplorerItem.this.item);
+ else
{
- if (ExplorerItem.this.folder)
- explorer.goToFolder((FolderPath) ExplorerItem.this.item);
- else
- {
- explorer.requestLoad((Note) ExplorerItem.this.item);
- SmartNotes.instance.setContent(((Note) ExplorerItem.this.item).getViewBox(explorer));
- }
+ explorer.requestLoad((Note) ExplorerItem.this.item);
+ SmartNotes.instance.setContent(((Note) ExplorerItem.this.item).getViewBox(explorer));
}
});
-
+
this.setAlignment(Pos.CENTER_LEFT);
this.setSpacing(10);
-
+
if (this.folder)
{
FolderPath folderPath = (FolderPath) this.item;
@@ -58,17 +52,17 @@ public class ExplorerItem extends HBox
this.getChildren().add(noteNameLabel);
}
}
-
+
public ExplorerItem setFolderIcon(String path)
{
this.getChildren().clear();
-
+
FolderPath folderPath = (FolderPath) this.item;
this.getChildren().add(new ImageView(new Image(path)));
Label folderNameLabel = new Label(folderPath.getName());
folderNameLabel.setId("noteItemName");
this.getChildren().add(folderNameLabel);
-
+
return this;
}
}
diff --git a/SmartNotes/smartnotes/src/main/java/com/madeorsk/smartnotes/ListBox.java b/SmartNotes/smartnotes/src/main/java/com/madeorsk/smartnotes/ListBox.java
index 7444666..64133e6 100644
--- a/SmartNotes/smartnotes/src/main/java/com/madeorsk/smartnotes/ListBox.java
+++ b/SmartNotes/smartnotes/src/main/java/com/madeorsk/smartnotes/ListBox.java
@@ -9,7 +9,6 @@ import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableBooleanValue;
import javafx.beans.value.ObservableValue;
-import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Cursor;
@@ -27,24 +26,24 @@ import javafx.util.Duration;
public class ListBox extends ScrollPane
{
private boolean editable;
-
+
private VBox main;
private VBox listContainer;
-
+
private Runnable listChangeListener;
-
+
public ListBox(boolean editable)
{
this.editable = editable;
-
+
this.setFitToHeight(true);
this.setFitToWidth(true);
-
+
this.main = new VBox();
this.main.setPadding(new Insets(0, 15, 0, 15));
this.listContainer = new VBox();
this.main.getChildren().add(this.listContainer);
-
+
if (this.editable)
{
final HBox addListItemBox = new HBox();
@@ -58,59 +57,44 @@ public class ListBox extends ScrollPane
addListItemBox.setCursor(Cursor.HAND);
// Fade and opacity
addListItemBox.setOpacity(0.4);
- addListItemBox.setOnMouseEntered(new EventHandler()
- {
- @Override
- public void handle(MouseEvent e)
- {
- FadeTransition transition = new FadeTransition(Duration.millis(200), addListItemBox);
- transition.setFromValue(0.4);
- transition.setToValue(1.0);
- transition.play();
- }
+ addListItemBox.setOnMouseEntered((MouseEvent e) -> {
+ FadeTransition transition = new FadeTransition(Duration.millis(200), addListItemBox);
+ transition.setFromValue(0.4);
+ transition.setToValue(1.0);
+ transition.play();
});
- addListItemBox.setOnMouseExited(new EventHandler()
- {
- @Override
- public void handle(MouseEvent e)
- {
- FadeTransition transition = new FadeTransition(Duration.millis(200), addListItemBox);
- transition.setFromValue(1.0);
- transition.setToValue(0.4);
- transition.play();
- }
+ addListItemBox.setOnMouseExited((MouseEvent e) -> {
+ FadeTransition transition = new FadeTransition(Duration.millis(200), addListItemBox);
+ transition.setFromValue(1.0);
+ transition.setToValue(0.4);
+ transition.play();
});
- addListItemBox.setOnMouseClicked(new EventHandler()
- {
- @Override
- public void handle(MouseEvent e)
- {
- ListBox.this.listContainer.getChildren().add(new ListBoxItem("", ListBox.this.editable));
- }
+ addListItemBox.setOnMouseClicked((MouseEvent e) -> {
+ ListBox.this.listContainer.getChildren().add(new ListBoxItem("", ListBox.this.editable));
});
}
this.main.getChildren().add(addListItemBox);
}
-
+
this.setContent(this.main);
}
-
+
public void updateList(Map content)
{
this.listContainer.getChildren().clear();
- for(String item : content.keySet())
+ for (String item : content.keySet())
this.listContainer.getChildren().add(new ListBoxItem(item, this.editable).setChecked(content.get(item).booleanValue()));
}
-
+
public void setListChangeListener(Runnable listener)
{
this.listChangeListener = listener;
}
-
+
public Map getList()
{
Map list = new HashMap();
- for(Node child : this.listContainer.getChildren())
+ for (Node child : this.listContainer.getChildren())
{
ListBoxItem item = (ListBoxItem) child;
if (item.getText() != null && !item.getText().isEmpty())
@@ -118,22 +102,17 @@ public class ListBox extends ScrollPane
}
return list;
}
-
+
private class ListBoxItem extends HBox
{
private ListCheckbox checkbox;
private TextField field;
-
+
public ListBoxItem(String text, boolean editable)
{
- ChangeListener