mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-16 22:35:04 -05:00
Rename "Analyze" panel to "Tools" panel
This commit is contained in:
parent
1251fbd657
commit
d53dd1ffec
@ -1,9 +1,5 @@
|
||||
package net.filebot.ui.analyze;
|
||||
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JTabbedPane;
|
||||
|
||||
@ -15,36 +11,23 @@ public class AnalyzePanel extends JComponent {
|
||||
private final JTabbedPane toolsPanel = new JTabbedPane();
|
||||
|
||||
public AnalyzePanel() {
|
||||
toolsPanel.setBorder(BorderFactory.createTitledBorder("Tools"));
|
||||
|
||||
setLayout(new MigLayout("insets dialog, gapx 50, fill"));
|
||||
add(fileTreePanel, "grow, sizegroupx column");
|
||||
add(toolsPanel, "grow, sizegroupx column");
|
||||
|
||||
addTool(new ExtractTool());
|
||||
addTool(new TypeTool());
|
||||
addTool(new SplitTool());
|
||||
addTool(new AttributeTool());
|
||||
|
||||
putClientProperty("transferablePolicy", fileTreePanel.getTransferablePolicy());
|
||||
|
||||
fileTreePanel.addPropertyChangeListener("filetree", filetreeListener);
|
||||
}
|
||||
|
||||
private void addTool(Tool<?> tool) {
|
||||
toolsPanel.addTab(tool.getName(), tool);
|
||||
}
|
||||
|
||||
private final PropertyChangeListener filetreeListener = new PropertyChangeListener() {
|
||||
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
fileTreePanel.addPropertyChangeListener("filetree", evt -> {
|
||||
// stopped loading, refresh tools
|
||||
for (int i = 0; i < toolsPanel.getTabCount(); i++) {
|
||||
Tool<?> tool = (Tool<?>) toolsPanel.getComponentAt(i);
|
||||
tool.updateRoot(fileTreePanel.getFileTree().getRoot().getFile());
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
public void addTool(Tool<?> tool) {
|
||||
toolsPanel.addTab(tool.getName(), tool);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,31 +1,33 @@
|
||||
|
||||
package net.filebot.ui.analyze;
|
||||
|
||||
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.JComponent;
|
||||
|
||||
import net.filebot.ResourceManager;
|
||||
import net.filebot.ui.PanelBuilder;
|
||||
|
||||
|
||||
public class AnalyzePanelBuilder implements PanelBuilder {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Analyze";
|
||||
return "Filter";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return ResourceManager.getIcon("panel.analyze");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public JComponent create() {
|
||||
return new AnalyzePanel();
|
||||
AnalyzePanel panel = new AnalyzePanel();
|
||||
panel.addTool(new MediaInfoTool());
|
||||
panel.addTool(new TypeTool());
|
||||
panel.addTool(new SplitTool());
|
||||
panel.addTool(new AttributeTool());
|
||||
panel.addTool(new ExtractTool());
|
||||
return panel;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import net.filebot.ResourceManager;
|
||||
import net.filebot.util.ui.FancyTreeCellRenderer;
|
||||
import net.filebot.util.ui.GradientStyle;
|
||||
|
||||
public class FileTreeCellRenderer extends FancyTreeCellRenderer {
|
||||
class FileTreeCellRenderer extends FancyTreeCellRenderer {
|
||||
|
||||
public FileTreeCellRenderer() {
|
||||
super(GradientStyle.TOP_TO_BOTTOM);
|
||||
|
25
source/net/filebot/ui/analyze/MediaInfoTool.java
Normal file
25
source/net/filebot/ui/analyze/MediaInfoTool.java
Normal file
@ -0,0 +1,25 @@
|
||||
package net.filebot.ui.analyze;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import javax.swing.table.TableModel;
|
||||
|
||||
class MediaInfoTool extends Tool<TableModel> {
|
||||
|
||||
public MediaInfoTool() {
|
||||
super("MediaInfo");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TableModel createModelInBackground(File root) throws InterruptedException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setModel(TableModel model) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -13,14 +13,14 @@ import javax.swing.JComponent;
|
||||
import javax.swing.SwingWorker;
|
||||
import javax.swing.tree.TreeNode;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import net.filebot.ui.analyze.FileTree.FileNode;
|
||||
import net.filebot.ui.analyze.FileTree.FolderNode;
|
||||
import net.filebot.util.ExceptionUtilities;
|
||||
import net.filebot.util.FileUtilities;
|
||||
import net.filebot.util.ui.LoadingOverlayPane;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
abstract class Tool<M> extends JComponent {
|
||||
|
||||
private UpdateModelTask updateTask = null;
|
||||
|
Loading…
Reference in New Issue
Block a user