Skip to content

Commit

Permalink
Merge pull request #73 from palexdev/staging
Browse files Browse the repository at this point in the history
Version 12.2.0, merge from staging
  • Loading branch information
palexdev authored Jul 13, 2021
2 parents defc5f6 + 4bd4f20 commit fcd1302
Show file tree
Hide file tree
Showing 311 changed files with 9,935 additions and 4,583 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,5 @@ out/
!gradle-wrapper.jar

# Others
demo/src/main/java/io/github/palexdev/materialfx/demo/TestDemo.java
demo/src/main/resources/io/github/palexdev/materialfx/demo/css/TestDemo.css
materialfx/src/test
demo/scenicView.properties
827 changes: 159 additions & 668 deletions LICENSE

Large diffs are not rendered by default.

19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ To date MaterialFX offers not only restyled controls, but also: new and unique c
</details>
<p></p>

<details>
<summary>Sliders</summary>
<br>
<img src="https://s6.gifyu.com/images/Sliders.gif" alt="Sliders" border="0">
</details>
<p></p>


<details>
<summary>Stepper</summary>
<br>
Expand Down Expand Up @@ -233,7 +241,7 @@ repositories {
}
dependencies {
implementation 'io.github.palexdev:materialfx:11.11.1'
implementation 'io.github.palexdev:materialfx:11.12.0'
}
```

Expand All @@ -243,15 +251,16 @@ implementation 'io.github.palexdev:materialfx:11.11.1'
<dependency>
<groupId>io.github.palexdev</groupId>
<artifactId>materialfx</artifactId>
<version>11.11.1</version>
<version>11.12.0</version>
</dependency>
```

<!-- ROADMAP -->

## Roadmap

