Changeset 7540


Ignore:
Timestamp:
2004-06-02T17:28:44+12:00 (20 years ago)
Author:
mdewsnip
Message:

Some minor tidy ups with removing dead code.

Location:
trunk/gli/src/org/greenstone/gatherer
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/file/FileAssociationManager.java

    r7516 r7540  
    3737import org.greenstone.gatherer.util.StaticStrings;
    3838import org.greenstone.gatherer.util.Utility;
    39 import org.greenstone.gatherer.util.WinRegistry;
    4039import org.w3c.dom.*;
    4140
  • trunk/gli/src/org/greenstone/gatherer/gui/EnrichPane.java

    r7534 r7540  
    5454import org.greenstone.gatherer.gui.GLIButton;
    5555import org.greenstone.gatherer.gui.MetaEditPrompt;
    56 import org.greenstone.gatherer.gui.TransformCharacterTextField;
    5756import org.greenstone.gatherer.gui.WarningDialog;
    5857import org.greenstone.gatherer.gui.table.GTableModel;
     
    6867import org.greenstone.gatherer.util.PatternTokenizer;
    6968import org.greenstone.gatherer.util.StaticStrings;
    70 import org.greenstone.gatherer.util.TableUtils;
    7169import org.greenstone.gatherer.util.TreeSynchronizer;
    7270import org.greenstone.gatherer.util.Utility;
  • trunk/gli/src/org/greenstone/gatherer/gui/GComboBox.java

    r6389 r7540  
    142142        ((Model)dataModel).clear();
    143143    }
    144     }
    145 
    146     public int count() {
    147     return dataModel.getSize();
    148144    }
    149145
  • trunk/gli/src/org/greenstone/gatherer/gui/MirrorPane.java

    r7151 r7540  
    211211    }
    212212
    213     public void setURL(String url) {
    214     url_field.setText(url);
    215     }
    216 
    217 
    218     static public FileNode getWebCacheMapping()
    219     {
    220     if (Gatherer.config.get("workflow.mirror", true) || Gatherer.config.get("workflow.mirror", false)) {
    221         /* @todo - add to dictionary */
    222         return new FileNode(Utility.getCacheDir(), "Mirroring.Mirror_Cache");
    223     }
    224     return null;
    225     }
     213//      public void setURL(String url) {
     214//      url_field.setText(url);
     215//      }
     216
     217
     218//      static public FileNode getWebCacheMapping()
     219//      {
     220//      if (Gatherer.config.get("workflow.mirror", true) || Gatherer.config.get("workflow.mirror", false)) {
     221//          /* @todo - add to dictionary */
     222//          return new FileNode(Utility.getCacheDir(), "Mirroring.Mirror_Cache");
     223//      }
     224//      return null;
     225//      }
    226226
    227227    /** A DepthEntry contains a depth value, as an int, and a representitive text string. This allows for a more meaningful appearance than '0' for instance. */
  • trunk/gli/src/org/greenstone/gatherer/gui/PreviewCommandDialog.java

    r7151 r7540  
    4747import org.greenstone.gatherer.Dictionary;
    4848import org.greenstone.gatherer.Gatherer;
    49 import org.greenstone.gatherer.gui.GComboBox;
    5049import org.greenstone.gatherer.gui.GLIButton;
    5150import org.greenstone.gatherer.gui.ModalDialog;
    52 import org.greenstone.gatherer.gui.NonWhitespaceField;
    5351import org.greenstone.gatherer.gui.OpenCollectionDialog;
    5452import org.greenstone.gatherer.gui.SimpleMenuBar;
    55 import org.greenstone.gatherer.util.TableUtils;
    5653import org.greenstone.gatherer.util.Utility;
    5754
  • trunk/gli/src/org/greenstone/gatherer/msm/ElementWrapper.java

    r6549 r7540  
    209209    }
    210210
    211     public void setHierarchy(boolean value) {
    212     element.setAttribute(StaticStrings.HIERARCHY_ATTRIBUTE, (value ? StaticStrings.TRUE_STR : StaticStrings.FALSE_STR));
    213     }
    214 
    215211    public String toString() {
    216212    return getNamespace() + MSMUtils.NS_SEP + getIdentity();
  • trunk/gli/src/org/greenstone/gatherer/msm/MetadataSetManager.java

    r7159 r7540  
    377377    return all_elements;
    378378    }
    379     /** Returns all the elements within this set as a combobox model.
    380      * @return A MetadataComboBoxModel containing all the metadata elements from all the sets, with namespacing.
    381      */
    382     public MetadataComboBoxModel getElementModel() {
    383     return new MetadataComboBoxModel(this);
    384     }
     379
    385380    /** Retrieve a metadata element by its index.
    386381     * @param index The specified index as an int.
     
    477472    return null;
    478473    }
    479     /** Get all of the metadata elements as an array of nodelists.
    480      * @return A NodeList[] of metadata elements.
    481      */
    482     /* private NodeList[] getNodeLists() {
    483     NodeList elements[] = null;
    484     int index = 0;
    485     elements = new NodeList[getSets().size()]; // Remember not to count hidden metadata
    486     for(Enumeration keys = mds_hashtable.keys(); keys.hasMoreElements(); ) {
    487         MetadataSet mds = (MetadataSet)mds_hashtable.get(keys.nextElement());
    488         if(!mds.getNamespace().equals(HIDDEN)) {
    489         elements[index] = mds.getElements();
    490         index++;
    491         }
    492     }
    493     return elements;
    494     } */
    495474
    496475    /** Retrieve the named metadata set.
     
    1020999    return (loader.searchForMetadata(destination, source, folder_level, dummy_run)?false:true);
    10211000    }
    1022     /** Build a vector of all the metadata sets that contain an element with the given name.
    1023      * @param name The name of an element as a String.
    1024      * @return A Vector of metadata sets.
    1025      * @see MSMPrompt (org.greenstone.gatherer.msm.MSMPrompt#selectSet)
    1026      */
    1027     public Vector setsThatContain(String name) {
    1028     Vector result = new Vector();
    1029     for(Enumeration keys = mds_hashtable.keys(); keys.hasMoreElements(); ) {
    1030         MetadataSet set = (MetadataSet) mds_hashtable.get(keys.nextElement());
    1031         if(set.getElement(name) != null) {
    1032         result.add(set);
    1033         }
    1034     }
    1035     return result;
    1036     }
    10371001
    10381002    public final int size() {
  • trunk/gli/src/org/greenstone/gatherer/util/TableUtils.java

    r6163 r7540  
    1919  // somewhat modified.
    2020
    21   public static void setPreferredCellSizes(JTable table) {
    22     TableModel model = table.getModel();
    23     TableColumnModel colModel = table.getColumnModel();
     21//    public static void setPreferredCellSizes(JTable table) {
     22//      TableModel model = table.getModel();
     23//      TableColumnModel colModel = table.getColumnModel();
    2424
    25     for (int i = 0; i < model.getColumnCount(); i++) {
    26       TableColumn column = colModel.getColumn(i);
     25//      for (int i = 0; i < model.getColumnCount(); i++) {
     26//        TableColumn column = colModel.getColumn(i);
    2727
    28       int longestCell = 0;
    29       int highestCell = 0;
     28//        int longestCell = 0;
     29//        int highestCell = 0;
    3030
    31       for (int j = 0; j < model.getRowCount(); j++) {
    32         Object value = model.getValueAt(j, i);
    33         if (value == null) continue;
     31//        for (int j = 0; j < model.getRowCount(); j++) {
     32//          Object value = model.getValueAt(j, i);
     33//          if (value == null) continue;
    3434
    35         Component cell =
    36           table.getDefaultRenderer(model.getColumnClass(i)).
    37           getTableCellRendererComponent(table, value,
    38                                         false, false, j, i);
     35//          Component cell =
     36//            table.getDefaultRenderer(model.getColumnClass(i)).
     37//            getTableCellRendererComponent(table, value,
     38//                                          false, false, j, i);
    3939
    40         int width = cell.getPreferredSize().width;
    41         int height = cell.getPreferredSize().height;
     40//          int width = cell.getPreferredSize().width;
     41//          int height = cell.getPreferredSize().height;
    4242
    43         if (width > longestCell) longestCell = width;         
    44         if (height > highestCell) highestCell = height;
    45       }
     43//          if (width > longestCell) longestCell = width;         
     44//          if (height > highestCell) highestCell = height;
     45//        }
    4646
    47       Component headerComp = column.getHeaderRenderer().
    48         getTableCellRendererComponent(table, column.getHeaderValue(),
    49                                       false, false, 0, 0);
     47//        Component headerComp = column.getHeaderRenderer().
     48//          getTableCellRendererComponent(table, column.getHeaderValue(),
     49//                                        false, false, 0, 0);
    5050
    51       int headerWidth = headerComp.getPreferredSize().width;
    52       int headerHeight = headerComp.getPreferredSize().height;
     51//        int headerWidth = headerComp.getPreferredSize().width;
     52//        int headerHeight = headerComp.getPreferredSize().height;
    5353
    54       column.setPreferredWidth(Math.max(headerWidth, longestCell));
     54//        column.setPreferredWidth(Math.max(headerWidth, longestCell));
    5555
    56       int currentHeight = table.getRowHeight();
    57       int preferredHeight = Math.max(headerHeight, highestCell);
     56//        int currentHeight = table.getRowHeight();
     57//        int preferredHeight = Math.max(headerHeight, highestCell);
    5858
    59       table.setRowHeight(Math.max(currentHeight, preferredHeight));
    60     }
    61   }                                                                   
     59//        table.setRowHeight(Math.max(currentHeight, preferredHeight));
     60//      }
     61//    }                                                                   
    6262
    6363  /**
Note: See TracChangeset for help on using the changeset viewer.