diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000000000000000000000000000000000000..083d87445a76e1794d25f6dfc01d855f39a03367 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="Encoding" native2AsciiForPropertiesFiles="true"> + <file url="PROJECT" charset="UTF-8" /> + </component> +</project> \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000000000000000000000000000000000..94a25f7f4cb416c083d265558da75d457237d671 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="$PROJECT_DIR$" vcs="Git" /> + </component> +</project> \ No newline at end of file diff --git a/PlayWall/assets/de/tobias/playpad/assets/lang/_de.properties b/PlayWall/assets/de/tobias/playpad/assets/lang/_de.properties index 841951b5c15168623334cfc51993f7acaa11f9a7..e9ece3f0db027b2725a84eeea99844bcd845c374 100644 --- a/PlayWall/assets/de/tobias/playpad/assets/lang/_de.properties +++ b/PlayWall/assets/de/tobias/playpad/assets/lang/_de.properties @@ -1,5 +1,5 @@ # Hier sind Sachen, die dynamisch im Code verwendet werden. Also wenn eine spezielle Aktionen ist. Beispielsweise Fehlermeldung und Hinweise. Die Sachen sind aber trotzdem in der UI. -#Kommentare befinden sich immer -->�BER<-- dem jeweiligen Eintrag +#Kommentare befinden sich immer -->\u00DCBER<-- dem jeweiligen Eintrag # Standard - File Standard.File.Save=Gespeichert @@ -18,9 +18,9 @@ Pad.TimeMode.REST=Verbleibende Zeit Pad.TimeMode.BOTH=Abgelaufende Zeit / Gesamtzeit # UI - Window - Titles -UI.Dialog.Launch.Title=Projekt w�hlen... +UI.Dialog.Launch.Title=Projekt w\u00E4hlen... UI.Window.Main.Title=Play Wall [Projekt: {} - Profil: {}] -UI.Window.Changelog.Title=Versions�nderungen +UI.Window.Changelog.Title=Versions\u00E4nderungen UI.Window.Settings.Title=Einstellungen - {} UI.Window.ProjectSettings.Title=Projekteinstellungen UI.Window.GlobalSettings.Title=Programmeinstellungen @@ -31,7 +31,7 @@ UI.Dialog.ProjectExport.Title=Projekt exportieren UI.Dialog.ErrorSummary.Title=Fehlerbericht UI.Dialog.NewProfile.Title=Neues Profil UI.Dialog.NewProject.Title=Neues Projekt -UI.Dialog.ChooseProfile.Title=Profil w�hlen +UI.Dialog.ChooseProfile.Title=Profil w\u00E4hlen UI.Dialog.ProjectManager.Title=Projektverwaltung UI.Dialog.UpdateCenter.Title=Aktualisierung UI.Dialog.Preset.Title=Vorlagen @@ -48,8 +48,8 @@ UI.Layout.Classic.Theme.TWILIGHT=Dunkelblau (Twilight) UI.Layout.Classic.Theme.LIGHT=Hell # UI - Window - Main -UI.Window.Main.CloseRequest=Es wird gerade noch Musik abgespielt. M�chten Sie PlayWall trotzdem beenden? -UI.Window.Main.SaveRequest=M�chten Sie die �nderungen speichern? +UI.Window.Main.CloseRequest=Es wird gerade noch Musik abgespielt. M\u00F6chten Sie PlayWall trotzdem beenden? +UI.Window.Main.SaveRequest=M\u00F6chten Sie die \u00C4nderungen speichern? UI.Window.Main.PageButton=Seite {} # UI - Dialog - Launch @@ -57,8 +57,8 @@ UI.Dialog.Launch.Info={} - {} # UI Window - Settings UI.Window.Settings.Gen.Title=Allgemein -UI.Window.Settings.Gen.CacheSize=Gr��e: {}B -UI.Window.Settings.Gen.Wait=Die �nderungen werden �bernommen. Das kann einen kurzen Moment dauern. +UI.Window.Settings.Gen.CacheSize=Gr\u00F6\u00DFe: {}B +UI.Window.Settings.Gen.Wait=Die \u00C4nderungen werden \u00FCbernommen. Das kann einen kurzen Moment dauern. UI.Window.Settings.Mapping.Title=Mapping UI.Window.Settings.Midi.Title=Midi UI.Window.Settings.Layout.Title=Layout @@ -70,14 +70,14 @@ UI.Window.Settings.Paths.Title=Ordner # UI - Settings - Keys UI.Settings.Keys.Conflict.Header=Tastenkombination bereits verwendet -UI.Settings.Keys.Conflict.Content=Diese Tastenkombination wird bereits verwendet f�r: \n{} +UI.Settings.Keys.Conflict.Content=Diese Tastenkombination wird bereits verwendet f\u00FCr: \n{} # UI - Dialog - NewProfile -UI.Dialog.NewProfile.Content=Geben Sie einen Namen f�r das neue Profil ein: +UI.Dialog.NewProfile.Content=Geben Sie einen Namen f\u00FCr das neue Profil ein: # UI - Dialog - NewProject -UI.Dialog.NewProject.Content=Geben Sie einen Namen f�r das neue Projekt ein: -UI.Dialog.NewProject.MediaPath=Sie m�ssen erst einen Ordner f�r die Mediendateien festlegen, bevor das Projekt erstellt werden kann. +UI.Dialog.NewProject.Content=Geben Sie einen Namen f\u00FCr das neue Projekt ein: +UI.Dialog.NewProject.MediaPath=Sie m\u00FCssen erst einen Ordner f\u00FCr die Mediendateien festlegen, bevor das Projekt erstellt werden kann. # UI - Dialog - Import UI.Dialog.Import.ReplaceProfile.Content=Es gibt bereits eine Profil mit dem Namen {}. Bitte geben Sie einen anderen Namen ein. @@ -85,54 +85,54 @@ UI.Dialog.Import.ReplaceProfile.Skip=Profil nicht importieren UI.Dialog.Import.ReplaceProfile.Rename=Umbenennen UI.Dialog.Import.ReplaceProfile.ReplaceContent=Es gibt bereits ein Profil mit dem Namen {}.\nBitte geben Sie einen anderen Namen ein. UI.Dialog.Import.ReplaceProject.ReplaceContent=Es gibt bereits ein Projekt mit dem Namen {}.\nBitte geben Sie einen anderen Namen ein. -UI.Dialog.Import.ReplaceMedia.Content=M�chten Sie die Mediendaten von diesem Projekt importieren? +UI.Dialog.Import.ReplaceMedia.Content=M\u00F6chten Sie die Mediendaten von diesem Projekt importieren? UI.Dialog.Import.ReplaceMedia.Copy=Ja UI.Dialog.Import.ReplaceMedia.Skip=Nein # UI - Dialog - ProjectManager -UI.Dialog.ProjectManager.Delete.Content=M�chten Sie das Projekt {} wirklich l�schen? +UI.Dialog.ProjectManager.Delete.Content=M\u00F6chten Sie das Projekt {} wirklich l\u00F6schen? # UI - Dialog - Profile -UI.Dialog.Profile.Delete.Content=Sind Sie sicher, dass Sie das Profil {} l�schen m�chten? +UI.Dialog.Profile.Delete.Content=Sind Sie sicher, dass Sie das Profil {} l\u00F6schen m\u00F6chten? # UI - Dialog - Info -UI.Dialog.Info.Header=�ber {} +UI.Dialog.Info.Header=\u00DCber {} UI.Dialog.Info.Content=Version: {} (Build: {})\nAutor: {}\nGrafiken: Robert Goldmann.\n\nDieses Programm nutzt Bibliotheken. ControlsFX (8.40.10), dom4j (1.6.1), snakeyaml (1.11), guava (15.0), gagawa (1.0.1), TinySound (1.1.1), JLayer (1.0.1), JSPF (1.0.2), json-smart (1.2). \nBesonderen Dank an die Betatester: Stefan, Robert. # UI - Dialog - Feedback -UI.Dialog.Feedback.Content=Der Fehlerbericht wird �bermittelt, dies kann einen Augenblick dauern. Ihre Nummer wird am Ende angezeigt. +UI.Dialog.Feedback.Content=Der Fehlerbericht wird \u00DCbermittelt, dies kann einen Augenblick dauern. Ihre Nummer wird am Ende angezeigt. # UI - Placeholder UI.Placeholder.Project=Keine Projekte vorhanden UI.Placeholder.Preset=Keine Vorlagen vorhanden UI.Placeholder.Plugins=Keine Erweiterungen vorhanden -UI.Placeholder.Updates=Es sind keine Aktualisierungen verf�gbar +UI.Placeholder.Updates=Es sind keine Aktualisierungen verf\u00FCgbar UI.Placeholder.ErrorSummary=Keine Fehler # Info - MIDI -Info.Midi.Device.Connected=Midi-Ger�t erkannt ({}) +Info.Midi.Device.Connected=Midi-Ger\u00E4t erkannt ({}) # Info - Settings -Info.Settings.ResetWarning=Die Einstellungen wurden zur�ckgesetzt. -Info.Settings.CacheDelete={} Datei(en) wurden gel�scht. +Info.Settings.ResetWarning=Die Einstellungen wurden zur\u00FCckgesetzt. +Info.Settings.CacheDelete={} Datei(en) wurden gel\u00F6scht. # Info - Print Info.Print.Header={} - {} # Error - Standard -Error.Standard.Gen=Es ist ein Fehler aufgetreten. Bitte versuchen Sie es sp�ter erneut. ({}) -Error.Standard.NameInUse=Der Name {} ist bereits vorhanden. Bitte w�hlen Sie einen anderen Namen. +Error.Standard.Gen=Es ist ein Fehler aufgetreten. Bitte versuchen Sie es sp\u00E4ter erneut. ({}) +Error.Standard.NameInUse=Der Name {} ist bereits vorhanden. Bitte w\u00E4hlen Sie einen anderen Namen. # Error - Settings -Error.Settings.CacheSize=Die Gr��e des Cache kann nicht bestimmt werden. ({}) -Error.Settings.CacheClear=Beim L�schen des Caches ist ein Fehler aufgetreten. ({}) +Error.Settings.CacheSize=Die Gr\u00F6\u00DFe des Cache kann nicht bestimmt werden. ({}) +Error.Settings.CacheClear=Beim L\u00F6schen des Caches ist ein Fehler aufgetreten. ({}) # Error - Profile Error.Profile.Create=Das Profil konnte aufgrund eines Fehlers nicht erstellt werden. ({}) -Error.Profile.NotFound=Das Profil konnte nicht geladen werden, da die ben�tigten Dateien fehlen. W�hlen Sie eine anderes Profile aus und �ffnen Sie das Projekt erneut. ({}) +Error.Profile.NotFound=Das Profil konnte nicht geladen werden, da die ben\u00F6tigten Dateien fehlen. W\u00E4hlen Sie eine anderes Profile aus und \u00F6ffnen Sie das Projekt erneut. ({}) Error.Profile.Save=Das Profil konnte aufgrund eines Fehlers nicht gespeichert werden. ({}) -Error.Profile.Delete=Das Projekt konnte nicht gel�scht werden. ({}) -Error.Profile.SmallScreen=Ihr Bildschirm ist f�r die gew�hlte Anzahl der Kacheln zu klein. (Maximal: {}x{} Kacheln) +Error.Profile.Delete=Das Projekt konnte nicht gel\u00F6scht werden. ({}) +Error.Profile.SmallScreen=Ihr Bildschirm ist f\u00FCr die gew\u00E4hlte Anzahl der Kacheln zu klein. (Maximal: {}x{} Kacheln) # Error - Preset Error.Preset.Import=Es ist ein Fehler beim Importieren der Vorlage aufgetreten. ({}) @@ -140,37 +140,37 @@ Error.Preset.Export=Die Vorlage konnte nicht exportiert werden. ({}) # Error - Project Error.Project.Create=Das Projekt konnte nicht erstellt werden. ({}) -Error.Profile.NotFound=Das Projekt {} konnte nicht ge�ffnet werden, da die Projektdatei nicht gefunden wurde. ({}) -Error.Project.Open=Das Projekt {} konnte nicht ge�ffnet werden. ({}) +Error.Project.NotFound=Das Projekt {} konnte nicht ge\u00F6ffnet werden, da die Projektdatei nicht gefunden wurde. ({}) +Error.Project.Open=Das Projekt {} konnte nicht ge\u00F6ffnet werden. ({}) Error.Project.Save=Das Projekt {} konnte nicht gespeichert werden. ({}) Error.Project.Rename=Das Projekt konnte nicht umbenannt werden. ({}) -Error.Project.Delete=Das Projekt konnte nicht gel�scht werden. ({}) +Error.Project.Delete=Das Projekt konnte nicht gel\u00F6scht werden. ({}) Error.Project.Export=Das Projekt {} konnte nicht exportiert werden. ({}) Error.Project.MediaPath=Der neue Ordner darf kein Unterodner des alten Medienordners sein. -Error.Project.PageCount=Sie k�nnen nicht mehr als 8 Seiten erstellen. +Error.Project.PageCount=Sie k\u00F6nnen nicht mehr als 8 Seiten erstellen. # Error - Pad - Enum Error.Pad.FILE_NOT_FOUND=Die Datei {} konnte nicht gefunden werden. Error.Pad.FILE_FORMAT_NOT_SUPPORTED=Die Datei {} ist nicht kompatibel. -Error.Pad.CONVERT_NOT_SUPPORTED=Die Datei {} kann nicht umgewandelt werden. W�hlen Sie ein anderes Format zum Import aus. +Error.Pad.CONVERT_NOT_SUPPORTED=Die Datei {} kann nicht umgewandelt werden. W\u00E4hlen Sie ein anderes Format zum Import aus. Error.Pad.UNKOWN=Es ist ein unbekannter Fehler aufgetreten. {} Error.Pad.UNKOWN_CONTENT_TYPE=Die Kachel {} konnte nicht geladen werden. -# Error - L�sung -Error.Fix.NewFile=Neue Datei w�hlen -Error.Fix.Delete=Kachel l�schen +# Error - L\u00F6sung +Error.Fix.NewFile=Neue Datei w\u00E4hlen +Error.Fix.Delete=Kachel l\u00F6schen # Error - Midi -Error.Midi.Settings.Unkown=F�r die ausgew�hlte Seite sind keine Midi Einstellungen aktiv. Gehen Sie in die Einstellungen, um Midi zu aktivieren. -Error.Midi.Device.Busy=Das Midi-Ger�t wird bereits durch ein anderes Programm verwendet. ({}) -Error.Midi.Device.Unavailible=Das Midi-Ger�t {} konnte nicht gefunden werden. -Error.Midi.Record.Fail=Die gedr�ckte Taste wird bereits verwendet. +Error.Midi.Settings.Unknown=F\u00FCr die ausgew\u00E4hlte Seite sind keine Midi Einstellungen aktiv. Gehen Sie in die Einstellungen, um Midi zu aktivieren. +Error.Midi.Device.Busy=Das Midi-Ger\u00E4t wird bereits durch ein anderes Programm verwendet. ({}) +Error.Midi.Device.Unavailable=Das Midi-Ger\u00E4t {} konnte nicht gefunden werden. +Error.Midi.Record.Fail=Die gedr\u00FCckte Taste wird bereits verwendet. Error.Midi.Send=Der Midi Befehl konnte nicht gesendet werden. ({}) # Error - Plugins Error.Plugins.Download=Die Erweiterung {} konnte nicht geladen werden. -Error.Plugins.Avaiable=Es sind keine Erweiterungen f�r diesen Update-Kanal verf�gbar. -Error.Plugins.Missing=Es wurden im Projekt Erweiterungen verwendet, welche momentan nicht installiert sind. Sie k�nnen das Projekt dennoch �ffnen, es kann aber zu Fehlern dabei kommen, wenn Sie folgende Erweiterungen nicht installiert haben. +Error.Plugins.Avaiable=Es sind keine Erweiterungen f\u00FCr diesen Update-Kanal verf\u00FCgbar. +Error.Plugins.Missing=Es wurden im Projekt Erweiterungen verwendet, welche momentan nicht installiert sind. Sie k\u00F6nnen das Projekt dennoch \u00F6ffnen, es kann aber zu Fehlern dabei kommen, wenn Sie folgende Erweiterungen nicht installiert haben. #Mapper Mapper.Keyboard.Name=Tastatur @@ -180,10 +180,10 @@ Mapper.Midi.toString=Midi {} # Info - Mapper # Das ist Midi und Tastatur gemeinsam -Info.Mapper.PressKey=Dr�cken Sie eine Taste auf dem Midi-Ger�t. +Info.Mapper.PressKey=Dr\u00FCcken Sie eine Taste auf dem Midi-Ger\u00E4t. #UI - Settings - Alerts -UI.Settings.Alert.NewKeyShortcut.Text=Dr�cken Sie bitte die gew�nschte Tastenkombination. \nDieses kann aus Buchstaben, Ziffern und/oder den F-Tasten bestehen. +UI.Settings.Alert.NewKeyShortcut.Text=Dr\u00FCcken Sie bitte die gew\u00FCnschte Tastenkombination. \nDieses kann aus Buchstaben, Ziffern und/oder den F-Tasten bestehen. # UI - Window - PadSettings UI.Window.PadSettings.General.Title=Allgemein @@ -205,7 +205,7 @@ Content.Audio.Name=Audio # NavigationType - Enum NavigationType.PREVIOUS=Vorherige Seite -NavigationType.NEXT=N�chste Seite +NavigationType.NEXT=N\u00E4chste Seite # CartAction - Enum CartAction.Mode.PLAY_STOP=Play/Stop @@ -214,7 +214,7 @@ CartAction.Mode.PLAY_HOLD=Play/Hold #UI - Dialog - AutoUpdate UI.Dialog.AutoUpdate.Header=Aktualisierung -UI.Dialog.AutoUpdate.Content=Es sind Aktualisierungen verf�gbar. M�chten Sie diese jetzt installieren?\n{} +UI.Dialog.AutoUpdate.Content=Es sind Aktualisierungen verf\u00FCgbar. M\u00F6chten Sie diese jetzt installieren?\n{} UI.Dialog.AutoUpdate.Title=Aktualisierung UI.Dialog.AutoUpdate.Checkbox=Diese Aktualisierung nicht mehr anzeigen. UI.Dialog.AutoUpdate.Button.Update=Jetzt aktualisieren @@ -222,7 +222,7 @@ UI.Dialog.AutoUpdate.Button.Cancel=Jetzt nicht aktualisieren #UI - Dialog - Save UI.Dialog.Save.Header=Speichern -UI.Dialog.Save.Content=M�chten Sie das Projekt speichern? +UI.Dialog.Save.Content=M\u00F6chten Sie das Projekt speichern? UI.Dialog.Save.Title=Speichern UI.Dialog.Save.Checkbox=Immer automatisch speichern und diesen Dialog nicht mehr anzeigen. UI.Dialog.Save.Button.Yes=Ja @@ -238,11 +238,11 @@ Error.Layout.Load=Es gab einen Fehler beim Laden des Layouts ({}) # UI - Dialog - Update UI.Dialog.Update.Cell={}: Installiert: {} - Neu: {} -UI.Dialog.Update.Info=Die Aktualisierung wird vorbereitet. Bitte schlie�en Sie nicht das Programm. \nDieser Vorgang kann wenige Minuten dauern. +UI.Dialog.Update.Info=Die Aktualisierung wird vorbereitet. Bitte schlie\u00DFen Sie nicht das Programm. \nDieser Vorgang kann wenige Minuten dauern. UI.Window.Settings.Updates.CurrentVersion={} (Build {}) # Error - Update - Downlaod -Error.Update.Download=Es ist ein Fehler beim Herunterladen der Aktualisierung aufgetreten. Bitte versuchen Sie es sp�ter erneut. ({}) +Error.Update.Download=Es ist ein Fehler beim Herunterladen der Aktualisierung aufgetreten. Bitte versuchen Sie es sp\u00E4ter erneut. ({}) # Layout Layout.Modern.Name=Modern @@ -251,7 +251,7 @@ Layout.Classic.Name=Klassisch # Trigger TriggerPoint.toString={} ({}) Trigger.Cart.Name=Kacheln -Trigger.Volume.Name=Lautst�rke +Trigger.Volume.Name=Lautst\u00E4rke # TriggerPoint - Enum TriggerPoint.START=Start @@ -272,25 +272,29 @@ Search.Placeholder=Suche Search.Alert.NoMatches=Keine Treffer gefunden. # UI - Dialog - Page - Delete -UI.Dialog.Page.Delete.Header=Seite l�schen -UI.Dialog.Page.Delete.Content=M�chten Sie die Seite unwiederbringlich l�schen? +UI.Dialog.Page.Delete.Header=Seite l\u00F6schen +UI.Dialog.Page.Delete.Content=M\u00F6chten Sie die Seite unwiederbringlich l\u00F6schen? # UI - Dialog - Name - Delete UI.Dialog.Page.Name.Header=Seite umbenennen -UI.Dialog.Page.Name.Content=Geben Sie einen Namen f�r die Seite ein. +UI.Dialog.Page.Name.Content=Geben Sie einen Namen f\u00FCr die Seite ein. # Tooltips Tooltip.PlayButton=Wiedergabe Tooltip.DragButton=Kacheln verschieben Tooltip.PageButton=Seiten bearbeiten -Tooltip.ColorButton=Kacheln einf�rben +Tooltip.ColorButton=Kacheln einf\u00E4rben Tooltip.Page.LeftMove=Nach links verschieben Tooltip.Page.RightMove=Nach rechts verschieben Tooltip.Page.Rename=Umbenennen Tooltip.Page.Clone=Duplizieren -Tooltip.Page.Delete=L�schen +Tooltip.Page.Delete=L\u00F6schen # Audio Features EQUALIZER=Equalizer: -SOUNDCARD=Soundkarte: \ No newline at end of file +SOUNDCARD=Soundkarte: + +#AudioHandler +AudioHandler.JavaFX=JavaFX +AudioHandler.TinySound=TinySound \ No newline at end of file diff --git a/PlayWall/assets/de/tobias/playpad/assets/lang/ui_de.properties b/PlayWall/assets/de/tobias/playpad/assets/lang/ui_de.properties index afe3290c008ceef5b34304c88e1c03c526ae906d..119bd5e46bfcef6e27dda8cd2a5614588dd356ea 100644 --- a/PlayWall/assets/de/tobias/playpad/assets/lang/ui_de.properties +++ b/PlayWall/assets/de/tobias/playpad/assets/lang/ui_de.properties @@ -1,5 +1,5 @@ -#Sprachdatei f�r die Benutzeroberfl�che -#Kommentare befinden sich immer -->�BER<-- dem jeweiligen Eintrag +#Sprachdatei f\u00FCr die Benutzeroberfl\u00E4che +#Kommentare befinden sich immer -->\u00DCBER<-- dem jeweiligen Eintrag main.menu.file=Datei main.menu.option=Optionen @@ -19,18 +19,16 @@ main.menu.editmode=Modus main.menuitem.play=Wiedergabe main.menuitem.drag=Kacheln verschieben main.menuitem.page=Seiten bearbeiten -main.menuitem.color=Kacheln einf�rben +main.menuitem.color=Kacheln einf\u00E4rben main.menuitem.errors=Fehlerbericht anzeigen... main.menuitem.plugins=Erweiterungen... main.menuitem.projectSettings=Projekteinstellungen... main.menuitem.profileSettings=Profileinstellungen... main.menuitem.globalSettings=Globale Einstellungen... -main.menuitem.about=�ber Play Wall... +main.menuitem.about=\u00DCber Play Wall... main.menuitem.website=Webseite besuchen... main.menuitem.senderror=Fehler senden... main.menuitem.fullScreen=Vollbild -main.menuitem.layout=Layout -main.menuitem.close=Touch Modus schlie�en main.menuitem.searchPad=Kachel suchen... main.label.live=Live @@ -40,24 +38,23 @@ settings.gen.label.columns=Anzahl der Spalten: settings.gen.label.rows=Anzahl der Reihen: settings.gen.label.liveMode=Live Modus: settings.gen.checkbox.liveMode=Aktivieren -settings.gen.label.liveMode.settings=Einstellungen �ndern: -settings.gen.label.liveMode.media=Mediadateien �ndern: +settings.gen.label.liveMode.settings=Einstellungen \u00E4ndern: +settings.gen.label.liveMode.media=Mediadateien \u00E4ndern: settings.gen.label.liveMode.dragPads=Kacheln verschieben: settings.gen.label.liveMode.pageChange=Seite wechseln: settings.gen.radio.liveMode.enable=Verbieten settings.gen.radio.liveMode.disable=Erlauben -settings.gen.label.liveModeInfo=Der Live Modus verhindert ausgew�hlte Aktionen w�hrend der Wiedergabe. -settings.gen.warning.button.reset=Hinweismeldungen zur�cksetzen +settings.gen.label.liveModeInfo=Der Live Modus verhindert ausgew\u00E4hlte Aktionen w\u00E4hrend der Wiedergabe. +settings.gen.warning.button.reset=Hinweismeldungen zur\u00FCcksetzen settings.gen.cache.label=Cachespeicher: -settings.gen.cache.button.choose=W�hlen +settings.gen.cache.button.choose=W\u00E4hlen settings.gen.cache.button.reset=Cache leeren -settings.gen.cache.label.info=Wenn Sie als Audioausgabetyp "Java Audiostream" gew�hlt haben, werden s�mtliche MP3-Dateien in eine WAV-Dateien umgewandelt. Diese wird dann in den oben angegebenen Ordner abgelegt. Sollten Sie viele Dateien aus Ihrem Projekt gel�scht haben, k�nnen Sie den Cache leeren, um die ben�tigten Speicherplatz zu verringern. Ben�tigte Dateien werden automatisch neu umgewandelt, falls sie nicht (mehr) existieren. +settings.gen.cache.label.info=Wenn Sie als Audioausgabetyp "Java Audiostream" gew\u00E4hlt haben, werden s\u00E4mtliche MP3-Dateien in eine WAV-Dateien umgewandelt. Diese wird dann in den oben angegebenen Ordner abgelegt. Sollten Sie viele Dateien aus Ihrem Projekt gel\u00F6scht haben, k\u00F6nnen Sie den Cache leeren, um die ben\u00F6tigten Speicherplatz zu verringern. Ben\u00F6tigte Dateien werden automatisch neu umgewandelt, falls sie nicht (mehr) existieren. settings.mapping.label.mapping=Mapping: settings.mapping.button.edit=Bearbeiten... -settings.midi.button.activate=Aktivieren -settings.midi.label.device=Midi-Ger�te: +settings.midi.label.device=Midi-Ger\u00E4te: settings.layout.label.type=Layout Type: @@ -71,13 +68,12 @@ settings.player.label.startIn=... nach Start settings.player.label.pauseIn=... bei Pause settings.player.label.pauseOut=... bei Pause settings.player.label.stopOut=... vor Stop (nicht Ende) -settings.player.label.fadeInfo=Wird beim Ein- oder Ausblenden die Dauer auf 0 gesetzt, so findet keine �berblendung statt. Wenn die Datei zu Ende ist, findet kein Ausblenden statt. +settings.player.label.fadeInfo=Wird beim Ein- oder Ausblenden die Dauer auf 0 gesetzt, so findet keine \u00DCberblendung statt. Wenn die Datei zu Ende ist, findet kein Ausblenden statt. settings.player.label.timeDisplay=Zeitanzeige: settings.update.label.current=Installierte Version: -settings.update.label.new=Aktuelle Version: settings.update.label.search=Nach Updates suchen: -settings.update.label.available=Verf�gbare Updates: +settings.update.label.available=Verf\u00FCgbare Updates: settings.update.button.search=Jetzt suchen settings.update.button.install=Aktualisieren und neu starten settings.update.label.channel=Update-Kanal: @@ -87,14 +83,14 @@ settings.update.label.infoE=Erweiterung settings.keys.label.headline=Tastenkombinationen settings.keys.label.name=Name: settings.keys.label.shortcut=Tastenkombination: -settings.keys.button.change=�ndern -settings.keys.button.delete=L�schen +settings.keys.button.change=\u00C4ndern +settings.keys.button.delete=L\u00F6schen settings.keys.table.name=Name settings.keys.table.shortcut=Tastenkombination settings.keys.textfield.search=Suchen... settings.paths.label.media=Mediendateien: -settings.paths.button.choose=W�hlen... +settings.paths.button.choose=W\u00E4hlen... settings.paths.checkbox.mediaActive=Mediendateien beim Import in den Medienordner kopieren settings.button.finish=Fertig @@ -104,28 +100,28 @@ layout.label.programmLayout=Programmlayout: layout.label.customLayout=Eigenes Layout: layout.label.baseColor=Akzentfarbe: layout.label.background=Hintergrund: -layout.label.playground=Hintergrund w�hrend Wiedergabe: -layout.label.fadeColor=Hintergrund w�hrend Ausblenden: +layout.label.playground=Hintergrund w\u00E4hrend Wiedergabe: +layout.label.fadeColor=Hintergrund w\u00E4hrend Ausblenden: layout.label.warnColor=Warnhinweis: layout.label.color=Farbe: -layout.label.fontSize=Schriftgr��e: +layout.label.fontSize=Schriftgr\u00F6\u00DFe: layout.label.infoLabel=Kopfzeile: layout.label.titleLabel=Titel: layout.label.animation=Animationen: layout.label.warnAnimation=Warnhinweise -layout.button.reset=Zur�cksetzen +layout.button.reset=Zur\u00FCcksetzen midi.label.key=Taste (Midi): -midi.button.new=�ndern +midi.button.new=\u00C4ndern keyboard.label.key=Taste (Tastatur): -keyboard.button.new=�ndern +keyboard.button.new=\u00C4ndern -padSettings.button.delete=L�schen +padSettings.button.delete=L\u00F6schen padSettings.button.path=Pfad zeigen padSettings.gen.label.title=Titel: -padSettings.gen.label.volume=Lautst�rke: +padSettings.gen.label.volume=Lautst\u00E4rke: padSettings.gen.label.timeDisplay=Zeitanzeige: padSettings.gen.checkbox.customSettings=Eigene Einstellungen padSettings.checkbox.loop=Wiederholen @@ -137,15 +133,15 @@ padSettings.player.label.fade=Ein-/Ausblenden: padSettings.layout.label.custom=Eigenes Layout: padSettings.layout.checkbox.custom=Aktiviert -project.button.finish=�ffnen +project.button.finish=\u00D6ffnen project.button.cancel=Abbrechen -project.button.delete=L�schen +project.button.delete=L\u00F6schen project.button.rename=Umbenennen project.button.new=Neues Projekt project.button.duplicate=Duplizieren project.button.export=Exportieren... project.button.import=Importieren.. -project.label.export=Wenn Sie ein ge�ffnetes Projekt exportieren, wird dieses zuerst gespeichert. +project.label.export=Wenn Sie ein ge\u00F6ffnetes Projekt exportieren, wird dieses zuerst gespeichert. project.label.name=Name: project.label.profile=Profile: project.label.lastModified=Zuletzt bearbeitet: @@ -159,16 +155,16 @@ project.export.button.save=Exportieren launch.button.import=Projekt importieren launch.button.new=Neues Projekt -launch.button.open=�ffnen -launch.button.delete=L�schen +launch.button.open=\u00D6ffnen +launch.button.delete=L\u00F6schen profile.label.name=Name -profile.label.info=Ein Profil umfasst alle Einstellungen des Programmes, beispielsweise das Aussehen, die Midi-Einstellungen oder die Audioeinstellungen. Sie k�nnen jederzeit f�r ein Projekt das Profil wechseln. +profile.label.info=Ein Profil umfasst alle Einstellungen des Programmes, beispielsweise das Aussehen, die Midi-Einstellungen oder die Audioeinstellungen. Sie k\u00F6nnen jederzeit f\u00FCr ein Projekt das Profil wechseln. profile.button.rename=Umbenennen profile.button.new=Neu -profile.button.delete=L�schen +profile.button.delete=L\u00F6schen profile.button.duplicate=Duplizieren -profile.button.choose=Profil w�hlen +profile.button.choose=Profil w\u00E4hlen warning.label.time=Warnhinweis ab Restdauer: (Sek) @@ -176,16 +172,16 @@ print.label.page=Seite: print.button.cancel=Abbrechen print.button.print=Drucken -plugin.label.restart=Einige �nderungen werden erst nach dem Neustart des Programmes wirksam. -plugin.label.updateInfo=Erweiterungen k�nnen in den Aktualisierungseinstellungen aktualisiert werden. +plugin.label.restart=Einige \u00C4nderungen werden erst nach dem Neustart des Programmes wirksam. +plugin.label.updateInfo=Erweiterungen k\u00F6nnen in den Aktualisierungseinstellungen aktualisiert werden. plugin.button.finish=Fertig -settings.audio.type=Ausgabetype w�hlen: +settings.audio.type=Ausgabetype w\u00E4hlen: newProject.label.name=Name: newProject.label.media=Medienordner: newProject.checkbox.mediafolder=Medienordner nutzen (Importierte Dateien werden in den angegebenen Ordner kopiert) -newProject.button.media=Medienordner w�hlen +newProject.button.media=Medienordner w\u00E4hlen newProject.label.profile=Profil: newProject.button.newProfile=Neues Profil... @@ -198,8 +194,8 @@ newProfile.label.midi=Midi Funktion: newProfile.button.finish=Profil erstellen newProfile.button.cancel=Abbrechen -profileChoose.label.info=Das verwendete Profil wurde nicht gefunden.\nBitte w�hlen Sie ein anderes Profil aus, welches verwendet werden soll. -profileChoose.button.finish=Profil w�hlen +profileChoose.label.info=Das verwendete Profil wurde nicht gefunden.\nBitte w\u00E4hlen Sie ein anderes Profil aus, welches verwendet werden soll. +profileChoose.button.finish=Profil w\u00E4hlen doubleFeedback.label.colorEvent=Eventfarbe: doubleFeedback.label.colorDefault=Standardfarbe: @@ -211,11 +207,11 @@ cartAction.checkbox.autoColor=Aktivieren action.mapper.headline=Einstellungen zum Mapping: -mappingPreset.button.add=Hinzuf�gen +mappingPreset.button.add=Hinzuf\u00FCgen mappingPreset.button.duplicate=Duplizieren mappingPreset.button.export=Exportieren... mappingPreset.button.import=Importieren... -mappingPreset.button.delete=L�schen +mappingPreset.button.delete=L\u00F6schen mappingPreset.button.finish=Fertig mappingPreset.label.mapping=Mapping: mappingPreset.label.name=Name: @@ -223,18 +219,18 @@ mappingPreset.label.name=Name: errorSummary.label.headline=Fehlerzusammenfassung: errorSummary.column.cart=Kachel errorSummary.column.des=Fehlerbeschreibung -errorSummary.column.solution=L�sungsvorschl�ge -errorSummary.button.close=Schlie�en +errorSummary.column.solution=L\u00F6sungsvorschl\u00E4ge +errorSummary.button.close=Schlie\u00DFen tinysound.label.soundcard=Soundkarte: triggertime.label.time=Zeit vom Trigger: (Sek) -carttrigger.label.action=Aktion f�r Kacheln: +carttrigger.label.action=Aktion f\u00FCr Kacheln: carttrigger.label.carts=Kacheln: carttrigger.checkbox.all=Alle anderen Kacheln -carttrigger.label.add.placeholder=Hinzuf�gen (Name der Kachel) -carttrigger.button.add=Hinzuf�gen +carttrigger.label.add.placeholder=Hinzuf\u00FCgen (Name der Kachel) +carttrigger.button.add=Hinzuf\u00FCgen -volumetrigger.label.volume=Lautst�rke: -volumetrigger.label.duration=�berblenddauer: \ No newline at end of file +volumetrigger.label.volume=Lautst\u00E4rke: +volumetrigger.label.duration=\u00DCberblenddauer: \ No newline at end of file diff --git a/PlayWall/src/de/tobias/playpad/PlayPadImpl.java b/PlayWall/src/de/tobias/playpad/PlayPadImpl.java index fd2981104a375d373fd739f34e58e8b1633c1901..a9f22a3ecbc2c3a7d73722b0f54fcf3e6655c6e0 100644 --- a/PlayWall/src/de/tobias/playpad/PlayPadImpl.java +++ b/PlayWall/src/de/tobias/playpad/PlayPadImpl.java @@ -16,6 +16,8 @@ import java.util.Optional; import java.util.ResourceBundle; import java.util.Set; +import de.tobias.playpad.audio.JavaFXHandlerFactory; +import de.tobias.playpad.design.modern.ModernDesignFactory; import org.dom4j.DocumentException; import de.tobias.playpad.action.mapper.MapperRegistry; @@ -262,20 +264,20 @@ public class PlayPadImpl implements PlayPad { // Load Components RegistryCollection registryCollection = PlayPadPlugin.getRegistryCollection(); - registryCollection.getActions().loadComponentsFromFile("de/tobias/playpad/components/Actions.xml", module); - registryCollection.getAudioHandlers().loadComponentsFromFile("de/tobias/playpad/components/AudioHandler.xml", module); - registryCollection.getDragModes().loadComponentsFromFile("de/tobias/playpad/components/DragMode.xml", module); - registryCollection.getDesigns().loadComponentsFromFile("de/tobias/playpad/components/Design.xml", module); - registryCollection.getMappers().loadComponentsFromFile("de/tobias/playpad/components/Mapper.xml", module); - registryCollection.getPadContents().loadComponentsFromFile("de/tobias/playpad/components/PadContent.xml", module); - registryCollection.getTriggerItems().loadComponentsFromFile("de/tobias/playpad/components/Trigger.xml", module); - registryCollection.getMainLayouts().loadComponentsFromFile("de/tobias/playpad/components/Layout.xml", module); + registryCollection.getActions().loadComponentsFromFile("de/tobias/playpad/components/Actions.xml", module, resourceBundle); + registryCollection.getAudioHandlers().loadComponentsFromFile("de/tobias/playpad/components/AudioHandler.xml", module, resourceBundle); + registryCollection.getDragModes().loadComponentsFromFile("de/tobias/playpad/components/DragMode.xml", module, resourceBundle); + registryCollection.getDesigns().loadComponentsFromFile("de/tobias/playpad/components/Design.xml", module, resourceBundle); + registryCollection.getMappers().loadComponentsFromFile("de/tobias/playpad/components/Mapper.xml", module, resourceBundle); + registryCollection.getPadContents().loadComponentsFromFile("de/tobias/playpad/components/PadContent.xml", module, resourceBundle); + registryCollection.getTriggerItems().loadComponentsFromFile("de/tobias/playpad/components/Trigger.xml", module, resourceBundle); + registryCollection.getMainLayouts().loadComponentsFromFile("de/tobias/playpad/components/Layout.xml", module, resourceBundle); // Set Default - registryCollection.getAudioHandlers().setDefaultID(JavaFXAudioHandler.TYPE); - registryCollection.getDesigns().setDefaultID(ModernGlobalDesign.TYPE); - } catch (IllegalAccessException | ClassNotFoundException | InstantiationException | IOException | DocumentException - | NoSuchComponentException e) { + // TODO Set Default + registryCollection.getAudioHandlers().setDefaultID(JavaFXHandlerFactory.class); + registryCollection.getDesigns().setDefaultID(ModernDesignFactory.class); + } catch (Exception e) { e.printStackTrace(); } diff --git a/PlayWall/src/de/tobias/playpad/PlayPadMain.java b/PlayWall/src/de/tobias/playpad/PlayPadMain.java index 9a472114c8ddba0cc6d5b0595f2f3f529f5f289d..9a256d5ac809214383c4b3280239bcb549aec371 100644 --- a/PlayWall/src/de/tobias/playpad/PlayPadMain.java +++ b/PlayWall/src/de/tobias/playpad/PlayPadMain.java @@ -111,7 +111,8 @@ public class PlayPadMain extends Application implements LocalizationDelegate { try { Image stageIcon = new Image(iconPath); PlayPadMain.stageIcon = Optional.of(stageIcon); - } catch (Exception e) {} + } catch (Exception e) { + } /* * Setup @@ -119,19 +120,21 @@ public class PlayPadMain extends Application implements LocalizationDelegate { updater = new PlayPadUpdater(); UpdateRegistery.registerUpdateable(updater); - impl.startup(uiResourceBundle); + impl.startup(Localization.getBundle()); // Load Plugin Path - Path pluginFolder; - if (getParameters().getNamed().containsKey("plugin")) { - String pluginParam = getParameters().getNamed().get("plugin"); - for (String part : pluginParam.split(":")) { - pluginFolder = Paths.get(part); + if (!getParameters().getRaw().contains("noplugins")) { + Path pluginFolder; + if (getParameters().getNamed().containsKey("plugin")) { + String pluginParam = getParameters().getNamed().get("plugin"); + for (String part : pluginParam.split(":")) { + pluginFolder = Paths.get(part); + setupPlugins(pluginFolder); + } + } else { + pluginFolder = ApplicationUtils.getApplication().getPath(PathType.LIBRARY); setupPlugins(pluginFolder); } - } else { - pluginFolder = ApplicationUtils.getApplication().getPath(PathType.LIBRARY); - setupPlugins(pluginFolder); } /* @@ -232,9 +235,8 @@ public class PlayPadMain extends Application implements LocalizationDelegate { /** * Gibt die Implementierung des Peers für Plugins zurück. - * + * * @return Schnittstelle - * * @see PlayPad */ public static PlayPadImpl getProgramInstance() { diff --git a/PlayWall/src/de/tobias/playpad/RegistryCollectionImpl.java b/PlayWall/src/de/tobias/playpad/RegistryCollectionImpl.java index 8e9b2bf1773efe28ae50e2bea3f3490bead6e7be..75079636aef275754b1dc19a766ac71169e4e034 100644 --- a/PlayWall/src/de/tobias/playpad/RegistryCollectionImpl.java +++ b/PlayWall/src/de/tobias/playpad/RegistryCollectionImpl.java @@ -1,28 +1,28 @@ package de.tobias.playpad; -import de.tobias.playpad.action.ActionConnect; -import de.tobias.playpad.action.mapper.MapperConnect; +import de.tobias.playpad.action.ActionFactory; +import de.tobias.playpad.action.mapper.MapperFactory; import de.tobias.playpad.audio.AudioRegistry; -import de.tobias.playpad.design.DesignConnect; +import de.tobias.playpad.design.DesignFactory; import de.tobias.playpad.pad.conntent.PadContentRegistry; import de.tobias.playpad.pad.drag.PadDragMode; import de.tobias.playpad.registry.ComponentRegistry; import de.tobias.playpad.registry.DefaultComponentRegistry; import de.tobias.playpad.registry.DefaultRegistry; import de.tobias.playpad.registry.Registry; -import de.tobias.playpad.tigger.TriggerItemConnect; -import de.tobias.playpad.view.main.MainLayoutConnect; +import de.tobias.playpad.tigger.TriggerItemFactory; +import de.tobias.playpad.view.main.MainLayoutFactory; public class RegistryCollectionImpl implements RegistryCollection { - private Registry<ActionConnect> actionRegistry; + private Registry<ActionFactory> actionRegistry; private AudioRegistry audioHandlerRegistry; private Registry<PadDragMode> dragModeRegistry; - private DefaultRegistry<DesignConnect> layoutRegistry; - private Registry<MapperConnect> mapperRegistry; + private DefaultRegistry<DesignFactory> layoutRegistry; + private Registry<MapperFactory> mapperRegistry; private PadContentRegistry padContentRegistry; - private Registry<TriggerItemConnect> triggerItemRegistry; - private DefaultRegistry<MainLayoutConnect> mainLayoutRegistry; + private Registry<TriggerItemFactory> triggerItemRegistry; + private DefaultRegistry<MainLayoutFactory> mainLayoutRegistry; public RegistryCollectionImpl() { actionRegistry = new ComponentRegistry<>("Action"); @@ -36,7 +36,7 @@ public class RegistryCollectionImpl implements RegistryCollection { } @Override - public Registry<ActionConnect> getActions() { + public Registry<ActionFactory> getActions() { return actionRegistry; } @@ -51,12 +51,12 @@ public class RegistryCollectionImpl implements RegistryCollection { } @Override - public DefaultRegistry<DesignConnect> getDesigns() { + public DefaultRegistry<DesignFactory> getDesigns() { return layoutRegistry; } @Override - public Registry<MapperConnect> getMappers() { + public Registry<MapperFactory> getMappers() { return mapperRegistry; } @@ -66,12 +66,12 @@ public class RegistryCollectionImpl implements RegistryCollection { } @Override - public Registry<TriggerItemConnect> getTriggerItems() { + public Registry<TriggerItemFactory> getTriggerItems() { return triggerItemRegistry; } @Override - public DefaultRegistry<MainLayoutConnect> getMainLayouts() { + public DefaultRegistry<MainLayoutFactory> getMainLayouts() { return mainLayoutRegistry; } diff --git a/PlayWall/src/de/tobias/playpad/Strings.java b/PlayWall/src/de/tobias/playpad/Strings.java index 7a24acf3963219898bdddc974049ce50e19f0853..801d7765c25a6e448bbf0e8fadb0834e4f619e61 100644 --- a/PlayWall/src/de/tobias/playpad/Strings.java +++ b/PlayWall/src/de/tobias/playpad/Strings.java @@ -153,9 +153,9 @@ public class Strings { public static final String Error_Fix_Delete = "Error.Fix.Delete"; // Error - Midi - public static final String Error_Midi_Settings_Unkown = "Error.Midi.Settings.Unkown"; + public static final String Error_Midi_Settings_Unkown = "Error.Midi.Settings.Unknown"; public static final String Error_Midi_Device_Busy = "Error.Midi.Device.Busy"; - public static final String Error_Midi_Device_Unavailible = "Error.Midi.Device.Unavailible"; + public static final String Error_Midi_Device_Unavailible = "Error.Midi.Device.Unavailable"; public static final String Error_Midi_Record_Fail = "Error.Midi.Record.Fail"; public static final String Error_Midi_Send = "Error.Midi.Send"; @@ -273,4 +273,8 @@ public class Strings { public static final String Tooltip_Page_Rename = "Tooltip.Page.Rename"; public static final String Tooltip_Page_Clone = "Tooltip.Page.Clone"; public static final String Tooltip_Page_Delete = "Tooltip.Page.Delete"; + + // AudioHandler + public static final String AudioHandler_JavaFX = "AudioHandler.JavaFX"; + public static final String AudioHandler_TinySound = "AudioHandler.TinySound"; } diff --git a/PlayWall/src/de/tobias/playpad/action/actions/NavigateAction.java b/PlayWall/src/de/tobias/playpad/action/actions/NavigateAction.java index e8df71b43fc387729ec9e6eec1be816a75e47ecd..b1776e4951a676fdde9cf93988d00727d59fe1ff 100644 --- a/PlayWall/src/de/tobias/playpad/action/actions/NavigateAction.java +++ b/PlayWall/src/de/tobias/playpad/action/actions/NavigateAction.java @@ -5,7 +5,6 @@ import org.dom4j.Element; import de.tobias.playpad.Strings; import de.tobias.playpad.action.Action; import de.tobias.playpad.action.InputType; -import de.tobias.playpad.action.connect.NavigateActionConnect; import de.tobias.playpad.action.feedback.FeedbackMessage; import de.tobias.playpad.action.feedback.FeedbackType; import de.tobias.playpad.project.Project; @@ -28,13 +27,15 @@ public class NavigateAction extends Action { } private NavigationType action; + private String type; // reference from NavigateActionFactory - public NavigateAction() { - action = NavigationType.NEXT; + public NavigateAction(String type) { + this(type, NavigationType.NEXT); } - public NavigateAction(NavigationType type) { - this.action = type; + public NavigateAction(String type, NavigationType action) { + this.action = action; + this.type = type; } public NavigationType getAction() { @@ -47,7 +48,7 @@ public class NavigateAction extends Action { @Override public String getType() { - return NavigateActionConnect.TYPE; + return type; } @Override @@ -81,6 +82,7 @@ public class NavigateAction extends Action { return FeedbackType.SINGLE; } + // Serialization private static final String TYPE = "action"; @Override diff --git a/PlayWall/src/de/tobias/playpad/action/actions/PageAction.java b/PlayWall/src/de/tobias/playpad/action/actions/PageAction.java index cd564863f87794440c4ba5052e095d7e179698a7..0dfa44349abae174cb0a78580148741023eea7b0 100644 --- a/PlayWall/src/de/tobias/playpad/action/actions/PageAction.java +++ b/PlayWall/src/de/tobias/playpad/action/actions/PageAction.java @@ -5,7 +5,6 @@ import org.dom4j.Element; import de.tobias.playpad.Strings; import de.tobias.playpad.action.Action; import de.tobias.playpad.action.InputType; -import de.tobias.playpad.action.connect.PageActionConnect; import de.tobias.playpad.action.feedback.FeedbackMessage; import de.tobias.playpad.action.feedback.FeedbackType; import de.tobias.playpad.project.Project; @@ -17,14 +16,16 @@ import javafx.beans.property.StringProperty; public class PageAction extends Action { + private final String type; + private int page; - public PageAction() { - this.page = 0; + public PageAction(String type) { + this(type, 0); } - public PageAction(int page) { - super(); + public PageAction(String type, int page) { + this.type = type; this.page = page; } @@ -38,7 +39,7 @@ public class PageAction extends Action { @Override public String getType() { - return PageActionConnect.TYPE; + return type; } @Override diff --git a/PlayWall/src/de/tobias/playpad/action/cartaction/CartAction.java b/PlayWall/src/de/tobias/playpad/action/cartaction/CartAction.java index 15796b6fc3052711b3690481fb6c1f4b6cb1d666..ad5af8a922484e84f6197480d59b436a64cae217 100644 --- a/PlayWall/src/de/tobias/playpad/action/cartaction/CartAction.java +++ b/PlayWall/src/de/tobias/playpad/action/cartaction/CartAction.java @@ -5,7 +5,6 @@ import org.dom4j.Element; import de.tobias.playpad.Strings; import de.tobias.playpad.action.Action; import de.tobias.playpad.action.InputType; -import de.tobias.playpad.action.connect.CartActionConnect; import de.tobias.playpad.action.feedback.ColorAdjustable; import de.tobias.playpad.action.feedback.FeedbackType; import de.tobias.playpad.pad.Pad; @@ -25,6 +24,8 @@ public class CartAction extends Action implements ColorAdjustable { PLAY_PAUSE, PLAY_STOP, PLAY_HOLD; } + private final String type; + private int x; private int y; @@ -36,15 +37,13 @@ public class CartAction extends Action implements ColorAdjustable { private transient PadStatusFeedbackListener padStatusFeedbackListener = new PadStatusFeedbackListener(); private transient PadPositionWarningListener padPositionListener = new PadPositionWarningListener(this); - public CartAction() { - this.x = 0; - this.y = 0; - - this.mode = ControlMode.PLAY_STOP; + public CartAction(String type) { + this(type, 0, 0, ControlMode.PLAY_STOP); this.autoFeedbackColors = true; } - public CartAction(int x, int y, ControlMode mode) { + public CartAction(String type, int x, int y, ControlMode mode) { + this.type = type; this.x = x; this.y = y; @@ -112,7 +111,7 @@ public class CartAction extends Action implements ColorAdjustable { @Override public String getType() { - return CartActionConnect.TYPE; + return type; } @Override diff --git a/PlayWall/src/de/tobias/playpad/action/connect/CartActionConnect.java b/PlayWall/src/de/tobias/playpad/action/factory/CartActionFactory.java similarity index 76% rename from PlayWall/src/de/tobias/playpad/action/connect/CartActionConnect.java rename to PlayWall/src/de/tobias/playpad/action/factory/CartActionFactory.java index b8936b0faa84a7b9056eeaf9ee001fd10eae5b40..48b84f17f923997d2fc9b5e84493d2e9ac391179 100644 --- a/PlayWall/src/de/tobias/playpad/action/connect/CartActionConnect.java +++ b/PlayWall/src/de/tobias/playpad/action/factory/CartActionFactory.java @@ -1,10 +1,10 @@ -package de.tobias.playpad.action.connect; +package de.tobias.playpad.action.factory; import java.util.List; import de.tobias.playpad.Strings; import de.tobias.playpad.action.Action; -import de.tobias.playpad.action.ActionConnect; +import de.tobias.playpad.action.ActionFactory; import de.tobias.playpad.action.ActionDisplayable; import de.tobias.playpad.action.ActionType; import de.tobias.playpad.action.Mapping; @@ -23,9 +23,11 @@ import javafx.beans.property.StringProperty; import javafx.scene.Node; import javafx.scene.control.TreeItem; -public class CartActionConnect extends ActionConnect implements ActionDisplayable { +public class CartActionFactory extends ActionFactory implements ActionDisplayable { - public static final String TYPE = "CART"; + public CartActionFactory(String type) { + super(type); + } @Override public TreeItem<ActionDisplayable> getTreeViewForActions(List<Action> actions, Mapping mapping) { @@ -37,23 +39,12 @@ public class CartActionConnect extends ActionConnect implements ActionDisplayabl public void initActionType(Mapping mapping, Profile profile) { for (int x = 0; x < ProjectSettings.MAX_COLUMNS; x++) { for (int y = 0; y < ProjectSettings.MAX_ROWS; y++) { - CartAction action = new CartAction(x, y, ControlMode.PLAY_STOP); + CartAction action = new CartAction(getType(), x, y, ControlMode.PLAY_STOP); mapping.addActionIfNotContains(action); } - } } - @Override - public StringProperty displayProperty() { - return new SimpleStringProperty(Localization.getString(Strings.Action_Cart_Name)); - } - - @Override - public Node getGraphics() { - return new FontIcon(FontAwesomeType.TH); - } - // Settings View (Übersicht mit den Buttons). Die Buttons rufen dann die jeweilige CartAction auf. Da muss dann auch die MapperView // manuell gesetzt werden. @Override @@ -63,7 +54,7 @@ public class CartActionConnect extends ActionConnect implements ActionDisplayabl @Override public Action newInstance() { - return new CartAction(); + return new CartAction(getType()); } @Override @@ -71,8 +62,4 @@ public class CartActionConnect extends ActionConnect implements ActionDisplayabl return ActionType.CONTROL; } - @Override - public String getType() { - return TYPE; - } } diff --git a/PlayWall/src/de/tobias/playpad/action/connect/NavigateActionConnect.java b/PlayWall/src/de/tobias/playpad/action/factory/NavigateActionFactory.java similarity index 64% rename from PlayWall/src/de/tobias/playpad/action/connect/NavigateActionConnect.java rename to PlayWall/src/de/tobias/playpad/action/factory/NavigateActionFactory.java index 43c8993ad95b68351a98cd8bf7e8acea2a96cfb0..34d822e0f9c2635d5aba3f466a727286ad2c1508 100644 --- a/PlayWall/src/de/tobias/playpad/action/connect/NavigateActionConnect.java +++ b/PlayWall/src/de/tobias/playpad/action/factory/NavigateActionFactory.java @@ -1,11 +1,10 @@ -package de.tobias.playpad.action.connect; +package de.tobias.playpad.action.factory; import java.util.Collections; import java.util.List; -import de.tobias.playpad.Strings; import de.tobias.playpad.action.Action; -import de.tobias.playpad.action.ActionConnect; +import de.tobias.playpad.action.ActionFactory; import de.tobias.playpad.action.ActionDisplayable; import de.tobias.playpad.action.ActionType; import de.tobias.playpad.action.Mapping; @@ -15,15 +14,14 @@ import de.tobias.playpad.settings.Profile; import de.tobias.utils.ui.ContentViewController; import de.tobias.utils.ui.icon.FontIcon; import de.tobias.utils.ui.icon.MaterialDesignIcon; -import de.tobias.utils.util.Localization; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; import javafx.scene.Node; import javafx.scene.control.TreeItem; -public class NavigateActionConnect extends ActionConnect implements ActionDisplayable { +public class NavigateActionFactory extends ActionFactory implements ActionDisplayable { - public static final String TYPE = "NAVIGATE"; + public NavigateActionFactory(String type) { + super(type); + } @Override public TreeItem<ActionDisplayable> getTreeViewForActions(List<Action> actions, Mapping mapping) { @@ -49,18 +47,8 @@ public class NavigateActionConnect extends ActionConnect implements ActionDispla @Override public void initActionType(Mapping mapping, Profile profile) { - mapping.addActionIfNotContains(new NavigateAction(NavigationType.PREVIOUS)); - mapping.addActionIfNotContains(new NavigateAction(NavigationType.NEXT)); - } - - @Override - public StringProperty displayProperty() { - return new SimpleStringProperty(Localization.getString(Strings.Action_Navigate_Name)); - } - - @Override - public Node getGraphics() { - return new FontIcon(MaterialDesignIcon.FONT_FILE, MaterialDesignIcon.NAVIGATION); + mapping.addActionIfNotContains(new NavigateAction(getType(), NavigationType.PREVIOUS)); + mapping.addActionIfNotContains(new NavigateAction(getType(), NavigationType.NEXT)); } @Override @@ -70,7 +58,7 @@ public class NavigateActionConnect extends ActionConnect implements ActionDispla @Override public Action newInstance() { - return new NavigateAction(); + return new NavigateAction(getType()); } @Override @@ -78,8 +66,4 @@ public class NavigateActionConnect extends ActionConnect implements ActionDispla return ActionType.CONTROL; } - @Override - public String getType() { - return TYPE; - } } diff --git a/PlayWall/src/de/tobias/playpad/action/connect/PageActionConnect.java b/PlayWall/src/de/tobias/playpad/action/factory/PageActionFactory.java similarity index 69% rename from PlayWall/src/de/tobias/playpad/action/connect/PageActionConnect.java rename to PlayWall/src/de/tobias/playpad/action/factory/PageActionFactory.java index 982f9799f9dbbf871a73714a271f761e81a249df..d9af8f2a18bf0a539bbfad58e5828445200eb184 100644 --- a/PlayWall/src/de/tobias/playpad/action/connect/PageActionConnect.java +++ b/PlayWall/src/de/tobias/playpad/action/factory/PageActionFactory.java @@ -1,11 +1,10 @@ -package de.tobias.playpad.action.connect; +package de.tobias.playpad.action.factory; import java.util.Collections; import java.util.List; -import de.tobias.playpad.Strings; import de.tobias.playpad.action.Action; -import de.tobias.playpad.action.ActionConnect; +import de.tobias.playpad.action.ActionFactory; import de.tobias.playpad.action.ActionDisplayable; import de.tobias.playpad.action.ActionType; import de.tobias.playpad.action.Mapping; @@ -15,15 +14,14 @@ import de.tobias.playpad.settings.Profile; import de.tobias.utils.ui.ContentViewController; import de.tobias.utils.ui.icon.FontAwesomeType; import de.tobias.utils.ui.icon.FontIcon; -import de.tobias.utils.util.Localization; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; import javafx.scene.Node; import javafx.scene.control.TreeItem; -public class PageActionConnect extends ActionConnect implements ActionDisplayable { +public class PageActionFactory extends ActionFactory implements ActionDisplayable { - public static final String TYPE = "PAGE"; + public PageActionFactory(String type) { + super(type); + } @Override public TreeItem<ActionDisplayable> getTreeViewForActions(List<Action> actions, Mapping mapping) { @@ -51,21 +49,11 @@ public class PageActionConnect extends ActionConnect implements ActionDisplayabl @Override public void initActionType(Mapping mapping, Profile profile) { for (int i = 0; i < ProjectSettings.MAX_PAGES; i++) { - PageAction action = new PageAction(i); + PageAction action = new PageAction(getType(), i); mapping.addActionIfNotContains(action); } } - @Override - public StringProperty displayProperty() { - return new SimpleStringProperty(Localization.getString(Strings.Action_Page_Name)); - } - - @Override - public Node getGraphics() { - return new FontIcon(FontAwesomeType.FILE_TEXT); - } - @Override public ContentViewController getSettingsViewController() { return null; @@ -73,7 +61,7 @@ public class PageActionConnect extends ActionConnect implements ActionDisplayabl @Override public Action newInstance() { - return new PageAction(); + return new PageAction(getType()); } @Override @@ -81,8 +69,4 @@ public class PageActionConnect extends ActionConnect implements ActionDisplayabl return ActionType.CONTROL; } - @Override - public String getType() { - return TYPE; - } } diff --git a/PlayWall/src/de/tobias/playpad/action/mapper/KeyboardMapper.java b/PlayWall/src/de/tobias/playpad/action/mapper/KeyboardMapper.java index cdc25969f5935c889785b2f9cbfa3ba1a717dc5e..04d18be7ef9a672e26005f21dc13591dde47575b 100644 --- a/PlayWall/src/de/tobias/playpad/action/mapper/KeyboardMapper.java +++ b/PlayWall/src/de/tobias/playpad/action/mapper/KeyboardMapper.java @@ -14,16 +14,17 @@ import javafx.scene.input.KeyCode; public class KeyboardMapper extends Mapper { + private final String type; + private KeyCode code; private String key; - public KeyboardMapper() { - this.code = KeyCode.A; - this.key = "A"; - updateDisplayProperty(); + public KeyboardMapper(String type) { + this(type, KeyCode.A, "A"); } - public KeyboardMapper(KeyCode code, String key) { + public KeyboardMapper(String type, KeyCode code, String key) { + this.type = type; this.code = code; this.key = key; updateDisplayProperty(); @@ -49,7 +50,7 @@ public class KeyboardMapper extends Mapper { @Override public String getType() { - return KeyboardMapperConnect.TYPE; + return type; } public String getReadableName() { diff --git a/PlayWall/src/de/tobias/playpad/action/mapper/KeyboardMapperConnect.java b/PlayWall/src/de/tobias/playpad/action/mapper/KeyboardMapperFactory.java similarity index 63% rename from PlayWall/src/de/tobias/playpad/action/mapper/KeyboardMapperConnect.java rename to PlayWall/src/de/tobias/playpad/action/mapper/KeyboardMapperFactory.java index 89bec3547663841b401e36f5101152151a38aa6b..67193d310172f71721e256f49bbcb8221d3a7ad0 100644 --- a/PlayWall/src/de/tobias/playpad/action/mapper/KeyboardMapperConnect.java +++ b/PlayWall/src/de/tobias/playpad/action/mapper/KeyboardMapperFactory.java @@ -1,11 +1,14 @@ package de.tobias.playpad.action.mapper; import de.tobias.playpad.Strings; +import de.tobias.utils.ui.icon.FontIconType; import de.tobias.utils.util.Localization; -public class KeyboardMapperConnect extends MapperConnect { +public class KeyboardMapperFactory extends MapperFactory { - public static final String TYPE = "KEYBOARD"; + public KeyboardMapperFactory(String type) { + super(type); + } @Override public MapperViewController getQuickSettingsViewController(Mapper mapper) { @@ -14,14 +17,10 @@ public class KeyboardMapperConnect extends MapperConnect { @Override public Mapper createNewMapper() { - return new KeyboardMapper(); - } - - @Override - public String getType() { - return TYPE; + return new KeyboardMapper(getType()); } + // TODO Remove @Override public String toString() { return Localization.getString(Strings.Mapper_Keyboard_Name); diff --git a/PlayWall/src/de/tobias/playpad/action/mapper/MidiMapper.java b/PlayWall/src/de/tobias/playpad/action/mapper/MidiMapper.java index f4073ed53acb60792b896faff8737c8aa3d4dfa8..2e2544ad5372e6c6d4a5b0c97cf0ed43410aead9 100644 --- a/PlayWall/src/de/tobias/playpad/action/mapper/MidiMapper.java +++ b/PlayWall/src/de/tobias/playpad/action/mapper/MidiMapper.java @@ -25,20 +25,20 @@ import javafx.scene.paint.Color; public class MidiMapper extends Mapper implements ColorAssociator, MapperFeedbackable { + private String type; + private int command; private int key; private Feedback feedback; private FeedbackType feedbackType; - public MidiMapper() { - this.command = 0; - this.key = 0; - - updateDisplayProperty(); + public MidiMapper(String type) { + this(type, 0, 0); } - public MidiMapper(int command, int key) { + public MidiMapper(String type, int command, int key) { + this.type = type; this.command = command; this.key = key; updateDisplayProperty(); @@ -90,7 +90,7 @@ public class MidiMapper extends Mapper implements ColorAssociator, MapperFeedbac @Override public String getType() { - return MidiMapperConnect.TYPE; + return type; } // Feedback, abhängig vom Device diff --git a/PlayWall/src/de/tobias/playpad/action/mapper/MidiMapperConnect.java b/PlayWall/src/de/tobias/playpad/action/mapper/MidiMapperFactory.java similarity index 57% rename from PlayWall/src/de/tobias/playpad/action/mapper/MidiMapperConnect.java rename to PlayWall/src/de/tobias/playpad/action/mapper/MidiMapperFactory.java index e70c964c141cca12ef407f30e7c0a79e9cc604fb..ffeb227ae4bf2a2c94e10bd041c4da96b41294bd 100644 --- a/PlayWall/src/de/tobias/playpad/action/mapper/MidiMapperConnect.java +++ b/PlayWall/src/de/tobias/playpad/action/mapper/MidiMapperFactory.java @@ -1,12 +1,16 @@ package de.tobias.playpad.action.mapper; import de.tobias.playpad.Strings; +import de.tobias.playpad.action.mididevice.Device; import de.tobias.playpad.midi.Midi; +import de.tobias.utils.ui.icon.FontIconType; import de.tobias.utils.util.Localization; -public class MidiMapperConnect extends MapperConnect implements MapperConnectFeedbackable { +public class MidiMapperFactory extends MapperFactory implements MapperConnectFeedbackable { - public static final String TYPE = "MIDI"; + public MidiMapperFactory(String type) { + super(type); + } @Override public MapperViewController getQuickSettingsViewController(Mapper mapper) { @@ -15,24 +19,20 @@ public class MidiMapperConnect extends MapperConnect implements MapperConnectFee @Override public Mapper createNewMapper() { - return new MidiMapper(); + return new MidiMapper(getType()); } @Override public void initFeedbackType() { - Midi.getInstance().getMidiDevice().ifPresent(device -> device.initDevice()); + Midi.getInstance().getMidiDevice().ifPresent(Device::initDevice); } @Override public void clearFeedbackType() { - Midi.getInstance().getMidiDevice().ifPresent(device -> device.clearFeedback()); - } - - @Override - public String getType() { - return TYPE; + Midi.getInstance().getMidiDevice().ifPresent(Device::clearFeedback); } + // TODO Remove @Override public String toString() { return Localization.getString(Strings.Mapper_Midi_Name); diff --git a/PlayWall/src/de/tobias/playpad/audio/ClipAudioHandler.java b/PlayWall/src/de/tobias/playpad/audio/ClipAudioHandler.java index d80cae8b7c5065780df897b9490f41598050657d..b108a75b4a8c7e4628f5b53a4389730071b56b87 100644 --- a/PlayWall/src/de/tobias/playpad/audio/ClipAudioHandler.java +++ b/PlayWall/src/de/tobias/playpad/audio/ClipAudioHandler.java @@ -35,8 +35,6 @@ import javazoom.jl.decoder.JavaLayerException; public class ClipAudioHandler extends AudioHandler { - public static final String TYPE = "clip"; - public static final String NAME = "Clip (Experimental)"; private static final String MP3 = "mp3"; private Mixer mixer; diff --git a/PlayWall/src/de/tobias/playpad/audio/ClipAudioHandlerConnect.java b/PlayWall/src/de/tobias/playpad/audio/ClipAudioHandlerFactory.java similarity index 84% rename from PlayWall/src/de/tobias/playpad/audio/ClipAudioHandlerConnect.java rename to PlayWall/src/de/tobias/playpad/audio/ClipAudioHandlerFactory.java index 24e5ee44d90437d47c5a133b015ace6cb4f23757..dbe49172360ed8bbdf468bee8626ea4da89c1377 100644 --- a/PlayWall/src/de/tobias/playpad/audio/ClipAudioHandlerConnect.java +++ b/PlayWall/src/de/tobias/playpad/audio/ClipAudioHandlerFactory.java @@ -3,8 +3,13 @@ package de.tobias.playpad.audio; import de.tobias.playpad.pad.conntent.PadContent; import de.tobias.playpad.viewcontroller.AudioHandlerViewController; import de.tobias.playpad.viewcontroller.audio.ClipSettingsViewController; +import de.tobias.utils.ui.icon.FontIconType; -public class ClipAudioHandlerConnect extends AudioHandlerConnect implements AutoCloseable { +public class ClipAudioHandlerFactory extends AudioHandlerFactory implements AutoCloseable { + + public ClipAudioHandlerFactory(String type) { + super(type); + } @Override public AudioHandler createAudioHandler(PadContent content) { @@ -16,11 +21,6 @@ public class ClipAudioHandlerConnect extends AudioHandlerConnect implements Auto return new ClipSettingsViewController(); } - @Override - public String getType() { - return ClipAudioHandler.TYPE; - } - @Override public void close() throws Exception { ClipAudioHandler.shutdown(); diff --git a/PlayWall/src/de/tobias/playpad/audio/JavaFXAudioHandler.java b/PlayWall/src/de/tobias/playpad/audio/JavaFXAudioHandler.java index a5a4a39fd0d2fd0e84298b9ad8578a9ab59bcf4d..02af656d2c50e2cb0a9a2701522f2f2aa36c6a7a 100644 --- a/PlayWall/src/de/tobias/playpad/audio/JavaFXAudioHandler.java +++ b/PlayWall/src/de/tobias/playpad/audio/JavaFXAudioHandler.java @@ -18,9 +18,6 @@ import javafx.util.Duration; public class JavaFXAudioHandler extends AudioHandler implements Equalizable { - public static final String TYPE = "JavaFx"; - public static final String NAME = "Java FX Media"; - private Media media; private MediaPlayer player; diff --git a/PlayWall/src/de/tobias/playpad/audio/JavaFXHandlerConnect.java b/PlayWall/src/de/tobias/playpad/audio/JavaFXHandlerFactory.java similarity index 81% rename from PlayWall/src/de/tobias/playpad/audio/JavaFXHandlerConnect.java rename to PlayWall/src/de/tobias/playpad/audio/JavaFXHandlerFactory.java index fb63c182d18ddb891dc3b55d9892f46954c49aa0..e7801045525443f01ce78886bcbd33a9078f8e8d 100644 --- a/PlayWall/src/de/tobias/playpad/audio/JavaFXHandlerConnect.java +++ b/PlayWall/src/de/tobias/playpad/audio/JavaFXHandlerFactory.java @@ -2,8 +2,13 @@ package de.tobias.playpad.audio; import de.tobias.playpad.pad.conntent.PadContent; import de.tobias.playpad.viewcontroller.AudioHandlerViewController; +import de.tobias.utils.ui.icon.FontIconType; -public class JavaFXHandlerConnect extends AudioHandlerConnect { +public class JavaFXHandlerFactory extends AudioHandlerFactory { + + public JavaFXHandlerFactory(String type) { + super(type); + } @Override public AudioHandler createAudioHandler(PadContent content) { @@ -15,11 +20,6 @@ public class JavaFXHandlerConnect extends AudioHandlerConnect { return null; } - @Override - public String getType() { - return JavaFXAudioHandler.TYPE; - } - @Override public boolean isFeatureAvaiable(AudioCapability audioCapability) { for (Class<?> clazz : JavaFXAudioHandler.class.getInterfaces()) { diff --git a/PlayWall/src/de/tobias/playpad/audio/TinyAudioHandlerConnect.java b/PlayWall/src/de/tobias/playpad/audio/TinyAudioHandlerFactory.java similarity index 86% rename from PlayWall/src/de/tobias/playpad/audio/TinyAudioHandlerConnect.java rename to PlayWall/src/de/tobias/playpad/audio/TinyAudioHandlerFactory.java index af7bc01e9e2ffdd0281f2649c737d44fc323033f..789a6774146b1ffca780459f170f95eba1f24fbe 100644 --- a/PlayWall/src/de/tobias/playpad/audio/TinyAudioHandlerConnect.java +++ b/PlayWall/src/de/tobias/playpad/audio/TinyAudioHandlerFactory.java @@ -3,8 +3,13 @@ package de.tobias.playpad.audio; import de.tobias.playpad.pad.conntent.PadContent; import de.tobias.playpad.viewcontroller.AudioHandlerViewController; import de.tobias.playpad.viewcontroller.audio.TinySoundSettingsViewController; +import de.tobias.utils.ui.icon.FontIconType; -public class TinyAudioHandlerConnect extends AudioHandlerConnect implements AutoCloseable { +public class TinyAudioHandlerFactory extends AudioHandlerFactory implements AutoCloseable { + + public TinyAudioHandlerFactory(String type) { + super(type); + } @Override public AudioHandler createAudioHandler(PadContent content) { diff --git a/PlayWall/src/de/tobias/playpad/components/Actions.xml b/PlayWall/src/de/tobias/playpad/components/Actions.xml index f35a84f150b73b9f342010fd489c87b06e54c1c8..3b7155c5468196b353776608257e3a2f247bde0d 100644 --- a/PlayWall/src/de/tobias/playpad/components/Actions.xml +++ b/PlayWall/src/de/tobias/playpad/components/Actions.xml @@ -1,5 +1,5 @@ <Actions> - <Component id="CART">de.tobias.playpad.action.connect.CartActionConnect</Component> - <Component id="PAGE">de.tobias.playpad.action.connect.PageActionConnect</Component> - <Component id="NAVIGATE">de.tobias.playpad.action.connect.NavigateActionConnect</Component> + <Component id="CART" name="Action.Cart.Name" icon="TH" class="de.tobias.utils.ui.icon.FontAwesomeType" size="11">de.tobias.playpad.action.factory.CartActionFactory</Component> + <Component id="PAGE" name="Action.Page.Name" icon="FILE_TEXT" class="de.tobias.utils.ui.icon.FontAwesomeType" size="11">de.tobias.playpad.action.factory.PageActionFactory</Component> + <Component id="NAVIGATE" name="Action.Navigate.Name" icon="NAVIGATION" class="de.tobias.utils.ui.icon.MaterialDesignIcon" size="11">de.tobias.playpad.action.factory.NavigateActionFactory</Component> </Actions> \ No newline at end of file diff --git a/PlayWall/src/de/tobias/playpad/components/AudioHandler.xml b/PlayWall/src/de/tobias/playpad/components/AudioHandler.xml index 4eb786b33b8fda7019303f173383fccc60afdaca..85250d1abb4f6f99e08958ffba643f2bcba898c6 100644 --- a/PlayWall/src/de/tobias/playpad/components/AudioHandler.xml +++ b/PlayWall/src/de/tobias/playpad/components/AudioHandler.xml @@ -1,4 +1,4 @@ <Actions> - <Component id="JavaFx">de.tobias.playpad.audio.JavaFXHandlerConnect</Component> - <Component id="TinyAudio">de.tobias.playpad.audio.TinyAudioHandlerConnect</Component> + <Component id="JavaFx" name="AudioHandler.JavaFX">de.tobias.playpad.audio.JavaFXHandlerFactory</Component> + <Component id="TinyAudio" name="AudioHandler.TinySound">de.tobias.playpad.audio.TinyAudioHandlerFactory</Component> </Actions> \ No newline at end of file diff --git a/PlayWall/src/de/tobias/playpad/components/Design.xml b/PlayWall/src/de/tobias/playpad/components/Design.xml index 0e8188e17752e3889f820bc8f0804dd9aebadb6f..bedc116a94a86d155a16ddeaa9da477a479fac98 100644 --- a/PlayWall/src/de/tobias/playpad/components/Design.xml +++ b/PlayWall/src/de/tobias/playpad/components/Design.xml @@ -1,4 +1,4 @@ <Actions> - <Component id="modern" default="true">de.tobias.playpad.design.modern.ModernDesignConnect</Component> - <Component id="classic">de.tobias.playpad.design.classic.ClassicDesignConnect</Component> + <Component id="modern" default="true" name="Layout.Modern.Name">de.tobias.playpad.design.modern.ModernDesignFactory</Component> + <Component id="classic" name="Layout.Classic.Name">de.tobias.playpad.design.classic.ClassicDesignFactory</Component> </Actions> \ No newline at end of file diff --git a/PlayWall/src/de/tobias/playpad/components/DragMode.xml b/PlayWall/src/de/tobias/playpad/components/DragMode.xml index 3d2b2e610574982028042d5f8a3de259d4c69ac6..dfe07e158e6b8a5e4a7255880a8b8577a2900f28 100644 --- a/PlayWall/src/de/tobias/playpad/components/DragMode.xml +++ b/PlayWall/src/de/tobias/playpad/components/DragMode.xml @@ -1,5 +1,5 @@ <Actions> - <Component id="move">de.tobias.playpad.pad.drag.MoveDragMode</Component> - <Component id="duplicate">de.tobias.playpad.pad.drag.DuplicateDragMode</Component> - <Component id="replace">de.tobias.playpad.pad.drag.ReplaceDragMode</Component> + <Component id="move" name="DnDMode.Move" icon="ARROWS" class="de.tobias.utils.ui.icon.FontAwesomeType" size="30">de.tobias.playpad.pad.drag.MoveDragMode</Component> + <Component id="duplicate" name="DnDMode.Duplicate" icon="COPY" class="de.tobias.utils.ui.icon.FontAwesomeType" size="30">de.tobias.playpad.pad.drag.DuplicateDragMode</Component> + <Component id="replace" name="DnDMode.Replace" icon="ARROW_CIRCLE_RIGHT" class="de.tobias.utils.ui.icon.FontAwesomeType" size="30">de.tobias.playpad.pad.drag.ReplaceDragMode</Component> </Actions> \ No newline at end of file diff --git a/PlayWall/src/de/tobias/playpad/components/Layout.xml b/PlayWall/src/de/tobias/playpad/components/Layout.xml index a828ab59a3c21cb03d30f9c95f42ee754b5ff0e3..ef8c5544f2d66ed0c0e71cbe4540a93fc3498254 100644 --- a/PlayWall/src/de/tobias/playpad/components/Layout.xml +++ b/PlayWall/src/de/tobias/playpad/components/Layout.xml @@ -1,4 +1,4 @@ <Actions> - <Component id="Desktop" default="true">de.tobias.playpad.layout.desktop.DesktopMainLayoutConnect</Component> - <Component id="Touch">de.tobias.playpad.layout.touch.TouchMainLayoutConnect</Component> + <Component id="Desktop" default="true" name="MainLayout.Desktop">de.tobias.playpad.layout.desktop.DesktopMainLayoutFactory</Component> + <Component id="Touch" name="MainLayout.Touch">de.tobias.playpad.layout.touch.TouchMainLayoutFactory</Component> </Actions> \ No newline at end of file diff --git a/PlayWall/src/de/tobias/playpad/components/Mapper.xml b/PlayWall/src/de/tobias/playpad/components/Mapper.xml index 9e0a14811feb8d3685b1c4ac6f3bfcc4e7b630c0..31119a3d67b7560cb458da389125dc303455cfaa 100644 --- a/PlayWall/src/de/tobias/playpad/components/Mapper.xml +++ b/PlayWall/src/de/tobias/playpad/components/Mapper.xml @@ -1,4 +1,4 @@ <Actions> - <Component id="MIDI">de.tobias.playpad.action.mapper.MidiMapperConnect</Component> - <Component id="KEYBOARD">de.tobias.playpad.action.mapper.KeyboardMapperConnect</Component> + <Component id="MIDI" name="Mapper.Midi.Name">de.tobias.playpad.action.mapper.MidiMapperFactory</Component> + <Component id="KEYBOARD" name="Mapper.Keyboard.Name">de.tobias.playpad.action.mapper.KeyboardMapperFactory</Component> </Actions> \ No newline at end of file diff --git a/PlayWall/src/de/tobias/playpad/components/PadContent.xml b/PlayWall/src/de/tobias/playpad/components/PadContent.xml index 43cfee85756a26829416ccb4b0122a5fb982b9bf..e592d5873a5911b5052bfbd179fff47827831b5b 100644 --- a/PlayWall/src/de/tobias/playpad/components/PadContent.xml +++ b/PlayWall/src/de/tobias/playpad/components/PadContent.xml @@ -1,3 +1,3 @@ <Actions> - <Component id="audio">de.tobias.playpad.pad.content.AudioContentConnect</Component> + <Component id="audio" name="Content.Audio.Name" icon="MUSIC" class="de.tobias.utils.ui.icon.FontAwesomeType" size="30">de.tobias.playpad.pad.content.AudioContentFactory</Component> </Actions> \ No newline at end of file diff --git a/PlayWall/src/de/tobias/playpad/components/Trigger.xml b/PlayWall/src/de/tobias/playpad/components/Trigger.xml index 2b5b149507c381b952aa088bc722fea183c5c093..ab11aef45069f1eeec9edb2e58108802b7f808cd 100644 --- a/PlayWall/src/de/tobias/playpad/components/Trigger.xml +++ b/PlayWall/src/de/tobias/playpad/components/Trigger.xml @@ -1,4 +1,4 @@ <Actions> - <Component id="Cart">de.tobias.playpad.trigger.CartTriggerItemConnect</Component> - <Component id="Volume">de.tobias.playpad.trigger.VolumeTriggerItemConnect</Component> + <Component id="Cart" name="Trigger.Cart.Name">de.tobias.playpad.trigger.CartTriggerItemFactory</Component> + <Component id="Volume" name="Trigger.Volume.Name">de.tobias.playpad.trigger.VolumeTriggerItemFactory</Component> </Actions> \ No newline at end of file diff --git a/PlayWall/src/de/tobias/playpad/design/classic/ClassicDesignConnect.java b/PlayWall/src/de/tobias/playpad/design/classic/ClassicDesignFactory.java similarity index 64% rename from PlayWall/src/de/tobias/playpad/design/classic/ClassicDesignConnect.java rename to PlayWall/src/de/tobias/playpad/design/classic/ClassicDesignFactory.java index d551c8a3bf703aaf6657fd60253954cb13765109..231786e27ee9d5ef40380d9d9bc87f393c60a787 100644 --- a/PlayWall/src/de/tobias/playpad/design/classic/ClassicDesignConnect.java +++ b/PlayWall/src/de/tobias/playpad/design/classic/ClassicDesignFactory.java @@ -1,29 +1,19 @@ package de.tobias.playpad.design.classic; -import de.tobias.playpad.Strings; import de.tobias.playpad.design.CartDesign; -import de.tobias.playpad.design.DesignConnect; +import de.tobias.playpad.design.DesignFactory; import de.tobias.playpad.design.GlobalDesign; import de.tobias.playpad.viewcontroller.CartDesignViewController; import de.tobias.playpad.viewcontroller.GlobalDesignViewController; import de.tobias.playpad.viewcontroller.design.ClassicCartDesignViewController; import de.tobias.playpad.viewcontroller.design.ClassicGlobalDesignViewController; -import de.tobias.utils.util.Localization; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import de.tobias.utils.ui.icon.FontIconType; -public class ClassicDesignConnect extends DesignConnect { +public class ClassicDesignFactory extends DesignFactory { - private static final String TYPE = "classic"; - @Override - public StringProperty displayProperty() { - return new SimpleStringProperty(Localization.getString(Strings.Layout_Classic_Name)); - } - - @Override - public String getType() { - return TYPE; + public ClassicDesignFactory(String type) { + super(type); } @Override diff --git a/PlayWall/src/de/tobias/playpad/design/modern/ModernDesignConnect.java b/PlayWall/src/de/tobias/playpad/design/modern/ModernDesignFactory.java similarity index 64% rename from PlayWall/src/de/tobias/playpad/design/modern/ModernDesignConnect.java rename to PlayWall/src/de/tobias/playpad/design/modern/ModernDesignFactory.java index f39235706560e340277ec0128e14fdad1a500103..5e241db9654697d585425fbd0077201ffd08c167 100644 --- a/PlayWall/src/de/tobias/playpad/design/modern/ModernDesignConnect.java +++ b/PlayWall/src/de/tobias/playpad/design/modern/ModernDesignFactory.java @@ -1,29 +1,19 @@ package de.tobias.playpad.design.modern; -import de.tobias.playpad.Strings; import de.tobias.playpad.design.CartDesign; -import de.tobias.playpad.design.DesignConnect; +import de.tobias.playpad.design.DesignFactory; import de.tobias.playpad.design.GlobalDesign; import de.tobias.playpad.viewcontroller.CartDesignViewController; import de.tobias.playpad.viewcontroller.GlobalDesignViewController; import de.tobias.playpad.viewcontroller.design.ModernCartDesignViewController; import de.tobias.playpad.viewcontroller.design.ModernGlobalDesignViewController; -import de.tobias.utils.util.Localization; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import de.tobias.utils.ui.icon.FontIconType; -public class ModernDesignConnect extends DesignConnect { +public class ModernDesignFactory extends DesignFactory { - private static final String TYPE = "modern"; - @Override - public StringProperty displayProperty() { - return new SimpleStringProperty(Localization.getString(Strings.Layout_Modern_Name)); - } - - @Override - public String getType() { - return TYPE; + public ModernDesignFactory(String type) { + super(type); } @Override diff --git a/PlayWall/src/de/tobias/playpad/design/modern/ModernGlobalDesign.java b/PlayWall/src/de/tobias/playpad/design/modern/ModernGlobalDesign.java index 37ff76e8f621881c49b2d9f28bc06f412ac83e2c..2de8bf6c30afb35e81c51ebaa1dcfa2f7c50d4fc 100644 --- a/PlayWall/src/de/tobias/playpad/design/modern/ModernGlobalDesign.java +++ b/PlayWall/src/de/tobias/playpad/design/modern/ModernGlobalDesign.java @@ -32,8 +32,6 @@ import javafx.util.Duration; public class ModernGlobalDesign extends Design implements GlobalDesign, DesignColorAssociator, ColorModeHandler { - public static final String TYPE = "modern"; - public static final double minWidth = 205; public static final double minHeight = 115; diff --git a/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopMainLayoutConnect.java b/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopMainLayoutFactory.java similarity index 83% rename from PlayWall/src/de/tobias/playpad/layout/desktop/DesktopMainLayoutConnect.java rename to PlayWall/src/de/tobias/playpad/layout/desktop/DesktopMainLayoutFactory.java index 9accf5d4df1d1b6da6de2812ecc72fa8b5b820c6..c4fedd83207191d8199757c9dbfc1929ff4257f9 100644 --- a/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopMainLayoutConnect.java +++ b/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopMainLayoutFactory.java @@ -6,9 +6,10 @@ import de.tobias.playpad.Strings; import de.tobias.playpad.layout.desktop.pad.DesktopPadView; import de.tobias.playpad.pad.view.IPadView; import de.tobias.playpad.settings.Profile; -import de.tobias.playpad.view.main.MainLayoutConnect; +import de.tobias.playpad.view.main.MainLayoutFactory; import de.tobias.playpad.viewcontroller.main.IMainViewController; import de.tobias.playpad.viewcontroller.main.MenuToolbarViewController; +import de.tobias.utils.ui.icon.FontIconType; import de.tobias.utils.util.Localization; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; @@ -20,29 +21,18 @@ import javafx.beans.property.SimpleObjectProperty; * * @since 5.1.0 */ -public class DesktopMainLayoutConnect implements MainLayoutConnect { - - private static final String TYPE = "Desktop"; +public class DesktopMainLayoutFactory extends MainLayoutFactory { private DesktopMenuToolbarViewController desktopMenuToolbarViewController; private ObjectProperty<DesktopEditMode> editMode = new SimpleObjectProperty<>(DesktopEditMode.PLAY); private Stack<IPadView> recyclingStack; - public DesktopMainLayoutConnect() { + public DesktopMainLayoutFactory(String type) { + super(type); recyclingStack = new Stack<>(); } - @Override - public String getType() { - return TYPE; - } - - @Override - public String name() { - return Localization.getString(Strings.MainLayout_Desktop); - } - @Override public MenuToolbarViewController createMenuToolbar(IMainViewController mainViewRef) { if (desktopMenuToolbarViewController == null) { diff --git a/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopMenuToolbarViewController.java b/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopMenuToolbarViewController.java index e33f2211b23a30989c405b797c0caf5d18942f24..67e1f160ddaa1808ffc9bf87bef2529bfe5ba9ea 100644 --- a/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopMenuToolbarViewController.java +++ b/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopMenuToolbarViewController.java @@ -33,7 +33,7 @@ import de.tobias.playpad.settings.ProfileNotFoundException; import de.tobias.playpad.settings.ProfileSettings; import de.tobias.playpad.settings.keys.KeyCollection; import de.tobias.playpad.view.HelpMenuItem; -import de.tobias.playpad.view.main.MainLayoutConnect; +import de.tobias.playpad.view.main.MainLayoutFactory; import de.tobias.playpad.view.main.MenuType; import de.tobias.playpad.viewcontroller.dialog.ErrorSummaryDialog; import de.tobias.playpad.viewcontroller.dialog.ImportDialog; @@ -136,9 +136,9 @@ public class DesktopMenuToolbarViewController extends BasicMenuToolbarViewContro private transient GlobalSettingsViewController globalSettingsViewController; private transient DesktopColorPickerView colorPickerView; - private DesktopMainLayoutConnect connect; + private DesktopMainLayoutFactory connect; - public DesktopMenuToolbarViewController(IMainViewController controller, DesktopMainLayoutConnect connect) { + public DesktopMenuToolbarViewController(IMainViewController controller, DesktopMainLayoutFactory connect) { super("header", "de/tobias/playpad/assets/view/main/desktop/", PlayPadMain.getUiResourceBundle()); this.mainViewController = controller; this.connect = connect; @@ -272,12 +272,12 @@ public class DesktopMenuToolbarViewController extends BasicMenuToolbarViewContro private void initLayoutMenu() { ProfileSettings profileSettings = Profile.currentProfile().getProfileSettings(); - Registry<MainLayoutConnect> mainLayouts = PlayPadPlugin.getRegistryCollection().getMainLayouts(); + Registry<MainLayoutFactory> mainLayouts = PlayPadPlugin.getRegistryCollection().getMainLayouts(); int index = 1; // Für Tastenkombination - for (MainLayoutConnect connect : mainLayouts.getComponents()) { + for (MainLayoutFactory connect : mainLayouts.getComponents()) { if (!connect.getType().equals(profileSettings.getMainLayoutType())) { - MenuItem item = new MenuItem(connect.name()); + MenuItem item = new MenuItem(connect.toString()); item.setOnAction(e -> { diff --git a/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadDragListener.java b/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadDragListener.java index 5d5ef535dc72721464a7cc66853ae51c8cfbfd69..8a24f60c47731c81b8d35baeffce6b13ce857659 100644 --- a/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadDragListener.java +++ b/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadDragListener.java @@ -7,10 +7,10 @@ import java.util.Set; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.layout.desktop.DesktopEditMode; -import de.tobias.playpad.layout.desktop.DesktopMainLayoutConnect; +import de.tobias.playpad.layout.desktop.DesktopMainLayoutFactory; import de.tobias.playpad.pad.Pad; +import de.tobias.playpad.pad.conntent.ContentFactory; import de.tobias.playpad.pad.conntent.PadContent; -import de.tobias.playpad.pad.conntent.PadContentConnect; import de.tobias.playpad.pad.conntent.PadContentRegistry; import de.tobias.playpad.pad.drag.PadDragMode; import de.tobias.playpad.pad.view.IPadView; @@ -43,13 +43,13 @@ public class DesktopPadDragListener implements EventHandler<DragEvent> { private Pad currentPad; private final Pane padView; // Node der PadView - private DesktopMainLayoutConnect connect; + private DesktopMainLayoutFactory connect; private static Project project; private PadDragOptionView padHud; private FileDragOptionView fileHud; - public DesktopPadDragListener(Pad currentPad, IPadView view, DesktopMainLayoutConnect connect) { + public DesktopPadDragListener(Pad currentPad, IPadView view, DesktopMainLayoutFactory connect) { this.currentPad = currentPad; this.connect = connect; @@ -97,7 +97,7 @@ public class DesktopPadDragListener implements EventHandler<DragEvent> { // Build In Filesupport try { PadContentRegistry registry = PlayPadPlugin.getRegistryCollection().getPadContents(); - Set<PadContentConnect> connects = registry.getPadContentConnectsForFile(file.toPath()); + Set<ContentFactory> connects = registry.getPadContentConnectsForFile(file.toPath()); if (!connects.isEmpty()) { if (fileHud == null) { @@ -153,7 +153,7 @@ public class DesktopPadDragListener implements EventHandler<DragEvent> { success = true; File file = db.getFiles().get(0); - PadContentConnect connect = fileHud.getSelectedConnect(); + ContentFactory connect = fileHud.getSelectedConnect(); if (connect != null) { PadContent content = currentPad.getContent(); if (currentPad.getContent() == null || !currentPad.getContent().getType().equals(connect.getType())) { diff --git a/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadView.java b/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadView.java index 567d497b129d854acc27d35780b9ba17446eeabd..f1d064a4bbeca9cea44c23e59d64c29c683d8e6b 100644 --- a/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadView.java +++ b/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadView.java @@ -2,10 +2,10 @@ package de.tobias.playpad.layout.desktop.pad; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.PseudoClasses; -import de.tobias.playpad.layout.desktop.DesktopMainLayoutConnect; +import de.tobias.playpad.layout.desktop.DesktopMainLayoutFactory; import de.tobias.playpad.pad.Pad; import de.tobias.playpad.pad.conntent.PadContent; -import de.tobias.playpad.pad.conntent.PadContentConnect; +import de.tobias.playpad.pad.conntent.ContentFactory; import de.tobias.playpad.pad.conntent.PadContentRegistry; import de.tobias.playpad.pad.conntent.play.Pauseable; import de.tobias.playpad.pad.view.IPadContentView; @@ -59,7 +59,7 @@ public class DesktopPadView implements IPadView { private transient DesktopPadViewController controller; // Reference to its controller - public DesktopPadView(DesktopMainLayoutConnect connect) { + public DesktopPadView(DesktopMainLayoutFactory connect) { controller = new DesktopPadViewController(this, connect); setupView(); } @@ -138,7 +138,7 @@ public class DesktopPadView implements IPadView { if (content != null) { try { PadContentRegistry registry = PlayPadPlugin.getRegistryCollection().getPadContents(); - PadContentConnect connect = registry.getComponent(content.getType()); + ContentFactory connect = registry.getFactory(content.getType()); previewContent = connect.getPadContentPreview(pad, preview); Node node = previewContent.getNode(); diff --git a/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadViewController.java b/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadViewController.java index b252d13b36915e32bbb9e4709bdf38fc69e777ce..30da0dea16d78577d36bc4f6415000051c7d58fd 100644 --- a/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadViewController.java +++ b/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadViewController.java @@ -8,12 +8,12 @@ import java.util.Set; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.Strings; import de.tobias.playpad.layout.desktop.DesktopEditMode; -import de.tobias.playpad.layout.desktop.DesktopMainLayoutConnect; +import de.tobias.playpad.layout.desktop.DesktopMainLayoutFactory; import de.tobias.playpad.pad.Pad; import de.tobias.playpad.pad.PadStatus; import de.tobias.playpad.pad.TimeMode; import de.tobias.playpad.pad.conntent.PadContent; -import de.tobias.playpad.pad.conntent.PadContentConnect; +import de.tobias.playpad.pad.conntent.ContentFactory; import de.tobias.playpad.pad.conntent.PadContentRegistry; import de.tobias.playpad.pad.conntent.play.Durationable; import de.tobias.playpad.pad.listener.IPadPositionListener; @@ -59,9 +59,9 @@ public class DesktopPadViewController implements IPadViewController, EventHandle private DesktopPadDragListener padDragListener; - private static DesktopMainLayoutConnect connect; + private static DesktopMainLayoutFactory connect; - public DesktopPadViewController(DesktopPadView padView, DesktopMainLayoutConnect connect) { + public DesktopPadViewController(DesktopPadView padView, DesktopMainLayoutFactory connect) { this.padView = padView; if (DesktopPadViewController.connect != connect) // Set once @@ -229,7 +229,7 @@ public class DesktopPadViewController implements IPadViewController, EventHandle if (file != null) { Path path = file.toPath(); - Set<PadContentConnect> connects = registry.getPadContentConnectsForFile(file.toPath()); + Set<ContentFactory> connects = registry.getPadContentConnectsForFile(file.toPath()); if (!connects.isEmpty()) { if (connects.size() > 1) { FileDragOptionView hud = new FileDragOptionView(padView.getRootNode()); @@ -241,7 +241,7 @@ public class DesktopPadViewController implements IPadViewController, EventHandle } }); } else { - PadContentConnect connect = connects.iterator().next(); + ContentFactory connect = connects.iterator().next(); setNewPadContent(file, path, connect); } } @@ -250,7 +250,7 @@ public class DesktopPadViewController implements IPadViewController, EventHandle } } - private void setNewPadContent(File file, Path path, PadContentConnect connect) { + private void setNewPadContent(File file, Path path, ContentFactory connect) { PadContent content = pad.getContent(); if (pad.getContent() == null || !pad.getContent().getType().equals(connect.getType())) { content = connect.newInstance(pad); diff --git a/PlayWall/src/de/tobias/playpad/layout/touch/TouchMainLayoutConnect.java b/PlayWall/src/de/tobias/playpad/layout/touch/TouchMainLayoutFactory.java similarity index 76% rename from PlayWall/src/de/tobias/playpad/layout/touch/TouchMainLayoutConnect.java rename to PlayWall/src/de/tobias/playpad/layout/touch/TouchMainLayoutFactory.java index 07126bc71dff9c20f93a7e497463b508d07d739e..1f70ef5fcb1a6433adaa5d2928aba03afc0ae0ae 100644 --- a/PlayWall/src/de/tobias/playpad/layout/touch/TouchMainLayoutConnect.java +++ b/PlayWall/src/de/tobias/playpad/layout/touch/TouchMainLayoutFactory.java @@ -4,9 +4,10 @@ import java.util.Stack; import de.tobias.playpad.Strings; import de.tobias.playpad.pad.view.IPadView; -import de.tobias.playpad.view.main.MainLayoutConnect; +import de.tobias.playpad.view.main.MainLayoutFactory; import de.tobias.playpad.viewcontroller.main.IMainViewController; import de.tobias.playpad.viewcontroller.main.MenuToolbarViewController; +import de.tobias.utils.ui.icon.FontIconType; import de.tobias.utils.util.Localization; /** @@ -16,28 +17,17 @@ import de.tobias.utils.util.Localization; * * @since 5.1.0 */ -public class TouchMainLayoutConnect implements MainLayoutConnect { - - private static final String TYPE = "Touch"; +public class TouchMainLayoutFactory extends MainLayoutFactory { private TouchMenuToolbarViewController touchMainLayoutConnect; private Stack<IPadView> recyclingStack; - public TouchMainLayoutConnect() { + public TouchMainLayoutFactory(String type) { + super(type); recyclingStack = new Stack<>(); } - @Override - public String getType() { - return TYPE; - } - - @Override - public String name() { - return Localization.getString(Strings.MainLayout_Touch); - } - @Override public MenuToolbarViewController createMenuToolbar(IMainViewController mainViewRef) { if (touchMainLayoutConnect == null) { diff --git a/PlayWall/src/de/tobias/playpad/layout/touch/TouchMenuToolbarViewController.java b/PlayWall/src/de/tobias/playpad/layout/touch/TouchMenuToolbarViewController.java index 1c239edc95aeb74d17ddf47cce72a9869293cb1c..c3c5b6de9d258d20bb7ab5253198d655acaf7c33 100644 --- a/PlayWall/src/de/tobias/playpad/layout/touch/TouchMenuToolbarViewController.java +++ b/PlayWall/src/de/tobias/playpad/layout/touch/TouchMenuToolbarViewController.java @@ -7,7 +7,7 @@ import de.tobias.playpad.project.Project; import de.tobias.playpad.project.page.Page; import de.tobias.playpad.settings.Profile; import de.tobias.playpad.settings.keys.KeyCollection; -import de.tobias.playpad.view.main.MainLayoutConnect; +import de.tobias.playpad.view.main.MainLayoutFactory; import de.tobias.playpad.view.main.MenuType; import de.tobias.playpad.viewcontroller.main.BasicMenuToolbarViewController; import de.tobias.playpad.viewcontroller.main.IMainViewController; @@ -133,7 +133,7 @@ public class TouchMenuToolbarViewController extends BasicMenuToolbarViewControll // Event Handler @FXML void closeMenuItemHandler(ActionEvent event) { - MainLayoutConnect defaultLayout = PlayPadPlugin.getRegistryCollection().getMainLayouts().getDefault(); + MainLayoutFactory defaultLayout = PlayPadPlugin.getRegistryCollection().getMainLayouts().getDefault(); Profile.currentProfile().getProfileSettings().setMainLayoutType(defaultLayout.getType()); mainViewController.setMainLayout(defaultLayout); diff --git a/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java b/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java index 02c20f1a2be7cc5543b867a0e599c5af88cdf074..6868fa950409370116d1ebc327799afb087226dd 100644 --- a/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java +++ b/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java @@ -4,7 +4,7 @@ import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.PseudoClasses; import de.tobias.playpad.pad.Pad; import de.tobias.playpad.pad.conntent.PadContent; -import de.tobias.playpad.pad.conntent.PadContentConnect; +import de.tobias.playpad.pad.conntent.ContentFactory; import de.tobias.playpad.pad.view.IPadContentView; import de.tobias.playpad.pad.view.IPadView; import de.tobias.playpad.pad.viewcontroller.IPadViewController; @@ -113,7 +113,7 @@ public class TouchPadView implements IPadView { PadContent content = pad.getContent(); if (content != null) { try { - PadContentConnect connect = PlayPadPlugin.getRegistryCollection().getPadContents().getComponent(content.getType()); + ContentFactory connect = PlayPadPlugin.getRegistryCollection().getPadContents().getFactory(content.getType()); previewContent = connect.getPadContentPreview(pad, preview); Node node = previewContent.getNode(); diff --git a/PlayWall/src/de/tobias/playpad/pad/content/AudioContent.java b/PlayWall/src/de/tobias/playpad/pad/content/AudioContent.java index d7a07ac1327d20eafe34c6e920b3a07fe73bd053..8279b461a40c8bed0f8af391634019611ac4e005 100644 --- a/PlayWall/src/de/tobias/playpad/pad/content/AudioContent.java +++ b/PlayWall/src/de/tobias/playpad/pad/content/AudioContent.java @@ -35,7 +35,7 @@ import javafx.util.Duration; public class AudioContent extends PadContent implements Pauseable, Durationable, Fadeable, Equalizable, SinglePathContent, IVolume { - private static final String TYPE = "audio"; + private final String type; private Path path; private AudioHandler audioHandler; @@ -47,10 +47,11 @@ public class AudioContent extends PadContent implements Pauseable, Durationable, private Fading fading; - private transient Transition transition; - - public AudioContent(Pad pad) { + public AudioContent(String type, Pad pad) { super(pad); + this.type = type; + fading = new Fading(this); + // Pad Volume Listener volumeListener = (a, b, c) -> updateVolume(); } @@ -79,7 +80,7 @@ public class AudioContent extends PadContent implements Pauseable, Durationable, @Override public String getType() { - return TYPE; + return type; } @Override @@ -103,20 +104,17 @@ public class AudioContent extends PadContent implements Pauseable, Durationable, public void fadeIn() { Pad pad = getPad(); - if (pad.getPadSettings().getFade().getFadeIn().toMillis() > 0) { - fading.fadeIn(pad.getPadSettings().getFade().getFadeIn()); + Duration fadeIn = pad.getPadSettings().getFade().getFadeIn(); + if (fadeIn.toMillis() > 0) { + fading.fadeIn(fadeIn); } } @Override public void fadeOut(Runnable onFinish) { - if (transition != null) { - transition.stop(); - } - - if (getPad().getPadSettings().getFade().getFadeOut().toMillis() > 0) { - fading.fadeOut(getPad().getPadSettings().getFade().getFadeOut(), () -> - { + Duration fadeOut = getPad().getPadSettings().getFade().getFadeOut(); + if (fadeOut.toMillis() > 0) { + fading.fadeOut(fadeOut, () -> { onFinish.run(); updateVolume(); }); @@ -127,10 +125,7 @@ public class AudioContent extends PadContent implements Pauseable, Durationable, @Override public boolean isFading() { - if (transition != null) { - return true; - } - return false; + return fading.isFading(); } @Override @@ -180,10 +175,8 @@ public class AudioContent extends PadContent implements Pauseable, Durationable, AudioRegistry audioRegistry = PlayPadPlugin.getRegistryCollection().getAudioHandlers(); audioHandler = audioRegistry.getCurrentAudioHandler().createAudioHandler(this); - fading = new Fading(this); - if (Files.exists(path)) { - audioHandler.loadMedia(new Path[] { path }); + audioHandler.loadMedia(new Path[]{path}); durationProperty.bind(audioHandler.durationProperty()); positionProperty.bind(audioHandler.positionProperty()); diff --git a/PlayWall/src/de/tobias/playpad/pad/content/AudioContentConnect.java b/PlayWall/src/de/tobias/playpad/pad/content/AudioContentFactory.java similarity index 68% rename from PlayWall/src/de/tobias/playpad/pad/content/AudioContentConnect.java rename to PlayWall/src/de/tobias/playpad/pad/content/AudioContentFactory.java index f0eb579ddee579440e26edd3561596dc1cd2b48d..bbc9d48c269777bce7a3aa56d6e5010478afc941 100644 --- a/PlayWall/src/de/tobias/playpad/pad/content/AudioContentConnect.java +++ b/PlayWall/src/de/tobias/playpad/pad/content/AudioContentFactory.java @@ -1,17 +1,13 @@ package de.tobias.playpad.pad.content; -import de.tobias.playpad.Strings; import de.tobias.playpad.pad.Pad; +import de.tobias.playpad.pad.PadStatus; +import de.tobias.playpad.pad.conntent.ContentFactory; import de.tobias.playpad.pad.conntent.PadContent; -import de.tobias.playpad.pad.conntent.PadContentConnect; import de.tobias.playpad.pad.view.IPadContentView; import de.tobias.playpad.viewcontroller.option.ProfileSettingsTabViewController; import de.tobias.playpad.viewcontroller.option.profile.AudioTabViewController; -import de.tobias.utils.ui.icon.FontAwesomeType; -import de.tobias.utils.ui.icon.FontIcon; -import de.tobias.utils.util.Localization; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import de.tobias.utils.ui.icon.FontIconType; import javafx.geometry.Pos; import javafx.scene.Node; import javafx.scene.control.Label; @@ -20,26 +16,17 @@ import javafx.scene.layout.Priority; import javafx.scene.layout.VBox; import javafx.scene.text.TextAlignment; -public class AudioContentConnect extends PadContentConnect { +public class AudioContentFactory extends ContentFactory { - public static final String TYPE = "audio"; public static final String[] FILE_EXTENSION = { "*.mp3", "*.wav" }; - private FontIcon icon; - - public AudioContentConnect() { - icon = new FontIcon(FontAwesomeType.MUSIC); - icon.setSize(30); - } - - @Override - public String getType() { - return TYPE; + public AudioContentFactory(String type) { + super(type); } @Override public PadContent newInstance(Pad pad) { - return new AudioContent(pad); + return new AudioContent(getType(), pad); } @Override @@ -90,16 +77,4 @@ public class AudioContentConnect extends PadContentConnect { nameLabel.textProperty().unbind(); } } - - // UI - DnD - @Override - public StringProperty displayProperty() { - return new SimpleStringProperty(Localization.getString(Strings.Content_Audio_Name)); - } - - @Override - public Node getGraphics() { - return icon; - } - } diff --git a/PlayWall/src/de/tobias/playpad/pad/drag/DuplicateDragMode.java b/PlayWall/src/de/tobias/playpad/pad/drag/DuplicateDragMode.java index c1101315aa0e6d187444a8fe6923f5aeb0887b55..ab0be09cfa3a5ae1af13dbcd8c470cd481e9b03a 100644 --- a/PlayWall/src/de/tobias/playpad/pad/drag/DuplicateDragMode.java +++ b/PlayWall/src/de/tobias/playpad/pad/drag/DuplicateDragMode.java @@ -6,6 +6,7 @@ import de.tobias.playpad.project.Project; import de.tobias.playpad.project.page.PadIndex; import de.tobias.utils.ui.icon.FontAwesomeType; import de.tobias.utils.ui.icon.FontIcon; +import de.tobias.utils.ui.icon.FontIconType; import de.tobias.utils.util.Localization; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; @@ -13,31 +14,8 @@ import javafx.scene.Node; public class DuplicateDragMode extends PadDragMode { - private static final String TYPE = "duplicate"; - - private FontIcon icon; - private StringProperty displayProperty; - - public DuplicateDragMode() { - icon = new FontIcon(FontAwesomeType.COPY); - icon.setSize(30); - - displayProperty = new SimpleStringProperty(Localization.getString(Strings.DnDMode_Duplicate)); - } - - @Override - public StringProperty displayProperty() { - return displayProperty; - } - - @Override - public Node getGraphics() { - return icon; - } - - @Override - public String getType() { - return TYPE; + public DuplicateDragMode(String type) { + super(type); } @Override diff --git a/PlayWall/src/de/tobias/playpad/pad/drag/MoveDragMode.java b/PlayWall/src/de/tobias/playpad/pad/drag/MoveDragMode.java index dfa1923a5e1d6c93f02c6f73553d1f1e46a95123..e926f7597ca4d4c32eb09a58c2b9d5dd0f53e56d 100644 --- a/PlayWall/src/de/tobias/playpad/pad/drag/MoveDragMode.java +++ b/PlayWall/src/de/tobias/playpad/pad/drag/MoveDragMode.java @@ -6,6 +6,7 @@ import de.tobias.playpad.project.Project; import de.tobias.playpad.project.page.PadIndex; import de.tobias.utils.ui.icon.FontAwesomeType; import de.tobias.utils.ui.icon.FontIcon; +import de.tobias.utils.ui.icon.FontIconType; import de.tobias.utils.util.Localization; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; @@ -13,31 +14,8 @@ import javafx.scene.Node; public class MoveDragMode extends PadDragMode { - private static final String TYPE = "move"; - - private FontIcon icon; - private StringProperty displayProperty; - - public MoveDragMode() { - icon = new FontIcon(FontAwesomeType.ARROWS); - icon.setSize(30); - - displayProperty = new SimpleStringProperty(Localization.getString(Strings.DnDMode_Move)); - } - - @Override - public StringProperty displayProperty() { - return displayProperty; - } - - @Override - public Node getGraphics() { - return icon; - } - - @Override - public String getType() { - return TYPE; + public MoveDragMode(String type) { + super(type); } @Override diff --git a/PlayWall/src/de/tobias/playpad/pad/drag/ReplaceDragMode.java b/PlayWall/src/de/tobias/playpad/pad/drag/ReplaceDragMode.java index e1c67a5dc91ac27fcbafdc08e7d06b3eb8ae6454..e20b4be266a790ea0601ebca0061d09a9cf654c9 100644 --- a/PlayWall/src/de/tobias/playpad/pad/drag/ReplaceDragMode.java +++ b/PlayWall/src/de/tobias/playpad/pad/drag/ReplaceDragMode.java @@ -6,6 +6,7 @@ import de.tobias.playpad.project.Project; import de.tobias.playpad.project.page.PadIndex; import de.tobias.utils.ui.icon.FontAwesomeType; import de.tobias.utils.ui.icon.FontIcon; +import de.tobias.utils.ui.icon.FontIconType; import de.tobias.utils.util.Localization; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; @@ -13,31 +14,8 @@ import javafx.scene.Node; public class ReplaceDragMode extends PadDragMode { - private static final String TYPE = "replace"; - - private FontIcon icon; - private StringProperty displayProperty; - - public ReplaceDragMode() { - icon = new FontIcon(FontAwesomeType.ARROW_CIRCLE_RIGHT); - icon.setSize(30); - - displayProperty = new SimpleStringProperty(Localization.getString(Strings.DnDMode_Replace)); - } - - @Override - public StringProperty displayProperty() { - return displayProperty; - } - - @Override - public Node getGraphics() { - return icon; - } - - @Override - public String getType() { - return TYPE; + public ReplaceDragMode(String type) { + super(type); } @Override diff --git a/PlayWall/src/de/tobias/playpad/trigger/CartTriggerItem.java b/PlayWall/src/de/tobias/playpad/trigger/CartTriggerItem.java index 631f2e8f1aa5a5921c09ad4d646dd84460cc13d4..b14b9aa381b39f66ff857cefc29a58bddf91189e 100644 --- a/PlayWall/src/de/tobias/playpad/trigger/CartTriggerItem.java +++ b/PlayWall/src/de/tobias/playpad/trigger/CartTriggerItem.java @@ -19,7 +19,11 @@ public class CartTriggerItem extends TriggerItem { private boolean allCarts; private PadStatus newStatus; // Only Play, Pause, Stop - public CartTriggerItem() { + private String type; + + public CartTriggerItem(String type) { + super(); + this.type = type; newStatus = PadStatus.PLAY; allCarts = false; uuids = new ArrayList<UUID>() { @@ -59,7 +63,7 @@ public class CartTriggerItem extends TriggerItem { @Override public String getType() { - return CartTriggerItemConnect.TYPE; + return type; } @Override diff --git a/PlayWall/src/de/tobias/playpad/trigger/CartTriggerItemConnect.java b/PlayWall/src/de/tobias/playpad/trigger/CartTriggerItemFactory.java similarity index 71% rename from PlayWall/src/de/tobias/playpad/trigger/CartTriggerItemConnect.java rename to PlayWall/src/de/tobias/playpad/trigger/CartTriggerItemFactory.java index 873488ad8610e1abe8d583607b298e4bcbf0d249..89ae2f4f164acc5da9cfef07aeb3044c790c6223 100644 --- a/PlayWall/src/de/tobias/playpad/trigger/CartTriggerItemConnect.java +++ b/PlayWall/src/de/tobias/playpad/trigger/CartTriggerItemFactory.java @@ -3,23 +3,21 @@ package de.tobias.playpad.trigger; import de.tobias.playpad.Strings; import de.tobias.playpad.tigger.Trigger; import de.tobias.playpad.tigger.TriggerItem; -import de.tobias.playpad.tigger.TriggerItemConnect; +import de.tobias.playpad.tigger.TriggerItemFactory; import de.tobias.playpad.viewcontroller.option.pad.trigger.CartTriggerViewController; import de.tobias.utils.ui.ContentViewController; +import de.tobias.utils.ui.icon.FontIconType; import de.tobias.utils.util.Localization; -public class CartTriggerItemConnect extends TriggerItemConnect { +public class CartTriggerItemFactory extends TriggerItemFactory { - public final static String TYPE = "Cart"; - - @Override - public String getType() { - return TYPE; + public CartTriggerItemFactory(String type) { + super(type); } @Override public TriggerItem newInstance(Trigger trigger) { - return new CartTriggerItem(); + return new CartTriggerItem(getType()); } @Override diff --git a/PlayWall/src/de/tobias/playpad/trigger/VolumeTriggerItem.java b/PlayWall/src/de/tobias/playpad/trigger/VolumeTriggerItem.java index 282bb4cedb75c979f4f2dbb166ec0f6b698e0048..ac027f0d5204eb5bf9eacafda94ed07614c590ff 100644 --- a/PlayWall/src/de/tobias/playpad/trigger/VolumeTriggerItem.java +++ b/PlayWall/src/de/tobias/playpad/trigger/VolumeTriggerItem.java @@ -19,9 +19,16 @@ public class VolumeTriggerItem extends TriggerItem { private transient static VolumeTriggerItem currentRunningTrigger; private transient static double currentValue = 1.0; + private String type; + + public VolumeTriggerItem(String type) { + super(); + this.type = type; + } + @Override public String getType() { - return VolumeTriggerItemConnect.TYPE; + return type; } public double getVolume() { diff --git a/PlayWall/src/de/tobias/playpad/trigger/VolumeTriggerItemConnect.java b/PlayWall/src/de/tobias/playpad/trigger/VolumeTriggerItemFactory.java similarity index 71% rename from PlayWall/src/de/tobias/playpad/trigger/VolumeTriggerItemConnect.java rename to PlayWall/src/de/tobias/playpad/trigger/VolumeTriggerItemFactory.java index 7ac1ee3b715701a8afd5d86bbf29e859b1ccc05b..c3a1220271eff3d0feb28d4cd3b39efa2627d6ae 100644 --- a/PlayWall/src/de/tobias/playpad/trigger/VolumeTriggerItemConnect.java +++ b/PlayWall/src/de/tobias/playpad/trigger/VolumeTriggerItemFactory.java @@ -3,23 +3,21 @@ package de.tobias.playpad.trigger; import de.tobias.playpad.Strings; import de.tobias.playpad.tigger.Trigger; import de.tobias.playpad.tigger.TriggerItem; -import de.tobias.playpad.tigger.TriggerItemConnect; +import de.tobias.playpad.tigger.TriggerItemFactory; import de.tobias.playpad.viewcontroller.option.pad.trigger.VolumeTriggerViewController; import de.tobias.utils.ui.ContentViewController; +import de.tobias.utils.ui.icon.FontIconType; import de.tobias.utils.util.Localization; -public class VolumeTriggerItemConnect extends TriggerItemConnect { +public class VolumeTriggerItemFactory extends TriggerItemFactory { - public final static String TYPE = "Volume"; - - @Override - public String getType() { - return TYPE; + public VolumeTriggerItemFactory(String type) { + super(type); } @Override public TriggerItem newInstance(Trigger trigger) { - return new VolumeTriggerItem(); + return new VolumeTriggerItem(getType()); } @Override diff --git a/PlayWall/src/de/tobias/playpad/view/FileDragOptionView.java b/PlayWall/src/de/tobias/playpad/view/FileDragOptionView.java index 191a1aca1d2aeceedfa394d1989fc5f90ce717c3..ccb9f47e4c5413ee4daf192b3b40138a786cc854 100644 --- a/PlayWall/src/de/tobias/playpad/view/FileDragOptionView.java +++ b/PlayWall/src/de/tobias/playpad/view/FileDragOptionView.java @@ -4,7 +4,7 @@ import java.util.Set; import java.util.function.Consumer; import de.tobias.playpad.PseudoClasses; -import de.tobias.playpad.pad.conntent.PadContentConnect; +import de.tobias.playpad.pad.conntent.ContentFactory; import javafx.animation.FadeTransition; import javafx.animation.ParallelTransition; import javafx.animation.ScaleTransition; @@ -47,22 +47,6 @@ public class FileDragOptionView { } - public Transition getInTransition() { - return inTransition; - } - - public void setInTransition(Transition inTransition) { - this.inTransition = inTransition; - } - - public Transition getOutTransition() { - return outTransition; - } - - public void setOutTransition(Transition outTransition) { - this.outTransition = outTransition; - } - private Transition createTransition(boolean in) { FadeTransition fadeTransition = new FadeTransition(); fadeTransition.setNode(optionPane); @@ -98,20 +82,20 @@ public class FileDragOptionView { return parallelTransition; } - private PadContentConnect selectedConnect; + private ContentFactory selectedConnect; - public void showDropOptions(Set<PadContentConnect> options) { + public void showDropOptions(Set<ContentFactory> options) { if (!parent.getChildren().contains(optionPane)) { selectedConnect = null; parent.getChildren().add(optionPane); optionPane.getChildren().clear(); - for (PadContentConnect connect : options.stream().sorted().toArray(value -> new PadContentConnect[value])) { + options.stream().sorted().forEach(contentType -> { Label label = new Label(); label.getStyleClass().add("dnd-file-option"); - label.textProperty().bind(connect.displayProperty()); - Node graphics = connect.getGraphics(); + label.textProperty().bind(contentType.displayProperty()); + Node graphics = contentType.getGraphics(); if (graphics != null) { graphics.setStyle("-fx-text-fill: white;"); label.setGraphic(graphics); @@ -121,7 +105,7 @@ public class FileDragOptionView { label.setOnDragOver(e -> { label.pseudoClassStateChanged(PseudoClasses.HOVER_CLASS, true); - selectedConnect = connect; + selectedConnect = contentType; }); label.setOnDragExited(e -> { @@ -129,7 +113,7 @@ public class FileDragOptionView { selectedConnect = null; }); - label.setUserData(connect); + label.setUserData(contentType); label.setAlignment(Pos.CENTER); label.setTextAlignment(TextAlignment.CENTER); @@ -140,14 +124,14 @@ public class FileDragOptionView { HBox.setHgrow(label, Priority.ALWAYS); optionPane.getChildren().add(label); - } + }); inTransition.play(); } } - public void showDropOptions(Set<PadContentConnect> options, Consumer<PadContentConnect> onFinish) { + public void showDropOptions(Set<ContentFactory> options, Consumer<ContentFactory> onFinish) { showDropOptions(options); for (Node node : optionPane.getChildren()) { @@ -155,7 +139,7 @@ public class FileDragOptionView { Label label = (Label) node; label.setOnMouseClicked(ev -> { - onFinish.accept((PadContentConnect) label.getUserData()); + onFinish.accept((ContentFactory) label.getUserData()); }); label.setOnMouseEntered(e -> { @@ -169,7 +153,7 @@ public class FileDragOptionView { } } - public PadContentConnect getSelectedConnect() { + public ContentFactory getSelectedConnect() { return selectedConnect; } diff --git a/PlayWall/src/de/tobias/playpad/view/MapperOverviewViewController.java b/PlayWall/src/de/tobias/playpad/view/MapperOverviewViewController.java index 5ae0d9f6a0f9de033b308e52034cb98731109147..7b86020d48338a34354f0b0ecb63e50aea218aa3 100644 --- a/PlayWall/src/de/tobias/playpad/view/MapperOverviewViewController.java +++ b/PlayWall/src/de/tobias/playpad/view/MapperOverviewViewController.java @@ -8,7 +8,7 @@ import de.tobias.playpad.PlayPadMain; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.action.Action; import de.tobias.playpad.action.mapper.Mapper; -import de.tobias.playpad.action.mapper.MapperConnect; +import de.tobias.playpad.action.mapper.MapperFactory; import de.tobias.playpad.action.mapper.MapperViewController; import de.tobias.playpad.registry.NoSuchComponentException; import de.tobias.playpad.registry.Registry; @@ -58,13 +58,13 @@ public class MapperOverviewViewController implements IMapperOverviewViewControll headline.setUnderline(true); root.getChildren().addAll(headline, mappingView, addMappingBox); - Registry<MapperConnect> registry = PlayPadPlugin.getRegistryCollection().getMappers(); + Registry<MapperFactory> registry = PlayPadPlugin.getRegistryCollection().getMappers(); Set<String> types = registry.getTypes(); types.stream().sorted().forEach(item -> { String name = item; try { - MapperConnect connect = registry.getComponent(item); + MapperFactory connect = registry.getFactory(item); name = connect.toString(); } catch (NoSuchComponentException e) { // TODO Error Handling @@ -97,9 +97,9 @@ public class MapperOverviewViewController implements IMapperOverviewViewControll } private MapperViewController onAddMapper(String type) throws NoSuchComponentException { - Registry<MapperConnect> registry = PlayPadPlugin.getRegistryCollection().getMappers(); + Registry<MapperFactory> registry = PlayPadPlugin.getRegistryCollection().getMappers(); - Mapper mapper = registry.getComponent(type).createNewMapper(); + Mapper mapper = registry.getFactory(type).createNewMapper(); action.addMapper(mapper); return addMapperView(type, mapper); } diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/actions/CartActionsViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/actions/CartActionsViewController.java index 34edd58feec6ceb1c79a9aa86f32886e71f6262d..9f8b7fa9a73b129d1a8ce6873fcaff6a1fff9fcc 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/actions/CartActionsViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/actions/CartActionsViewController.java @@ -2,12 +2,15 @@ package de.tobias.playpad.viewcontroller.actions; import java.util.List; +import de.tobias.playpad.PlayPadPlugin; +import de.tobias.playpad.action.ActionFactory; +import de.tobias.playpad.registry.NoSuchComponentException; import org.controlsfx.control.SegmentedButton; import de.tobias.playpad.PlayPadMain; import de.tobias.playpad.action.Mapping; import de.tobias.playpad.action.cartaction.CartAction; -import de.tobias.playpad.action.connect.CartActionConnect; +import de.tobias.playpad.action.factory.CartActionFactory; import de.tobias.playpad.project.Project; import de.tobias.playpad.project.ProjectSettings; import de.tobias.playpad.viewcontroller.IMappingTabViewController; @@ -26,18 +29,20 @@ import javafx.scene.layout.VBox; * seitenauswahl (Carts ändern sich) und eine Scrollview für die Einstellungen. Die Einstellungen werden von der Class * CartActionViewController hier eingebettet. Dabei wird nicht jedes mal eine neue Instance erstellt, sondern die in CartAction vorhandene * Instance verwendet. Das geht, solange die View nur einmal verwendet wird. - * - * @author tobias * + * @author tobias */ public class CartActionsViewController extends ContentViewController { - @FXML private VBox buttonVbox; + @FXML + private VBox buttonVbox; private ToggleGroup cartsToggle; - @FXML private GridPane gridPane; + @FXML + private GridPane gridPane; - @FXML private VBox cartActionContainer; + @FXML + private VBox cartActionContainer; private Mapping mapping; private IMappingTabViewController parentController; @@ -86,7 +91,7 @@ public class CartActionsViewController extends ContentViewController { for (int x = 0; x < settings.getColumns(); x++) { ToggleButton button = new ToggleButton(String.valueOf(index++ + 1)); button.setMaxWidth(Double.MAX_VALUE); - button.setUserData(new int[] { x, y }); + button.setUserData(new int[]{x, y}); button.getStyleClass().add(SegmentedButton.STYLE_CLASS_DARK); // Show the right cart settings @@ -97,14 +102,20 @@ public class CartActionsViewController extends ContentViewController { int currentX = data[0]; int currentY = data[1]; - List<CartAction> cartActions = mapping.getActions(CartActionConnect.TYPE); - for (CartAction action : cartActions) { - if (action.getX() == currentX && action.getY() == currentY) { - ContentViewController actionViewController = action.getSettingsViewController(); - cartActionContainer.getChildren().setAll(actionViewController.getParent()); - cartActionContainer.setVisible(true); - parentController.showMapperFor(action); + try { + ActionFactory actionFactory = PlayPadPlugin.getRegistryCollection().getActions().getFactory(CartActionFactory.class); + + List<CartAction> cartActions = mapping.getActions(actionFactory); + for (CartAction action : cartActions) { + if (action.getX() == currentX && action.getY() == currentY) { + ContentViewController actionViewController = action.getSettingsViewController(); + cartActionContainer.getChildren().setAll(actionViewController.getParent()); + cartActionContainer.setVisible(true); + parentController.showMapperFor(action); + } } + } catch (NoSuchComponentException e) { + e.printStackTrace(); } } else { cartActionContainer.setVisible(false); diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/cell/errordialog/IOExceptionButtonListener.java b/PlayWall/src/de/tobias/playpad/viewcontroller/cell/errordialog/IOExceptionButtonListener.java index d0ff923ecac5c67c074a2a808096107638549d0d..a6af41df0bd7d91275a8c05ffab050a31c39c407 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/cell/errordialog/IOExceptionButtonListener.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/cell/errordialog/IOExceptionButtonListener.java @@ -8,7 +8,7 @@ import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.pad.Pad; import de.tobias.playpad.pad.PadException; import de.tobias.playpad.pad.conntent.PadContent; -import de.tobias.playpad.pad.conntent.PadContentConnect; +import de.tobias.playpad.pad.conntent.ContentFactory; import de.tobias.playpad.pad.conntent.PadContentRegistry; import de.tobias.playpad.registry.NoSuchComponentException; import de.tobias.playpad.view.ExceptionButton; @@ -38,9 +38,9 @@ public class IOExceptionButtonListener implements EventHandler<ActionEvent> { PadContent content = item.getPad().getContent(); try { PadContentRegistry padContents = PlayPadPlugin.getRegistryCollection().getPadContents(); - PadContentConnect padContentConnect = padContents.getComponent(content.getType()); + ContentFactory contentFactory = padContents.getFactory(content.getType()); - if (Files.exists(path) && PadContentConnect.isFileSupported(path, padContentConnect)) { + if (Files.exists(path) && ContentFactory.isFileTypeSupported(path, contentFactory)) { content.handlePath(path); pad.setName(FileUtils.getFilenameWithoutExtention(path.getFileName())); pad.removeException(item); diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/design/ClassicGlobalDesignViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/design/ClassicGlobalDesignViewController.java index 491005c05eccdbcfa7eb0ed3d89cff53f3bdfd0b..ec4009fca5dad3aa43ead74b9140b47ff3727572 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/design/ClassicGlobalDesignViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/design/ClassicGlobalDesignViewController.java @@ -2,7 +2,7 @@ package de.tobias.playpad.viewcontroller.design; import de.tobias.playpad.PlayPadMain; import de.tobias.playpad.PseudoClasses; -import de.tobias.playpad.design.DesignConnect; +import de.tobias.playpad.design.DesignFactory; import de.tobias.playpad.design.GlobalDesign; import de.tobias.playpad.design.classic.ClassicGlobalDesign; import de.tobias.playpad.design.classic.Theme; @@ -22,7 +22,7 @@ public class ClassicGlobalDesignViewController extends GlobalDesignViewControlle private ClassicGlobalDesign layout; - @FXML private ComboBox<DesignConnect> layoutTypeComboBox; + @FXML private ComboBox<DesignFactory> layoutTypeComboBox; @FXML private ComboBox<Theme> programLayoutComboBox; @FXML private ColorPicker accentColorChooser; diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewController.java index a25c1b9c63eaf9656c83d2f0e22b27cee3e9b599..0381d8ee1e7095379b96c6518df7fdff32e165f2 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewController.java @@ -14,7 +14,7 @@ import de.tobias.playpad.action.Mapping; import de.tobias.playpad.action.mapper.listener.KeyboardHandler; import de.tobias.playpad.action.mapper.listener.MidiHandler; import de.tobias.playpad.design.GlobalDesign; -import de.tobias.playpad.layout.desktop.DesktopMainLayoutConnect; +import de.tobias.playpad.layout.desktop.DesktopMainLayoutFactory; import de.tobias.playpad.layout.desktop.pad.DesktopPadDragListener; import de.tobias.playpad.midi.Midi; import de.tobias.playpad.midi.MidiListener; @@ -31,7 +31,7 @@ import de.tobias.playpad.settings.Profile; import de.tobias.playpad.settings.ProfileListener; import de.tobias.playpad.settings.ProfileSettings; import de.tobias.playpad.settings.keys.KeyCollection; -import de.tobias.playpad.view.main.MainLayoutConnect; +import de.tobias.playpad.view.main.MainLayoutFactory; import de.tobias.playpad.view.main.MainLayoutHandler; import de.tobias.playpad.viewcontroller.dialog.ErrorSummaryDialog; import de.tobias.playpad.viewcontroller.dialog.SaveDialog; @@ -94,7 +94,7 @@ public class MainViewController extends ViewController implements IMainViewContr private Color gridColor; // Layout - private MainLayoutConnect mainLayout; + private MainLayoutFactory mainLayout; private List<MainLayoutHandler> layoutActions; // Listener @@ -119,7 +119,7 @@ public class MainViewController extends ViewController implements IMainViewContr initMapper(openProject); // Default Layout - setMainLayout(new DesktopMainLayoutConnect()); + setMainLayout(PlayPadPlugin.getRegistryCollection().getMainLayouts().getDefault()); Profile.registerListener(this); reloadSettings(null, Profile.currentProfile()); @@ -187,16 +187,16 @@ public class MainViewController extends ViewController implements IMainViewContr } // main layout - public MainLayoutConnect getMainLayout() { + public MainLayoutFactory getMainLayout() { return mainLayout; } @Override - public void setMainLayout(MainLayoutConnect mainLayoutConnect) { + public void setMainLayout(MainLayoutFactory mainLayoutFactory) { removePadsFromView(); removePadViews(); - this.mainLayout = mainLayoutConnect; + this.mainLayout = mainLayoutFactory; initMainLayout(); } @@ -567,8 +567,8 @@ public class MainViewController extends ViewController implements IMainViewContr } try { - DefaultRegistry<MainLayoutConnect> registry = PlayPadPlugin.getRegistryCollection().getMainLayouts(); - MainLayoutConnect connect = registry.getComponent(currentProfile.getProfileSettings().getMainLayoutType()); + DefaultRegistry<MainLayoutFactory> registry = PlayPadPlugin.getRegistryCollection().getMainLayouts(); + MainLayoutFactory connect = registry.getFactory(currentProfile.getProfileSettings().getMainLayoutType()); setMainLayout(connect); } catch (NoSuchComponentException e) { // TODO Error Handling diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/DesignPadTabViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/DesignPadTabViewController.java index c5919f6a08310f994cc2561203bfe1c5dcc5f819..dc5e02c1e084579e4f47a37ba1288b3d897805ad 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/DesignPadTabViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/DesignPadTabViewController.java @@ -7,9 +7,9 @@ import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.Strings; import de.tobias.playpad.action.Mapping; import de.tobias.playpad.action.cartaction.CartAction; -import de.tobias.playpad.action.connect.CartActionConnect; +import de.tobias.playpad.action.factory.CartActionFactory; import de.tobias.playpad.design.CartDesign; -import de.tobias.playpad.design.DesignConnect; +import de.tobias.playpad.design.DesignFactory; import de.tobias.playpad.pad.Pad; import de.tobias.playpad.pad.PadSettings; import de.tobias.playpad.registry.NoSuchComponentException; @@ -90,7 +90,7 @@ public class DesignPadTabViewController extends PadSettingsTabViewController { String layoutType = Profile.currentProfile().getProfileSettings().getLayoutType(); CartDesign layout = pad.getPadSettings().getLayout(layoutType); - DesignConnect component = PlayPadPlugin.getRegistryCollection().getDesigns().getComponent(layoutType); + DesignFactory component = PlayPadPlugin.getRegistryCollection().getDesigns().getFactory(layoutType); CartDesignViewController controller = component.getCartDesignViewController(layout); setLayoutController(controller); } catch (NoSuchComponentException e) { @@ -108,11 +108,15 @@ public class DesignPadTabViewController extends PadSettingsTabViewController { IMainViewController mainViewController = PlayPadPlugin.getImplementation().getMainViewController(); mainViewController.loadUserCss(); - // Mapping Auto Matched Colors - Mapping activeMapping = Profile.currentProfile().getMappings().getActiveMapping(); - List<CartAction> actions = activeMapping.getActions(CartActionConnect.TYPE); - // Update die Mapper der CartAction - actions.stream().filter(action -> action.getPad() != null).filter(action -> action.getPad().getIndex() == pad.getIndex()) - .forEach(item -> item.initFeedback(pad.getProject(), mainViewController)); + try { + // Mapping Auto Matched Colors + Mapping activeMapping = Profile.currentProfile().getMappings().getActiveMapping(); + List<CartAction> actions = activeMapping.getActions(PlayPadPlugin.getRegistryCollection().getActions().getFactory(CartActionFactory.class)); + // Update die Mapper der CartAction + actions.stream().filter(action -> action.getPad() != null).filter(action -> action.getPad().getIndex() == pad.getIndex()) + .forEach(item -> item.initFeedback(pad.getProject(), mainViewController)); + } catch (NoSuchComponentException e) { + e.printStackTrace(); + } } } diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/PadSettingsViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/PadSettingsViewController.java index 111ad6285b739667f3ffb71d3013f3c03c34b50e..82234cd261e611b985199ebc2a4e2bd7db7f1421 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/PadSettingsViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/PadSettingsViewController.java @@ -9,8 +9,8 @@ import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.Strings; import de.tobias.playpad.pad.Pad; import de.tobias.playpad.pad.PadStatus; +import de.tobias.playpad.pad.conntent.ContentFactory; import de.tobias.playpad.pad.conntent.PadContent; -import de.tobias.playpad.pad.conntent.PadContentConnect; import de.tobias.playpad.pad.conntent.PadContentRegistry; import de.tobias.playpad.pad.conntent.path.MultiPathContent; import de.tobias.playpad.pad.conntent.path.SinglePathContent; @@ -60,8 +60,8 @@ public class PadSettingsViewController extends ViewController implements IPadSet String type = pad.getContent().getType(); PadContentRegistry registry = PlayPadPlugin.getRegistryCollection().getPadContents(); - PadContentConnect padContentConnect = registry.getComponent(type); - PadSettingsTabViewController contentTab = padContentConnect.getSettingsViewController(pad); + ContentFactory contentFactory = registry.getFactory(type); + PadSettingsTabViewController contentTab = contentFactory.getSettingsViewController(pad); if (contentTab != null) addTab(contentTab); diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/trigger/TriggerPointViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/trigger/TriggerPointViewController.java index 19421ded87abb3bdaeff6515896d94d9c0a9c8af..6e28be9f248b6bdd42b454b2d7955f117523947e 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/trigger/TriggerPointViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/trigger/TriggerPointViewController.java @@ -6,7 +6,7 @@ import de.tobias.playpad.PlayPadMain; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.registry.NoSuchComponentException; import de.tobias.playpad.tigger.TriggerItem; -import de.tobias.playpad.tigger.TriggerItemConnect; +import de.tobias.playpad.tigger.TriggerItemFactory; import de.tobias.playpad.trigger.TriggerDisplayable; import de.tobias.utils.ui.ContentViewController; import de.tobias.utils.ui.icon.FontAwesomeType; @@ -39,7 +39,7 @@ public class TriggerPointViewController extends ContentViewController { types.stream().sorted().forEach(item -> { try { - TriggerItemConnect conntect = PlayPadPlugin.getRegistryCollection().getTriggerItems().getComponent(item); + TriggerItemFactory conntect = PlayPadPlugin.getRegistryCollection().getTriggerItems().getFactory(item); Button button = new Button(conntect.toString(), new FontIcon(FontAwesomeType.PLUS_CIRCLE)); button.setContentDisplay(ContentDisplay.TOP); button.setPrefWidth(150); @@ -61,7 +61,7 @@ public class TriggerPointViewController extends ContentViewController { private void showTriggerItem(TriggerItem item) { try { - TriggerItemConnect connect = PlayPadPlugin.getRegistryCollection().getTriggerItems().getComponent(item.getType()); + TriggerItemFactory connect = PlayPadPlugin.getRegistryCollection().getTriggerItems().getFactory(item.getType()); VBox itemBox = new VBox(14); ContentViewController contentViewController = connect.getSettingsController(item); diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/option/profile/AudioTabViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/option/profile/AudioTabViewController.java index d577a3a3313f4ecf2c82e5cddd2fb56fb7543e9b..c64ee3f3363faecbba31bee0fc76e08356ee0747 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/option/profile/AudioTabViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/option/profile/AudioTabViewController.java @@ -7,7 +7,7 @@ import de.tobias.playpad.PlayPadMain; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.Strings; import de.tobias.playpad.audio.AudioCapability; -import de.tobias.playpad.audio.AudioHandlerConnect; +import de.tobias.playpad.audio.AudioHandlerFactory; import de.tobias.playpad.audio.AudioRegistry; import de.tobias.playpad.project.Project; import de.tobias.playpad.registry.NoSuchComponentException; @@ -78,7 +78,7 @@ public class AudioTabViewController extends ProfileSettingsTabViewController imp AudioRegistry audioHandlerRegistry = PlayPadPlugin.getRegistryCollection().getAudioHandlers(); try { - AudioHandlerConnect audio = audioHandlerRegistry.getComponent(classID); + AudioHandlerFactory audio = audioHandlerRegistry.getFactory(classID); for (AudioCapability audioCapability : AudioCapability.getFeatures()) { options.getChildren().add(createCapabilityView(audio, audioCapability)); @@ -88,7 +88,7 @@ public class AudioTabViewController extends ProfileSettingsTabViewController imp } } - private Parent createCapabilityView(AudioHandlerConnect audio, AudioCapability audioCapability) { + private Parent createCapabilityView(AudioHandlerFactory audio, AudioCapability audioCapability) { HBox masterView = new HBox(14); VBox detailView = new VBox(14); diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/option/profile/DesignTabViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/option/profile/DesignTabViewController.java index bd24b753b9a6ad7d9ee6cc4e1f2cc16d8d8e8cb4..19256471f89724586fe128b42c3cd7864e02ba40 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/option/profile/DesignTabViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/option/profile/DesignTabViewController.java @@ -3,7 +3,7 @@ package de.tobias.playpad.viewcontroller.option.profile; import de.tobias.playpad.PlayPadMain; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.Strings; -import de.tobias.playpad.design.DesignConnect; +import de.tobias.playpad.design.DesignFactory; import de.tobias.playpad.design.GlobalDesign; import de.tobias.playpad.project.Project; import de.tobias.playpad.registry.NoSuchComponentException; @@ -24,7 +24,7 @@ import javafx.scene.layout.VBox; public class DesignTabViewController extends ProfileSettingsTabViewController implements IProfileReloadTask { @FXML private VBox layoutContainer; - @FXML private ComboBox<DesignConnect> layoutTypeComboBox; + @FXML private ComboBox<DesignFactory> layoutTypeComboBox; private GlobalDesignViewController globalLayoutViewController; public DesignTabViewController() { @@ -32,7 +32,7 @@ public class DesignTabViewController extends ProfileSettingsTabViewController im String layoutType = Profile.currentProfile().getProfileSettings().getLayoutType(); try { - layoutTypeComboBox.setValue(PlayPadPlugin.getRegistryCollection().getDesigns().getComponent(layoutType)); + layoutTypeComboBox.setValue(PlayPadPlugin.getRegistryCollection().getDesigns().getFactory(layoutType)); } catch (NoSuchComponentException e) { // TODO Auto-generated catch block e.printStackTrace(); diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/option/profile/MappingTabViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/option/profile/MappingTabViewController.java index 688b4b0f5e3b80b2b4ca0eb46bf95d4ba14b7685..e177b8f69150ab60c38cc41180595cb5f454439d 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/option/profile/MappingTabViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/option/profile/MappingTabViewController.java @@ -1,5 +1,6 @@ package de.tobias.playpad.viewcontroller.option.profile; +import java.util.Collection; import java.util.List; import java.util.Set; import java.util.stream.Collectors; @@ -8,7 +9,7 @@ import de.tobias.playpad.PlayPadMain; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.Strings; import de.tobias.playpad.action.Action; -import de.tobias.playpad.action.ActionConnect; +import de.tobias.playpad.action.ActionFactory; import de.tobias.playpad.action.ActionDisplayable; import de.tobias.playpad.action.ActionType; import de.tobias.playpad.action.Mapping; @@ -38,12 +39,16 @@ import javafx.scene.layout.VBox; public class MappingTabViewController extends ProfileSettingsTabViewController implements IMappingTabViewController, IProfileReloadTask { - @FXML private ComboBox<Mapping> mappingComboBox; - @FXML private Button editMappingsButton; + @FXML + private ComboBox<Mapping> mappingComboBox; + @FXML + private Button editMappingsButton; - @FXML private TreeView<ActionDisplayable> treeView; + @FXML + private TreeView<ActionDisplayable> treeView; - @FXML private VBox detailView; + @FXML + private VBox detailView; private IMapperOverviewViewController mapperOverviewViewController; private Mapping oldMapping; @@ -87,8 +92,8 @@ public class MappingTabViewController extends ProfileSettingsTabViewController i private TreeItem<ActionDisplayable> createTreeView(Mapping mapping) { TreeItem<ActionDisplayable> rootItem = new TreeItem<>(); - Set<String> types = PlayPadPlugin.getRegistryCollection().getActions().getTypes(); - List<String> sortedTypes = types.stream().sorted().collect(Collectors.toList()); + Collection<ActionFactory> types = PlayPadPlugin.getRegistryCollection().getActions().getComponents(); + List<ActionFactory> sortedTypes = types.stream().sorted((a, b) -> a.getType().compareTo(b.getType())).collect(Collectors.toList()); // Sort the tpyes for the treeview for (ActionType actionType : ActionType.values()) { @@ -98,18 +103,12 @@ public class MappingTabViewController extends ProfileSettingsTabViewController i return rootItem; } - private void createTreeViewForActionType(Mapping mapping, TreeItem<ActionDisplayable> rootItem, List<String> sortedTypes, ActionType type) { - for (String id : sortedTypes) { - List<Action> actions = mapping.getActionsOfType(id); - try { - ActionConnect actionConnect = PlayPadPlugin.getRegistryCollection().getActions().getComponent(id); - if (actionConnect.geActionType() == type) { - TreeItem<ActionDisplayable> item = actionConnect.getTreeViewForActions(actions, mapping); - rootItem.getChildren().add(item); - } - } catch (NoSuchComponentException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + private void createTreeViewForActionType(Mapping mapping, TreeItem<ActionDisplayable> rootItem, List<ActionFactory> sortedTypes, ActionType type) { + for (ActionFactory actionFactory : sortedTypes) { + List<Action> actions = mapping.getActionsOfType(actionFactory); + if (actionFactory.geActionType() == type) { + TreeItem<ActionDisplayable> item = actionFactory.getTreeViewForActions(actions, mapping); + rootItem.getChildren().add(item); } } } @@ -171,7 +170,7 @@ public class MappingTabViewController extends ProfileSettingsTabViewController i protected Void call() throws Exception { updateTitle(name()); updateProgress(-1, -1); - + Profile.currentProfile().getMappings().getActiveMapping().adjustPadColorToMapper(); Mapping activeMapping = Profile.currentProfile().getMappings().getActiveMapping(); diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/option/profile/ProfileSettingsViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/option/profile/ProfileSettingsViewController.java index ae657afc775973a86d806fe2563d07e3849fa8be..a9a099fac48df4c8d456f0c474f03d9610869b0f 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/option/profile/ProfileSettingsViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/option/profile/ProfileSettingsViewController.java @@ -3,13 +3,13 @@ package de.tobias.playpad.viewcontroller.option.profile; import java.util.ArrayList; import java.util.List; +import de.tobias.playpad.pad.conntent.ContentFactory; import org.controlsfx.control.TaskProgressView; import de.tobias.playpad.PlayPadMain; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.Strings; import de.tobias.playpad.midi.Midi; -import de.tobias.playpad.pad.conntent.PadContentConnect; import de.tobias.playpad.project.Project; import de.tobias.playpad.registry.NoSuchComponentException; import de.tobias.playpad.settings.Profile; @@ -60,7 +60,7 @@ public class ProfileSettingsViewController extends ViewController implements IPr // Custom Tabs - Content Types for (String type : PlayPadPlugin.getRegistryCollection().getPadContents().getTypes()) { try { - PadContentConnect component = PlayPadPlugin.getRegistryCollection().getPadContents().getComponent(type); + ContentFactory component = PlayPadPlugin.getRegistryCollection().getPadContents().getFactory(type); ProfileSettingsTabViewController controller = component.getSettingsTabViewController(activePlayer); if (controller != null) { addTab(controller); diff --git a/PlayWallCore/src/de/tobias/playpad/RegistryCollection.java b/PlayWallCore/src/de/tobias/playpad/RegistryCollection.java index 86f1372ca0fc0bb4aa47aaf6612b478fd68b99b4..eab6ee01a1ca11c838960bc7320cab49beb19d26 100644 --- a/PlayWallCore/src/de/tobias/playpad/RegistryCollection.java +++ b/PlayWallCore/src/de/tobias/playpad/RegistryCollection.java @@ -1,15 +1,15 @@ package de.tobias.playpad; -import de.tobias.playpad.action.ActionConnect; -import de.tobias.playpad.action.mapper.MapperConnect; +import de.tobias.playpad.action.ActionFactory; +import de.tobias.playpad.action.mapper.MapperFactory; import de.tobias.playpad.audio.AudioRegistry; -import de.tobias.playpad.design.DesignConnect; +import de.tobias.playpad.design.DesignFactory; import de.tobias.playpad.pad.conntent.PadContentRegistry; import de.tobias.playpad.pad.drag.PadDragMode; import de.tobias.playpad.registry.DefaultRegistry; import de.tobias.playpad.registry.Registry; -import de.tobias.playpad.tigger.TriggerItemConnect; -import de.tobias.playpad.view.main.MainLayoutConnect; +import de.tobias.playpad.tigger.TriggerItemFactory; +import de.tobias.playpad.view.main.MainLayoutFactory; /** * Schnittstelle für die einzelen Registry. Hier sind alle Registries gesammelt, damit Komponenten registriert werden können. Die @@ -21,19 +21,19 @@ import de.tobias.playpad.view.main.MainLayoutConnect; */ public interface RegistryCollection { - public Registry<ActionConnect> getActions(); + Registry<ActionFactory> getActions(); - public AudioRegistry getAudioHandlers(); + AudioRegistry getAudioHandlers(); - public Registry<PadDragMode> getDragModes(); + Registry<PadDragMode> getDragModes(); - public DefaultRegistry<DesignConnect> getDesigns(); + DefaultRegistry<DesignFactory> getDesigns(); - public Registry<MapperConnect> getMappers(); + Registry<MapperFactory> getMappers(); - public PadContentRegistry getPadContents(); + PadContentRegistry getPadContents(); - public Registry<TriggerItemConnect> getTriggerItems(); + Registry<TriggerItemFactory> getTriggerItems(); - public DefaultRegistry<MainLayoutConnect> getMainLayouts(); + DefaultRegistry<MainLayoutFactory> getMainLayouts(); } \ No newline at end of file diff --git a/PlayWallCore/src/de/tobias/playpad/action/ActionDisplayable.java b/PlayWallCore/src/de/tobias/playpad/action/ActionDisplayable.java index 5c89514dd9d4c79007b656e10056245b1f1a1d45..185e80c8a1fce661331334a8a5562dfdc25c7537 100644 --- a/PlayWallCore/src/de/tobias/playpad/action/ActionDisplayable.java +++ b/PlayWallCore/src/de/tobias/playpad/action/ActionDisplayable.java @@ -5,7 +5,7 @@ import de.tobias.playpad.viewcontroller.IMappingTabViewController; import de.tobias.utils.ui.ContentViewController; /** - * Einn zusätzliches Interface für die Klasse {@link ActionConnect} oder {@link Action} mit der es möglich ist für ein ActionType oder eine + * Einn zusätzliches Interface für die Klasse {@link ActionFactory} oder {@link Action} mit der es möglich ist für ein ActionType oder eine * Action Einstellungen anzuzeigen. * * @author tobias @@ -13,6 +13,7 @@ import de.tobias.utils.ui.ContentViewController; * @since 5.0.0 * */ +// TODO Redo public interface ActionDisplayable extends Displayable { /** diff --git a/PlayWallCore/src/de/tobias/playpad/action/ActionConnect.java b/PlayWallCore/src/de/tobias/playpad/action/ActionFactory.java similarity index 86% rename from PlayWallCore/src/de/tobias/playpad/action/ActionConnect.java rename to PlayWallCore/src/de/tobias/playpad/action/ActionFactory.java index cdcdff5d913deee4384570704d04e683bb04429f..3e8c858561141ec0e4ed39ac63cb1cd8fa25e1ba 100644 --- a/PlayWallCore/src/de/tobias/playpad/action/ActionConnect.java +++ b/PlayWallCore/src/de/tobias/playpad/action/ActionFactory.java @@ -2,7 +2,9 @@ package de.tobias.playpad.action; import java.util.List; +import de.tobias.playpad.registry.Component; import de.tobias.playpad.settings.Profile; +import de.tobias.utils.ui.icon.FontIconType; import javafx.scene.control.TreeItem; /** @@ -14,7 +16,11 @@ import javafx.scene.control.TreeItem; * * @see Action Implementierung der eigentlichen Action. */ -public abstract class ActionConnect { +public abstract class ActionFactory extends Component { + + public ActionFactory(String type) { + super(type); + } /** * Erstellt ein TreeItem für die Grupierung der Actions. @@ -35,8 +41,6 @@ public abstract class ActionConnect { * Mapping * @param profile * Profile für Einstellungen - * @param projectSettings - * Project Einstellungen */ public abstract void initActionType(Mapping mapping, Profile profile); @@ -56,10 +60,4 @@ public abstract class ActionConnect { */ public abstract ActionType geActionType(); - /** - * Gibt die ID der Action zurück. - * - * @return ID - */ - public abstract String getType(); } diff --git a/PlayWallCore/src/de/tobias/playpad/action/ActionSerializer.java b/PlayWallCore/src/de/tobias/playpad/action/ActionSerializer.java index 93e5df2219e338f567de94f832a0e6914c6578cd..9453acb412944c477df252e139605dfa4b21e3f1 100644 --- a/PlayWallCore/src/de/tobias/playpad/action/ActionSerializer.java +++ b/PlayWallCore/src/de/tobias/playpad/action/ActionSerializer.java @@ -44,7 +44,7 @@ public class ActionSerializer implements XMLSerializer<Action>, XMLDeserializer< String tpye = element.attributeValue(ACTION_TYPE); try { - Action action = PlayPadPlugin.getRegistryCollection().getActions().getComponent(tpye).newInstance(); + Action action = PlayPadPlugin.getRegistryCollection().getActions().getFactory(tpye).newInstance(); action.load(element); boolean added = mapping.addActionIfNotContains(action); diff --git a/PlayWallCore/src/de/tobias/playpad/action/Mapping.java b/PlayWallCore/src/de/tobias/playpad/action/Mapping.java index 5198bfea6be0241c01f87558970b3d58b2011e2e..7c5cb76bc45e00dceda68e8302cc3e4698eec7c9 100644 --- a/PlayWallCore/src/de/tobias/playpad/action/Mapping.java +++ b/PlayWallCore/src/de/tobias/playpad/action/Mapping.java @@ -10,7 +10,7 @@ import java.util.stream.Collectors; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.action.feedback.ColorAdjuster; import de.tobias.playpad.action.mapper.Mapper; -import de.tobias.playpad.action.mapper.MapperConnect; +import de.tobias.playpad.action.mapper.MapperFactory; import de.tobias.playpad.action.mapper.MapperConnectFeedbackable; import de.tobias.playpad.project.Project; import de.tobias.playpad.registry.Registry; @@ -65,12 +65,12 @@ public class Mapping implements Cloneable, ActionDisplayable { } @SuppressWarnings("unchecked") - public <T extends Action> List<T> getActions(String type) { + public <T extends Action> List<T> getActions(ActionFactory type) { return (List<T>) getActionsOfType(type); } - public List<Action> getActionsOfType(String type) { - return mapping.keySet().stream().filter(i -> i.getType().equals(type)).collect(Collectors.toList()); + public List<Action> getActionsOfType(ActionFactory actionFactory) { + return mapping.keySet().stream().filter(i -> i.getType().equals(actionFactory.getType())).collect(Collectors.toList()); } public List<Action> getActionsForMapper(Mapper mapper) { @@ -110,8 +110,8 @@ public class Mapping implements Cloneable, ActionDisplayable { } public void initActionType(Profile profile) { - Registry<ActionConnect> actions = PlayPadPlugin.getRegistryCollection().getActions(); - for (ActionConnect component : actions.getComponents()) { + Registry<ActionFactory> actions = PlayPadPlugin.getRegistryCollection().getActions(); + for (ActionFactory component : actions.getComponents()) { component.initActionType(this, profile); } } @@ -125,8 +125,8 @@ public class Mapping implements Cloneable, ActionDisplayable { } public void initFeedback() { - Registry<MapperConnect> registry = PlayPadPlugin.getRegistryCollection().getMappers(); - for (MapperConnect mapper : registry.getComponents()) { + Registry<MapperFactory> registry = PlayPadPlugin.getRegistryCollection().getMappers(); + for (MapperFactory mapper : registry.getComponents()) { if (mapper instanceof MapperConnectFeedbackable) { ((MapperConnectFeedbackable) mapper).initFeedbackType(); } @@ -151,8 +151,8 @@ public class Mapping implements Cloneable, ActionDisplayable { } public void clearFeedback() { - Registry<MapperConnect> registry = PlayPadPlugin.getRegistryCollection().getMappers(); - for (MapperConnect mapper : registry.getComponents()) { + Registry<MapperFactory> registry = PlayPadPlugin.getRegistryCollection().getMappers(); + for (MapperFactory mapper : registry.getComponents()) { if (mapper instanceof MapperConnectFeedbackable) { ((MapperConnectFeedbackable) mapper).clearFeedbackType(); } diff --git a/PlayWallCore/src/de/tobias/playpad/action/mapper/MapperConnect.java b/PlayWallCore/src/de/tobias/playpad/action/mapper/MapperFactory.java similarity index 52% rename from PlayWallCore/src/de/tobias/playpad/action/mapper/MapperConnect.java rename to PlayWallCore/src/de/tobias/playpad/action/mapper/MapperFactory.java index 7971a3c7def681bc47dace40ef06f12ffd98743b..0593ca26a35483b9b4f9aa4cd4694d8273883edb 100644 --- a/PlayWallCore/src/de/tobias/playpad/action/mapper/MapperConnect.java +++ b/PlayWallCore/src/de/tobias/playpad/action/mapper/MapperFactory.java @@ -1,10 +1,14 @@ package de.tobias.playpad.action.mapper; -public abstract class MapperConnect { +import de.tobias.playpad.registry.Component; + +public abstract class MapperFactory extends Component { + + public MapperFactory(String type) { + super(type); + } public abstract Mapper createNewMapper(); public abstract MapperViewController getQuickSettingsViewController(Mapper mapper); - - public abstract String getType(); } diff --git a/PlayWallCore/src/de/tobias/playpad/action/mapper/MapperSerializer.java b/PlayWallCore/src/de/tobias/playpad/action/mapper/MapperSerializer.java index 34f621600019be97a504fc0f3a92fea92cb2d82d..90dde24e9f883c52012dbd192dd08974d8a27e79 100644 --- a/PlayWallCore/src/de/tobias/playpad/action/mapper/MapperSerializer.java +++ b/PlayWallCore/src/de/tobias/playpad/action/mapper/MapperSerializer.java @@ -30,7 +30,7 @@ public class MapperSerializer implements XMLSerializer<Mapper>, XMLDeserializer< String mapperType = element.attributeValue(MAPPER_TYPE); try { - MapperConnect component = PlayPadPlugin.getRegistryCollection().getMappers().getComponent(mapperType); + MapperFactory component = PlayPadPlugin.getRegistryCollection().getMappers().getFactory(mapperType); Mapper mapper = component.createNewMapper(); mapper.load(element, action); diff --git a/PlayWallCore/src/de/tobias/playpad/audio/AudioHandlerConnect.java b/PlayWallCore/src/de/tobias/playpad/audio/AudioHandlerFactory.java similarity index 86% rename from PlayWallCore/src/de/tobias/playpad/audio/AudioHandlerConnect.java rename to PlayWallCore/src/de/tobias/playpad/audio/AudioHandlerFactory.java index 122976a4f70e57b0802c04646ec55a9e6c9a3eb3..9d013094da03329f69e7027f3951da2d55578916 100644 --- a/PlayWallCore/src/de/tobias/playpad/audio/AudioHandlerConnect.java +++ b/PlayWallCore/src/de/tobias/playpad/audio/AudioHandlerFactory.java @@ -1,7 +1,9 @@ package de.tobias.playpad.audio; import de.tobias.playpad.pad.conntent.PadContent; +import de.tobias.playpad.registry.Component; import de.tobias.playpad.viewcontroller.AudioHandlerViewController; +import de.tobias.utils.ui.icon.FontIconType; /** * Audio Handler Interface zur Verwaltung einer AudioHandler Implementierung. @@ -12,7 +14,11 @@ import de.tobias.playpad.viewcontroller.AudioHandlerViewController; * * @since 5.0.0 */ -public abstract class AudioHandlerConnect { +public abstract class AudioHandlerFactory extends Component { + + public AudioHandlerFactory(String type) { + super(type); + } /** * Erstellt für eine Kachel ein neunes AudioInterface @@ -30,13 +36,6 @@ public abstract class AudioHandlerConnect { */ public abstract AudioHandlerViewController getAudioHandlerSettingsViewController(); - /** - * Gibt den Type des AudioHandlers zurück. - * - * @return Type - */ - public abstract String getType(); - /** * Prüft ob ein Feature verfügbar ist. * diff --git a/PlayWallCore/src/de/tobias/playpad/audio/AudioRegistry.java b/PlayWallCore/src/de/tobias/playpad/audio/AudioRegistry.java index bb44d27af8784edf2e56d18dc88e87265644501b..6416be398cd54aabcf306d90a87479db96f2bbdf 100644 --- a/PlayWallCore/src/de/tobias/playpad/audio/AudioRegistry.java +++ b/PlayWallCore/src/de/tobias/playpad/audio/AudioRegistry.java @@ -4,15 +4,15 @@ import de.tobias.playpad.registry.DefaultComponentRegistry; import de.tobias.playpad.registry.NoSuchComponentException; import de.tobias.playpad.settings.Profile; -public class AudioRegistry extends DefaultComponentRegistry<AudioHandlerConnect> { +public class AudioRegistry extends DefaultComponentRegistry<AudioHandlerFactory> { public AudioRegistry() { super("Audio Handler"); } - public AudioHandlerConnect getCurrentAudioHandler() { + public AudioHandlerFactory getCurrentAudioHandler() { try { - return getComponent(Profile.currentProfile().getProfileSettings().getAudioClass()); + return getFactory(Profile.currentProfile().getProfileSettings().getAudioClass()); } catch (NoSuchComponentException e) { return getDefault(); } diff --git a/PlayWallCore/src/de/tobias/playpad/audio/fade/Fading.java b/PlayWallCore/src/de/tobias/playpad/audio/fade/Fading.java index 5fe281b641efba4fb06f3cfc05eced1515fa5029..e915ca85ec448be08fa8fc23c469a3bbbb121548 100644 --- a/PlayWallCore/src/de/tobias/playpad/audio/fade/Fading.java +++ b/PlayWallCore/src/de/tobias/playpad/audio/fade/Fading.java @@ -6,9 +6,8 @@ import javafx.util.Duration; /** * Fading utils. - * + * * @author tobias - * * @since 6.0.0 */ public class Fading { @@ -22,14 +21,6 @@ public class Fading { this.iVolume = iVolume; } - public double getVelocity() { - return velocity; - } - - public void setVelocity(double velocity) { - this.velocity = velocity; - } - public void fadeIn(Duration duration) { fade(0, 1, duration, null); } @@ -50,6 +41,12 @@ public class Fading { return currentFadeTransition != null; } + public void stop() { + if (currentFadeTransition != null) { + currentFadeTransition.stop(); + } + } + private void fade(double from, double to, Duration duration, Runnable onFinish) { if (currentFadeTransition != null) { currentFadeTransition.stop(); diff --git a/PlayWallCore/src/de/tobias/playpad/design/DesignConnect.java b/PlayWallCore/src/de/tobias/playpad/design/DesignFactory.java similarity index 69% rename from PlayWallCore/src/de/tobias/playpad/design/DesignConnect.java rename to PlayWallCore/src/de/tobias/playpad/design/DesignFactory.java index c38d3368ade34b03bfccde7babae7bffedff31c8..fa0f5c4cc12527729429da29be3b8f370feb604a 100644 --- a/PlayWallCore/src/de/tobias/playpad/design/DesignConnect.java +++ b/PlayWallCore/src/de/tobias/playpad/design/DesignFactory.java @@ -1,12 +1,16 @@ package de.tobias.playpad.design; import de.tobias.playpad.Displayable; +import de.tobias.playpad.registry.Component; import de.tobias.playpad.viewcontroller.CartDesignViewController; import de.tobias.playpad.viewcontroller.GlobalDesignViewController; +import de.tobias.utils.ui.icon.FontIconType; -public abstract class DesignConnect implements Displayable { +public abstract class DesignFactory extends Component implements Displayable { - public abstract String getType(); + public DesignFactory(String type) { + super(type); + } public abstract CartDesign newCartDesign(); diff --git a/PlayWallCore/src/de/tobias/playpad/design/GlobalDesign.java b/PlayWallCore/src/de/tobias/playpad/design/GlobalDesign.java index b8795f49297e3f8982e74edb0509e821366b44cd..a52140036bf05e9bf0e1ebe906b44609d5492451 100644 --- a/PlayWallCore/src/de/tobias/playpad/design/GlobalDesign.java +++ b/PlayWallCore/src/de/tobias/playpad/design/GlobalDesign.java @@ -81,14 +81,14 @@ public interface GlobalDesign { Document document = reader.read(Files.newInputStream(path)); Element root = document.getRootElement(); - DefaultRegistry<DesignConnect> layouts2 = PlayPadPlugin.getRegistryCollection().getDesigns(); + DefaultRegistry<DesignFactory> layouts2 = PlayPadPlugin.getRegistryCollection().getDesigns(); for (Object layoutObj : root.elements("Layout")) { Element layoutElement = (Element) layoutObj; String type = layoutElement.attributeValue("type"); try { - GlobalDesign layout = layouts2.getComponent(type).newGlobalDesign(); + GlobalDesign layout = layouts2.getFactory(type).newGlobalDesign(); layout.load(layoutElement); layouts.put(type, layout); } catch (NoSuchComponentException e) { diff --git a/PlayWallCore/src/de/tobias/playpad/midi/device/DeviceRegistry.java b/PlayWallCore/src/de/tobias/playpad/midi/device/DeviceRegistry.java index bfbd50d27ac7b765103630677ef67d3656628710..67b9b8a796939c1cf497bdc173440baf10e932c6 100644 --- a/PlayWallCore/src/de/tobias/playpad/midi/device/DeviceRegistry.java +++ b/PlayWallCore/src/de/tobias/playpad/midi/device/DeviceRegistry.java @@ -64,7 +64,7 @@ public class DeviceRegistry extends EventDispatcher { } /** - * Instanz der Device Factory + * Instanz der Device Component * * @return instance */ diff --git a/PlayWallCore/src/de/tobias/playpad/pad/PadSerializer.java b/PlayWallCore/src/de/tobias/playpad/pad/PadSerializer.java index e932e8d641e7547ef7b9c54c3fd250545d94d514..ae1277b2447642dfc41472aca92a14501ce10461 100644 --- a/PlayWallCore/src/de/tobias/playpad/pad/PadSerializer.java +++ b/PlayWallCore/src/de/tobias/playpad/pad/PadSerializer.java @@ -2,13 +2,13 @@ package de.tobias.playpad.pad; import java.util.UUID; +import de.tobias.playpad.pad.conntent.ContentFactory; import org.dom4j.Element; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.design.CartDesign; -import de.tobias.playpad.design.DesignConnect; +import de.tobias.playpad.design.DesignFactory; import de.tobias.playpad.pad.conntent.PadContent; -import de.tobias.playpad.pad.conntent.PadContentConnect; import de.tobias.playpad.plugin.Module; import de.tobias.playpad.project.Project; import de.tobias.playpad.registry.DefaultRegistry; @@ -100,8 +100,8 @@ public class PadSerializer implements XMLSerializer<Pad>, XMLDeserializer<Pad> { String type = layoutElement.attributeValue(LAYOUT_TYPE_ATTR); try { - DefaultRegistry<DesignConnect> layouts = PlayPadPlugin.getRegistryCollection().getDesigns(); - CartDesign layout = layouts.getComponent(type).newCartDesign(); + DefaultRegistry<DesignFactory> layouts = PlayPadPlugin.getRegistryCollection().getDesigns(); + CartDesign layout = layouts.getFactory(type).newCartDesign(); layout.load(layoutElement); padSettings.setLayout(layout, type); @@ -144,8 +144,8 @@ public class PadSerializer implements XMLSerializer<Pad>, XMLDeserializer<Pad> { if (contentElement != null) { String contentType = contentElement.attributeValue(CONTENT_TYPE_ATTR); try { - Registry<PadContentConnect> padContents = PlayPadPlugin.getRegistryCollection().getPadContents(); - PadContent content = padContents.getComponent(contentType).newInstance(pad); + Registry<ContentFactory> padContents = PlayPadPlugin.getRegistryCollection().getPadContents(); + PadContent content = padContents.getFactory(contentType).newInstance(pad); content.load(contentElement); pad.setContent(content); diff --git a/PlayWallCore/src/de/tobias/playpad/pad/PadSettings.java b/PlayWallCore/src/de/tobias/playpad/pad/PadSettings.java index 698ac80e2d438c866fde83ff1fac944372f5ba8e..c4869cb25634f86ddaff7a8920497115bfe496a1 100644 --- a/PlayWallCore/src/de/tobias/playpad/pad/PadSettings.java +++ b/PlayWallCore/src/de/tobias/playpad/pad/PadSettings.java @@ -4,7 +4,7 @@ import java.util.HashMap; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.design.CartDesign; -import de.tobias.playpad.design.DesignConnect; +import de.tobias.playpad.design.DesignFactory; import de.tobias.playpad.registry.DefaultRegistry; import de.tobias.playpad.registry.NoSuchComponentException; import de.tobias.playpad.settings.Fade; @@ -162,9 +162,9 @@ public class PadSettings implements Cloneable { public CartDesign getLayout(String type) { if (!layouts.containsKey(type)) { - DefaultRegistry<DesignConnect> layouts2 = PlayPadPlugin.getRegistryCollection().getDesigns(); + DefaultRegistry<DesignFactory> layouts2 = PlayPadPlugin.getRegistryCollection().getDesigns(); try { - layouts.put(type, layouts2.getComponent(type).newCartDesign()); + layouts.put(type, layouts2.getFactory(type).newCartDesign()); } catch (NoSuchComponentException e) { // TODO Auto-generated catch block e.printStackTrace(); diff --git a/PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContentConnect.java b/PlayWallCore/src/de/tobias/playpad/pad/conntent/ContentFactory.java similarity index 72% rename from PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContentConnect.java rename to PlayWallCore/src/de/tobias/playpad/pad/conntent/ContentFactory.java index 260019495c53a8b7ffa92e95c91dc2cb48d18dff..c4098bdd50474e586c4b3d9b2e5cc491b3b5964b 100644 --- a/PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContentConnect.java +++ b/PlayWallCore/src/de/tobias/playpad/pad/conntent/ContentFactory.java @@ -2,18 +2,21 @@ package de.tobias.playpad.pad.conntent; import java.nio.file.Path; -import de.tobias.playpad.Displayable; import de.tobias.playpad.pad.Pad; import de.tobias.playpad.pad.view.IPadContentView; +import de.tobias.playpad.registry.Component; import de.tobias.playpad.viewcontroller.PadSettingsTabViewController; import de.tobias.playpad.viewcontroller.option.ProfileSettingsTabViewController; +import de.tobias.utils.ui.icon.FontIconType; import de.tobias.utils.util.FileUtils; import javafx.scene.layout.Pane; -// COMMENT PadContentConnect -public abstract class PadContentConnect implements Comparable<PadContentConnect>, Displayable { +// COMMENT ContentFactory +public abstract class ContentFactory extends Component implements Comparable<ContentFactory> { - public abstract String getType(); + public ContentFactory(String type) { + super(type); + } public abstract PadContent newInstance(Pad pad); @@ -30,11 +33,11 @@ public abstract class PadContentConnect implements Comparable<PadContentConnect> public abstract String[] getSupportedTypes(); @Override - public int compareTo(PadContentConnect o) { + public int compareTo(ContentFactory o) { return getType().compareTo(o.getType()); } - public static boolean isFileSupported(Path path, PadContentConnect connect) { + public static boolean isFileTypeSupported(Path path, ContentFactory connect) { String extension = FileUtils.getFileExtention(path); for (String ex : connect.getSupportedTypes()) { if (ex.endsWith(extension)) { diff --git a/PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContentRegistry.java b/PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContentRegistry.java index d3e6374a17468d79875453f51c8c579c86ab00ad..7f1e6e584e850ba6e2a19db8b10323c55b8bbe80 100644 --- a/PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContentRegistry.java +++ b/PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContentRegistry.java @@ -10,16 +10,16 @@ import java.util.Set; import de.tobias.playpad.registry.ComponentRegistry; import de.tobias.playpad.registry.NoSuchComponentException; -public class PadContentRegistry extends ComponentRegistry<PadContentConnect> { +public class PadContentRegistry extends ComponentRegistry<ContentFactory> { public PadContentRegistry(String name) { super(name); } - public Set<PadContentConnect> getPadContentConnectsForFile(Path path) throws NoSuchComponentException { - Set<PadContentConnect> connects = new HashSet<>(); + public Set<ContentFactory> getPadContentConnectsForFile(Path path) throws NoSuchComponentException { + Set<ContentFactory> connects = new HashSet<>(); for (String type : getTypes()) { - PadContentConnect connect = getComponent(type); + ContentFactory connect = getFactory(type); for (String extension : connect.getSupportedTypes()) { if (path.getFileName().toString().toLowerCase().matches("." + extension)) { connects.add(connect); @@ -32,7 +32,7 @@ public class PadContentRegistry extends ComponentRegistry<PadContentConnect> { public String[] getSupportedFileTypes() throws NoSuchComponentException { List<String> extensions = new ArrayList<>(); for (String type : getTypes()) { - PadContentConnect connect = getComponent(type); + ContentFactory connect = getFactory(type); String[] fileExtensions = connect.getSupportedTypes(); Collections.addAll(extensions, fileExtensions); } diff --git a/PlayWallCore/src/de/tobias/playpad/pad/drag/PadDragMode.java b/PlayWallCore/src/de/tobias/playpad/pad/drag/PadDragMode.java index f79faf279af0462a9eee5b7e0f9c7b638d93263f..a3e4dcf467b31792827febe7fe310c21a92b42f0 100644 --- a/PlayWallCore/src/de/tobias/playpad/pad/drag/PadDragMode.java +++ b/PlayWallCore/src/de/tobias/playpad/pad/drag/PadDragMode.java @@ -1,8 +1,9 @@ package de.tobias.playpad.pad.drag; -import de.tobias.playpad.Displayable; import de.tobias.playpad.project.Project; import de.tobias.playpad.project.page.PadIndex; +import de.tobias.playpad.registry.Component; +import de.tobias.utils.ui.icon.FontIconType; /** * Modus um ein Pad mit Drag and Drop zu verschieben. @@ -11,9 +12,11 @@ import de.tobias.playpad.project.page.PadIndex; * * @since 6.0.0 */ -public abstract class PadDragMode implements Displayable, Comparable<PadDragMode> { +public abstract class PadDragMode extends Component implements Comparable<PadDragMode> { - public abstract String getType(); + public PadDragMode(String type) { + super(type); + } /** * Führt die Drag and Drop Aktion aus, ändert das Datenmodell. diff --git a/PlayWallCore/src/de/tobias/playpad/profile/ref/ProfileReference.java b/PlayWallCore/src/de/tobias/playpad/profile/ref/ProfileReference.java index 8b3cecea7892323d0716d7f3cdd939a0d4d1d70f..fbde1db0894d5db0d270d4c01d30072b902f5584 100644 --- a/PlayWallCore/src/de/tobias/playpad/profile/ref/ProfileReference.java +++ b/PlayWallCore/src/de/tobias/playpad/profile/ref/ProfileReference.java @@ -34,10 +34,7 @@ public class ProfileReference implements Displayable { * Name */ public ProfileReference(String name) { - this.name = name; - this.uuid = UUID.randomUUID(); - requestedModules = new HashSet<>(); - updateDisplayProperty(); + this(UUID.randomUUID(), name); } /** diff --git a/PlayWallCore/src/de/tobias/playpad/project/ref/ProjectReference.java b/PlayWallCore/src/de/tobias/playpad/project/ref/ProjectReference.java index b993267893bec2724d27a4701adcfaa9652eb276..1d0a3877030404ae3fffec969c967ee27e85d2f2 100644 --- a/PlayWallCore/src/de/tobias/playpad/project/ref/ProjectReference.java +++ b/PlayWallCore/src/de/tobias/playpad/project/ref/ProjectReference.java @@ -108,9 +108,11 @@ public class ProjectReference implements Displayable { } } - for (Module requested : profileReference.getRequestedModules()) { - if (!activeModules.contains(requested)) { - missedModules.add(requested); + if (profileReference != null) { + for (Module requested : profileReference.getRequestedModules()) { + if (!activeModules.contains(requested)) { + missedModules.add(requested); + } } } return missedModules; diff --git a/PlayWallCore/src/de/tobias/playpad/registry/Component.java b/PlayWallCore/src/de/tobias/playpad/registry/Component.java new file mode 100644 index 0000000000000000000000000000000000000000..7d656b772c8d237c3c62b907e2e0e4c688cba397 --- /dev/null +++ b/PlayWallCore/src/de/tobias/playpad/registry/Component.java @@ -0,0 +1,56 @@ +package de.tobias.playpad.registry; + +import de.tobias.playpad.Displayable; +import de.tobias.utils.ui.icon.FontIcon; +import de.tobias.utils.ui.icon.FontIconType; +import javafx.beans.property.SimpleStringProperty; +import javafx.beans.property.StringProperty; +import javafx.scene.Node; + +/** + * Created by tobias on 31.12.16. + */ +public class Component implements Displayable { + + private String type; + private StringProperty displayProperty; + private FontIcon graphics; + + public Component(String type) { + this.type = type; + this.displayProperty = new SimpleStringProperty(); + this.graphics = new FontIcon(); + } + + public String getType() { + return type; + } + + @Override + public StringProperty displayProperty() { + return displayProperty; + } + + @Override + public Node getGraphics() { + return graphics; + } + + public void setName(String name) { + displayProperty.set(name); + } + + public void setGraphics(FontIconType icon) { + this.graphics = new FontIcon(icon); + } + + public void setGraphics(FontIconType icon, int size) { + this.graphics = new FontIcon(icon.getFontFile(), icon); + this.graphics.setSize(size); + } + + @Override + public String toString() { + return displayProperty.get(); + } +} diff --git a/PlayWallCore/src/de/tobias/playpad/registry/ComponentRegistry.java b/PlayWallCore/src/de/tobias/playpad/registry/ComponentRegistry.java index d5e4d04a52bc1e667d14096be4a7bb58696fa7dd..949ee3c7c415d97074e61425c43ec37cfb0b7c2b 100644 --- a/PlayWallCore/src/de/tobias/playpad/registry/ComponentRegistry.java +++ b/PlayWallCore/src/de/tobias/playpad/registry/ComponentRegistry.java @@ -1,57 +1,70 @@ package de.tobias.playpad.registry; -import java.io.IOException; -import java.net.URL; -import java.util.Collection; -import java.util.HashMap; -import java.util.Set; - +import de.tobias.playpad.plugin.Module; +import de.tobias.utils.ui.icon.FontIconType; import org.dom4j.Document; import org.dom4j.DocumentException; import org.dom4j.Element; import org.dom4j.io.SAXReader; -import de.tobias.playpad.plugin.Module; +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.net.URL; +import java.util.Collection; +import java.util.HashMap; +import java.util.ResourceBundle; +import java.util.Set; +import java.util.stream.Collectors; /** * Eine Implementierung für eine Registry. - * - * @author tobias * - * @param <C> - * Componentent - * + * @param <C> Componentent + * @author tobias * @since 5.1.0 */ -public class ComponentRegistry<C> implements Registry<C> { +public class ComponentRegistry<C extends Component> implements Registry<C> { + + private HashMap<String, Item<C>> components; - private HashMap<String, C> components; - // Zu einem Component die zugehörigen Meta Daten (das Modul) - private HashMap<String, Module> modules; private String name; public ComponentRegistry(String name) { this.components = new HashMap<>(); - this.modules = new HashMap<>(); this.name = name; } @Override - public void registerComponent(C component, String id, Module module) throws IllegalArgumentException { - if (components.containsKey(id)) { - throw new IllegalArgumentException("A components already exists with this id: " + id); + public void registerComponent(C factory, Module module) throws IllegalArgumentException { + if (components.containsKey(factory.getType())) { + throw new IllegalArgumentException("A components already exists with this id: " + factory.getType()); } - components.put(id, component); - modules.put(id, module); - System.out.println("Registered: " + name + "#" + id); + + Item<C> item = new Item<>(); + item.content = factory; + item.module = module; + + components.put(factory.getType(), item); + System.out.println("Registered: " + name + "#" + factory.getType()); } @Override - public C getComponent(String id) throws NoSuchComponentException { + public C getFactory(String id) throws NoSuchComponentException { if (!components.containsKey(id)) { throw new NoSuchComponentException(id); } - return components.get(id); + return components.get(id).content; + } + + @Override + public C getFactory(Class<?> clazz) throws NoSuchComponentException { + for (Item<C> item : components.values()) { + if (item.content.getClass().equals(clazz)) { + return item.content; + } + } + throw new NoSuchComponentException(clazz.getName()); } @Override @@ -61,12 +74,13 @@ public class ComponentRegistry<C> implements Registry<C> { @Override public Collection<C> getComponents() { - return components.values(); + // Maps internal structure to Content List + return components.values().stream().map(a -> a.content).collect(Collectors.toList()); } @Override - public void loadComponentsFromFile(URL url, ClassLoader loader, Module module) - throws IOException, DocumentException, ClassNotFoundException, InstantiationException, IllegalAccessException { + public void loadComponentsFromFile(URL url, ClassLoader loader, Module module, ResourceBundle resourceBundle) + throws IOException, DocumentException, ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { if (url == null) { throw new IOException("URL not found: " + url); } @@ -81,15 +95,36 @@ public class ComponentRegistry<C> implements Registry<C> { // Find the class of the type @SuppressWarnings("unchecked") Class<C> clazz = (Class<C>) loader.loadClass(element.getStringValue()); - C component = clazz.newInstance(); + Constructor<C> constructor = clazz.getConstructor(String.class); + C factory = constructor.newInstance(type); + + // setup Displayable + if (element.attributeValue("name") != null) { + String name = element.attributeValue("name"); + String localizedName = resourceBundle.getString(name); + factory.setName(localizedName); + } - registerComponent(component, type, module); + if (element.attributeValue("icon") != null && element.attributeValue("class") != null && element.attributeValue("size") != null) { + String icon = element.attributeValue("icon"); + Class iconClass = Class.forName(element.attributeValue("class")); + int size = Integer.valueOf(element.attributeValue("size")); + Object iconObj = Enum.valueOf(iconClass, icon); + if (iconObj instanceof FontIconType) { + FontIconType iconType = (FontIconType) iconObj; + factory.setGraphics(iconType, size); + } + } + + registerComponent(factory, module); } } } @Override public Module getModule(String id) { - return modules.get(id); + return components.get(id).module; } + + } diff --git a/PlayWallCore/src/de/tobias/playpad/registry/DefaultComponentRegistry.java b/PlayWallCore/src/de/tobias/playpad/registry/DefaultComponentRegistry.java index a8b2dae1e98a084ff8401420129acbe109257393..41f97ac1d9db7ecda7ac9dc34bc0b295aa710f5e 100644 --- a/PlayWallCore/src/de/tobias/playpad/registry/DefaultComponentRegistry.java +++ b/PlayWallCore/src/de/tobias/playpad/registry/DefaultComponentRegistry.java @@ -1,25 +1,28 @@ package de.tobias.playpad.registry; -import java.io.IOException; -import java.net.URL; - +import de.tobias.playpad.plugin.Module; +import de.tobias.utils.ui.icon.FontIconType; import org.dom4j.Document; import org.dom4j.DocumentException; import org.dom4j.Element; import org.dom4j.io.SAXReader; -import de.tobias.playpad.plugin.Module; +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.net.URL; +import java.util.ResourceBundle; -public class DefaultComponentRegistry<C> extends ComponentRegistry<C> implements DefaultRegistry<C> { +public class DefaultComponentRegistry<F extends Component> extends ComponentRegistry<F> implements DefaultRegistry<F> { - private C defaultValue; + private F defaultValue; public DefaultComponentRegistry(String name) { super(name); } @Override - public C getDefault() { + public F getDefault() { return defaultValue; } @@ -27,7 +30,7 @@ public class DefaultComponentRegistry<C> extends ComponentRegistry<C> implements public String getDefaultID() { for (String type : getTypes()) { try { - if (getComponent(type).equals(defaultValue)) { + if (getFactory(type).equals(defaultValue)) { return type; } } catch (NoSuchComponentException e) { @@ -38,18 +41,23 @@ public class DefaultComponentRegistry<C> extends ComponentRegistry<C> implements } @Override - public void setDefault(C component) { + public void setDefault(F component) { this.defaultValue = component; } @Override public void setDefaultID(String id) throws NoSuchComponentException { - setDefault(getComponent(id)); + setDefault(getFactory(id)); } @Override - public void loadComponentsFromFile(URL url, ClassLoader loader, Module module) - throws IOException, DocumentException, ClassNotFoundException, InstantiationException, IllegalAccessException { + public void setDefaultID(Class<?> clazz) throws NoSuchComponentException{ + setDefault(getFactory(clazz)); + } + + @Override + public void loadComponentsFromFile(URL url, ClassLoader loader, Module module, ResourceBundle resourceBundle) + throws IOException, DocumentException, ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { if (url == null) { throw new IOException("URL not found: " + url); } @@ -63,15 +71,34 @@ public class DefaultComponentRegistry<C> extends ComponentRegistry<C> implements String type = element.attributeValue("id"); // Find the class of the type - @SuppressWarnings("unchecked") Class<C> clazz = (Class<C>) loader.loadClass(element.getStringValue()); - C component = clazz.newInstance(); + @SuppressWarnings("unchecked") Class<F> clazz = (Class<F>) loader.loadClass(element.getStringValue()); + Constructor<F> constructor = clazz.getConstructor(String.class); + F factory = constructor.newInstance(type); - registerComponent(component, type, module); + registerComponent(factory, module); if (element.attributeValue("default") != null) { String defaultValue = element.attributeValue("default"); if (defaultValue.equals("true")) { - setDefault(component); + setDefault(factory); + } + } + + // setup Displayable + if (element.attributeValue("name") != null) { + String name = element.attributeValue("name"); + String localizedName = resourceBundle.getString(name); + factory.setName(localizedName); + } + + if (element.attributeValue("icon") != null && element.attributeValue("class") != null && element.attributeValue("size") != null) { + String icon = element.attributeValue("icon"); + Class iconClass = Class.forName(element.attributeValue("class")); + int size = Integer.valueOf(element.attributeValue("size")); + Object iconObj = Enum.valueOf(iconClass, icon); + if (iconObj instanceof FontIconType) { + FontIconType iconType = (FontIconType) iconObj; + factory.setGraphics(iconType, size); } } } diff --git a/PlayWallCore/src/de/tobias/playpad/registry/DefaultRegistry.java b/PlayWallCore/src/de/tobias/playpad/registry/DefaultRegistry.java index 527370af19c653afe363d0f0a21b1666f778404d..893f7a56bb7aa989f511d97ea442568354a61cf3 100644 --- a/PlayWallCore/src/de/tobias/playpad/registry/DefaultRegistry.java +++ b/PlayWallCore/src/de/tobias/playpad/registry/DefaultRegistry.java @@ -5,16 +5,18 @@ package de.tobias.playpad.registry; * * @author tobias - s0553746 * - * @param <C> Type der Daten + * @param <F> Type der Daten */ -public interface DefaultRegistry<C> extends Registry<C> { +public interface DefaultRegistry<F extends Component> extends Registry<F> { - public C getDefault(); + F getDefault(); - public String getDefaultID(); + String getDefaultID(); - public void setDefault(C component); + void setDefault(F component); - public void setDefaultID(String id) throws NoSuchComponentException; + void setDefaultID(String id) throws NoSuchComponentException; + + void setDefaultID(Class<?> clazz) throws NoSuchComponentException; } diff --git a/PlayWallCore/src/de/tobias/playpad/registry/Item.java b/PlayWallCore/src/de/tobias/playpad/registry/Item.java new file mode 100644 index 0000000000000000000000000000000000000000..998c57936cf328e83e76198db8823f5fc2cdc868 --- /dev/null +++ b/PlayWallCore/src/de/tobias/playpad/registry/Item.java @@ -0,0 +1,17 @@ +package de.tobias.playpad.registry; + +import de.tobias.playpad.plugin.Module; +import de.tobias.utils.ui.icon.FontIconType; + +/** + * Created by tobias on 31.12.16. + */ +class Item<C> { + C content; + Module module; + String localozedName; + + // UI Description + FontIconType fontIconType; + int iconSize; +} diff --git a/PlayWallCore/src/de/tobias/playpad/registry/Registry.java b/PlayWallCore/src/de/tobias/playpad/registry/Registry.java index df4ff3af7f836393d50fc52817f84bdd4a5ed74c..be457d8500a45ca4554050f46dd2a70eeca50e03 100644 --- a/PlayWallCore/src/de/tobias/playpad/registry/Registry.java +++ b/PlayWallCore/src/de/tobias/playpad/registry/Registry.java @@ -11,7 +11,7 @@ import de.tobias.playpad.plugin.Module; * @author tobias * * @param <C> - * Component + * Item * * @since 5.1.0 */ @@ -27,21 +27,29 @@ public interface Registry<C> extends WriteOnlyRegistry<C> { * @throws NoSuchComponentException * Wird geworfen, wenn die Komponente nicht existiert. */ - public C getComponent(String id) throws NoSuchComponentException; + C getFactory(String id) throws NoSuchComponentException; + + /** + * Get a Components for a Class Type + * @param clazz type + * @return component + * @throws NoSuchComponentException no component found + */ + C getFactory(Class<?> clazz) throws NoSuchComponentException; /** * Listet alle Type ID auf, die registriert wurden. * * @return Liste mit IDs */ - public Set<String> getTypes(); + Set<String> getTypes(); /** * Listet alle Implementierungen auf. * * @return Implementierungen */ - public Collection<C> getComponents(); + Collection<C> getComponents(); /** * Gibt das Module zurück. @@ -50,5 +58,5 @@ public interface Registry<C> extends WriteOnlyRegistry<C> { * id der Komponente. * @return Module */ - public Module getModule(String id); + Module getModule(String id); } diff --git a/PlayWallCore/src/de/tobias/playpad/registry/WriteOnlyRegistry.java b/PlayWallCore/src/de/tobias/playpad/registry/WriteOnlyRegistry.java index 5326d6b212858937a49ef131323c9c63b4f0f847..90260f8999a71419eeb3f5b329e45f8e4b49cfee 100644 --- a/PlayWallCore/src/de/tobias/playpad/registry/WriteOnlyRegistry.java +++ b/PlayWallCore/src/de/tobias/playpad/registry/WriteOnlyRegistry.java @@ -1,7 +1,9 @@ package de.tobias.playpad.registry; import java.io.IOException; +import java.lang.reflect.InvocationTargetException; import java.net.URL; +import java.util.ResourceBundle; import org.dom4j.DocumentException; @@ -13,7 +15,7 @@ import de.tobias.playpad.plugin.Module; * @author tobias * * @param <C> - * Component + * Item * * @since 5.1.0 */ @@ -24,14 +26,12 @@ public interface WriteOnlyRegistry<C> { * * @param component * Komponente - * @param id - * ID * @param module * Module zu dem diese Komponente gehört * @throws IllegalArgumentException * Die Komponete gibt es bereits. */ - public void registerComponent(C component, String id, Module module) throws IllegalArgumentException; + void registerComponent(C component, Module module) throws IllegalArgumentException; /** * Lädt aus einer XML Datei die Komponenten Deklaration und registriert diese automatisch. @@ -53,16 +53,16 @@ public interface WriteOnlyRegistry<C> { * @throws InstantiationException * Die Klasse konnte nicht instanziert werden */ - public void loadComponentsFromFile(URL url, ClassLoader loader, Module module) - throws IOException, DocumentException, ClassNotFoundException, InstantiationException, IllegalAccessException; + void loadComponentsFromFile(URL url, ClassLoader loader, Module module, ResourceBundle resourceBundle) + throws IOException, DocumentException, ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException; - public default void loadComponentsFromFile(String name, Module module) - throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException, DocumentException { - loadComponentsFromFile(getClass().getClassLoader().getResource(name), getClass().getClassLoader(), module); + default void loadComponentsFromFile(String name, Module module, ResourceBundle resourceBundle) + throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException, DocumentException, NoSuchMethodException, InvocationTargetException { + loadComponentsFromFile(getClass().getClassLoader().getResource(name), getClass().getClassLoader(), module, resourceBundle); } - public default void loadComponentsFromFile(String name, ClassLoader loader, Module module) - throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException, DocumentException { - loadComponentsFromFile(loader.getResource(name), loader, module); + default void loadComponentsFromFile(String name, ClassLoader loader, Module module, ResourceBundle resourceBundle) + throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException, DocumentException, NoSuchMethodException, InvocationTargetException { + loadComponentsFromFile(loader.getResource(name), loader, module, resourceBundle); } } diff --git a/PlayWallCore/src/de/tobias/playpad/settings/Profile.java b/PlayWallCore/src/de/tobias/playpad/settings/Profile.java index cd8b78e90bf865042eca8da35b54b1f833f0a3d1..3d8ea67725b64af1fde1abbbf9719232d878ae2c 100644 --- a/PlayWallCore/src/de/tobias/playpad/settings/Profile.java +++ b/PlayWallCore/src/de/tobias/playpad/settings/Profile.java @@ -12,7 +12,7 @@ import org.dom4j.DocumentException; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.action.MappingList; -import de.tobias.playpad.design.DesignConnect; +import de.tobias.playpad.design.DesignFactory; import de.tobias.playpad.design.GlobalDesign; import de.tobias.playpad.profile.ref.ProfileReference; import de.tobias.playpad.profile.ref.ProfileReferences; @@ -82,8 +82,8 @@ public class Profile { return layouts.get(type); } else { try { - DefaultRegistry<DesignConnect> registry = PlayPadPlugin.getRegistryCollection().getDesigns(); - GlobalDesign layout = registry.getComponent(type).newGlobalDesign(); + DefaultRegistry<DesignFactory> registry = PlayPadPlugin.getRegistryCollection().getDesigns(); + GlobalDesign layout = registry.getFactory(type).newGlobalDesign(); layouts.put(type, layout); return layout; } catch (NoSuchComponentException e) { // -> Throw exception diff --git a/PlayWallCore/src/de/tobias/playpad/tigger/Trigger.java b/PlayWallCore/src/de/tobias/playpad/tigger/Trigger.java index 924e6010ac208363794f1ded976d2062f81ce9a4..d405b5f1fb3024a9862060a0b52136b740ec3ea9 100644 --- a/PlayWallCore/src/de/tobias/playpad/tigger/Trigger.java +++ b/PlayWallCore/src/de/tobias/playpad/tigger/Trigger.java @@ -66,9 +66,9 @@ public class Trigger { Element itemElement = (Element) itemObj; String type = itemElement.attributeValue(TYPE_ATTR); - Registry<TriggerItemConnect> registry = PlayPadPlugin.getRegistryCollection().getTriggerItems(); + Registry<TriggerItemFactory> registry = PlayPadPlugin.getRegistryCollection().getTriggerItems(); try { - TriggerItemConnect connect = registry.getComponent(type); + TriggerItemFactory connect = registry.getFactory(type); TriggerItem item = connect.newInstance(this); item.load(itemElement); items.add(item); diff --git a/PlayWallCore/src/de/tobias/playpad/tigger/TriggerItemConnect.java b/PlayWallCore/src/de/tobias/playpad/tigger/TriggerItemFactory.java similarity index 52% rename from PlayWallCore/src/de/tobias/playpad/tigger/TriggerItemConnect.java rename to PlayWallCore/src/de/tobias/playpad/tigger/TriggerItemFactory.java index c478c0671d672821e786ca90aecc4dac9460614a..0932f2ee159ccaa7022b303cf8a7acb0a0de150f 100644 --- a/PlayWallCore/src/de/tobias/playpad/tigger/TriggerItemConnect.java +++ b/PlayWallCore/src/de/tobias/playpad/tigger/TriggerItemFactory.java @@ -1,10 +1,14 @@ package de.tobias.playpad.tigger; +import de.tobias.playpad.registry.Component; import de.tobias.utils.ui.ContentViewController; +import de.tobias.utils.ui.icon.FontIconType; -public abstract class TriggerItemConnect { +public abstract class TriggerItemFactory extends Component { - public abstract String getType(); + public TriggerItemFactory(String type) { + super(type); + } public abstract TriggerItem newInstance(Trigger trigger); diff --git a/PlayWallCore/src/de/tobias/playpad/view/main/MainLayoutConnect.java b/PlayWallCore/src/de/tobias/playpad/view/main/MainLayoutFactory.java similarity index 69% rename from PlayWallCore/src/de/tobias/playpad/view/main/MainLayoutConnect.java rename to PlayWallCore/src/de/tobias/playpad/view/main/MainLayoutFactory.java index b8a88aa78514af5227bfe7290a8ff84d780ff548..65fd155c8db96948253b3f6f927e5717aabece0b 100644 --- a/PlayWallCore/src/de/tobias/playpad/view/main/MainLayoutConnect.java +++ b/PlayWallCore/src/de/tobias/playpad/view/main/MainLayoutFactory.java @@ -2,8 +2,10 @@ package de.tobias.playpad.view.main; import de.tobias.playpad.pad.view.IPadView; import de.tobias.playpad.pad.viewcontroller.IPadViewController; +import de.tobias.playpad.registry.Component; import de.tobias.playpad.viewcontroller.main.IMainViewController; import de.tobias.playpad.viewcontroller.main.MenuToolbarViewController; +import de.tobias.utils.ui.icon.FontIconType; /** * Dieses Interface beschreibt die Bestandteile des Layouts (GUI Elemente) des Main Views. @@ -12,21 +14,11 @@ import de.tobias.playpad.viewcontroller.main.MenuToolbarViewController; * * @since 5.1.0 */ -public interface MainLayoutConnect { +public abstract class MainLayoutFactory extends Component { - /** - * Gibt den Unique Identifier zurück. - * - * @return ID - */ - public String getType(); - - /** - * Gibt einen lesbaren (am besten Localized) Namen für den Nutzer zurück. - * - * @return Name - */ - public String name(); + public MainLayoutFactory(String type) { + super(type); + } /** * Erstellt einen ViewController für die Menu/Toolbar Fläche. @@ -36,7 +28,7 @@ public interface MainLayoutConnect { * * @return Neuer ViewController mit View */ - public MenuToolbarViewController createMenuToolbar(IMainViewController mainViewRef); + public abstract MenuToolbarViewController createMenuToolbar(IMainViewController mainViewRef); /** * Erstellt ein neues Pad mit einem ViewController @@ -46,7 +38,7 @@ public interface MainLayoutConnect { * @see IPadView notwendige Methoden für ein Pad * @see IPadViewController ViewController zum Pad */ - public IPadView createPadView(); + public abstract IPadView createPadView(); /** * Recycelt eine PadView, damit nicht immer neue erstellt werden müssen. @@ -54,13 +46,13 @@ public interface MainLayoutConnect { * @param padView * alte PadView */ - public void recyclePadView(IPadView padView); + public abstract void recyclePadView(IPadView padView); /** * Gibt das Layout sepzifische Stylesheet zurück. * * @return path in jar */ - public String getStylesheet(); + public abstract String getStylesheet(); } diff --git a/PlayWallCore/src/de/tobias/playpad/view/main/MainLayoutHandler.java b/PlayWallCore/src/de/tobias/playpad/view/main/MainLayoutHandler.java index 4c94753baf1ed882c45f8305e1e3b4ce6b5a2b70..e13845f2c440bbd2800b3e4cf4aef0534db229ab 100644 --- a/PlayWallCore/src/de/tobias/playpad/view/main/MainLayoutHandler.java +++ b/PlayWallCore/src/de/tobias/playpad/view/main/MainLayoutHandler.java @@ -11,7 +11,7 @@ import de.tobias.playpad.viewcontroller.main.MenuToolbarViewController; * @since 5.1.0 * * @see IMainViewController#performLayoutDependendAction(MainLayoutHandler) - * @see MainLayoutConnect + * @see MainLayoutFactory */ @FunctionalInterface public interface MainLayoutHandler { diff --git a/PlayWallCore/src/de/tobias/playpad/viewcontroller/AudioHandlerViewController.java b/PlayWallCore/src/de/tobias/playpad/viewcontroller/AudioHandlerViewController.java index ba5e4d0af5824208ba515155ddd68e2fe7a70397..2f40403db9ca8f324990f5272a8fc9b1bd78bfae 100644 --- a/PlayWallCore/src/de/tobias/playpad/viewcontroller/AudioHandlerViewController.java +++ b/PlayWallCore/src/de/tobias/playpad/viewcontroller/AudioHandlerViewController.java @@ -2,7 +2,7 @@ package de.tobias.playpad.viewcontroller; import java.util.ResourceBundle; -import de.tobias.playpad.audio.AudioHandlerConnect; +import de.tobias.playpad.audio.AudioHandlerFactory; import de.tobias.utils.ui.ContentViewController; /** @@ -10,7 +10,7 @@ import de.tobias.utils.ui.ContentViewController; * * @author tobias * - * @see AudioHandlerConnect + * @see AudioHandlerFactory */ public abstract class AudioHandlerViewController extends ContentViewController { diff --git a/PlayWallCore/src/de/tobias/playpad/viewcontroller/main/IMainViewController.java b/PlayWallCore/src/de/tobias/playpad/viewcontroller/main/IMainViewController.java index 6cdbcf12808a8620c7f69d7b4e2c213faf6e7dd1..6bd38cf0a5fed4ec0af30e45907c70a835981a56 100644 --- a/PlayWallCore/src/de/tobias/playpad/viewcontroller/main/IMainViewController.java +++ b/PlayWallCore/src/de/tobias/playpad/viewcontroller/main/IMainViewController.java @@ -5,7 +5,7 @@ import java.util.List; import de.tobias.playpad.midi.MidiListener; import de.tobias.playpad.pad.view.IPadView; import de.tobias.playpad.settings.keys.KeyCollection; -import de.tobias.playpad.view.main.MainLayoutConnect; +import de.tobias.playpad.view.main.MainLayoutFactory; import de.tobias.playpad.view.main.MainLayoutHandler; import de.tobias.utils.ui.Alertable; import de.tobias.utils.ui.NotificationHandler; @@ -123,10 +123,10 @@ public interface IMainViewController extends NotificationHandler, Alertable { /** * Setzt das MainLayout des Hauptfensters. * - * @param mainLayoutConnect + * @param mainLayoutFactory * Neues Layout */ - public void setMainLayout(MainLayoutConnect mainLayoutConnect); + public void setMainLayout(MainLayoutFactory mainLayoutFactory); /** * Führt eine Aktion für das Hauptfenster aus. Beispielsweise MenuItem in MenuToolbarController hinzufügen. Zudem wird diese Aktion diff --git a/PluginAction/src/de/tobias/playpad/actionsplugin/assets/Actions.xml b/PluginAction/src/de/tobias/playpad/actionsplugin/assets/Actions.xml index b8727f3b34c0165a078e4010a5181878e91f8213..7d1513ede27cdd371cfbc126ed95906982df6b06 100644 --- a/PluginAction/src/de/tobias/playpad/actionsplugin/assets/Actions.xml +++ b/PluginAction/src/de/tobias/playpad/actionsplugin/assets/Actions.xml @@ -1,4 +1,4 @@ <Actions> - <Component id="MUTE">de.tobias.playpad.actionsplugin.muteaction.MuteActionConnect</Component> - <Component id="STOP">de.tobias.playpad.actionsplugin.stopaction.StopActionConnect</Component> + <Component id="MUTE" name="muteaction.name">de.tobias.playpad.actionsplugin.muteaction.MuteActionFactory</Component> + <Component id="STOP" name="stopaction.name">de.tobias.playpad.actionsplugin.stopaction.StopActionFactory</Component> </Actions> \ No newline at end of file diff --git a/PluginAction/src/de/tobias/playpad/actionsplugin/impl/ActionsPluginImpl.java b/PluginAction/src/de/tobias/playpad/actionsplugin/impl/ActionsPluginImpl.java index 0c286fdd56bb436caddbbdc3c08520cc648e0878..62fc671920e7a6ad249f980f14724f8cfed2ec8c 100644 --- a/PluginAction/src/de/tobias/playpad/actionsplugin/impl/ActionsPluginImpl.java +++ b/PluginAction/src/de/tobias/playpad/actionsplugin/impl/ActionsPluginImpl.java @@ -7,7 +7,7 @@ import java.util.ResourceBundle; import org.dom4j.DocumentException; import de.tobias.playpad.PlayPadPlugin; -import de.tobias.playpad.action.ActionConnect; +import de.tobias.playpad.action.ActionFactory; import de.tobias.playpad.actionsplugin.ActionsPlugin; import de.tobias.playpad.plugin.Module; import de.tobias.playpad.plugin.WindowListener; @@ -112,9 +112,9 @@ public class ActionsPluginImpl implements ActionsPlugin, ChangeListener<Boolean> updater = new ActionsPluginUpdater(); try { - Registry<ActionConnect> padContents = PlayPadPlugin.getRegistryCollection().getActions(); - padContents.loadComponentsFromFile("de/tobias/playpad/actionsplugin/assets/Actions.xml", getClass().getClassLoader(), module); - } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IOException | DocumentException e) { + Registry<ActionFactory> padContents = PlayPadPlugin.getRegistryCollection().getActions(); + padContents.loadComponentsFromFile("de/tobias/playpad/actionsplugin/assets/Actions.xml", getClass().getClassLoader(), module, bundle); + } catch (Exception e) { e.printStackTrace(); } muteProperty.addListener(this); diff --git a/PluginAction/src/de/tobias/playpad/actionsplugin/muteaction/MuteAction.java b/PluginAction/src/de/tobias/playpad/actionsplugin/muteaction/MuteAction.java index 79108172ab2f6cfc937db836cddbdbf0110be61a..69019f841e592c08ba4611f0a353111624b59d9a 100644 --- a/PluginAction/src/de/tobias/playpad/actionsplugin/muteaction/MuteAction.java +++ b/PluginAction/src/de/tobias/playpad/actionsplugin/muteaction/MuteAction.java @@ -1,5 +1,6 @@ package de.tobias.playpad.actionsplugin.muteaction; +import com.sun.xml.internal.bind.v2.TODO; import org.dom4j.Element; import de.tobias.playpad.Displayable; @@ -23,7 +24,10 @@ public class MuteAction extends Action implements Displayable { private ChangeListener<Boolean> muteListener; - public MuteAction() { + private String type; + + public MuteAction(String type) { + this.type = type; muteListener = (a, b, c) -> { if (c) { @@ -64,7 +68,7 @@ public class MuteAction extends Action implements Displayable { @Override public String getType() { - return MuteActionConnect.TYPE; + return type; } @Override @@ -81,6 +85,7 @@ public class MuteAction extends Action implements Displayable { return super.equals(obj); } + // TODO Remove @Override public StringProperty displayProperty() { return new SimpleStringProperty(ActionsPluginImpl.getBundle().getString("muteaction.name")); diff --git a/PluginAction/src/de/tobias/playpad/actionsplugin/muteaction/MuteActionConnect.java b/PluginAction/src/de/tobias/playpad/actionsplugin/muteaction/MuteActionFactory.java similarity index 72% rename from PluginAction/src/de/tobias/playpad/actionsplugin/muteaction/MuteActionConnect.java rename to PluginAction/src/de/tobias/playpad/actionsplugin/muteaction/MuteActionFactory.java index e48dafbea5d7637d2252ee6993b28d2b0d0deebf..3693ec3a89eaaf4fe5030c016c62bab1bc9185a0 100644 --- a/PluginAction/src/de/tobias/playpad/actionsplugin/muteaction/MuteActionConnect.java +++ b/PluginAction/src/de/tobias/playpad/actionsplugin/muteaction/MuteActionFactory.java @@ -3,16 +3,19 @@ package de.tobias.playpad.actionsplugin.muteaction; import java.util.List; import de.tobias.playpad.action.Action; -import de.tobias.playpad.action.ActionConnect; +import de.tobias.playpad.action.ActionFactory; import de.tobias.playpad.action.ActionDisplayable; import de.tobias.playpad.action.ActionType; import de.tobias.playpad.action.Mapping; import de.tobias.playpad.settings.Profile; +import de.tobias.utils.ui.icon.FontIconType; import javafx.scene.control.TreeItem; -public class MuteActionConnect extends ActionConnect { +public class MuteActionFactory extends ActionFactory { - public static final String TYPE = "MUTE"; + public MuteActionFactory(String type) { + super(type); + } @Override public TreeItem<ActionDisplayable> getTreeViewForActions(List<Action> actions, Mapping mapping) { @@ -22,21 +25,17 @@ public class MuteActionConnect extends ActionConnect { @Override public void initActionType(Mapping mapping, Profile profile) { - mapping.addActionIfNotContains(new MuteAction()); + mapping.addActionIfNotContains(newInstance()); } @Override public Action newInstance() { - return new MuteAction(); + return new MuteAction(getType()); } @Override public ActionType geActionType() { return ActionType.SETTINGS; } - - @Override - public String getType() { - return TYPE; - } + } diff --git a/PluginAction/src/de/tobias/playpad/actionsplugin/stopaction/StopAction.java b/PluginAction/src/de/tobias/playpad/actionsplugin/stopaction/StopAction.java index cc77ec62a7a5cb1d1cf4f1c3df4645e4a57cd353..b493128c73cc1f26d97bc5c87b1f43fa8c912a66 100644 --- a/PluginAction/src/de/tobias/playpad/actionsplugin/stopaction/StopAction.java +++ b/PluginAction/src/de/tobias/playpad/actionsplugin/stopaction/StopAction.java @@ -20,9 +20,15 @@ import javafx.scene.control.Label; public class StopAction extends Action { + private String type; + + public StopAction(String type) { + this.type = type; + } + @Override public String getType() { - return StopActionConnect.TYPE; + return type; } @Override diff --git a/PluginAction/src/de/tobias/playpad/actionsplugin/stopaction/StopActionConnect.java b/PluginAction/src/de/tobias/playpad/actionsplugin/stopaction/StopActionFactory.java similarity index 76% rename from PluginAction/src/de/tobias/playpad/actionsplugin/stopaction/StopActionConnect.java rename to PluginAction/src/de/tobias/playpad/actionsplugin/stopaction/StopActionFactory.java index 4f7cab1c9d67335aebdb7c3c1883aafd1f11993f..f3a88517a4a5ad2bfe7baa47a28e9f0a4d6d9ffd 100644 --- a/PluginAction/src/de/tobias/playpad/actionsplugin/stopaction/StopActionConnect.java +++ b/PluginAction/src/de/tobias/playpad/actionsplugin/stopaction/StopActionFactory.java @@ -3,16 +3,19 @@ package de.tobias.playpad.actionsplugin.stopaction; import java.util.List; import de.tobias.playpad.action.Action; -import de.tobias.playpad.action.ActionConnect; +import de.tobias.playpad.action.ActionFactory; import de.tobias.playpad.action.ActionDisplayable; import de.tobias.playpad.action.ActionType; import de.tobias.playpad.action.Mapping; import de.tobias.playpad.settings.Profile; +import de.tobias.utils.ui.icon.FontIconType; import javafx.scene.control.TreeItem; -public class StopActionConnect extends ActionConnect { +public class StopActionFactory extends ActionFactory { - public static final String TYPE = "STOP"; + public StopActionFactory(String type) { + super(type); + } @Override public TreeItem<ActionDisplayable> getTreeViewForActions(List<Action> actions, Mapping mapping) { @@ -27,7 +30,7 @@ public class StopActionConnect extends ActionConnect { @Override public Action newInstance() { - return new StopAction(); + return new StopAction(getType()); } @Override @@ -35,8 +38,4 @@ public class StopActionConnect extends ActionConnect { return ActionType.CONTROL; } - @Override - public String getType() { - return TYPE; - } } diff --git a/PluginMedia/src/de/tobias/playpad/mediaplugin/assets/Actions.xml b/PluginMedia/src/de/tobias/playpad/mediaplugin/assets/Actions.xml index 9686e34b9996de2bbf36b8fec42e66dfcf96a1f1..9b9571fa5d688eaef5001cad09daac470326a7f6 100644 --- a/PluginMedia/src/de/tobias/playpad/mediaplugin/assets/Actions.xml +++ b/PluginMedia/src/de/tobias/playpad/mediaplugin/assets/Actions.xml @@ -1,3 +1,3 @@ <Actions> - <Component id="BLIND">de.tobias.playpad.mediaplugin.blindaction.BlindActionConnect</Component> + <Component id="BLIND" name="blindaction.name">de.tobias.playpad.mediaplugin.blindaction.BlindActionFactory</Component> </Actions> \ No newline at end of file diff --git a/PluginMedia/src/de/tobias/playpad/mediaplugin/assets/PadContent.xml b/PluginMedia/src/de/tobias/playpad/mediaplugin/assets/PadContent.xml index 5be46a07f09a288d2a5440e2100dc7fef4079824..24b05e5e13f8b8bfdfe6842c7347311e9a65fc99 100644 --- a/PluginMedia/src/de/tobias/playpad/mediaplugin/assets/PadContent.xml +++ b/PluginMedia/src/de/tobias/playpad/mediaplugin/assets/PadContent.xml @@ -1,4 +1,4 @@ <Actions> - <Component id="video">de.tobias.playpad.mediaplugin.video.VideoContentConntect</Component> - <Component id="image">de.tobias.playpad.mediaplugin.image.ImageContentConntect</Component> + <Component id="video" name="Content.Video.Name">de.tobias.playpad.mediaplugin.video.VideoContentConntect</Component> + <Component id="image" name="Content.Image.Name">de.tobias.playpad.mediaplugin.image.ImageContentConntect</Component> </Actions> \ No newline at end of file diff --git a/PluginMedia/src/de/tobias/playpad/mediaplugin/blindaction/BlindAction.java b/PluginMedia/src/de/tobias/playpad/mediaplugin/blindaction/BlindAction.java index ce74283ac852c79616bbc92a74d9eaa96f7426c5..71edf608dce590665528b0e363f4c1d503a93846 100644 --- a/PluginMedia/src/de/tobias/playpad/mediaplugin/blindaction/BlindAction.java +++ b/PluginMedia/src/de/tobias/playpad/mediaplugin/blindaction/BlindAction.java @@ -64,7 +64,7 @@ public class BlindAction extends Action implements Displayable { @Override public String getType() { - return BlindActionConnect.TYPE; + return BlindActionFactory.TYPE; } @Override diff --git a/PluginMedia/src/de/tobias/playpad/mediaplugin/blindaction/BlindActionConnect.java b/PluginMedia/src/de/tobias/playpad/mediaplugin/blindaction/BlindActionFactory.java similarity index 81% rename from PluginMedia/src/de/tobias/playpad/mediaplugin/blindaction/BlindActionConnect.java rename to PluginMedia/src/de/tobias/playpad/mediaplugin/blindaction/BlindActionFactory.java index 65aafefd5529e8d889542ee5ede01e9bbcac26fb..149bfc72e97b3ffef1cef9f39432a4e9edcdabe2 100644 --- a/PluginMedia/src/de/tobias/playpad/mediaplugin/blindaction/BlindActionConnect.java +++ b/PluginMedia/src/de/tobias/playpad/mediaplugin/blindaction/BlindActionFactory.java @@ -3,17 +3,22 @@ package de.tobias.playpad.mediaplugin.blindaction; import java.util.List; import de.tobias.playpad.action.Action; -import de.tobias.playpad.action.ActionConnect; +import de.tobias.playpad.action.ActionFactory; import de.tobias.playpad.action.ActionDisplayable; import de.tobias.playpad.action.ActionType; import de.tobias.playpad.action.Mapping; import de.tobias.playpad.settings.Profile; +import de.tobias.utils.ui.icon.FontIconType; import javafx.scene.control.TreeItem; -public class BlindActionConnect extends ActionConnect { +public class BlindActionFactory extends ActionFactory { public static final String TYPE = "BLIND"; + public BlindActionFactory(String type) { + super(type); + } + @Override public TreeItem<ActionDisplayable> getTreeViewForActions(List<Action> actions, Mapping mapping) { TreeItem<ActionDisplayable> item = new TreeItem<>(actions.get(0)); diff --git a/PluginMedia/src/de/tobias/playpad/mediaplugin/image/ImageContent.java b/PluginMedia/src/de/tobias/playpad/mediaplugin/image/ImageContent.java index 65f08624ca734bdecaec52e42ab43a5c4d8fb773..3ac375ec6c3908ba3f87aba5df14e77856501948 100644 --- a/PluginMedia/src/de/tobias/playpad/mediaplugin/image/ImageContent.java +++ b/PluginMedia/src/de/tobias/playpad/mediaplugin/image/ImageContent.java @@ -17,15 +17,13 @@ import javafx.application.Platform; public class ImageContent extends PadContent { + private final String type; + private Path path; - public ImageContent(Pad pad) { + public ImageContent(String type, Pad pad) { super(pad); - } - - public ImageContent(Pad pad, Path path) { - this(pad); - this.path = path; + this.type = type; } public Path getPath() { @@ -48,7 +46,7 @@ public class ImageContent extends PadContent { @Override public String getType() { - return ImageContentConntect.TYPE; + return type; } @Override diff --git a/PluginMedia/src/de/tobias/playpad/mediaplugin/image/ImageContentConntect.java b/PluginMedia/src/de/tobias/playpad/mediaplugin/image/ImageContentConntect.java index fabd24a886e9c823f5a661b1a1b6f51bd7bf5cfa..2083881eafc8b33e9b4779b3df5c406db4a29175 100644 --- a/PluginMedia/src/de/tobias/playpad/mediaplugin/image/ImageContentConntect.java +++ b/PluginMedia/src/de/tobias/playpad/mediaplugin/image/ImageContentConntect.java @@ -3,12 +3,13 @@ package de.tobias.playpad.mediaplugin.image; import de.tobias.playpad.mediaplugin.main.impl.MediaPluginImpl; import de.tobias.playpad.mediaplugin.main.impl.Strings; import de.tobias.playpad.pad.Pad; +import de.tobias.playpad.pad.conntent.ContentFactory; import de.tobias.playpad.pad.conntent.PadContent; -import de.tobias.playpad.pad.conntent.PadContentConnect; import de.tobias.playpad.pad.view.IPadContentView; import de.tobias.playpad.viewcontroller.PadSettingsTabViewController; import de.tobias.utils.ui.icon.FontAwesomeType; import de.tobias.utils.ui.icon.FontIcon; +import de.tobias.utils.ui.icon.FontIconType; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.collections.ListChangeListener; @@ -23,26 +24,17 @@ import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; import javafx.scene.text.TextAlignment; -public class ImageContentConntect extends PadContentConnect { +public class ImageContentConntect extends ContentFactory { - public static final String TYPE = "image"; public static final String[] FILE_EXTENSION = { "*.png", "*.jpg", "*.jpeg", "*.bmp", "*.gif" }; - private FontIcon icon; - - public ImageContentConntect() { - icon = new FontIcon(FontAwesomeType.PICTURE_ALT); - icon.setSize(30); - } - - @Override - public String getType() { - return TYPE; + public ImageContentConntect(String type) { + super(type); } @Override public PadContent newInstance(Pad pad) { - return new ImageContent(pad); + return new ImageContent(getType(), pad); } @Override @@ -131,14 +123,4 @@ public class ImageContentConntect extends PadContentConnect { + "\"); -fx-background-size: contain; -fx-background-repeat: no-repeat; -fx-background-position: center; -fx-opacity: 0.3;"); } } - - @Override - public StringProperty displayProperty() { - return new SimpleStringProperty(MediaPluginImpl.getInstance().getBundle().getString(Strings.Content_Image_Name)); - } - - @Override - public Node getGraphics() { - return icon; - } } diff --git a/PluginMedia/src/de/tobias/playpad/mediaplugin/main/impl/MediaPluginImpl.java b/PluginMedia/src/de/tobias/playpad/mediaplugin/main/impl/MediaPluginImpl.java index 8229a6c7e7c0043185c5363d635b6738989eda2d..dcf83562da0a8004e6bd8b97e8a5960e7caf1028 100644 --- a/PluginMedia/src/de/tobias/playpad/mediaplugin/main/impl/MediaPluginImpl.java +++ b/PluginMedia/src/de/tobias/playpad/mediaplugin/main/impl/MediaPluginImpl.java @@ -5,13 +5,13 @@ import java.nio.file.NoSuchFileException; import java.nio.file.Path; import java.util.ResourceBundle; +import de.tobias.playpad.pad.conntent.ContentFactory; import org.dom4j.DocumentException; import de.tobias.playpad.PlayPadPlugin; -import de.tobias.playpad.action.ActionConnect; +import de.tobias.playpad.action.ActionFactory; import de.tobias.playpad.mediaplugin.main.MediaPlugin; import de.tobias.playpad.mediaplugin.main.VideoSettings; -import de.tobias.playpad.pad.conntent.PadContentConnect; import de.tobias.playpad.plugin.Module; import de.tobias.playpad.plugin.SettingsListener; import de.tobias.playpad.registry.Registry; @@ -66,9 +66,9 @@ public class MediaPluginImpl implements MediaPlugin, SettingsListener, ChangeLis // Load Content Types try { - Registry<PadContentConnect> padContents = PlayPadPlugin.getRegistryCollection().getPadContents(); - padContents.loadComponentsFromFile("de/tobias/playpad/mediaplugin/assets/PadContent.xml", getClass().getClassLoader(), module); - } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IOException | DocumentException e) { + Registry<ContentFactory> padContents = PlayPadPlugin.getRegistryCollection().getPadContents(); + padContents.loadComponentsFromFile("de/tobias/playpad/mediaplugin/assets/PadContent.xml", getClass().getClassLoader(), module, bundle); + } catch (Exception e) { e.printStackTrace(); } @@ -95,9 +95,9 @@ public class MediaPluginImpl implements MediaPlugin, SettingsListener, ChangeLis } try { - Registry<ActionConnect> padContents = PlayPadPlugin.getRegistryCollection().getActions(); - padContents.loadComponentsFromFile("de/tobias/playpad/mediaplugin/assets/Actions.xml", getClass().getClassLoader(), module); - } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IOException | DocumentException e) { + Registry<ActionFactory> padContents = PlayPadPlugin.getRegistryCollection().getActions(); + padContents.loadComponentsFromFile("de/tobias/playpad/mediaplugin/assets/Actions.xml", getClass().getClassLoader(), module, bundle); + } catch (Exception e) { e.printStackTrace(); } blindProperty.addListener(this); diff --git a/PluginMedia/src/de/tobias/playpad/mediaplugin/video/VideoContent.java b/PluginMedia/src/de/tobias/playpad/mediaplugin/video/VideoContent.java index 0d49f9f637e3abb231dfc96e339de3b89522856d..94d02793e205456267219e42a319e764910dc237 100644 --- a/PluginMedia/src/de/tobias/playpad/mediaplugin/video/VideoContent.java +++ b/PluginMedia/src/de/tobias/playpad/mediaplugin/video/VideoContent.java @@ -28,9 +28,9 @@ import javafx.util.Duration; public class VideoContent extends PadContent implements Pauseable, Durationable { - private static final String TYPE = "video"; public static final String VIDEO_LAST_FRAME = "Video.LastFrame"; + private final String type; private Media media; private MediaPlayer player; @@ -43,19 +43,15 @@ public class VideoContent extends PadContent implements Pauseable, Durationable private transient boolean holdLastFrame = false; - public VideoContent(Pad pad) { + public VideoContent(String type, Pad pad) { super(pad); + this.type = type; padVolumeListener = (a, b, c) -> { updateVolume(); }; } - public VideoContent(Pad pad, Path path) { - this(pad); - this.path = path; - } - public Path getPath() { return path; } @@ -82,7 +78,7 @@ public class VideoContent extends PadContent implements Pauseable, Durationable @Override public String getType() { - return TYPE; + return type; } @Override diff --git a/PluginMedia/src/de/tobias/playpad/mediaplugin/video/VideoContentConntect.java b/PluginMedia/src/de/tobias/playpad/mediaplugin/video/VideoContentConntect.java index 394e41c66b502ce4239858454656bdc102fbef95..b954ec39548f5bbf2eaa9cc28ef2743782c7f585 100644 --- a/PluginMedia/src/de/tobias/playpad/mediaplugin/video/VideoContentConntect.java +++ b/PluginMedia/src/de/tobias/playpad/mediaplugin/video/VideoContentConntect.java @@ -5,12 +5,13 @@ import de.tobias.playpad.mediaplugin.main.impl.MediaSettingsTabViewController; import de.tobias.playpad.mediaplugin.main.impl.Strings; import de.tobias.playpad.pad.Pad; import de.tobias.playpad.pad.conntent.PadContent; -import de.tobias.playpad.pad.conntent.PadContentConnect; +import de.tobias.playpad.pad.conntent.ContentFactory; import de.tobias.playpad.pad.view.IPadContentView; import de.tobias.playpad.viewcontroller.PadSettingsTabViewController; import de.tobias.playpad.viewcontroller.option.ProfileSettingsTabViewController; import de.tobias.utils.ui.icon.FontAwesomeType; import de.tobias.utils.ui.icon.FontIcon; +import de.tobias.utils.ui.icon.FontIconType; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.geometry.Pos; @@ -21,26 +22,17 @@ import javafx.scene.layout.Priority; import javafx.scene.layout.VBox; import javafx.scene.text.TextAlignment; -public class VideoContentConntect extends PadContentConnect { +public class VideoContentConntect extends ContentFactory { - public static final String TYPE = "video"; public static final String[] FILE_EXTENSION = { "*.mp4", "*.mov" }; - private FontIcon icon; - - public VideoContentConntect() { - icon = new FontIcon(FontAwesomeType.FILM); - icon.setSize(30); - } - - @Override - public String getType() { - return TYPE; + public VideoContentConntect(String type) { + super(type); } @Override public PadContent newInstance(Pad pad) { - return new VideoContent(pad); + return new VideoContent(getType(), pad); } @Override @@ -91,15 +83,4 @@ public class VideoContentConntect extends PadContentConnect { nameLabel.textProperty().unbind(); } } - - @Override - public StringProperty displayProperty() { - return new SimpleStringProperty(MediaPluginImpl.getInstance().getBundle().getString(Strings.Content_Video_Name)); - } - - @Override - public Node getGraphics() { - return icon; - } - } diff --git a/PluginNativeMac/src/de/tobias/playpad/namac/NativeAudioMacHandlerConnect.java b/PluginNativeMac/src/de/tobias/playpad/namac/NativeAudioMacHandlerFactory.java similarity index 88% rename from PluginNativeMac/src/de/tobias/playpad/namac/NativeAudioMacHandlerConnect.java rename to PluginNativeMac/src/de/tobias/playpad/namac/NativeAudioMacHandlerFactory.java index 1f70f7588854c5ee2ea078a3ea8eeca14c283c87..1804405667f52bcae03c87f13a9f70c5c4fa1378 100644 --- a/PluginNativeMac/src/de/tobias/playpad/namac/NativeAudioMacHandlerConnect.java +++ b/PluginNativeMac/src/de/tobias/playpad/namac/NativeAudioMacHandlerFactory.java @@ -6,18 +6,20 @@ import de.tobias.playpad.NativeAudio; import de.tobias.playpad.NativeAudio.NativeAudioDelegate; import de.tobias.playpad.audio.AudioCapability; import de.tobias.playpad.audio.AudioHandler; -import de.tobias.playpad.audio.AudioHandlerConnect; +import de.tobias.playpad.audio.AudioHandlerFactory; import de.tobias.playpad.audio.Peakable.Channel; import de.tobias.playpad.pad.PadStatus; import de.tobias.playpad.pad.conntent.PadContent; import de.tobias.playpad.viewcontroller.AudioHandlerViewController; +import de.tobias.utils.ui.icon.FontIconType; import javafx.util.Duration; -public class NativeAudioMacHandlerConnect extends AudioHandlerConnect implements NativeAudioDelegate { +public class NativeAudioMacHandlerFactory extends AudioHandlerFactory implements NativeAudioDelegate { private static final HashMap<Integer, NativeAudioMacHandler> handlers = new HashMap<>(); - public NativeAudioMacHandlerConnect() { + public NativeAudioMacHandlerFactory(String type) { + super(type); NativeAudio.initialize(); NativeAudio.setDelegate(this); } @@ -34,11 +36,6 @@ public class NativeAudioMacHandlerConnect extends AudioHandlerConnect implements return null; } - @Override - public String getType() { - return "Native"; - } - @Override public void onFinish(int id) { NativeAudioMacHandler nativeAudioMacHandler = handlers.get(id); diff --git a/PluginNativeMac/src/de/tobias/playpad/namac/NativeAudioMacPluginImpl.java b/PluginNativeMac/src/de/tobias/playpad/namac/NativeAudioMacPluginImpl.java index f7ad651a68ba87a8a6bf3636b70b75c145a413ba..3e8ee610c3f8cfa6ae91dd4bc555b15e1868f84a 100644 --- a/PluginNativeMac/src/de/tobias/playpad/namac/NativeAudioMacPluginImpl.java +++ b/PluginNativeMac/src/de/tobias/playpad/namac/NativeAudioMacPluginImpl.java @@ -38,7 +38,9 @@ public class NativeAudioMacPluginImpl implements NativeAudioMacPlugin { if (OS.isMacOS()) { AudioRegistry registry = PlayPadPlugin.getRegistryCollection().getAudioHandlers(); - registry.registerComponent(new NativeAudioMacHandlerConnect(), "NativeMac", module); + NativeAudioMacHandlerFactory nativeMac = new NativeAudioMacHandlerFactory("NativeMac"); + nativeMac.setName("NativeMac"); + registry.registerComponent(nativeMac, module); } } catch (IOException e) { e.printStackTrace(); diff --git a/PluginNativeWin/src/de/tobias/playpad/nawin/NativeAudioWinPluginImpl.java b/PluginNativeWin/src/de/tobias/playpad/nawin/NativeAudioWinPluginImpl.java index 4d49e1dd889bcd824b7483d834c1e47508342948..fc5485fc82d1f9fed748fcc5938f908436c1ba53 100644 --- a/PluginNativeWin/src/de/tobias/playpad/nawin/NativeAudioWinPluginImpl.java +++ b/PluginNativeWin/src/de/tobias/playpad/nawin/NativeAudioWinPluginImpl.java @@ -6,7 +6,7 @@ import java.nio.file.Path; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.audio.AudioRegistry; -import de.tobias.playpad.nawin.audio.NativeAudioWinHandlerConnect; +import de.tobias.playpad.nawin.audio.NativeAudioWinHandlerFactory; import de.tobias.playpad.plugin.Module; import de.tobias.updater.client.Updatable; import de.tobias.utils.application.App; @@ -41,7 +41,9 @@ public class NativeAudioWinPluginImpl implements NativeAudioWinPlugin { if (OS.isWindows()) { AudioRegistry registry = PlayPadPlugin.getRegistryCollection().getAudioHandlers(); - registry.registerComponent(new NativeAudioWinHandlerConnect(), "NativeWin", module); + NativeAudioWinHandlerFactory nativeWin = new NativeAudioWinHandlerFactory("NativeWin"); + nativeWin.setName("NativeWin"); + registry.registerComponent(nativeWin, module); } } catch (IOException e) { e.printStackTrace(); diff --git a/PluginNativeWin/src/de/tobias/playpad/nawin/audio/NativeAudioWinHandlerConnect.java b/PluginNativeWin/src/de/tobias/playpad/nawin/audio/NativeAudioWinHandlerFactory.java similarity index 77% rename from PluginNativeWin/src/de/tobias/playpad/nawin/audio/NativeAudioWinHandlerConnect.java rename to PluginNativeWin/src/de/tobias/playpad/nawin/audio/NativeAudioWinHandlerFactory.java index 57239777045fb95a608f912e6719ea4fde6eb935..9134d1984bbd419a87c6e100b63b08db2d4565d6 100644 --- a/PluginNativeWin/src/de/tobias/playpad/nawin/audio/NativeAudioWinHandlerConnect.java +++ b/PluginNativeWin/src/de/tobias/playpad/nawin/audio/NativeAudioWinHandlerFactory.java @@ -2,11 +2,16 @@ package de.tobias.playpad.nawin.audio; import de.tobias.playpad.audio.AudioCapability; import de.tobias.playpad.audio.AudioHandler; -import de.tobias.playpad.audio.AudioHandlerConnect; +import de.tobias.playpad.audio.AudioHandlerFactory; import de.tobias.playpad.pad.conntent.PadContent; import de.tobias.playpad.viewcontroller.AudioHandlerViewController; +import de.tobias.utils.ui.icon.FontIconType; -public class NativeAudioWinHandlerConnect extends AudioHandlerConnect { +public class NativeAudioWinHandlerFactory extends AudioHandlerFactory { + + public NativeAudioWinHandlerFactory(String type) { + super(type); + } @Override public AudioHandler createAudioHandler(PadContent content) { @@ -17,11 +22,6 @@ public class NativeAudioWinHandlerConnect extends AudioHandlerConnect { public AudioHandlerViewController getAudioHandlerSettingsViewController() { return null; } - - @Override - public String getType() { - return "NativeWin"; - } @Override public boolean isFeatureAvaiable(AudioCapability audioCapability) {