diff --git a/.gitignore b/.gitignore index 3926a68..f570f60 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ .DS_Store /installer/ settings +err.txt +error.txt diff --git a/src/main/java/bitchanger/gui/controller/AlphaNumKeysController.java b/src/main/java/bitchanger/gui/controller/AlphaNumKeysController.java index 557438f..2584f14 100644 --- a/src/main/java/bitchanger/gui/controller/AlphaNumKeysController.java +++ b/src/main/java/bitchanger/gui/controller/AlphaNumKeysController.java @@ -52,7 +52,7 @@ * @author Tim Mühle * * @since Bitchanger 0.1.0 - * @version 0.1.4 + * @version 0.1.5 * */ /* @@ -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 { @@ -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()); } diff --git a/src/main/java/bitchanger/gui/controls/AlphaNumKeys.java b/src/main/java/bitchanger/gui/controls/AlphaNumKeys.java index b61388c..3d60dbb 100644 --- a/src/main/java/bitchanger/gui/controls/AlphaNumKeys.java +++ b/src/main/java/bitchanger/gui/controls/AlphaNumKeys.java @@ -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 @@ -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); diff --git a/src/main/java/bitchanger/gui/controls/BasicMenuBar.java b/src/main/java/bitchanger/gui/controls/BasicMenuBar.java index 6041de7..dbcddb3 100644 --- a/src/main/java/bitchanger/gui/controls/BasicMenuBar.java +++ b/src/main/java/bitchanger/gui/controls/BasicMenuBar.java @@ -40,7 +40,7 @@ * @author Tim Mühle * * @since Bitchanger 0.1.4 - * @version 0.1.4 + * @version 0.1.5 * * @see BasicMenuController */ @@ -53,7 +53,7 @@ * @author Tim Mühle * * @since Bitchanger 0.1.4 - * @version 0.1.4 + * @version 0.1.5 * * @see BasicMenuController */ @@ -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); @@ -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"); @@ -328,12 +328,12 @@ 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); @@ -341,7 +341,7 @@ private void createMenuView() { 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); @@ -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); diff --git a/src/main/java/bitchanger/gui/controls/SVGIcon.java b/src/main/java/bitchanger/gui/controls/SVGIcon.java index de6b5ed..c4eb4e2 100644 --- a/src/main/java/bitchanger/gui/controls/SVGIcon.java +++ b/src/main/java/bitchanger/gui/controls/SVGIcon.java @@ -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; @@ -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)); } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * diff --git a/src/main/java/bitchanger/gui/views/AlphaNumGridView.java b/src/main/java/bitchanger/gui/views/AlphaNumGridView.java index fd30fdd..2cd280e 100644 --- a/src/main/java/bitchanger/gui/views/AlphaNumGridView.java +++ b/src/main/java/bitchanger/gui/views/AlphaNumGridView.java @@ -71,7 +71,7 @@ * @author Tim Mühle * * @since Bitchanger 0.1.4 - * @version 0.1.4 + * @version 0.1.5 * */ // TODO JavaDoc EN @@ -425,9 +425,10 @@ public AlphaNumGridView(int firstLabelRow, int labelColumn, int firstTFRow, int this.backspaceBtnKey = "backspaceBtn"; this.btnTexts = new HashMap(); - 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(); diff --git a/src/main/java/bitchanger/gui/views/CalculatorView.java b/src/main/java/bitchanger/gui/views/CalculatorView.java index 9ec64f6..86bbdf5 100644 --- a/src/main/java/bitchanger/gui/views/CalculatorView.java +++ b/src/main/java/bitchanger/gui/views/CalculatorView.java @@ -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; @@ -94,8 +94,8 @@ public CalculatorView() { center.getChildren().clear(); ArrayDeque