Перенос.

This commit is contained in:
2023-09-17 22:13:42 +03:00
parent dd2e0ca7e0
commit 629d8b8477
1239 changed files with 61161 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
package GlobalData.RemoteFile.UI;
import Common.Current;
import Common.UI.Themes.VisualiserFonts;
import Common.UI.Trees.StyledTreeCellRenderer;
import GlobalData.RemoteFile.RemoteFile;
import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
public class RemoteFileRenderer extends StyledTreeCellRenderer {
public java.awt.Component getTreeCellRendererComponent(
JTree tree, Object value,
boolean selected, boolean expanded,
boolean leaf, int row, boolean hasFocus) {
super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
Object o = ((DefaultMutableTreeNode) value).getUserObject();
if (o instanceof RemoteFile) {
RemoteFile file = (RemoteFile) o;
setText(file.name);
setFont(Current.getTheme().Fonts.get(VisualiserFonts.TreePlain));
if (file.isDirectory())
setIcon(new ImageIcon(getClass().getResource("/icons/Folder.png")));
}
setForeground(tree.getForeground());
return this;
}
}