Ignore:
Timestamp:
2003-11-20T11:19:13+13:00 (21 years ago)
Author:
jmt12
Message:

Renderer now uses different icons for files which already exist in the currently open collection (if any)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/gui/tree/DragTreeCellRenderer.java

    r5886 r5915  
    4343import org.greenstone.gatherer.Gatherer;
    4444import org.greenstone.gatherer.file.FileNode;
     45import org.greenstone.gatherer.util.StaticStrings;
    4546import org.greenstone.gatherer.util.Utility;
    4647
     
    5253    private Color selection_foreground;
    5354     
    54     static final private ImageIcon GRAY_FOLDER = Utility.getImage("greyfolder.gif");
    55     //static final private ImageIcon GREEN_FILE = Utility.getImage("greenfile.gif");
    56     //static final private ImageIcon GREEN_FOLDER = Utility.getImage("greenfolder.gif");
    57     static final private String PREFIX = " [";
    58     static final private String SUFFIX = "]";
     55    static final private ImageIcon GREY_FOLDER = Utility.getImage("greyfolder.gif", true);
     56    static final private ImageIcon GREEN_FILE = Utility.getImage("greenfile.gif", true);
     57    static final private ImageIcon GREEN_FOLDER = Utility.getImage("greenfolder.gif", true);
    5958
    6059    public DragTreeCellRenderer() {
    6160    super();
     61    // Have to wait until this image is loaded
    6262    selection_background = getBackgroundSelectionColor();
    6363    selection_foreground = getTextSelectionColor();
     
    7777        String new_value = null;
    7878        if(Gatherer.config.get("general.show_file_size", Configuration.COLLECTION_SPECIFIC) && node.getFile() != null && !node.getAllowsChildren()) {
    79         new_value = node.toString() + PREFIX + Utility.formatFileLength(node.getFile().length()) + SUFFIX;
     79        new_value = node.toString() + StaticStrings.LBRACKET_CHARACTER + Utility.formatFileLength(node.getFile().length()) + StaticStrings.RBRACKET_CHARACTER;
    8080        }
    8181        else {
     
    8686
    8787        if(node.getFile() == null || node.isFileSystemRoot()) {
    88         ((JLabel)tree_cell).setIcon(GRAY_FOLDER);
     88        ((JLabel)tree_cell).setIcon(GREY_FOLDER);
    8989        }
    90         //else if(node.isInCurrentCollection()) {
    91         //if(!node.getFile().isFile()) {
    92         //    ((JLabel)tree_cell).setIcon(GREEN_FOLDER);
    93         //}
    94         //else {
    95         //    ((JLabel)tree_cell).setIcon(GREEN_FILE);
    96         //}
    97         //}
     90        else if(node.isInCurrentCollection()) {
     91        if(!node.getFile().isFile()) {
     92            ((JLabel)tree_cell).setIcon(GREEN_FOLDER);
     93        }
     94        else {
     95            ((JLabel)tree_cell).setIcon(GREEN_FILE);
     96        }
     97        }
    9898    }
    9999    else {
Note: See TracChangeset for help on using the changeset viewer.