See the [open issues](https://github.com/palexdev/MaterialFX/issues) for a list of proposed features (and known issues).
See the [open issues](https://github.com/palexdev/MaterialFX/issues) for a list of proposed features (and known issues).
See the [ROADMAP](https://github.com/palexdev/MaterialFX/blob/main/ROADMAP.md) for a list of implemented and upcoming features.

<!-- CONTRIBUTING -->

Expand All @@ -270,7 +279,7 @@ contributions you make are **greatly appreciated**.

## License

Distributed under the GNU GPLv3 License. See `LICENSE` for more information.
Distributed under the GNU LGPLv3 License. See `LICENSE` for more information.

<!-- CONTACT -->

Expand All @@ -296,6 +305,8 @@ donation here. [![Donate](https://img.shields.io/badge/$-support-green.svg?style
(If you want your github page to be linked here and you didn't specify your username in the donation, feel free to contact me by email and tell me. Also contact me if for some some reason you don't want to be listed here)

- Alex Hawk
- Yiding He
- Alaa Abu Zidan
- *Your name can be here by supporting me at this link, [Support](https://bit.ly/31XB8zD)*

Thank you very very much to all supporters, to all people who contribute to the project, to all people that thanked me, you really made my day
3 changes: 2 additions & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

- [ ] *MFXCard*
- [ ] *MFXChipView(?)*
- [ ] *MFXSlider*
- [x] *MFXSlider*
- [ ] *MFXRangeSlider*
- [ ] *MFXHighlighter(?)*
<br></br>
- [ ] *MFXColorPicker*
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group 'io.github.palexdev'
version '11.11.1'
version '11.12.0'

repositories {
mavenCentral()
Expand All @@ -16,7 +16,7 @@ subprojects {

javafx {
version = "16"
modules = [ 'javafx.controls', 'javafx.fxml', 'javafx.swing', 'javafx.web' ]
modules = [ 'javafx.controls', 'javafx.fxml', 'javafx.media', 'javafx.swing', 'javafx.web' ]
}
}

Expand Down
26 changes: 13 additions & 13 deletions demo/src/main/java/io/github/palexdev/materialfx/demo/Demo.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2021 Parisi Alessandro
* This file is part of MaterialFX (https://github.com/palexdev/MaterialFX).
* Copyright (C) 2021 Parisi Alessandro
* This file is part of MaterialFX (https://github.com/palexdev/MaterialFX).
*
* MaterialFX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* MaterialFX is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* MaterialFX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* MaterialFX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MaterialFX. If not, see <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU Lesser General Public License
* along with MaterialFX. If not, see <http://www.gnu.org/licenses/>.
*/

package io.github.palexdev.materialfx.demo;
Expand All @@ -38,7 +38,7 @@ public class Demo extends Application {
public void start(Stage primaryStage) throws IOException {
CSSFX.start();

FXMLLoader fxmlLoader = new FXMLLoader(MFXResourcesLoader.load("Demo.fxml"));
FXMLLoader fxmlLoader = new FXMLLoader(MFXDemoResourcesLoader.loadURL("Demo.fxml"));
fxmlLoader.setControllerFactory(controller -> new DemoController(primaryStage, getHostServices()));
StackPane demoPane = fxmlLoader.load();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright (C) 2021 Parisi Alessandro
* This file is part of MaterialFX (https://github.com/palexdev/MaterialFX).
*
* MaterialFX is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* MaterialFX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with MaterialFX. If not, see <http://www.gnu.org/licenses/>.
*/

package io.github.palexdev.materialfx.demo;

import java.io.InputStream;
import java.net.URL;

/**
* Utility class which manages the access to this project's assets.
* Helps keeping the assets files structure organized.
*/
public class MFXDemoResourcesLoader {

private MFXDemoResourcesLoader() {
}

public static URL loadURL(String path) {
return MFXDemoResourcesLoader.class.getResource(path);
}

public static String load(String path) {
return loadURL(path).toString();
}

public static InputStream loadStream(String name) {
return MFXDemoResourcesLoader.class.getResourceAsStream(name);
}

}

This file was deleted.

132 changes: 132 additions & 0 deletions demo/src/main/java/io/github/palexdev/materialfx/demo/TestDemo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
/*
* Copyright (C) 2021 Parisi Alessandro
* This file is part of MaterialFX (https://github.com/palexdev/MaterialFX).
*
* MaterialFX is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* MaterialFX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with MaterialFX. If not, see <http://www.gnu.org/licenses/>.
*/

package io.github.palexdev.materialfx.demo;

import io.github.palexdev.materialfx.controls.MFXButton;
import io.github.palexdev.materialfx.controls.MFXIconWrapper;
import io.github.palexdev.materialfx.controls.MFXRectangleToggleNode;
import io.github.palexdev.materialfx.controls.MFXTableView;
import io.github.palexdev.materialfx.controls.cell.MFXTableColumn;
import io.github.palexdev.materialfx.controls.cell.MFXTableRowCell;
import io.github.palexdev.materialfx.demo.model.FilterablePerson;
import io.github.palexdev.materialfx.font.FontResources;
import io.github.palexdev.materialfx.font.MFXFontIcon;
import io.github.palexdev.materialfx.utils.ColorUtils;
import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import org.scenicview.ScenicView;

import java.util.Random;

@SuppressWarnings("All")
public class TestDemo extends Application {
private final Random random = new Random(System.currentTimeMillis());

@Override
public void start(Stage primaryStage) {
VBox box = new VBox(100);
box.setAlignment(Pos.CENTER);

HBox bbox = new HBox(20);
bbox.setAlignment(Pos.CENTER);

MFXButton b1 = new MFXButton("Set Leading");
MFXButton b2 = new MFXButton("Set Trailing");
MFXButton b3 = new MFXButton("Set Graphic");
MFXButton b4 = new MFXButton("Remove Graphic");
MFXButton b5 = new MFXButton("Remove Label Graphic");
MFXRectangleToggleNode rtn = new MFXRectangleToggleNode("");
rtn.setPrefSize(32, 32);
rtn.setAlignment(Pos.CENTER);

b1.setOnAction(event -> {
rtn.setLabelLeadingIcon(MFXFontIcon.getRandomIcon(12, ColorUtils.getRandomColor()));
});
b2.setOnAction(event -> {
rtn.setLabelTrailingIcon(MFXFontIcon.getRandomIcon(12, ColorUtils.getRandomColor()));
});
b3.setOnAction(event -> {
rtn.setGraphic(MFXFontIcon.getRandomIcon(12, ColorUtils.getRandomColor()));
});
b4.setOnAction(event -> {
rtn.setGraphic(null);
});
b5.setOnAction(event -> {
rtn.setLabelLeadingIcon(null);
rtn.setLabelTrailingIcon(null);
});

bbox.getChildren().addAll(b1, b2, b3, b4, b5);

box.getChildren().addAll(rtn, bbox);
box.getStylesheets().add(MFXDemoResourcesLoader.load("css/TestDemo.css"));

Scene scene = new Scene(box, 800, 600);
primaryStage.setScene(scene);
primaryStage.show();

ScenicView.show(scene);
}

public static void main(String[] args) {
launch(args);
}

private static boolean isInvalidCharacter(char c) {
if (c == 0x7F) return true;
if (c == 0xA) return true;
if (c == 0x9) return true;
return c < 0x20;
}

public MFXIconWrapper getRandomIcon(double size) {
FontResources[] resources = FontResources.values();
String desc = resources[random.nextInt(resources.length)].getDescription();
return new MFXIconWrapper(new MFXFontIcon(desc, size, ColorUtils.getRandomColor()), size * 1.5);
}

private void setupTable(MFXTableView<FilterablePerson> tableView) {
MFXTableColumn<FilterablePerson> firstName = new MFXTableColumn<>("FName");
MFXTableColumn<FilterablePerson> lastName = new MFXTableColumn<>("LName");
MFXTableColumn<FilterablePerson> address = new MFXTableColumn<>("Address");
MFXTableColumn<FilterablePerson> age = new MFXTableColumn<>("age");

firstName.setRowCellFunction(person -> new MFXTableRowCell(person.firstNameProperty()));
lastName.setRowCellFunction(person -> new MFXTableRowCell(person.lastNameProperty()));
address.setRowCellFunction(person -> new MFXTableRowCell(person.addressProperty()));
age.setRowCellFunction(person -> new MFXTableRowCell(person.ageProperty().asString()));

tableView.getTableColumns().addAll(firstName, lastName, address, age);
//tableView.setItems(people);
}

public String randStr() {
int leftLimit = 97; // letter 'a'
int rightLimit = 122; // letter 'z'
int targetStringLength = 30;
return random.ints(leftLimit, rightLimit + 1)
.limit(targetStringLength)
.collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append)
.toString();
}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2021 Parisi Alessandro
* This file is part of MaterialFX (https://github.com/palexdev/MaterialFX).
* Copyright (C) 2021 Parisi Alessandro
* This file is part of MaterialFX (https://github.com/palexdev/MaterialFX).
*
* MaterialFX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* MaterialFX is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* MaterialFX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* MaterialFX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MaterialFX. If not, see <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU Lesser General Public License
* along with MaterialFX. If not, see <http://www.gnu.org/licenses/>.
*/

package io.github.palexdev.materialfx.demo.controllers;
Expand Down
Loading

0 comments on commit fcd1302

Please sign in to comment.