X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=inline;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsonitus%2Fgui%2FPipelinePanel.java;h=93189efe977bc0be7e18a0fc5edfd4e0dee2238f;hb=633a841142f978235ed9f745b6ba16c278963e62;hp=8c5fa1555d2158df9b72c5f2ca54c6c559d4dae2;hpb=fa5196e029c48636f0c318311244395cfae49953;p=sonitus.git
diff --git a/src/main/java/net/pterodactylus/sonitus/gui/PipelinePanel.java b/src/main/java/net/pterodactylus/sonitus/gui/PipelinePanel.java
index 8c5fa15..93189ef 100644
--- a/src/main/java/net/pterodactylus/sonitus/gui/PipelinePanel.java
+++ b/src/main/java/net/pterodactylus/sonitus/gui/PipelinePanel.java
@@ -17,8 +17,13 @@
package net.pterodactylus.sonitus.gui;
+import static javax.swing.BorderFactory.createCompoundBorder;
+import static javax.swing.BorderFactory.createEmptyBorder;
import static javax.swing.BorderFactory.createEtchedBorder;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
@@ -26,31 +31,36 @@ import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Collection;
import java.util.EventListener;
-import java.util.List;
+import java.util.logging.Logger;
+import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
+import javax.swing.UIManager;
import javax.swing.event.EventListenerList;
-import net.pterodactylus.sonitus.data.ControlledComponent;
import net.pterodactylus.sonitus.data.Filter;
+import net.pterodactylus.sonitus.data.Metadata;
+import net.pterodactylus.sonitus.data.MetadataListener;
import net.pterodactylus.sonitus.data.Pipeline;
-import net.pterodactylus.sonitus.data.Sink;
-import net.pterodactylus.sonitus.data.Source;
-
-import com.google.common.collect.Lists;
/**
- * {@link JPanel} that displays all components of a {@link Pipeline}.
+ * {@link JPanel} that displays all filters of a {@link Pipeline}.
*
* @author David âBombeâ Roden
*/
public class PipelinePanel extends JPanel {
+ /** The logger. */
+ private static final Logger logger = Logger.getLogger(PipelinePanel.class.getName());
+
/** The pipeline being displayed. */
private final Pipeline pipeline;
- /** The component hover listeners. */
- private final EventListenerList componentHoverListeners = new EventListenerList();
+ /** The filter selection listeners. */
+ private final EventListenerList filterSelectionListeners = new EventListenerList();
+
+ /** The currently selected filter. */
+ private JComponent selectedFilter;
/**
* Creates a new pipeline panel displaying the given pipeline.
@@ -69,13 +79,13 @@ public class PipelinePanel extends JPanel {
//
/**
- * Adds the given component hover listener to this panel.
+ * Adds the given filter selection listener to this panel.
*
- * @param componentHoverListener
- * The component hover listener to add
+ * @param filterSelectionListener
+ * The filter selection listener to add
*/
- public void addComponentHoverListener(ComponentHoverListener componentHoverListener) {
- componentHoverListeners.add(ComponentHoverListener.class, componentHoverListener);
+ public void addFilterSelectionListener(FilterSelectionListener filterSelectionListener) {
+ filterSelectionListeners.add(FilterSelectionListener.class, filterSelectionListener);
}
//
@@ -87,18 +97,13 @@ public class PipelinePanel extends JPanel {
/* clear everything. */
removeAll();
- /* count all sinks. */
+ /* count all filters. */
int sinkCount = 0;
- List