Skip to content

Commit

Permalink
Release 0.1.5
Browse files Browse the repository at this point in the history
Bugfix: Ressourcen in der jar-Datei dürfen nur als Stream und nicht als File gladen werden
  • Loading branch information
Tim Muehle committed Aug 24, 2020
1 parent 0fbb4cc commit 5a1ef4f
Show file tree
Hide file tree
Showing 12 changed files with 864 additions and 93 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
.DS_Store
/installer/
settings
err.txt
error.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
* @author Tim Mühle
*
* @since Bitchanger 0.1.0
* @version 0.1.4
* @version 0.1.5
*
*/
/* <!-- $LANGUAGE=EN -->
Expand All @@ -72,7 +72,7 @@
* @author Tim Mühle
*
* @since Bitchanger 0.1.0
* @version 0.1.4
* @version 0.1.5
*
*/
public class AlphaNumKeysController extends ControllerBase<AlphaNumKeys> {
Expand Down Expand Up @@ -158,8 +158,8 @@ public AlphaNumKeysController(AlphaNumKeys keys, Scene scene) {
this.buttonList = keys.getButtonMatrix();
this.isShowingKeyboard = false;

this.keyboardOpenGraphic = IconFactory.styleBindIcon(Resources.KEYBORD_OPEN_ICON, Resources.KEYBORD_OPEN_FILLED_ICON);
this.keyboardCloseGraphic = IconFactory.styleBindIcon(Resources.KEYBORD_CLOSE_ICON, Resources.KEYBORD_CLOSE_FILLED_ICON);
this.keyboardOpenGraphic = IconFactory.styleBindIcon(Resources.keybordOpenIconStream(), Resources.keybordOpenFilledIconStream());
this.keyboardCloseGraphic = IconFactory.styleBindIcon(Resources.keybordCloseIconStream(), Resources.keybordCloseFilledIconStream());
}


Expand Down
8 changes: 4 additions & 4 deletions src/main/java/bitchanger/gui/controls/AlphaNumKeys.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
* @author Tim Mühle
*
* @since Bitchanger 0.1.0
* @version 0.1.4
* @version 0.1.5
*
* @see AlphaNumKeysController
* @see UnfocusedButton
Expand Down Expand Up @@ -430,14 +430,14 @@ private void createMainMatrix() {
// TODO JavaDoc EN
private void createControlButtons() {
keyboardBtn = new UnfocusedButton("ABC");
FXUtils.setIconOrText(keyboardBtn, IconFactory.styleBindIcon(Resources.KEYBORD_OPEN_ICON, Resources.KEYBORD_OPEN_FILLED_ICON));
FXUtils.setIconOrText(keyboardBtn, IconFactory.styleBindIcon(Resources.keybordOpenIconStream(), Resources.keybordOpenFilledIconStream()));
addButton(keyboardBtn, firstColumn, firstRow + 3, KEYBOARD_BTN_KEY);

previousBtn = new UnfocusedButton();
nextBtn = new UnfocusedButton();

FXUtils.setIconOrText(previousBtn, IconFactory.ofSVGFile(Resources.ARROW_LEFT_ICON), "<");
FXUtils.setIconOrText(nextBtn, IconFactory.ofSVGFile(Resources.ARROW_RIGHT_ICON), ">");
FXUtils.setIconOrText(previousBtn, IconFactory.ofSVGFile(Resources.arrowLeftIconStream()), "<");
FXUtils.setIconOrText(nextBtn, IconFactory.ofSVGFile(Resources.arrowRightIconStream()), ">");

buttonMap.put(PREVIOUS_BTN_KEY, previousBtn);
buttonMap.put(NEXT_BTN_KEY, nextBtn);
Expand Down
32 changes: 16 additions & 16 deletions src/main/java/bitchanger/gui/controls/BasicMenuBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* @author Tim Mühle
*
* @since Bitchanger 0.1.4
* @version 0.1.4
* @version 0.1.5
*
* @see BasicMenuController
*/
Expand All @@ -53,7 +53,7 @@
* @author Tim Mühle
*
* @since Bitchanger 0.1.4
* @version 0.1.4
* @version 0.1.5
*
* @see BasicMenuController
*/
Expand Down Expand Up @@ -278,12 +278,12 @@ public void handle(ActionEvent event) {
*/
private void createMenuModus() {
Menu modus = new Menu("Modus");
FXUtils.setIconOrText(modus, IconFactory.ofSVGFile(Resources.MENU_ICON));
FXUtils.setIconOrText(modus, IconFactory.ofSVGFile(Resources.menuIconStream()));
addMenu(modus, MODUS_MENU_KEY);

MenuItem viewConverter = new MenuItem("Umrechner", IconFactory.ofSVGFile(Resources.SYNC_2_ICON));
MenuItem viewIEEE = new MenuItem("IEEE", IconFactory.ofSVGFile(Resources.TEXTFIELD_ICON));
MenuItem viewCalculator = new MenuItem("Berechnungen", IconFactory.styleBindIcon(Resources.CALCULATOR_SYMBOLS_ICON, Resources.CALCULATOR_SYMBOLS_FILLED_ICON));
MenuItem viewConverter = new MenuItem("Umrechner", IconFactory.ofSVGFile(Resources.sync_2_IconStream()));
MenuItem viewIEEE = new MenuItem("IEEE", IconFactory.ofSVGFile(Resources.textfieldIconStream()));
MenuItem viewCalculator = new MenuItem("Berechnungen", IconFactory.styleBindIcon(Resources.calculatorSymbolsIconStream(), Resources.calculatorSymbolsFilledIconStream()));

menuItemMap.put(MODUS_CONVERTER_ITEM_KEY, viewConverter);
menuItemMap.put(MODUS_IEEE_ITEM_KEY, viewIEEE);
Expand All @@ -304,7 +304,7 @@ private void createMenuModus() {
* "deutsch" and "englisch"
*/
private void createMenuOptions() {
Menu options = new Menu("Optionen", IconFactory.ofSVGFile(Resources.PREFERENCES_GEAR_3_ICON));
Menu options = new Menu("Optionen", IconFactory.ofSVGFile(Resources.preferencesGear_3_IconStream()));
addMenu(options, OPTIONS_MENU_KEY);

Menu chooseComma = new Menu("Komma w\u00E4hlen");
Expand All @@ -328,20 +328,20 @@ private void createMenuOptions() {
* Creates the Menu "Ansicht" with its Items "Stil", "Auf Monitor bewegen" and "Vollbild"
*/
private void createMenuView() {
Menu viewMenu = new Menu("Ansicht", IconFactory.ofSVGFile(Resources.WINDOW_THIN_2_ICON));
Menu viewMenu = new Menu("Ansicht", IconFactory.ofSVGFile(Resources.windowThin_2_IconStream()));
addMenu(viewMenu, MODUS_MENU_KEY);

Menu styleMenu = new Menu("Stil", IconFactory.ofSVGFile(Resources.PAINT_BRUSH_WINDOW_ICON));
MenuItem styleLight = new MenuItem("Hell", IconFactory.ofSVGFile(Resources.SUN_ICON));
MenuItem styleDark = new MenuItem("Dunkel", IconFactory.ofSVGFile(Resources.SUN_FILLED_ICON));
Menu styleMenu = new Menu("Stil", IconFactory.ofSVGFile(Resources.paintBrushWindowIconStream()));
MenuItem styleLight = new MenuItem("Hell", IconFactory.ofSVGFile(Resources.sunIconStream()));
MenuItem styleDark = new MenuItem("Dunkel", IconFactory.ofSVGFile(Resources.sunFilledIconStream()));

styleMenu.getItems().addAll(styleLight, styleDark);

menuItemMap.put(VIEW_STYLE_MENU_KEY, styleMenu);
menuItemMap.put(VIEW_STYLE_LIGHT_ITEM_KEY, styleLight);
menuItemMap.put(VIEW_STYLE_DARK_ITEM_KEY, styleDark);

Menu moveToScreen = new Menu("Auf Monitor bewegen", IconFactory.styleBindIcon(Resources.MONITOR_ICON, Resources.MONITOR_FILLED_ICON));
Menu moveToScreen = new Menu("Auf Monitor bewegen", IconFactory.styleBindIcon(Resources.monitorIconStream(), Resources.monitorFilledIconStream()));
CheckMenuItem showFullscreen = new CheckMenuItem("Vollbild");

menuItemMap.put(VIEW_MOVE_TO_SCREEN_ITEM_KEY, moveToScreen);
Expand All @@ -359,12 +359,12 @@ private void createMenuView() {
* Creates the Menu "Hilfe" with its Items "Über" and "Version"
*/
private void createMenuHelp() {
Menu help = new Menu("Hilfe", IconFactory.styleBindIcon(Resources.QUESTION_CIRCLE_ICON, Resources.QUESTION_CIRCLE_FILLED_ICON));
Menu help = new Menu("Hilfe", IconFactory.styleBindIcon(Resources.questionCircleIconStream(), Resources.questionCircleFilledIconStream()));
addMenu(help, HELP_MENU_KEY);

MenuItem about = new MenuItem("\u00DCber", IconFactory.styleBindIcon(Resources.QUESTION_SPEECH_BUBBLE_ICON, Resources.QUESTION_SPEECH_BUBBLE_FILLED_ICON));
MenuItem version = new MenuItem("Version", IconFactory.styleBindIcon(Resources.INFO_CIRCLE_ICON, Resources.INFO_CIRCLE_FILLED_ICON));
MenuItem resetPreferences = new MenuItem("Einstellungen zur\u00FCcksetzen", IconFactory.ofSVGFile(Resources.PREFERENCES_WRENCH_RESET_ICON));
MenuItem about = new MenuItem("\u00DCber", IconFactory.styleBindIcon(Resources.questionSpeechBubbleIconStream(), Resources.questionSpeechBubbleFilledIconStream()));
MenuItem version = new MenuItem("Version", IconFactory.styleBindIcon(Resources.infoCircleIconStream(), Resources.infoCircleFilledIconStream()));
MenuItem resetPreferences = new MenuItem("Einstellungen zur\u00FCcksetzen", IconFactory.ofSVGFile(Resources.preferencesWrenchResetIconStream()));

menuItemMap.put(HELP_ABOUT_ITEM_KEY, about);
menuItemMap.put(HELP_VERSION_ITEM_KEY, version);
Expand Down
14 changes: 12 additions & 2 deletions src/main/java/bitchanger/gui/controls/SVGIcon.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
package bitchanger.gui.controls;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

import bitchanger.util.FXUtils;
import javafx.beans.value.ChangeListener;
Expand Down Expand Up @@ -45,8 +48,15 @@ public SVGIcon() {
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

// TODO JavaDoc
public SVGIcon(File svgFile) {
this(FXUtils.loadSVG(svgFile));
public SVGIcon(File svgFile) throws FileNotFoundException {
this(new FileInputStream(svgFile));
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

// TODO JavaDoc
public SVGIcon(InputStream svgIn) {
this(FXUtils.loadSVG(svgIn));
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/bitchanger/gui/views/AlphaNumGridView.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
* @author Tim Mühle
*
* @since Bitchanger 0.1.4
* @version 0.1.4
* @version 0.1.5
*
*/
// TODO JavaDoc EN
Expand Down Expand Up @@ -425,9 +425,10 @@ public AlphaNumGridView(int firstLabelRow, int labelColumn, int firstTFRow, int
this.backspaceBtnKey = "backspaceBtn";

this.btnTexts = new HashMap<String, Object>();
SVGIcon trashIcon = IconFactory.styleBindIcon(Resources.TRASH_X_ICON, Resources.TRASH_X_FILLED_ICON);
SVGIcon trashIcon = IconFactory.styleBindIcon(Resources.trashIconStream(), Resources.trashXFilledIconStream());
this.btnTexts.put(clearBtnKey, trashIcon == null ? "AC" : trashIcon);
SVGIcon backSpaceIcon = IconFactory.styleBindIcon(Resources.X_MARK_ARROW_LEFT_ICON, Resources.X_MARK_ARROW_LEFT_FILLED_ICON);
SVGIcon backSpaceIcon = IconFactory.styleBindIcon(Resources.xMarkArrowLeftIconStream(), Resources.xMarkArrowLeftFilledIconStream());
System.out.println(backSpaceIcon);
this.btnTexts.put(backspaceBtnKey, backSpaceIcon == null ? "<--" : backSpaceIcon);

this.center = new GridPane();
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/bitchanger/gui/views/CalculatorView.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package bitchanger.gui.views;

import java.io.File;
import java.io.InputStream;
import java.util.ArrayDeque;

import bitchanger.gui.controls.UnfocusedButton;
Expand Down Expand Up @@ -94,8 +94,8 @@ public CalculatorView() {
center.getChildren().clear();

ArrayDeque<Button> buttons = new ArrayDeque<>();
for(File file : Resources.ICON_LIST) {
Button b = new UnfocusedButton("", IconFactory.ofSVGFile(file));
for(InputStream in : Resources.ICON_LIST) {
Button b = new UnfocusedButton("", IconFactory.ofSVGFile(in));
b.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
buttons.add(b);
}
Expand Down
15 changes: 13 additions & 2 deletions src/main/java/bitchanger/main/BitchangerLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

package bitchanger.main;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;

import bitchanger.preferences.Preferences;

/** <!-- $LANGUAGE=DE -->
Expand All @@ -16,7 +20,7 @@
* @author Tim Mühle
*
* @since Bitchanger 0.1.0
* @version 0.1.4
* @version 0.1.5
*
*/
/* <!-- $LANGUAGE=EN -->
Expand All @@ -25,7 +29,7 @@
* @author Tim Muehle
*
* @since Bitchanger 0.1.0
* @version 0.1.4
* @version 0.1.5
*
*/
public class BitchangerLauncher {
Expand Down Expand Up @@ -55,6 +59,13 @@ public static void main(String[] args) {
/* Dies ist notwendig, da ohne den Aufruf mit diesem Launcher der Classpath auf die javafx Runtime
* ueberprueft wird und die Anwendung mit einer Exception abgebrochen wird
*/
try {
System.setErr(new PrintStream(new File("error.txt")));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

PrimaryFXApp.launchFXApplication(args);

Preferences.storeCustom();
Expand Down
Loading

0 comments on commit 5a1ef4f

Please sign in to comment.