-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds-ons. Themes now installable jars (docs to follow).
- Loading branch information
1 parent
4fcf28d
commit ad61d4d
Showing
42 changed files
with
1,086 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/bin/ | ||
/snake-theme-test/ |
Binary file added
BIN
+146 KB
...themes/snake-theme-abluelife/src/main/resources/themes/abluelife/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+146 KB
.../snake-theme-agreenfuture/src/main/resources/themes/agreenfuture/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+150 KB
...nake-theme-anorangetwist/src/main/resources/themes/anorangetwist/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+151 KB
...emes/snake-theme-apinkburst/src/main/resources/themes/apinkburst/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+150 KB
...es/snake-theme-apurplehaze/src/main/resources/themes/apurplehaze/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+146 KB
snake-themes/snake-theme-aredsky/src/main/resources/themes/aredsky/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+156 KB
...es/snake-theme-awhitelight/src/main/resources/themes/awhitelight/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+150 KB
.../snake-theme-ayellowdwarf/src/main/resources/themes/ayellowdwarf/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
snake-ui/src/main/java/uk/co/bithatch/snake/ui/AbstractAddOn.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
package uk.co.bithatch.snake.ui; | ||
|
||
import java.io.IOException; | ||
import java.net.URL; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public abstract class AbstractAddOn implements AddOn { | ||
|
||
|
||
protected String name; | ||
protected String url; | ||
protected String license; | ||
protected String description; | ||
protected String author; | ||
protected String id; | ||
protected Path archive; | ||
protected URL location; | ||
|
||
public AbstractAddOn() { | ||
super(); | ||
} | ||
|
||
@Override | ||
public URL getLocation() { | ||
return location; | ||
} | ||
|
||
@Override | ||
public String getId() { | ||
return id; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
@Override | ||
public String getUrl() { | ||
return url; | ||
} | ||
|
||
public void setUrl(String url) { | ||
this.url = url; | ||
} | ||
|
||
@Override | ||
public String getLicense() { | ||
return license; | ||
} | ||
|
||
public void setLicense(String license) { | ||
this.license = license; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public void setDescription(String description) { | ||
this.description = description; | ||
} | ||
|
||
@Override | ||
public String getAuthor() { | ||
return author; | ||
} | ||
|
||
public void setAuthor(String author) { | ||
this.author = author; | ||
} | ||
|
||
public Path getArchive() { | ||
return archive; | ||
} | ||
|
||
public void setArchive(Path archive) { | ||
this.archive = archive; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package uk.co.bithatch.snake.ui; | ||
|
||
import java.net.URL; | ||
import java.nio.file.Path; | ||
|
||
public interface AddOn { | ||
|
||
URL getLocation(); | ||
|
||
String getId(); | ||
|
||
String getName(); | ||
|
||
String getUrl(); | ||
|
||
String getLicense(); | ||
|
||
String getDescription(); | ||
|
||
String getAuthor(); | ||
|
||
URL getScreenshot(); | ||
|
||
Path getArchive(); | ||
|
||
default boolean isSystem() { | ||
return getArchive() == null; | ||
} | ||
|
||
} |
42 changes: 42 additions & 0 deletions
42
snake-ui/src/main/java/uk/co/bithatch/snake/ui/AddOnDetails.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package uk.co.bithatch.snake.ui; | ||
|
||
import java.net.URL; | ||
|
||
import javafx.event.ActionEvent; | ||
import javafx.fxml.FXML; | ||
import javafx.scene.control.Label; | ||
import javafx.scene.image.Image; | ||
import javafx.scene.image.ImageView; | ||
|
||
public class AddOnDetails extends AbstractDeviceController { | ||
|
||
@FXML | ||
private Label author; | ||
@FXML | ||
private Label addOnType; | ||
@FXML | ||
private Label addOnName; | ||
@FXML | ||
private ImageView screenshot; | ||
|
||
@Override | ||
protected void onConfigure() throws Exception { | ||
} | ||
|
||
public void setAddOn(AddOn addOn) { | ||
author.textProperty().set(addOn.getAuthor()); | ||
addOnType.textProperty().set(addOn.getClass().getSimpleName()); | ||
addOnName.textProperty().set(addOn.getName()); | ||
URL ss = addOn.getScreenshot(); | ||
if (ss == null) { | ||
// screenshot.setImage(new Image(ss, true)); | ||
} else | ||
screenshot.setImage(new Image(ss.toExternalForm(), true)); | ||
} | ||
|
||
@FXML | ||
void evtSelect(ActionEvent evt) { | ||
// context.push(DeviceDetails.class, this, Direction.FROM_RIGHT); | ||
} | ||
|
||
} |
Oops, something went wrong.