diff --git a/PlayWall/.classpath b/PlayWall/.classpath index 0ede5a8607f5719c73b0d0fa43b800cacfe55769..d6c36775992856017bbd4f040c3ad7f1dbb44b5d 100644 --- a/PlayWall/.classpath +++ b/PlayWall/.classpath @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry excluding="**/.DS_Store|**/.gitignore|icon.icns|icon.ico" kind="src" path="src"/> + <classpathentry excluding="**/.DS_Store|**/.gitignore|icon.icns|icon.ico|de/tobias/playpad/viewcontroller/main/MainMenuBarController.java|de/tobias/playpad/viewcontroller/main/MainToolbarController.java|de/tobias/playpad/viewcontroller/main/MainViewController.java|de/tobias/playpad/viewcontroller/pad/PadViewController.java|de/tobias/playpad/view/PadView.java" kind="src" path="src"/> <classpathentry excluding="**/.gitignor|de/tobias/playpad/assets/files/dialogDnD.pxm" kind="src" path="assets"/> <classpathentry kind="src" path="test"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> diff --git a/PlayWall/assets/de/tobias/playpad/assets/style/touch.css b/PlayWall/assets/de/tobias/playpad/assets/style/touch.css index 8ae65926cfaa567e2d4094aea017dab40d8dd67f..4db18b4f902ebcb013b80100489907bdef408243 100644 --- a/PlayWall/assets/de/tobias/playpad/assets/style/touch.css +++ b/PlayWall/assets/de/tobias/playpad/assets/style/touch.css @@ -4,7 +4,7 @@ } .label { - -fx-font-size: 17px; + -fx-font-size: 20px; } .button { diff --git a/PlayWall/src/de/tobias/playpad/PlayPadMain.java b/PlayWall/src/de/tobias/playpad/PlayPadMain.java index 3efcb2c05a4840f37e88e82e8eca750becb34e8a..26fd6ff5df11b207e456dd1eafb9672c8112c95f 100644 --- a/PlayWall/src/de/tobias/playpad/PlayPadMain.java +++ b/PlayWall/src/de/tobias/playpad/PlayPadMain.java @@ -11,34 +11,21 @@ import java.util.UUID; import org.dom4j.DocumentException; -import de.tobias.playpad.action.ActionRegistery; -import de.tobias.playpad.action.connect.CartActionConnect; -import de.tobias.playpad.action.connect.NavigateActionConnect; -import de.tobias.playpad.action.connect.PageActionConnect; import de.tobias.playpad.action.mapper.KeyboardMapperConnect; import de.tobias.playpad.action.mapper.MapperRegistry; import de.tobias.playpad.action.mapper.MidiMapperConnect; import de.tobias.playpad.audio.ClipAudioHandler; import de.tobias.playpad.audio.JavaFXAudioHandler; import de.tobias.playpad.audio.TinyAudioHandler; -import de.tobias.playpad.design.LayoutRegistry; -import de.tobias.playpad.design.classic.ClassicDesignConnect; -import de.tobias.playpad.design.classic.ClassicGlobalDesign; -import de.tobias.playpad.design.modern.ModernDesignConnect; import de.tobias.playpad.design.modern.ModernGlobalDesign; import de.tobias.playpad.midi.device.DeviceRegistry; import de.tobias.playpad.midi.device.PD12; -import de.tobias.playpad.pad.conntent.PadContentRegistry; -import de.tobias.playpad.pad.content.AudioContentConnect; import de.tobias.playpad.project.Project; import de.tobias.playpad.project.ProjectReference; import de.tobias.playpad.registry.NoSuchComponentException; import de.tobias.playpad.settings.Profile; import de.tobias.playpad.settings.ProfileListener; import de.tobias.playpad.settings.ProfileReference; -import de.tobias.playpad.tigger.TriggerRegistry; -import de.tobias.playpad.trigger.CartTriggerItemConnect; -import de.tobias.playpad.trigger.VolumeTriggerItemConnect; import de.tobias.playpad.update.PlayPadUpdater; import de.tobias.playpad.update.UpdateRegistery; import de.tobias.playpad.update.Updates; @@ -207,31 +194,14 @@ public class PlayPadMain extends Application implements LocalizationDelegate, Pr } private void registerComponents() { - // Layout - LayoutRegistry.registerLayout(new ClassicDesignConnect()); - LayoutRegistry.registerLayout(new ModernDesignConnect()); - LayoutRegistry.setDefaultLayout(ClassicGlobalDesign.TYPE); - // Midi DeviceRegistry.getFactoryInstance().registerDevice(PD12.NAME, PD12.class); - // Trigger - TriggerRegistry.register(new CartTriggerItemConnect()); - TriggerRegistry.register(new VolumeTriggerItemConnect()); - - // Actions - ActionRegistery.registerActionConnect(new CartActionConnect()); - ActionRegistery.registerActionConnect(new PageActionConnect()); - ActionRegistery.registerActionConnect(new NavigateActionConnect()); - // Mapper MapperRegistry.registerMapperConnect(new MidiMapperConnect()); MapperRegistry.registerMapperConnect(new KeyboardMapperConnect()); MapperRegistry.setOverviewViewController(new MapperOverviewViewController()); - // Pad Content - PadContentRegistry.registerActionConnect(new AudioContentConnect()); - Profile.registerListener(this); try { diff --git a/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadView.java b/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadView.java index 16ab7c5dd2ce80b5745b0dc476e396a955c949ed..bb142d1a0c0862e9a4db07a5243c130e9de75f8d 100644 --- a/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadView.java +++ b/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadView.java @@ -181,7 +181,6 @@ public class DesktopPadView implements IPadViewV2 { this.playBar.setProgress(progress); } - @Override public ProgressBar getPlayBar() { return playBar; } @@ -374,4 +373,9 @@ public class DesktopPadView implements IPadViewV2 { public void setPlaybarVisible(boolean visible) { playBar.setVisible(visible); } + + @Override + public void setPlayBarProgress(double value) { + playBar.setProgress(value); + } } diff --git a/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadViewController.java b/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadViewController.java index 03fa9b1cc88b06ac4fc9f7038b240ca2350a1735..bfe721169c5f86b455b4cab862547cc8ad827b69 100644 --- a/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadViewController.java +++ b/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopPadViewController.java @@ -1,9 +1,17 @@ package de.tobias.playpad.layout.desktop; +import java.io.File; +import java.nio.file.Path; +import java.util.Set; + import de.tobias.playpad.PlayPadPlugin; +import de.tobias.playpad.Strings; import de.tobias.playpad.pad.Pad; +import de.tobias.playpad.pad.PadContentRegistry; 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.play.Durationable; import de.tobias.playpad.pad.listener.IPadPositionListener; import de.tobias.playpad.pad.listener.PadContentListener; @@ -13,21 +21,29 @@ import de.tobias.playpad.pad.listener.PadPositionListener; import de.tobias.playpad.pad.listener.PadStatusListener; import de.tobias.playpad.pad.view.IPadViewV2; import de.tobias.playpad.pad.viewcontroller.IPadViewControllerV2; +import de.tobias.playpad.registry.NoSuchComponentException; import de.tobias.playpad.settings.Profile; import de.tobias.playpad.settings.ProfileSettings; +import de.tobias.playpad.view.FileDragOptionView; import de.tobias.playpad.viewcontroller.main.IMainViewController; import de.tobias.playpad.viewcontroller.option.pad.PadSettingsViewController; import de.tobias.playpad.viewcontroller.pad.PadDragListener; +import de.tobias.utils.application.ApplicationUtils; +import de.tobias.utils.util.FileUtils; +import de.tobias.utils.util.Localization; import javafx.beans.value.ChangeListener; import javafx.event.ActionEvent; import javafx.event.EventHandler; +import javafx.scene.Node; +import javafx.stage.FileChooser; +import javafx.stage.FileChooser.ExtensionFilter; import javafx.stage.Stage; import javafx.util.Duration; public class DesktopPadViewController implements IPadViewControllerV2, EventHandler<ActionEvent> { protected static final String CURRENT_PAGE_BUTTON = "current-page-button"; - + private static final String OPEN_FOLDER = "openFolder"; private static final String DURATION_FORMAT = "%d:%02d"; private DesktopPadView padView; @@ -142,7 +158,12 @@ public class DesktopPadViewController implements IPadViewControllerV2, EventHand } else if (event.getSource() == padView.getStopButton()) { onStop(); } else if (event.getSource() == padView.getNewButton()) { - onNew(event); + try { + onNew(event); + } catch (NoSuchComponentException e) { + // TODO Error Handling + e.printStackTrace(); + } } else if (event.getSource() == padView.getSettingsButton()) { onSettings(); } @@ -166,8 +187,69 @@ public class DesktopPadViewController implements IPadViewControllerV2, EventHand } } - private void onNew(ActionEvent event) { - // TODO Implement + private void onNew(ActionEvent event) throws NoSuchComponentException { + ProfileSettings settings = Profile.currentProfile().getProfileSettings(); + if (pad.getProject() != null) { + if (settings.isLiveMode() && settings.isLiveModeFile() && pad.getProject().getPlayedPlayers() > 0) { + PlayPadPlugin.getImplementation().getMainViewController().showLiveInfo(); + return; + } + } + + FileChooser chooser = new FileChooser(); + PadContentRegistry registry = PlayPadPlugin.getRegistryCollection().getPadContents(); + + // File Extension + ExtensionFilter extensionFilter = new ExtensionFilter(Localization.getString(Strings.File_Filter_Media), + registry.getSupportedFileTypes()); + chooser.getExtensionFilters().add(extensionFilter); + + // Last Folder + Object openFolder = ApplicationUtils.getApplication().getUserDefaults().getData(OPEN_FOLDER); + if (openFolder != null) { + File folder = new File(openFolder.toString()); + chooser.setInitialDirectory(folder); + } + + File file = chooser.showOpenDialog(((Node) event.getTarget()).getScene().getWindow()); + if (file != null) { + Path path = file.toPath(); + + Set<PadContentConnect> connects = registry.getPadContentConnectsForFile(file.toPath()); + if (!connects.isEmpty()) { + if (connects.size() > 1) { + FileDragOptionView hud = new FileDragOptionView(padView.getRootNode()); + hud.showDropOptions(connects, connect -> + { + if (connect != null) { + setNewPadContent(file, path, connect); + hud.hide(); + } + }); + } else { + PadContentConnect connect = connects.iterator().next(); + setNewPadContent(file, path, connect); + } + } + + ApplicationUtils.getApplication().getUserDefaults().setData(OPEN_FOLDER, path.getParent().toString()); + } + } + + private void setNewPadContent(File file, Path path, PadContentConnect connect) { + PadContent content = pad.getContent(); + if (pad.getContent() == null || !pad.getContent().getType().equals(connect.getType())) { + content = connect.newInstance(pad); + this.pad.setContent(content); + } + + try { + content.handlePath(file.toPath()); + } catch (NoSuchComponentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + this.pad.setName(FileUtils.getFilenameWithoutExtention(path.getFileName())); } private void onSettings() { diff --git a/PlayWall/src/de/tobias/playpad/layout/touch/TouchMenuToolbarViewController.java b/PlayWall/src/de/tobias/playpad/layout/touch/TouchMenuToolbarViewController.java index 17e1ff5b6c3be058ab96117df7d1a6e5c440d08c..b2519237eb2cdbc9f547652b9bd9081cc4158a71 100644 --- a/PlayWall/src/de/tobias/playpad/layout/touch/TouchMenuToolbarViewController.java +++ b/PlayWall/src/de/tobias/playpad/layout/touch/TouchMenuToolbarViewController.java @@ -108,7 +108,7 @@ public class TouchMenuToolbarViewController extends BasicMenuToolbarViewControll @Override public Slider getVolumeSlider() { - return null; + return volumeSlider; } @Override diff --git a/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java b/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java index 115adbccd53445c32310ded29f1635e9d122f03f..849b15cc6833a0b7c5c9555a241b02b1f471cb18 100644 --- a/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java +++ b/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java @@ -85,7 +85,7 @@ public class TouchPadView implements IPadViewV2 { root.getChildren().addAll(infoBox, preview, playBar); superRoot.getChildren().addAll(root); - + superRoot.setOnTouchPressed(controller); superRoot.setOnMouseClicked(controller); } @@ -155,7 +155,6 @@ public class TouchPadView implements IPadViewV2 { this.playBar.setProgress(progress); } - @Override public ProgressBar getPlayBar() { return playBar; } @@ -275,4 +274,9 @@ public class TouchPadView implements IPadViewV2 { public void setPlaybarVisible(boolean visible) { playBar.setVisible(visible); } + + @Override + public void setPlayBarProgress(double value) { + playBar.setProgress(value); + } } diff --git a/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadViewController.java b/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadViewController.java index 0eadc9706453a410967abebffcd6063e1d9839c6..0a4c14f7587f407ebc750112972906fa0e243fe7 100644 --- a/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadViewController.java +++ b/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadViewController.java @@ -1,9 +1,17 @@ package de.tobias.playpad.layout.touch; +import java.io.File; +import java.nio.file.Path; +import java.util.Set; + import de.tobias.playpad.PlayPadPlugin; +import de.tobias.playpad.Strings; import de.tobias.playpad.pad.Pad; +import de.tobias.playpad.pad.PadContentRegistry; 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.play.Durationable; import de.tobias.playpad.pad.listener.IPadPositionListener; import de.tobias.playpad.pad.listener.PadContentListener; @@ -13,25 +21,32 @@ import de.tobias.playpad.pad.listener.PadPositionListener; import de.tobias.playpad.pad.listener.PadStatusListener; import de.tobias.playpad.pad.view.IPadViewV2; import de.tobias.playpad.pad.viewcontroller.IPadViewControllerV2; +import de.tobias.playpad.registry.NoSuchComponentException; import de.tobias.playpad.settings.Profile; import de.tobias.playpad.settings.ProfileSettings; +import de.tobias.playpad.view.FileDragOptionView; import de.tobias.playpad.viewcontroller.main.IMainViewController; import de.tobias.playpad.viewcontroller.option.pad.PadSettingsViewController; import de.tobias.playpad.viewcontroller.pad.PadDragListener; +import de.tobias.utils.application.ApplicationUtils; +import de.tobias.utils.util.FileUtils; +import de.tobias.utils.util.Localization; import javafx.beans.value.ChangeListener; -import javafx.event.ActionEvent; import javafx.event.Event; import javafx.event.EventHandler; +import javafx.scene.Node; import javafx.scene.input.MouseButton; import javafx.scene.input.MouseEvent; import javafx.scene.input.TouchEvent; +import javafx.stage.FileChooser; +import javafx.stage.FileChooser.ExtensionFilter; import javafx.stage.Stage; import javafx.util.Duration; public class TouchPadViewController implements IPadViewControllerV2, EventHandler<Event> { protected static final String CURRENT_PAGE_BUTTON = "current-page-button"; - + private static final String OPEN_FOLDER = "openFolder"; private static final String DURATION_FORMAT = "%d:%02d"; private TouchPadView padView; @@ -142,42 +157,51 @@ public class TouchPadViewController implements IPadViewControllerV2, EventHandle if (event instanceof TouchEvent) { TouchEvent touchEvent = (TouchEvent) event; if (event.getEventType() == TouchEvent.TOUCH_PRESSED) { - if (touchEvent.getTouchCount() == 1) { - if (pad.getStatus() == PadStatus.PLAY) { - onStop(); - } else { - onPlay(); - } - } else if (touchEvent.getTouchCount() == 2) { - onSettings(); + if (touchEvent.getTouchCount() == 1 || touchEvent.getTouchCount() == 2) { + handleAction(touchEvent.getTouchCount() == 1, event); } } } else if (event instanceof MouseEvent) { if (event.getEventType() == MouseEvent.MOUSE_CLICKED) { MouseEvent mouseEvent = (MouseEvent) event; - if (mouseEvent.getButton() == MouseButton.PRIMARY) { - if (pad.getStatus() == PadStatus.PLAY) { - onStop(); - } else { - onPlay(); - } - } else if (mouseEvent.getButton() == MouseButton.SECONDARY) { - onSettings(); + if (mouseEvent.getButton() == MouseButton.PRIMARY || mouseEvent.getButton() == MouseButton.SECONDARY) { + handleAction(mouseEvent.getButton() == MouseButton.PRIMARY, event); } } } } - private void onPlay() { - if (pad.getContent() != null) { - pad.setStatus(PadStatus.PLAY); + /** + * Diese Methode handlet die Eingabe für Touch oder Mouse + * + * @param primaryAction + * <code>true</code> Touch einfacher Click, Mause Primary Button + * @param event + * event + */ + private void handleAction(boolean primaryAction, Event event) { + if (primaryAction) { + if (pad.getStatus() == PadStatus.EMPTY) { + try { + onNew(event); + } catch (NoSuchComponentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } else if (pad.getStatus() == PadStatus.PLAY) { + onStop(); + } else { + onPlay(); + } + } else { + onSettings(); } } - private void onPause() { + private void onPlay() { if (pad.getContent() != null) { - pad.setStatus(PadStatus.PAUSE); + pad.setStatus(PadStatus.PLAY); } } @@ -187,8 +211,69 @@ public class TouchPadViewController implements IPadViewControllerV2, EventHandle } } - private void onNew(ActionEvent event) { - // TODO Implement + private void onNew(Event event) throws NoSuchComponentException { + ProfileSettings settings = Profile.currentProfile().getProfileSettings(); + if (pad.getProject() != null) { + if (settings.isLiveMode() && settings.isLiveModeFile() && pad.getProject().getPlayedPlayers() > 0) { + PlayPadPlugin.getImplementation().getMainViewController().showLiveInfo(); + return; + } + } + + FileChooser chooser = new FileChooser(); + PadContentRegistry registry = PlayPadPlugin.getRegistryCollection().getPadContents(); + + // File Extension + ExtensionFilter extensionFilter = new ExtensionFilter(Localization.getString(Strings.File_Filter_Media), + registry.getSupportedFileTypes()); + chooser.getExtensionFilters().add(extensionFilter); + + // Last Folder + Object openFolder = ApplicationUtils.getApplication().getUserDefaults().getData(OPEN_FOLDER); + if (openFolder != null) { + File folder = new File(openFolder.toString()); + chooser.setInitialDirectory(folder); + } + + File file = chooser.showOpenDialog(((Node) event.getTarget()).getScene().getWindow()); + if (file != null) { + Path path = file.toPath(); + + Set<PadContentConnect> connects = registry.getPadContentConnectsForFile(file.toPath()); + if (!connects.isEmpty()) { + if (connects.size() > 1) { + FileDragOptionView hud = new FileDragOptionView(padView.getRootNode()); + hud.showDropOptions(connects, connect -> + { + if (connect != null) { + setNewPadContent(file, path, connect); + hud.hide(); + } + }); + } else { + PadContentConnect connect = connects.iterator().next(); + setNewPadContent(file, path, connect); + } + } + + ApplicationUtils.getApplication().getUserDefaults().setData(OPEN_FOLDER, path.getParent().toString()); + } + } + + private void setNewPadContent(File file, Path path, PadContentConnect connect) { + PadContent content = pad.getContent(); + if (pad.getContent() == null || !pad.getContent().getType().equals(connect.getType())) { + content = connect.newInstance(pad); + this.pad.setContent(content); + } + + try { + content.handlePath(file.toPath()); + } catch (NoSuchComponentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + this.pad.setName(FileUtils.getFilenameWithoutExtention(path.getFileName())); } private void onSettings() { diff --git a/PlayWall/src/de/tobias/playpad/pad/listener/PadPositionListener.java b/PlayWall/src/de/tobias/playpad/pad/listener/PadPositionListener.java index db5081c585b7d4b19066509bebbb063a56e83238..27b674a5afdcd92112396beaf71c64c8f39285ae 100644 --- a/PlayWall/src/de/tobias/playpad/pad/listener/PadPositionListener.java +++ b/PlayWall/src/de/tobias/playpad/pad/listener/PadPositionListener.java @@ -56,7 +56,7 @@ public class PadPositionListener implements Runnable, IPadPositionListener { private void updateDuration(Duration newValue, Durationable durationable, Duration totalDuration) { double value = newValue.toMillis() / totalDuration.toMillis(); - controller.getView().getPlayBar().setProgress(value); + controller.getView().setPlayBarProgress(value); // Label (Restlaufzeit) controller.updateTimeLabel(); diff --git a/PlayWall/src/de/tobias/playpad/view/touch/PadViewTouch.java b/PlayWall/src/de/tobias/playpad/view/touch/PadViewTouch.java deleted file mode 100644 index c4e3ba354139c613a92fd2e37a9893654c9674fc..0000000000000000000000000000000000000000 --- a/PlayWall/src/de/tobias/playpad/view/touch/PadViewTouch.java +++ /dev/null @@ -1,95 +0,0 @@ -package de.tobias.playpad.view.touch; - -import de.tobias.playpad.pad.Pad; -import de.tobias.playpad.pad.view.IPadContentView; -import de.tobias.playpad.viewcontroller.IPadView; -import de.tobias.playpad.viewcontroller.pad.PadViewController; -import de.tobias.utils.ui.scene.BusyView; -import javafx.css.PseudoClass; -import javafx.scene.Node; -import javafx.scene.control.Button; -import javafx.scene.control.ProgressBar; -import javafx.scene.layout.HBox; -import javafx.scene.layout.StackPane; - -public class PadViewTouch extends StackPane implements IPadView { - - private HBox preview; - private IPadContentView previewContent; - - private ProgressBar playBar; - - private BusyView busyView; - - private transient PadViewController controller; // Reference to its controller - - public PadViewTouch(PadViewController controller) { - this.controller = controller; - } - - @Override - public void setBusy(boolean busy) { - - } - - @Override - public void pseudoClassState(PseudoClass pseudoClass, boolean active) { - - } - - @Override - public Node getNewButton() { - return null; - } - - @Override - public Button getPlayButton() { - return null; - } - - @Override - public Button getPauseButton() { - return null; - } - - @Override - public Button getStopButton() { - return null; - } - - @Override - public ProgressBar getPlayBar() { - return null; - } - - @Override - public void showPlaybar(boolean b) { - - } - - @Override - public void setPreviewContent(Pad pad) { - - } - - @Override - public void addDefaultButton(Pad pad) { - - } - - @Override - public void setErrorLabelActive(boolean b) { - - } - - @Override - public void setTriggerLabelActive(boolean b) { - - } - - @Override - public IPadContentView getPadContentView() { - return null; - } - -} diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewControllerV2.java b/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewControllerV2.java index 745b57589c93fed7757c14e0b57c7baecad41f4b..4dcf9be0d4de0a2a8cff1aed64c86209b91ad9f7 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewControllerV2.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewControllerV2.java @@ -470,6 +470,12 @@ public class MainViewControllerV2 extends ViewController implements IMainViewCon } } + @Override + public void showLiveInfo() { + // TODO Auto-generated method stub + + } + // Settings @Override public void reloadSettings(Profile old, Profile currentProfile) { 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 466384b4b11c55309b3bf75c23abcaf76e8a871a..631696d96ad189e9e8c65592d5c71db7ef9a6e42 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/PadSettingsViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/option/pad/PadSettingsViewController.java @@ -186,5 +186,6 @@ public class PadSettingsViewController extends ViewController implements IPadSet for (PadSettingsTabViewController controller : tabs) { controller.saveSettings(pad); } + getStage().close(); } } diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/pad/PadViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/pad/PadViewController.java index f2ef0d06c16b4a58e61981711c4b0167f391123e..47372327084c09e2b17c49f972f6956a1e89f1f6 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/pad/PadViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/pad/PadViewController.java @@ -2,18 +2,14 @@ package de.tobias.playpad.viewcontroller.pad; import java.io.File; import java.nio.file.Path; -import java.util.Set; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.PseudoClasses; -import de.tobias.playpad.Strings; 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.PadContentRegistry; -import de.tobias.playpad.pad.conntent.UnkownPadContentException; import de.tobias.playpad.pad.conntent.play.Durationable; import de.tobias.playpad.pad.listener.IPadPositionListener; import de.tobias.playpad.pad.listener.PadContentListener; @@ -25,19 +21,13 @@ import de.tobias.playpad.pad.view.IPadViewController; import de.tobias.playpad.registry.NoSuchComponentException; import de.tobias.playpad.settings.Profile; import de.tobias.playpad.settings.ProfileSettings; -import de.tobias.playpad.view.FileDragOptionView; import de.tobias.playpad.view.PadView; import de.tobias.playpad.viewcontroller.IPadView; import de.tobias.playpad.viewcontroller.main.IMainViewController; import de.tobias.playpad.viewcontroller.option.pad.PadSettingsViewController; -import de.tobias.utils.application.ApplicationUtils; import de.tobias.utils.util.FileUtils; -import de.tobias.utils.util.Localization; import javafx.event.ActionEvent; import javafx.event.EventHandler; -import javafx.scene.Node; -import javafx.stage.FileChooser; -import javafx.stage.FileChooser.ExtensionFilter; import javafx.stage.Stage; import javafx.util.Duration; @@ -112,55 +102,55 @@ public class PadViewController implements EventHandler<ActionEvent>, IPadViewCon } private void onNew(ActionEvent event) { - ProfileSettings settings = Profile.currentProfile().getProfileSettings(); - if (pad.getProject() != null) { - if (settings.isLiveMode() && settings.isLiveModeFile() && pad.getProject().getPlayedPlayers() > 0) { - PlayPadPlugin.getImplementation().getMainViewController().showLiveInfo(); - return; - } - } - - FileChooser chooser = new FileChooser(); - - // File Extension - ExtensionFilter extensionFilter = new ExtensionFilter(Localization.getString(Strings.File_Filter_Media), - PadContentRegistry.getSupportedFileTypes()); - chooser.getExtensionFilters().add(extensionFilter); - - // Last Folder - Object openFolder = ApplicationUtils.getApplication().getUserDefaults().getData(OPEN_FOLDER); - if (openFolder != null) { - File folder = new File(openFolder.toString()); - chooser.setInitialDirectory(folder); - } - - File file = chooser.showOpenDialog(((Node) event.getTarget()).getScene().getWindow()); - if (file != null) { - Path path = file.toPath(); - - try { - Set<PadContentConnect> connects = PadContentRegistry.getPadContentConnectsForFile(file.toPath()); - if (!connects.isEmpty()) { - if (connects.size() > 1) { - FileDragOptionView hud = new FileDragOptionView(view); - hud.showDropOptions(connects, connect -> - { - if (connect != null) { - setNewPadContent(file, path, connect); - hud.hide(); - } - }); - } else { - PadContentConnect connect = connects.iterator().next(); - setNewPadContent(file, path, connect); - } - } - } catch (UnkownPadContentException e) { - e.printStackTrace(); - } - - ApplicationUtils.getApplication().getUserDefaults().setData(OPEN_FOLDER, path.getParent().toString()); - } +// ProfileSettings settings = Profile.currentProfile().getProfileSettings(); +// if (pad.getProject() != null) { +// if (settings.isLiveMode() && settings.isLiveModeFile() && pad.getProject().getPlayedPlayers() > 0) { +// PlayPadPlugin.getImplementation().getMainViewController().showLiveInfo(); +// return; +// } +// } +// +// FileChooser chooser = new FileChooser(); +// +// // File Extension +// ExtensionFilter extensionFilter = new ExtensionFilter(Localization.getString(Strings.File_Filter_Media), +// PadContentRegistry.getSupportedFileTypes()); +// chooser.getExtensionFilters().add(extensionFilter); +// +// // Last Folder +// Object openFolder = ApplicationUtils.getApplication().getUserDefaults().getData(OPEN_FOLDER); +// if (openFolder != null) { +// File folder = new File(openFolder.toString()); +// chooser.setInitialDirectory(folder); +// } +// +// File file = chooser.showOpenDialog(((Node) event.getTarget()).getScene().getWindow()); +// if (file != null) { +// Path path = file.toPath(); +// +// try { +// Set<PadContentConnect> connects = PadContentRegistry.getPadContentConnectsForFile(file.toPath()); +// if (!connects.isEmpty()) { +// if (connects.size() > 1) { +// FileDragOptionView hud = new FileDragOptionView(view); +// hud.showDropOptions(connects, connect -> +// { +// if (connect != null) { +// setNewPadContent(file, path, connect); +// hud.hide(); +// } +// }); +// } else { +// PadContentConnect connect = connects.iterator().next(); +// setNewPadContent(file, path, connect); +// } +// } +// } catch (UnkownPadContentException e) { +// e.printStackTrace(); +// } +// +// ApplicationUtils.getApplication().getUserDefaults().setData(OPEN_FOLDER, path.getParent().toString()); +// } } private void setNewPadContent(File file, Path path, PadContentConnect connect) { diff --git a/PlayWallCore/src/de/tobias/playpad/action/ActionRegistery.java b/PlayWallCore/src/de/tobias/playpad/action/ActionRegistery.java deleted file mode 100644 index 15e3bc3bfb6fe6aa778436d37a36b596890d561b..0000000000000000000000000000000000000000 --- a/PlayWallCore/src/de/tobias/playpad/action/ActionRegistery.java +++ /dev/null @@ -1,30 +0,0 @@ -package de.tobias.playpad.action; - -import java.util.HashMap; -import java.util.Set; - -@Deprecated -public class ActionRegistery { - - private static HashMap<String, ActionConnect> actions; - - static { - actions = new HashMap<>(); - } - - public static void registerActionConnect(ActionConnect connect) { - actions.put(connect.getType(), connect); - } - - public static ActionConnect getActionConnect(String type) { - if (actions.containsKey(type)) { - return actions.get(type); - } else { - throw new IllegalArgumentException("Type of ActionConnect does not exists: " + type); - } - } - - public static Set<String> getTypes() { - return actions.keySet(); - } -} diff --git a/PlayWallCore/src/de/tobias/playpad/design/LayoutRegistry.java b/PlayWallCore/src/de/tobias/playpad/design/LayoutRegistry.java deleted file mode 100644 index 70944c794f9fe0574c5fc436a3bcd6d6c4a65a7f..0000000000000000000000000000000000000000 --- a/PlayWallCore/src/de/tobias/playpad/design/LayoutRegistry.java +++ /dev/null @@ -1,40 +0,0 @@ -package de.tobias.playpad.design; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Set; - -@Deprecated -public class LayoutRegistry { - - static { - layouts = new HashMap<>(); - } - - private static String defaultLayout; - private static HashMap<String, DesignConnect> layouts; - - public static void registerLayout(DesignConnect layoutConnect) { - layouts.put(layoutConnect.getType(), layoutConnect); - } - - public static Set<String> getTypes() { - return layouts.keySet(); - } - - public static DesignConnect getLayout(String type) { - return layouts.get(type); - } - - public static Collection<DesignConnect> getValues() { - return layouts.values(); - } - - public static String getDefaultLayout() { - return defaultLayout; - } - - public static void setDefaultLayout(String defaultLayout) { - LayoutRegistry.defaultLayout = defaultLayout; - } -} diff --git a/PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContentRegistry.java b/PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContentRegistry.java deleted file mode 100644 index 929aad301286837258a4b0086a3245c70628cfa3..0000000000000000000000000000000000000000 --- a/PlayWallCore/src/de/tobias/playpad/pad/conntent/PadContentRegistry.java +++ /dev/null @@ -1,72 +0,0 @@ -package de.tobias.playpad.pad.conntent; - -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -@Deprecated -public class PadContentRegistry { - - private static HashMap<String, PadContentConnect> padContents; - - static { - padContents = new HashMap<>(); - } - - public static void registerActionConnect(PadContentConnect connect) { - padContents.put(connect.getType(), connect); - } - - public static PadContentConnect getPadContentConnect(String type) throws UnkownPadContentException { - if (padContents.containsKey(type)) { - return padContents.get(type); - } else { - throw new UnkownPadContentException(type); - } - } - - public static Set<String> getTypes() { - return padContents.keySet(); - } - - public static String getContentTypeForFile(Path path) { - for (String type : padContents.keySet()) { - PadContentConnect connect = padContents.get(type); - String[] fileExtensions = connect.getSupportedTypes(); - for (String fileExtension : fileExtensions) { - if (path.toString().toLowerCase().matches("." + fileExtension)) { - return type; - } - } - } - return null; - } - - // TODO - public static Set<PadContentConnect> getPadContentConnectsForFile(Path path) throws UnkownPadContentException { - Set<PadContentConnect> connects = new HashSet<>(); - for (String type : PadContentRegistry.getTypes()) { - PadContentConnect connect = PadContentRegistry.getPadContentConnect(type); - for (String extension : connect.getSupportedTypes()) { - if (path.getFileName().toString().toLowerCase().matches("." + extension)) { - connects.add(connect); - } - } - } - return connects; - } - - public static String[] getSupportedFileTypes() { - List<String> extensions = new ArrayList<>(); - for (String type : padContents.keySet()) { - PadContentConnect connect = padContents.get(type); - String[] fileExtensions = connect.getSupportedTypes(); - Collections.addAll(extensions, fileExtensions); - } - return extensions.toArray(new String[extensions.size()]); - } -} diff --git a/PlayWallCore/src/de/tobias/playpad/pad/conntent/UnkownPadContentException.java b/PlayWallCore/src/de/tobias/playpad/pad/conntent/UnkownPadContentException.java deleted file mode 100644 index 42d375d306cd7f1efa59447e55c9dc9269152366..0000000000000000000000000000000000000000 --- a/PlayWallCore/src/de/tobias/playpad/pad/conntent/UnkownPadContentException.java +++ /dev/null @@ -1,12 +0,0 @@ -package de.tobias.playpad.pad.conntent; - -@Deprecated -//TODO Remove -public class UnkownPadContentException extends Exception { - - private static final long serialVersionUID = 1L; - - public UnkownPadContentException(String type) { - super(type); - } -} diff --git a/PlayWallCore/src/de/tobias/playpad/pad/view/IPadViewV2.java b/PlayWallCore/src/de/tobias/playpad/pad/view/IPadViewV2.java index db2a747afcd3ea91b106e85959c07f4ac0701223..ef729afa31783439f1203e54cab389a3b8a016cb 100644 --- a/PlayWallCore/src/de/tobias/playpad/pad/view/IPadViewV2.java +++ b/PlayWallCore/src/de/tobias/playpad/pad/view/IPadViewV2.java @@ -3,7 +3,6 @@ package de.tobias.playpad.pad.view; import de.tobias.playpad.pad.Pad; import de.tobias.playpad.pad.viewcontroller.IPadViewControllerV2; import javafx.css.PseudoClass; -import javafx.scene.control.ProgressBar; import javafx.scene.layout.Pane; /** @@ -67,9 +66,13 @@ public interface IPadViewV2 { public void setErrorLabelActive(boolean b); - // GUI Elemente - @Deprecated - public ProgressBar getPlayBar(); + /** + * Setzt den Fortschritt auf der PlayBar + * + * @param value + * [0, 1] + */ + public void setPlayBarProgress(double value); /** * Setzt die Playbar sichtbar. diff --git a/PlayWallCore/src/de/tobias/playpad/settings/Profile.java b/PlayWallCore/src/de/tobias/playpad/settings/Profile.java index 9ab551627ded8f2b9740323c45bd0a48667d2c00..4a1e2e9ccfe32200cab44281ea33b4c34897ae21 100644 --- a/PlayWallCore/src/de/tobias/playpad/settings/Profile.java +++ b/PlayWallCore/src/de/tobias/playpad/settings/Profile.java @@ -12,8 +12,10 @@ 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.GlobalDesign; -import de.tobias.playpad.design.LayoutRegistry; +import de.tobias.playpad.registry.DefaultRegistry; +import de.tobias.playpad.registry.NoSuchComponentException; import de.tobias.utils.application.App; import de.tobias.utils.application.ApplicationUtils; import de.tobias.utils.application.container.PathType; @@ -71,10 +73,17 @@ public class Profile { if (layouts.containsKey(type)) { return layouts.get(type); } else { - GlobalDesign layout = LayoutRegistry.getLayout(type).newGlobalDesign(); - layouts.put(type, layout); - return layout; + try { + DefaultRegistry<DesignConnect> registry = PlayPadPlugin.getRegistryCollection().getDesigns(); + GlobalDesign layout = registry.getComponent(type).newGlobalDesign(); + layouts.put(type, layout); + return layout; + } catch (NoSuchComponentException e) { // -> Throw exception + // TODO Error Handling + e.printStackTrace(); + } } + return null; } public GlobalDesign currentLayout() { diff --git a/PlayWallCore/src/de/tobias/playpad/tigger/Trigger.java b/PlayWallCore/src/de/tobias/playpad/tigger/Trigger.java index e6c84edf666fbafe345f06136114394f43f332b6..924e6010ac208363794f1ded976d2062f81ce9a4 100644 --- a/PlayWallCore/src/de/tobias/playpad/tigger/Trigger.java +++ b/PlayWallCore/src/de/tobias/playpad/tigger/Trigger.java @@ -6,9 +6,12 @@ import java.util.List; import org.dom4j.Element; +import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.pad.Pad; import de.tobias.playpad.pad.PadStatus; import de.tobias.playpad.project.Project; +import de.tobias.playpad.registry.NoSuchComponentException; +import de.tobias.playpad.registry.Registry; import de.tobias.playpad.settings.Profile; import de.tobias.playpad.viewcontroller.main.IMainViewController; import javafx.util.Duration; @@ -62,10 +65,17 @@ public class Trigger { if (itemObj instanceof Element) { Element itemElement = (Element) itemObj; String type = itemElement.attributeValue(TYPE_ATTR); - TriggerItemConnect connect = TriggerRegistry.getTriggerConnect(type); - TriggerItem item = connect.newInstance(this); - item.load(itemElement); - items.add(item); + + Registry<TriggerItemConnect> registry = PlayPadPlugin.getRegistryCollection().getTriggerItems(); + try { + TriggerItemConnect connect = registry.getComponent(type); + TriggerItem item = connect.newInstance(this); + item.load(itemElement); + items.add(item); + } catch (NoSuchComponentException e) { + e.printStackTrace(); + // TODO Error Handling + } } } } diff --git a/PlayWallCore/src/de/tobias/playpad/tigger/TriggerRegistry.java b/PlayWallCore/src/de/tobias/playpad/tigger/TriggerRegistry.java deleted file mode 100644 index 18c8967e199ab17ddc17257fd77656645d3b3703..0000000000000000000000000000000000000000 --- a/PlayWallCore/src/de/tobias/playpad/tigger/TriggerRegistry.java +++ /dev/null @@ -1,25 +0,0 @@ -package de.tobias.playpad.tigger; - -import java.util.HashMap; -import java.util.Set; - -@Deprecated -public class TriggerRegistry { - - private static HashMap<String, TriggerItemConnect> triggers = new HashMap<>();; - - public static void register(TriggerItemConnect connect) { - triggers.put(connect.getType(), connect); - } - - public static TriggerItemConnect getTriggerConnect(String type) { - if (triggers.containsKey(type)) { - return triggers.get(type); - } - return null; - } - - public static Set<String> getTypes() { - return triggers.keySet(); - } -} diff --git a/PlayWallCore/src/de/tobias/playpad/viewcontroller/main/IMainViewController.java b/PlayWallCore/src/de/tobias/playpad/viewcontroller/main/IMainViewController.java index 4c25fe9463e20e9e4a2b8f5f54733534a5e8ed66..b735be997f2006ea5734da332bd38c9bd74f1df6 100644 --- a/PlayWallCore/src/de/tobias/playpad/viewcontroller/main/IMainViewController.java +++ b/PlayWallCore/src/de/tobias/playpad/viewcontroller/main/IMainViewController.java @@ -4,13 +4,11 @@ import java.util.List; import de.tobias.playpad.midi.MidiListener; import de.tobias.playpad.pad.view.IPadViewV2; -import de.tobias.playpad.project.Project; import de.tobias.playpad.view.main.MainLayoutConnect; import de.tobias.utils.ui.NotificationHandler; import javafx.event.EventHandler; import javafx.event.EventType; import javafx.scene.Parent; -import javafx.scene.control.Slider; import javafx.scene.input.KeyEvent; import javafx.scene.paint.Color; import javafx.stage.Screen; @@ -42,8 +40,7 @@ public interface IMainViewController extends NotificationHandler { public void applyColorsToMappers(); - @Deprecated - public default void showLiveInfo() {} + public void showLiveInfo(); public void setTitle(); @@ -58,6 +55,6 @@ public interface IMainViewController extends NotificationHandler { public void setPadVolume(double doubleValue); public void setMainLayout(MainLayoutConnect mainLayoutConnect); - + public void performLayoutDependendAction(Runnable runnable); } diff --git a/PlayWallPlugins/actionsplugin/de/tobias/playpad/actionsplugin/impl/ActionsPluginImpl.java b/PlayWallPlugins/actionsplugin/de/tobias/playpad/actionsplugin/impl/ActionsPluginImpl.java index d83f077d99191dfc018e95987aac518bc1b04fdf..3fe6c23940513539a8c48644e1899d03b191591c 100644 --- a/PlayWallPlugins/actionsplugin/de/tobias/playpad/actionsplugin/impl/ActionsPluginImpl.java +++ b/PlayWallPlugins/actionsplugin/de/tobias/playpad/actionsplugin/impl/ActionsPluginImpl.java @@ -8,10 +8,7 @@ import org.dom4j.DocumentException; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.action.ActionConnect; -import de.tobias.playpad.action.ActionRegistery; import de.tobias.playpad.actionsplugin.ActionsPlugin; -import de.tobias.playpad.actionsplugin.muteaction.MuteActionConnect; -import de.tobias.playpad.actionsplugin.stopaction.StopActionConnect; import de.tobias.playpad.plugin.WindowListener; import de.tobias.playpad.registry.Registry; import de.tobias.playpad.settings.Profile; @@ -72,20 +69,17 @@ public class ActionsPluginImpl implements ActionsPlugin, ChangeListener<Boolean> @Override public void onInit(IMainViewController t) { - // TODO NullPointer - /* - t.getMenuToolbarController().getVolumeSlider().valueChangingProperty().addListener(new ChangeListener<Boolean>() { - - @Override - public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) { - if (newValue && volume == -1 && Profile.currentProfile().getProfileSettings().getVolume() != 0) { + t.performLayoutDependendAction(() -> + { + t.getMenuToolbarController().getVolumeSlider().valueChangingProperty().addListener((a, b, c) -> + { + if (c && volume == -1 && Profile.currentProfile().getProfileSettings().getVolume() != 0) { volume = Profile.currentProfile().getProfileSettings().getVolume(); } else { volume = -1; } - } + }); }); - */ } }); @@ -111,9 +105,6 @@ public class ActionsPluginImpl implements ActionsPlugin, ChangeListener<Boolean> } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IOException | DocumentException e) { e.printStackTrace(); } - ActionRegistery.registerActionConnect(new MuteActionConnect()); - ActionRegistery.registerActionConnect(new StopActionConnect()); - muteProperty.addListener(this); System.out.println("Enable Action Plugin"); diff --git a/PlayWallPlugins/mediaplugin/de/tobias/playpad/mediaplugin/main/impl/MediaPluginImpl.java b/PlayWallPlugins/mediaplugin/de/tobias/playpad/mediaplugin/main/impl/MediaPluginImpl.java index 54e111b9afbdf55d22734fa5445ed11dc702ea05..7b71b3255ffa67ac72acbcee2bd858ecb636e47e 100644 --- a/PlayWallPlugins/mediaplugin/de/tobias/playpad/mediaplugin/main/impl/MediaPluginImpl.java +++ b/PlayWallPlugins/mediaplugin/de/tobias/playpad/mediaplugin/main/impl/MediaPluginImpl.java @@ -9,14 +9,9 @@ import org.dom4j.DocumentException; import de.tobias.playpad.PlayPadPlugin; import de.tobias.playpad.action.ActionConnect; -import de.tobias.playpad.action.ActionRegistery; -import de.tobias.playpad.mediaplugin.blindaction.BlindActionConnect; -import de.tobias.playpad.mediaplugin.image.ImageContentConntect; import de.tobias.playpad.mediaplugin.main.VideoPlugin; import de.tobias.playpad.mediaplugin.main.VideoSettings; -import de.tobias.playpad.mediaplugin.video.VideoContentConntect; import de.tobias.playpad.pad.conntent.PadContentConnect; -import de.tobias.playpad.pad.conntent.PadContentRegistry; import de.tobias.playpad.plugin.SettingsListener; import de.tobias.playpad.registry.Registry; import de.tobias.playpad.settings.Profile; @@ -65,8 +60,6 @@ public class MediaPluginImpl implements VideoPlugin, SettingsListener, ChangeLis } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IOException | DocumentException e) { e.printStackTrace(); } - PadContentRegistry.registerActionConnect(new VideoContentConntect()); - PadContentRegistry.registerActionConnect(new ImageContentConntect()); PlayPadPlugin.getImplementation().addSettingsListener(this); @@ -91,15 +84,13 @@ public class MediaPluginImpl implements VideoPlugin, SettingsListener, ChangeLis } UpdateRegistery.registerUpdateable(new MediaPluginUpdater()); - + try { Registry<ActionConnect> padContents = PlayPadPlugin.getRegistryCollection().getActions(); padContents.loadComponentsFromFile("de/tobias/playpad/mediaplugin/assets/Actions.xml", getClass().getClassLoader()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IOException | DocumentException e) { e.printStackTrace(); } - ActionRegistery.registerActionConnect(new BlindActionConnect()); - blindProperty.addListener(this); System.out.println("Enable Media Plugin");