diff --git a/PlayWall/src/de/tobias/playpad/PlayPadMain.java b/PlayWall/src/de/tobias/playpad/PlayPadMain.java index 0439b37f31d78aa3c532ad960a0130d9afb00012..861720fe69d7cdf2a31cd6094a7d381bb4190d64 100644 --- a/PlayWall/src/de/tobias/playpad/PlayPadMain.java +++ b/PlayWall/src/de/tobias/playpad/PlayPadMain.java @@ -131,7 +131,8 @@ public class PlayPadMain extends Application implements LocalizationDelegate, Pr try { Image stageIcon = new Image(iconPath); PlayPadMain.stageIcon = Optional.of(stageIcon); - } catch (Exception e) {} + } catch (Exception e) { + } /* * Setup @@ -195,9 +196,6 @@ public class PlayPadMain extends Application implements LocalizationDelegate, Pr // Midi DeviceRegistry.getFactoryInstance().registerDevice(PD12.NAME, PD12.class); - // Mapper - MapperRegistry.setOverviewViewController(new MapperOverviewViewController()); - Profile.registerListener(this); try { @@ -220,6 +218,9 @@ public class PlayPadMain extends Application implements LocalizationDelegate, Pr | NoSuchComponentException e) { e.printStackTrace(); } + + // Mapper + MapperRegistry.setOverviewViewController(new MapperOverviewViewController()); } private void setupPlugins(Path pluginPath) throws IOException, MalformedURLException { diff --git a/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadView.java b/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadView.java index 4994b8d2c29b2d7d43a72020c512cf9a46e238ef..795110a571af780e77df69c91bc26b4bd8844226 100644 --- a/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadView.java +++ b/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadView.java @@ -3,6 +3,7 @@ package de.tobias.playpad.layout.desktop; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.PseudoClasses; import de.tobias.playpad.pad.Pad; +import de.tobias.playpad.pad.PadContentRegistry; import de.tobias.playpad.pad.conntent.PadContent; import de.tobias.playpad.pad.conntent.PadContentConnect; import de.tobias.playpad.pad.conntent.play.Pauseable; @@ -131,11 +132,19 @@ public class DesktopPadView implements IPadViewV2 { PadContent content = pad.getContent(); if (content != null) { try { - PadContentConnect connect = PlayPadPlugin.getRegistryCollection().getPadContents().getComponent(content.getType()); + PadContentRegistry registry = PlayPadPlugin.getRegistryCollection().getPadContents(); + PadContentConnect connect = registry.getComponent(content.getType()); + previewContent = connect.getPadContentPreview(pad, preview); Node node = previewContent.getNode(); node.getStyleClass().addAll("pad-title", "pad" + pad.getIndex() + "-title"); + + // Copy Pseudoclasses + for (PseudoClass pseudoClass : superRoot.getPseudoClassStates()) { + node.pseudoClassStateChanged(pseudoClass, true); + } + preview.getChildren().setAll(node); return; } catch (NoSuchComponentException e) { diff --git a/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java b/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java index d0666f0ec80ecea56054fff3315cb54b53a3bf7c..0b54082236cb6a5ea2cb093d9f67a53fa0a65d47 100644 --- a/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java +++ b/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java @@ -110,6 +110,12 @@ public class TouchPadView implements IPadViewV2 { Node node = previewContent.getNode(); node.getStyleClass().addAll("pad-title", "pad" + pad.getIndex() + "-title"); + + // Copy Pseudoclasses + for (PseudoClass pseudoClass : superRoot.getPseudoClassStates()) { + node.pseudoClassStateChanged(pseudoClass, true); + } + preview.getChildren().setAll(node); return; } catch (NoSuchComponentException e) { diff --git a/PlayWall/src/de/tobias/playpad/view/MapperOverviewViewController.java b/PlayWall/src/de/tobias/playpad/view/MapperOverviewViewController.java index 44f42324683bad635c2010489f06e375df27442f..9a996c2a503bc5ffc3200710b304619f6460d687 100644 --- a/PlayWall/src/de/tobias/playpad/view/MapperOverviewViewController.java +++ b/PlayWall/src/de/tobias/playpad/view/MapperOverviewViewController.java @@ -62,7 +62,7 @@ public class MapperOverviewViewController implements IMapperOverviewViewControll Set<String> types = registry.getTypes(); types.stream().sorted().forEach(item -> { - Button button = new Button(registry.toString(), new FontIcon(FontAwesomeType.PLUS_CIRCLE)); + Button button = new Button(item.toString(), new FontIcon(FontAwesomeType.PLUS_CIRCLE)); button.setContentDisplay(ContentDisplay.TOP); button.setPrefWidth(150); diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewControllerV2.java b/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewControllerV2.java index 29fb2c9b3f9745e93d453c4c45baea2858363e83..ef839e189a4f7c97131584c9d3f38e30c093ecb5 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewControllerV2.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewControllerV2.java @@ -182,6 +182,9 @@ public class MainViewControllerV2 extends ViewController implements IMainViewCon } public void setMainLayout(MainLayoutConnect mainLayoutConnect) { + removePadsFromView(); + removePadViews(); + this.mainLayout = mainLayoutConnect; initMainLayout(); } @@ -196,9 +199,6 @@ public class MainViewControllerV2 extends ViewController implements IMainViewCon menuToolbarViewController.getVolumeSlider().valueProperty().removeListener(volumeChangeListener); } - removePadsFromView(); - removePadViews(); - headerBox.getChildren().clear(); MenuToolbarViewController newMenuToolbarViewController = mainLayout.createMenuToolbar(this); headerBox.getChildren().add(newMenuToolbarViewController.getParent()); @@ -512,7 +512,8 @@ public class MainViewControllerV2 extends ViewController implements IMainViewCon { try { Thread.sleep(PlayPadMain.displayTimeMillis * 2); - } catch (Exception e) {} + } catch (Exception e) { + } Platform.runLater(() -> { if (menuToolbarViewController != null) diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/option/MappingTabViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/option/MappingTabViewController.java index c58323cb1353e029d23dae2d4a626e474487b0c6..5d07685f255278a9352ccee1173c36ccb8277de0 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/option/MappingTabViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/option/MappingTabViewController.java @@ -139,7 +139,9 @@ public class MappingTabViewController extends SettingsTabViewController implemen } else { detailView.getChildren().remove(mapperOverviewViewController.getParent()); } - } catch (Exception e) {} + } catch (Exception e) { + e.printStackTrace(); + } } // Tab Utils @@ -151,7 +153,8 @@ public class MappingTabViewController extends SettingsTabViewController implemen } @Override - public void saveSettings(Profile profile) {} + public void saveSettings(Profile profile) { + } @Override public boolean needReload() { diff --git a/PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContentConnect.java b/PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContentConnect.java index c00fd9629838862dbd9d7bfed9ff06c7d04bf5bf..88dccf7273cdff6a998b7d157d96af79f2745f61 100644 --- a/PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContentConnect.java +++ b/PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContentConnect.java @@ -10,6 +10,7 @@ import de.tobias.playpad.viewcontroller.SettingsTabViewController; import de.tobias.utils.util.FileUtils; import javafx.scene.layout.Pane; +// COMMENT PadContentConnect public abstract class PadContentConnect implements Comparable<PadContentConnect>, Displayable { public abstract String getType(); diff --git a/PlayWallCore/src/de/tobias/playpad/pad/view/IPadViewV2.java b/PlayWallCore/src/de/tobias/playpad/pad/view/IPadViewV2.java index d14022dce4139d09809621c9e1118a88837d1070..32942fd3633cc902d68802feaddc01446bd2c5ff 100644 --- a/PlayWallCore/src/de/tobias/playpad/pad/view/IPadViewV2.java +++ b/PlayWallCore/src/de/tobias/playpad/pad/view/IPadViewV2.java @@ -60,11 +60,30 @@ public interface IPadViewV2 { */ public void showBusyView(boolean enable); - // COMMENT IPadViewV2 + /** + * Aktiviert eine Pseudoclass für die View + * + * @param playCalss + * Pseudoclass + * @param b + * <code>true</code> Aktiv + */ public void pseudoClassState(PseudoClass playCalss, boolean b); + /** + * Setzt den Style für den Root Node der PadView. + * + * @param string + * Style + */ public void setStyle(String string); + /** + * Aktiviert des Error Labels, damit es angezeigt wird. + * + * @param b + * <code>true</code> Sichtbar + */ public void setErrorLabelActive(boolean b); /**