Changeset 5614
- Timestamp:
- 09/16/08 13:04:22 (2 months ago)
- Location:
- trunk/SRC/org/openmicroscopy/shoola/agents/editor
- Files:
-
- 14 modified
-
EditorAgent.java (modified) (2 diffs)
-
browser/paramUIs/EnumEditor.java (modified) (1 diff)
-
browser/paramUIs/NumberEditor.java (modified) (1 diff)
-
browser/paramUIs/TextBoxEditor.java (modified) (1 diff)
-
browser/paramUIs/editTemplate/AttributeEditArea.java (modified) (2 diffs)
-
browser/paramUIs/editTemplate/AttributeEditLine.java (modified) (1 diff)
-
browser/paramUIs/editTemplate/EnumTemplate.java (modified) (3 diffs)
-
browser/paramUIs/editTemplate/FieldEditorPanel.java (modified) (1 diff)
-
browser/paramUIs/editTemplate/ParamTemplateUIFactory.java (modified) (2 diffs)
-
view/EditorComponent.java (modified) (1 diff)
-
view/EditorControl.java (modified) (3 diffs)
-
view/EditorFactory.java (modified) (3 diffs)
-
view/EditorModel.java (modified) (2 diffs)
-
view/EditorUI.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/org/openmicroscopy/shoola/agents/editor/EditorAgent.java
r5613 r5614 100 100 101 101 /** 102 * Creates or recycles an editor. 103 * @param event The event to handle. 102 * Creates a {@link Editor#NEW} editor with no file, or recycles an editor. 104 103 */ 105 private void handleShowEditor( ShowEditorEvent event)104 private void handleShowEditor() 106 105 { 106 Editor editor = EditorFactory.getEditor(); 107 if (editor != null) { 108 editor.activate(); 109 } 107 110 } 108 111 … … 166 169 167 170 if (e instanceof ShowEditorEvent) 168 handleShowEditor( (ShowEditorEvent) e);171 handleShowEditor(); 169 172 } 170 173 -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/paramUIs/EnumEditor.java
r5601 r5614 36 36 37 37 import org.openmicroscopy.shoola.agents.editor.model.IAttributes; 38 import org.openmicroscopy.shoola.agents.editor.model.params.IParam;39 38 import org.openmicroscopy.shoola.agents.editor.model.params.SingleParam; 40 39 import org.openmicroscopy.shoola.agents.editor.uiComponents.CustomComboBox; -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/paramUIs/NumberEditor.java
r5588 r5614 64 64 private void buildUI() 65 65 { 66 TextFieldEditor numberField = new TextFieldEditor( (IParam)getParameter(),66 TextFieldEditor numberField = new TextFieldEditor(getParameter(), 67 67 SingleParam.PARAM_VALUE); 68 68 numberField.addPropertyChangeListener(ITreeEditComp.VALUE_CHANGED_PROPERTY, -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/paramUIs/TextBoxEditor.java
r5596 r5614 40 40 41 41 import org.openmicroscopy.shoola.agents.editor.model.IAttributes; 42 import org.openmicroscopy.shoola.agents.editor.model.params.IParam;43 42 import org.openmicroscopy.shoola.agents.editor.model.params.SingleParam; 44 43 import org.openmicroscopy.shoola.agents.editor.uiComponents.CustomLabel; -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/paramUIs/editTemplate/AttributeEditArea.java
r5610 r5614 26 26 27 27 import java.awt.BorderLayout; 28 import java.awt.Dimension;29 28 30 29 import javax.swing.BorderFactory; 31 import javax.swing.JScrollPane;32 30 import javax.swing.JTextArea; 33 31 import javax.swing.border.Border; 34 32 import javax.swing.event.DocumentEvent; 35 33 import javax.swing.event.DocumentListener; 36 import javax.swing.text.BadLocationException;37 34 38 35 //Third-party libraries … … 43 40 import org.openmicroscopy.shoola.agents.editor.browser.paramUIs.AttributeEditListeners; 44 41 import org.openmicroscopy.shoola.agents.editor.model.IAttributes; 45 import org.openmicroscopy.shoola.agents.editor.model.params.IParam;46 42 import org.openmicroscopy.shoola.agents.editor.model.params.SingleParam; 47 43 import org.openmicroscopy.shoola.agents.editor.uiComponents.CustomLabel; -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/paramUIs/editTemplate/AttributeEditLine.java
r5597 r5614 41 41 import org.openmicroscopy.shoola.agents.editor.browser.paramUIs.TextFieldEditor; 42 42 import org.openmicroscopy.shoola.agents.editor.model.IAttributes; 43 import org.openmicroscopy.shoola.agents.editor.model.params.IParam;44 import org.openmicroscopy.shoola.agents.editor.model.params.SingleParam;45 43 import org.openmicroscopy.shoola.agents.editor.uiComponents.CustomLabel; 46 44 -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/paramUIs/editTemplate/EnumTemplate.java
r5610 r5614 23 23 package org.openmicroscopy.shoola.agents.editor.browser.paramUIs.editTemplate; 24 24 25 //Java imports 26 25 27 import java.awt.BorderLayout; 26 import java.awt.event.ActionEvent;27 import java.awt.event.ActionListener;28 28 import java.beans.PropertyChangeEvent; 29 29 import java.beans.PropertyChangeListener; 30 30 import java.util.HashMap; 31 31 32 import javax.swing.BoxLayout; 33 import javax.swing.JComboBox; 32 //Third-party libraries 33 34 //Application-internal dependencies 34 35 35 36 import org.openmicroscopy.shoola.agents.editor.browser.paramUIs.AbstractParamEditor; … … 38 39 import org.openmicroscopy.shoola.agents.editor.model.IAttributes; 39 40 import org.openmicroscopy.shoola.agents.editor.model.params.SingleParam; 40 import org.openmicroscopy.shoola.agents.editor.uiComponents.CustomComboBox;41 41 import org.openmicroscopy.shoola.agents.editor.uiComponents.CustomLabel; 42 42 43 //Java imports44 45 //Third-party libraries46 47 //Application-internal dependencies48 49 43 /** 50 * 44 * This is the UI component for editing the "Template" of an Enumeration 45 * Parameter. 46 * It includes a text box for entering a comma-delimited list of options, and 47 * a comboBox for choosing the default option. 51 48 * 52 49 * @author William Moore … … 63 60 { 64 61 62 /** 63 * The text box for entering a list of comma-delimited options. 64 */ 65 65 private AttributeEditArea optionsFieldEditor; 66 66 67 /** 68 * A comboBox for selecting the default option. 69 */ 67 70 private AbstractParamEditor defaultValueComboBox; 68 71 -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/paramUIs/editTemplate/FieldEditorPanel.java
r5610 r5614 377 377 378 378 else if (newVal instanceof HashMap) { 379 HashMap newVals = (HashMap)newVal;379 HashMap<String,String> newVals = (HashMap)newVal; 380 380 controller.editAttributes(param, displayName, newVals, 381 381 tree, treeNode); -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/paramUIs/editTemplate/ParamTemplateUIFactory.java
r5610 r5614 27 27 28 28 import javax.swing.JComponent; 29 import javax.swing.JPanel;30 29 31 30 //Third-party libraries … … 33 32 //Application-internal dependencies 34 33 35 import org.openmicroscopy.shoola.agents.editor.browser.paramUIs.DateTimeField;36 import org.openmicroscopy.shoola.agents.editor.browser.paramUIs.TextBoxEditor;37 34 import org.openmicroscopy.shoola.agents.editor.model.DataFieldConstants; 38 35 import org.openmicroscopy.shoola.agents.editor.model.params.AbstractParam; -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/view/EditorComponent.java
r5613 r5614 107 107 switch (state) { 108 108 case NEW: 109 model.fireFileLoading(); 110 fireStateChange(); 111 //view.setOnScreen(); // called by EditorUI initialize() 109 if (model.getFileID() != 0) { 110 model.fireFileLoading(); 111 fireStateChange(); 112 //view.setOnScreen(); // called by EditorUI initialize() 113 } 114 else { 115 view.deIconify(); 116 } 112 117 break; 113 118 case DISCARDED: -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/view/EditorControl.java
r5613 r5614 22 22 */ 23 23 package org.openmicroscopy.shoola.agents.editor.view; 24 25 26 24 27 25 //Java imports … … 47 45 import org.openmicroscopy.shoola.agents.editor.actions.EditorAction; 48 46 import org.openmicroscopy.shoola.agents.editor.actions.OpenLocalFileAction; 49 import org.openmicroscopy.shoola.agents.editor.browser.Browser;50 47 51 48 /** … … 224 221 */ 225 222 public void propertyChange(PropertyChangeEvent evt) { 226 String name = evt.getPropertyName();223 //String name = evt.getPropertyName(); 227 224 228 225 -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/view/EditorFactory.java
r5613 r5614 22 22 */ 23 23 package org.openmicroscopy.shoola.agents.editor.view; 24 25 26 24 27 25 //Java imports … … 87 85 { 88 86 EditorModel model = new EditorModel(file); 87 89 88 return singleton.getEditor(model); 89 } 90 91 /** 92 * If no editors exist, this returns a new {@link Editor}, 93 * with an {@link EditorModel} that has no file. 94 * Otherwise, it simply returns the first editor in the {@link #editors} list. 95 * 96 * @return See above. 97 */ 98 public static Editor getEditor() 99 { 100 EditorModel model; 101 Editor editor; 102 if (singleton.editors.isEmpty()) { 103 model = new EditorModel(); 104 editor = singleton.getEditor(model); 105 editor.setStatus("", true); 106 } else { 107 Editor e = singleton.editors.iterator().next(); 108 model = ((EditorComponent)e).getModel(); 109 editor = singleton.getEditor(model); 110 } 111 return editor; 90 112 } 91 113 … … 158 180 (comp.getModel().getFileName().equals(model.getFileName()))) 159 181 return comp; 182 if (comp.getModel().getFileName().equals("")) { 183 return comp; 184 } 160 185 } 161 186 comp = new EditorComponent(model); // creates View and Controller -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/view/EditorModel.java
r5590 r5614 107 107 * Creates a new instance and sets the state to {@link Editor#NEW}. 108 108 * {@link #fileSize} and {@link #fileID} are not set. 109 * File is not opened. To do this, call {@link Editor#setFileToEdit(File)} 109 110 * 110 111 * @param file The file to open. Sets the {@link #fileName} to the 111 * name of this file .112 * name of this file but does not open file. 112 113 */ 113 114 EditorModel(File file) 114 115 { 115 116 if (file == null) throw new NullPointerException("No file."); 116 if (! file.exists()) return;117 117 118 118 state = Editor.NEW; 119 119 this.fileName = file.getName(); 120 } 121 122 /** 123 * Creates a new instance and sets the state to {@link Editor#NEW}. 124 * {@link #fileSize} and {@link #fileID} are not set. 125 * 126 */ 127 EditorModel() 128 { 129 state = Editor.NEW; 130 this.fileName = ""; 120 131 } 121 132 … … 201 212 { 202 213 fileToEdit = file; 214 fileName = file.getName(); 203 215 TreeModel treeModel = TreeModelFactory.getTree(file); 204 216 browser.setTreeModel(treeModel); -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/view/EditorUI.java
r5613 r5614 26 26 import java.awt.BorderLayout; 27 27 import java.awt.Container; 28 import java.awt.Dimension;29 import java.awt.Toolkit;30 28 31 29 import javax.swing.JMenu; … … 100 98 Container c = getContentPane(); 101 99 c.setLayout(new BorderLayout(0, 0)); 102 // c.add(toolBar, BorderLayout.NORTH);100 //c.add(toolBar, BorderLayout.NORTH); 103 101 104 102 c.add(statusBar, BorderLayout.SOUTH);
