X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsonitus%2Fgui%2FPipelinePanel.java;h=93189efe977bc0be7e18a0fc5edfd4e0dee2238f;hb=HEAD;hp=ab1c484fbc2bcd4d63c768c53d673b9ae682ef91;hpb=45f83831984a48fefacb09f3754502f530fc158e;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 ab1c484..93189ef 100644
--- a/src/main/java/net/pterodactylus/sonitus/gui/PipelinePanel.java
+++ b/src/main/java/net/pterodactylus/sonitus/gui/PipelinePanel.java
@@ -17,34 +17,51 @@
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;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
import java.util.Collection;
-import java.util.List;
+import java.util.EventListener;
+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.Controlled;
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 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.
*
@@ -58,6 +75,20 @@ public class PipelinePanel extends JPanel {
}
//
+ // LISTENER MANAGEMENT
+ //
+
+ /**
+ * Adds the given filter selection listener to this panel.
+ *
+ * @param filterSelectionListener
+ * The filter selection listener to add
+ */
+ public void addFilterSelectionListener(FilterSelectionListener filterSelectionListener) {
+ filterSelectionListeners.add(FilterSelectionListener.class, filterSelectionListener);
+ }
+
+ //
// PRIVATE METHODS
//
@@ -66,18 +97,13 @@ public class PipelinePanel extends JPanel {
/* clear everything. */
removeAll();
- /* count all sinks. */
+ /* count all filters. */
int sinkCount = 0;
- List