Changeset 7540
- Timestamp:
- 2004-06-02T17:28:44+12:00 (20 years ago)
- 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 37 37 import org.greenstone.gatherer.util.StaticStrings; 38 38 import org.greenstone.gatherer.util.Utility; 39 import org.greenstone.gatherer.util.WinRegistry;40 39 import org.w3c.dom.*; 41 40 -
trunk/gli/src/org/greenstone/gatherer/gui/EnrichPane.java
r7534 r7540 54 54 import org.greenstone.gatherer.gui.GLIButton; 55 55 import org.greenstone.gatherer.gui.MetaEditPrompt; 56 import org.greenstone.gatherer.gui.TransformCharacterTextField;57 56 import org.greenstone.gatherer.gui.WarningDialog; 58 57 import org.greenstone.gatherer.gui.table.GTableModel; … … 68 67 import org.greenstone.gatherer.util.PatternTokenizer; 69 68 import org.greenstone.gatherer.util.StaticStrings; 70 import org.greenstone.gatherer.util.TableUtils;71 69 import org.greenstone.gatherer.util.TreeSynchronizer; 72 70 import org.greenstone.gatherer.util.Utility; -
trunk/gli/src/org/greenstone/gatherer/gui/GComboBox.java
r6389 r7540 142 142 ((Model)dataModel).clear(); 143 143 } 144 }145 146 public int count() {147 return dataModel.getSize();148 144 } 149 145 -
trunk/gli/src/org/greenstone/gatherer/gui/MirrorPane.java
r7151 r7540 211 211 } 212 212 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 // } 226 226 227 227 /** 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 47 47 import org.greenstone.gatherer.Dictionary; 48 48 import org.greenstone.gatherer.Gatherer; 49 import org.greenstone.gatherer.gui.GComboBox;50 49 import org.greenstone.gatherer.gui.GLIButton; 51 50 import org.greenstone.gatherer.gui.ModalDialog; 52 import org.greenstone.gatherer.gui.NonWhitespaceField;53 51 import org.greenstone.gatherer.gui.OpenCollectionDialog; 54 52 import org.greenstone.gatherer.gui.SimpleMenuBar; 55 import org.greenstone.gatherer.util.TableUtils;56 53 import org.greenstone.gatherer.util.Utility; 57 54 -
trunk/gli/src/org/greenstone/gatherer/msm/ElementWrapper.java
r6549 r7540 209 209 } 210 210 211 public void setHierarchy(boolean value) {212 element.setAttribute(StaticStrings.HIERARCHY_ATTRIBUTE, (value ? StaticStrings.TRUE_STR : StaticStrings.FALSE_STR));213 }214 215 211 public String toString() { 216 212 return getNamespace() + MSMUtils.NS_SEP + getIdentity(); -
trunk/gli/src/org/greenstone/gatherer/msm/MetadataSetManager.java
r7159 r7540 377 377 return all_elements; 378 378 } 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 385 380 /** Retrieve a metadata element by its index. 386 381 * @param index The specified index as an int. … … 477 472 return null; 478 473 } 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 metadata486 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 } */495 474 496 475 /** Retrieve the named metadata set. … … 1020 999 return (loader.searchForMetadata(destination, source, folder_level, dummy_run)?false:true); 1021 1000 } 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 }1037 1001 1038 1002 public final int size() { -
trunk/gli/src/org/greenstone/gatherer/util/TableUtils.java
r6163 r7540 19 19 // somewhat modified. 20 20 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(); 24 24 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); 27 27 28 int longestCell = 0;29 int highestCell = 0;28 // int longestCell = 0; 29 // int highestCell = 0; 30 30 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; 34 34 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); 39 39 40 int width = cell.getPreferredSize().width;41 int height = cell.getPreferredSize().height;40 // int width = cell.getPreferredSize().width; 41 // int height = cell.getPreferredSize().height; 42 42 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 // } 46 46 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); 50 50 51 int headerWidth = headerComp.getPreferredSize().width;52 int headerHeight = headerComp.getPreferredSize().height;51 // int headerWidth = headerComp.getPreferredSize().width; 52 // int headerHeight = headerComp.getPreferredSize().height; 53 53 54 column.setPreferredWidth(Math.max(headerWidth, longestCell));54 // column.setPreferredWidth(Math.max(headerWidth, longestCell)); 55 55 56 int currentHeight = table.getRowHeight();57 int preferredHeight = Math.max(headerHeight, highestCell);56 // int currentHeight = table.getRowHeight(); 57 // int preferredHeight = Math.max(headerHeight, highestCell); 58 58 59 table.setRowHeight(Math.max(currentHeight, preferredHeight));60 }61 }59 // table.setRowHeight(Math.max(currentHeight, preferredHeight)); 60 // } 61 // } 62 62 63 63 /**
Note:
See TracChangeset
for help on using the changeset viewer.