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 b8cb2eb016c169db68a0d94544d2a786edf08483..4018120e3031c881335de118e4cf2c4fddb7920b 100644 --- a/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadView.java +++ b/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadView.java @@ -339,50 +339,36 @@ public class DesktopPadView implements IPadView { Pad pad = getViewController().getPad(); PadIndex index = pad.getPadIndex(); - superRoot.getStyleClass().removeAll("pad", "pad" + index); + superRoot.getStyleClass().removeIf(c -> c.startsWith("pad")); - indexLabel.getStyleClass().removeAll("pad-index", "pad" + index + "-index", "pad-info", "pad" + index + "-info"); - timeLabel.getStyleClass().removeAll("pad-time", "pad" + index + "-time", "pad-info", "pad" + index + "-info"); - loopLabel.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + index + "-icon"); - triggerLabel.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + index + "-icon"); - errorLabel.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + index + "-icon"); + indexLabel.getStyleClass().removeIf( c -> c.startsWith("pad")); + timeLabel.getStyleClass().removeIf( c -> c.startsWith("pad")); + loopLabel.getGraphic().getStyleClass().removeIf( c -> c.startsWith("pad")); + triggerLabel.getGraphic().getStyleClass().removeIf( c -> c.startsWith("pad")); + errorLabel.getGraphic().getStyleClass().removeIf( c -> c.startsWith("pad")); - preview.getChildren().forEach(i -> i.getStyleClass().removeAll("pad-title", "pad" + index + "-title")); + preview.getChildren().forEach(i -> i.getStyleClass().removeIf( c -> c.startsWith("pad"))); - playBar.getStyleClass().removeAll("pad-playbar", "pad" + index + "-playbar"); + playBar.getStyleClass().removeIf( c -> c.startsWith("pad")); - playButton.getStyleClass().removeAll("pad-button", "pad" + index + "-button"); - pauseButton.getStyleClass().removeAll("pad-button", "pad" + index + "-button"); - stopButton.getStyleClass().removeAll("pad-button", "pad" + index + "-button"); - newButton.getStyleClass().removeAll("pad-button", "pad" + index + "-button"); - settingsButton.getStyleClass().removeAll("pad-button", "pad" + index + "-button"); + playButton.getStyleClass().removeIf( c -> c.startsWith("pad")); + pauseButton.getStyleClass().removeIf( c -> c.startsWith("pad")); + stopButton.getStyleClass().removeIf( c -> c.startsWith("pad")); + newButton.getStyleClass().removeIf( c -> c.startsWith("pad")); + settingsButton.getStyleClass().removeIf( c -> c.startsWith("pad")); - playButton.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + index + "-icon"); - pauseButton.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + index + "-icon"); - stopButton.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + index + "-icon"); - newButton.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + index + "-icon"); - settingsButton.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + index + "-icon"); + playButton.getGraphic().getStyleClass().removeIf( c -> c.startsWith("pad")); + pauseButton.getGraphic().getStyleClass().removeIf( c -> c.startsWith("pad")); + stopButton.getGraphic().getStyleClass().removeIf( c -> c.startsWith("pad")); + newButton.getGraphic().getStyleClass().removeIf( c -> c.startsWith("pad")); + settingsButton.getGraphic().getStyleClass().removeIf( c -> c.startsWith("pad")); - buttonBox.getStyleClass().add("pad-button-box"); - root.getStyleClass().add("pad-root"); + buttonBox.getStyleClass().remove("pad-button-box"); + root.getStyleClass().remove("pad-root"); } @Override public void highlightView(int milliSecounds) { - // FadeableColor stopColor = new FadeableColor(ModernColor.GRAY1.getColorHi(), ModernColor.GRAY1.getColorLow()); - // FadeableColor playColor = new FadeableColor(ModernColor.BLUE1.getColorHi(), ModernColor.BLUE1.getColorLow()); - // - // ModernDesignAnimator.animateWarn(controller, stopColor, playColor, Duration.seconds(3)); - // Pad pad = controller.getPad(); - // - // Warning warning = pad.getWarning(); - // - // if (pad.isCustomLayout()) { - // pad.getLayout().handleWarning(controller, warning, Profile.currentProfile().currentLayout()); - // } else { - // Profile.currentProfile().currentLayout().handleWarning(controller, warning); - // } - PulseTranslation pulseTranslation = new PulseTranslation(superRoot, null, 0.1); pulseTranslation.play(); } diff --git a/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java b/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java index 172d7ce43e1acc7256bcd614751709138967c4e5..7c6019487e8299c6812c7677ea523a56ddd48e51 100644 --- a/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java +++ b/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java @@ -253,19 +253,19 @@ public class TouchPadView implements IPadView { Pad pad = getViewController().getPad(); PadIndex index = pad.getPadIndex(); - superRoot.getStyleClass().removeAll("pad", "pad" + index); + superRoot.getStyleClass().removeIf( c -> c.startsWith("pad")); - indexLabel.getStyleClass().removeAll("pad-index", "pad" + index + "-index", "pad-info", "pad" + index + "-info"); - timeLabel.getStyleClass().removeAll("pad-time", "pad" + index + "-time", "pad-info", "pad" + index + "-info"); - loopLabel.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + index + "-icon"); - triggerLabel.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + index + "-icon"); - errorLabel.getGraphic().getStyleClass().removeAll("pad-icon", "pad" + index + "-icon"); + indexLabel.getStyleClass().removeIf( c -> c.startsWith("pad")); + timeLabel.getStyleClass().removeIf( c -> c.startsWith("pad")); + loopLabel.getGraphic().getStyleClass().removeIf( c -> c.startsWith("pad")); + triggerLabel.getGraphic().getStyleClass().removeIf( c -> c.startsWith("pad")); + errorLabel.getGraphic().getStyleClass().removeIf( c -> c.startsWith("pad")); - preview.getChildren().forEach(i -> i.getStyleClass().removeAll("pad-title", "pad" + index + "-title")); + preview.getChildren().forEach(i -> i.getStyleClass().removeIf( c -> c.startsWith("pad"))); - playBar.getStyleClass().removeAll("pad-playbar", "pad" + index + "-playbar"); + playBar.getStyleClass().removeIf( c -> c.startsWith("pad")); - root.getStyleClass().add("pad-root"); + root.getStyleClass().remove("pad-root"); } @Override diff --git a/PlayWallCore/src/de/tobias/playpad/pad/viewcontroller/IPadViewController.java b/PlayWallCore/src/de/tobias/playpad/pad/viewcontroller/IPadViewController.java index 563272c8cec50647a64cb38fb109744f09395687..673dd449028cc9fd08e5c9fc5e7a7e8b5510ebd3 100644 --- a/PlayWallCore/src/de/tobias/playpad/pad/viewcontroller/IPadViewController.java +++ b/PlayWallCore/src/de/tobias/playpad/pad/viewcontroller/IPadViewController.java @@ -20,14 +20,14 @@ public interface IPadViewController { * * @return Pad */ - public Pad getPad(); + Pad getPad(); /** * Gibt die View des Controllers zurück. * * @return View */ - public IPadView getView(); + IPadView getView(); /** * Setzt ein Pad für ein View. Hier werden die Datein mittels ViewController der View bekannt gemacht. @@ -35,18 +35,18 @@ public interface IPadViewController { * @param pad * Neues Pad */ - public void setupPad(Pad pad); + void setupPad(Pad pad); /** * Entfertn des Verbundene Pad von der View. */ - public void removePad(); + void removePad(); - public void updateTimeLabel(); + void updateTimeLabel(); - public void updateButtonDisable(); + void updateButtonDisable(); - public IPadPositionListener getPadPositionListener(); + IPadPositionListener getPadPositionListener(); - public ChangeListener<Duration> getPadDurationListener(); + ChangeListener<Duration> getPadDurationListener(); } diff --git a/PlayWallCore/src/de/tobias/playpad/viewcontroller/main/IMainViewController.java b/PlayWallCore/src/de/tobias/playpad/viewcontroller/main/IMainViewController.java index 6bd38cf0a5fed4ec0af30e45907c70a835981a56..4261ff866499e79f3d0ca76f1ee1f809f15eebeb 100644 --- a/PlayWallCore/src/de/tobias/playpad/viewcontroller/main/IMainViewController.java +++ b/PlayWallCore/src/de/tobias/playpad/viewcontroller/main/IMainViewController.java @@ -35,21 +35,21 @@ public interface IMainViewController extends NotificationHandler, Alertable { * @param color * Neue Farbe */ - public void setGridColor(Color color); + void setGridColor(Color color); /** * Gibt die Stage des ViewControllers zurück. * * @return Stage */ - public Stage getStage(); + Stage getStage(); /** * Gibt den Root Node der View zurück. * * @return root node */ - public Parent getParent(); + Parent getParent(); /** * Registriert ein KeyEvent Listener für das Fenster. @@ -59,38 +59,38 @@ public interface IMainViewController extends NotificationHandler, Alertable { * @param listener * Listener für Event */ - public void registerKeyboardListener(EventType<KeyEvent> eventType, EventHandler<KeyEvent> listener); + void registerKeyboardListener(EventType<KeyEvent> eventType, EventHandler<KeyEvent> listener); /** * Aktualisiert den Title des Fenster. */ - public void updateWindowTitle(); + void updateWindowTitle(); /** * Gibt den aktiven MenuToolbarController des Hauptfensters zurück. Dieser basiert auf dem aktuellen MainLayout. * * @return Controller */ - public MenuToolbarViewController getMenuToolbarController(); + MenuToolbarViewController getMenuToolbarController(); /** * Gibt den Bildschirm zurück, wo das Fenster aktiv ist, * * @return Screen */ - public Screen getScreen(); + Screen getScreen(); /** * Erstellt die Pad Views. */ - public void createPadViews(); + void createPadViews(); /** * Gibt die Nummer Aktuelle Seite zurück. (0, n) * * @return Nummer der Seite */ - public int getPage(); + int getPage(); /** * Zeigt eine Seite. Sollte die Seite bereits offen sien, passiert nichts. @@ -99,12 +99,12 @@ public interface IMainViewController extends NotificationHandler, Alertable { * Page Number * @return <code>false</code> Seite gibt es nicht. */ - public boolean showPage(int page); + boolean showPage(int page); /** * Lädt die CSS Files neu. */ - public void loadUserCss(); + void loadUserCss(); /** * Gibt die PadViews zurück. @@ -118,7 +118,7 @@ public interface IMainViewController extends NotificationHandler, Alertable { * * @return MIDI Handler */ - public MidiListener getMidiHandler(); + MidiListener getMidiHandler(); /** * Setzt das MainLayout des Hauptfensters. @@ -126,7 +126,7 @@ public interface IMainViewController extends NotificationHandler, Alertable { * @param mainLayoutFactory * Neues Layout */ - public void setMainLayout(MainLayoutFactory mainLayoutFactory); + void setMainLayout(MainLayoutFactory mainLayoutFactory); /** * Führt eine Aktion für das Hauptfenster aus. Beispielsweise MenuItem in MenuToolbarController hinzufügen. Zudem wird diese Aktion @@ -135,7 +135,7 @@ public interface IMainViewController extends NotificationHandler, Alertable { * @param runnable * Funktion */ - public void performLayoutDependendAction(MainLayoutHandler runnable); + void performLayoutDependendAction(MainLayoutHandler runnable); /** * Lädt die Tastenkombinationen für das Menü und co neu. @@ -143,16 +143,16 @@ public interface IMainViewController extends NotificationHandler, Alertable { * @param keys * Einstellungen der Key Bindings */ - public void loadKeybinding(KeyCollection keys); + void loadKeybinding(KeyCollection keys); /** * Gibt das NotificationPane zurück. * * @return NotificationPane */ - public NotificationPane getNotificationPane(); + NotificationPane getNotificationPane(); - public <T extends Event> void addListenerForPads(EventHandler<? super T> handler, EventType<T> eventType); + <T extends Event> void addListenerForPads(EventHandler<? super T> handler, EventType<T> eventType); - public <T extends Event> void removeListenerForPads(EventHandler<? super T> handler, EventType<T> eventType); + <T extends Event> void removeListenerForPads(EventHandler<? super T> handler, EventType<T> eventType); }