Skip to content

Commit

Permalink
style: fix code style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
DropSnorz committed Jul 22, 2022
1 parent 0066f2e commit 8bf981d
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@

package com.owlplug.core.controllers;

import com.jfoenix.controls.*;
import com.jfoenix.controls.JFXButton;
import com.jfoenix.controls.JFXCheckBox;
import com.jfoenix.controls.JFXDialog;
import com.jfoenix.controls.JFXDialogLayout;
import com.jfoenix.controls.JFXListView;
import com.jfoenix.controls.JFXToggleButton;
import com.owlplug.core.components.ApplicationDefaults;
import com.owlplug.core.components.CoreTaskFactory;
import com.owlplug.core.components.ImageCache;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@
import com.owlplug.core.controllers.dialogs.NewLinkController;
import com.owlplug.core.dao.PluginDAO;
import com.owlplug.core.dao.SymlinkDAO;
import com.owlplug.core.model.*;
import com.owlplug.core.model.IDirectory;
import com.owlplug.core.model.Plugin;
import com.owlplug.core.model.PluginComponent;
import com.owlplug.core.model.PluginDirectory;
import com.owlplug.core.model.Symlink;
import com.owlplug.core.services.PluginService;
import com.owlplug.core.ui.PluginTreeCell;
import com.owlplug.core.ui.FilterableTreeItem;
import com.owlplug.core.ui.PluginTreeCell;
import com.owlplug.core.utils.FileUtils;
import java.util.ArrayList;
import java.util.HashMap;
Expand Down Expand Up @@ -192,7 +196,7 @@ public void clearAndFillPluginTree() {

// Display subcomponents in the plugin tree
if (plugin.getComponents().size() > 1) {
for(PluginComponent component : plugin.getComponents()) {
for (PluginComponent component : plugin.getComponents()) {
FilterableTreeItem<Object> compItem = new FilterableTreeItem<>(component);
item.getInternalChildren().add(compItem);
}
Expand All @@ -211,27 +215,21 @@ public void clearAndFillPluginTree() {
&& !prefs.get(ApplicationDefaults.VST_DIRECTORY_KEY, "").isBlank()) {
String path = prefs.get(ApplicationDefaults.VST_DIRECTORY_KEY, "");
userPluginDirectories.add(FileUtils.convertPath(path));
for(String extraDirectory : prefs.getList(ApplicationDefaults.VST2_EXTRA_DIRECTORY_KEY)) {
userPluginDirectories.add(extraDirectory);
}
userPluginDirectories.addAll(prefs.getList(ApplicationDefaults.VST2_EXTRA_DIRECTORY_KEY));
}

if (prefs.getBoolean(ApplicationDefaults.VST3_DISCOVERY_ENABLED_KEY, false)
&& !prefs.get(ApplicationDefaults.VST3_DIRECTORY_KEY, "").isBlank()) {
String path = prefs.get(ApplicationDefaults.VST3_DIRECTORY_KEY, "");
userPluginDirectories.add(FileUtils.convertPath(path));
for(String extraDirectory : prefs.getList(ApplicationDefaults.VST3_EXTRA_DIRECTORY_KEY)) {
userPluginDirectories.add(extraDirectory);
}
userPluginDirectories.addAll(prefs.getList(ApplicationDefaults.VST3_EXTRA_DIRECTORY_KEY));
}

if (prefs.getBoolean(ApplicationDefaults.AU_DISCOVERY_ENABLED_KEY, false)
&& !prefs.get(ApplicationDefaults.AU_DIRECTORY_KEY, "").isBlank()) {
String path = prefs.get(ApplicationDefaults.AU_DIRECTORY_KEY, "");
userPluginDirectories.add(FileUtils.convertPath(path));
for(String extraDirectory : prefs.getList(ApplicationDefaults.AU_EXTRA_DIRECTORY_KEY)) {
userPluginDirectories.add(extraDirectory);
}
userPluginDirectories.addAll(prefs.getList(ApplicationDefaults.AU_EXTRA_DIRECTORY_KEY));
}

for (String directory : userPluginDirectories) {
Expand Down
14 changes: 12 additions & 2 deletions owlplug-client/src/main/java/com/owlplug/core/model/Plugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,20 @@

package com.owlplug.core.model;

import com.owlplug.store.model.ProductTag;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.*;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Inheritance;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Inheritance
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
package com.owlplug.core.model;

import com.owlplug.store.model.StoreProduct;
import javax.persistence.*;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(indexes = { @Index(name = "IDX_PLUGIN_COMPONENT_ID", columnList = "id") })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,22 @@
import com.owlplug.core.dao.PluginDAO;
import com.owlplug.core.dao.PluginFootprintDAO;
import com.owlplug.core.dao.SymlinkDAO;
import com.owlplug.core.model.*;
import com.owlplug.core.model.Plugin;
import com.owlplug.core.model.PluginComponent;
import com.owlplug.core.model.PluginFootprint;
import com.owlplug.core.model.PluginFormat;
import com.owlplug.core.model.PluginType;
import com.owlplug.core.model.Symlink;
import com.owlplug.core.services.NativeHostService;
import com.owlplug.core.tasks.plugins.discovery.PluginFileCollector;
import com.owlplug.core.tasks.plugins.discovery.PluginSyncTaskParameters;
import com.owlplug.core.tasks.plugins.discovery.SymlinkCollector;
import com.owlplug.core.tasks.plugins.discovery.fileformats.PluginFile;
import com.owlplug.host.NativePlugin;
import java.util.*;

import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -121,23 +128,23 @@ protected TaskResult call() throws Exception {
if (parameters.isFindVst2()) {
collectedPluginFiles.addAll(pluginCollector.collect(vst2Directory, PluginFormat.VST2));
collectedSymlinks.addAll(symlinkCollector.collect(vst2Directory));
for(String path : parameters.getVst2ExtraDirectories()) {
for (String path : parameters.getVst2ExtraDirectories()) {
collectedPluginFiles.addAll(pluginCollector.collect(path, PluginFormat.VST2));
collectedSymlinks.addAll(symlinkCollector.collect(path));
}
}
if (parameters.isFindVst3()) {
collectedPluginFiles.addAll(pluginCollector.collect(vst3Directory, PluginFormat.VST3));
collectedSymlinks.addAll(symlinkCollector.collect(vst3Directory));
for(String path : parameters.getVst3ExtraDirectories()) {
for (String path : parameters.getVst3ExtraDirectories()) {
collectedPluginFiles.addAll(pluginCollector.collect(path, PluginFormat.VST3));
collectedSymlinks.addAll(symlinkCollector.collect(path));
}
}
if (parameters.isFindAu()) {
collectedPluginFiles.addAll(pluginCollector.collect(auDirectory, PluginFormat.AU));
collectedSymlinks.addAll(symlinkCollector.collect(auDirectory));
for(String path : parameters.getAuExtraDirectories()) {
for (String path : parameters.getAuExtraDirectories()) {
collectedPluginFiles.addAll(pluginCollector.collect(path, PluginFormat.AU));
collectedSymlinks.addAll(symlinkCollector.collect(path));
}
Expand Down Expand Up @@ -173,7 +180,7 @@ protected TaskResult call() throws Exception {

plugin.setNativeCompatible(true);

for(NativePlugin nativePlugin : nativePlugins) {
for (NativePlugin nativePlugin : nativePlugins) {
PluginComponent component = nativePluginToPluginComponent(nativePlugin);
component.setPlugin(plugin);
plugin.getComponents().add(component);
Expand All @@ -192,7 +199,7 @@ protected TaskResult call() throws Exception {
this.commitProgress(80.0 / collectedPluginFiles.size());
}


this.updateProgress(1, 1);
this.updateMessage("Plugins synchronized");
log.info("Plugin Sync task complete");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@

import com.jfoenix.controls.JFXTreeCell;
import com.owlplug.core.components.ApplicationDefaults;
import com.owlplug.core.model.*;
import com.owlplug.core.model.IDirectory;
import com.owlplug.core.model.Plugin;
import com.owlplug.core.model.PluginComponent;
import com.owlplug.core.model.PluginDirectory;
import com.owlplug.core.model.PluginState;
import com.owlplug.core.model.Symlink;
import com.owlplug.core.services.PluginService;
import javafx.geometry.Pos;
import javafx.scene.Node;
Expand All @@ -36,7 +41,7 @@ public class PluginTreeCell extends JFXTreeCell<Object> {
private PluginService pluginService;
private ApplicationDefaults applicationDefaults;

public PluginTreeCell(ApplicationDefaults applicationDefaults, PluginService pluginService){
public PluginTreeCell(ApplicationDefaults applicationDefaults, PluginService pluginService) {
this.applicationDefaults = applicationDefaults;
this.pluginService = pluginService;
}
Expand All @@ -53,7 +58,7 @@ public void updateItem(Object item, boolean empty) {
if (item instanceof Plugin) {
renderPlugin((Plugin) item);
} else if (item instanceof PluginComponent) {
renderComponent((PluginComponent) item );
renderComponent((PluginComponent) item);
} else if (item instanceof IDirectory) {
renderDirectory((IDirectory) item);
} else {
Expand Down Expand Up @@ -99,7 +104,6 @@ private void renderPlugin(Plugin plugin) {


private void renderComponent(PluginComponent pluginComponent) {

Label label = new Label(pluginComponent.getName());
label.setGraphic(new ImageView(applicationDefaults.pluginComponentImage));
setGraphic(label);
Expand Down Expand Up @@ -130,7 +134,7 @@ private void renderDirectory(IDirectory dir) {
textFlow.getChildren().add(directoryName);

Node icon;
if(dir instanceof Symlink) {
if (dir instanceof Symlink) {
icon = new ImageView(applicationDefaults.symlinkImage);
} else if (dir instanceof PluginDirectory pluginDirectory) {
if (pluginDirectory.isRootDirectory()) {
Expand All @@ -149,5 +153,4 @@ private void renderDirectory(IDirectory dir) {
setText(null);
}


}

0 comments on commit 8bf981d

Please sign in to comment.