Changeset 5610
- Timestamp:
- 09/15/08 14:23:49 (2 months ago)
- Location:
- trunk/SRC/org/openmicroscopy/shoola/agents/editor
- Files:
-
- 4 added
- 14 modified
- 1 moved
-
EditorAgent.java (modified) (1 diff)
-
browser/BrowserControl.java (modified) (2 diffs)
-
browser/BrowserUI.java (modified) (1 diff)
-
browser/FieldEditorDisplay.java (modified) (1 diff)
-
browser/paramUIs/editTemplate/AttributeEditArea.java (modified) (1 diff)
-
browser/paramUIs/editTemplate/BooleanTemplate.java (modified) (2 diffs)
-
browser/paramUIs/editTemplate/DateTimeTemplate.java (added)
-
browser/paramUIs/editTemplate/EnumTemplate.java (modified) (1 diff)
-
browser/paramUIs/editTemplate/FieldEditorPanel.java (modified) (1 diff)
-
browser/paramUIs/editTemplate/ParamTemplateUIFactory.java (modified) (2 diffs)
-
browser/paramUIs/editTemplate/TableTemplate.java (added)
-
browser/paramUIs/editTemplate/TimerTemplate.java (added)
-
graphx/eclipse_addTextLine16.png (moved) (moved from trunk/SRC/org/openmicroscopy/shoola/agents/editor/graphx/nuvola_addTextLine16.png)
-
model/params/MutableTableModel.java (modified) (2 diffs)
-
model/undoableEdits/AttributeEdit.java (modified) (1 diff)
-
model/undoableEdits/ChangeParamEdit.java (added)
-
model/undoableEdits/DeleteFieldsEdit.java (modified) (2 diffs)
-
view/EditorComponent.java (modified) (1 diff)
-
view/EditorFactory.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/org/openmicroscopy/shoola/agents/editor/EditorAgent.java
r5588 r5610 155 155 handleFileEdition((EditFileEvent) e); 156 156 } 157 158 /** 159 * This was an attempted shortcut to directly start OMERO.editor 160 * without Insight and a server connection. 161 * However, I get a NPE becuase there is no Registry! 162 * 163 * @param args 164 */ 165 public static void main(String[] args) { 166 167 File testFile = new File 168 ("/Users/will/xmlProtocols/demoForRelease/AllFields.pro.xml"); 169 /* 170 Editor editor = EditorFactory.getEditor(testFile); 171 172 if (editor != null) { 173 editor.setFileToEdit(testFile); 174 } 175 */ 176 177 } 157 178 } -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/BrowserControl.java
r5608 r5610 51 51 import org.openmicroscopy.shoola.agents.editor.model.IAttributes; 52 52 import org.openmicroscopy.shoola.agents.editor.model.IField; 53 import org.openmicroscopy.shoola.agents.editor.model.params.IParam; 53 54 import org.openmicroscopy.shoola.agents.editor.model.undoableEdits.AddParamEdit; 54 55 import org.openmicroscopy.shoola.agents.editor.model.undoableEdits.AttributeEdit; 55 56 import org.openmicroscopy.shoola.agents.editor.model.undoableEdits.AttributesEdit; 57 import org.openmicroscopy.shoola.agents.editor.model.undoableEdits.ChangeParamEdit; 56 58 57 59 … … 257 259 } 258 260 } 261 262 /** 263 * Edits a field by creating and adding a new Parameter. 264 * 265 * @param field The field to add a new parameter to. 266 * @param paramType A string defining the type of parameter to add. 267 * @param tree The JTree to refresh with undo/redo 268 * @param node The node to highlight / refresh with undo/redo. 269 */ 270 public void changeParam(IField field, IParam param, int index, 271 JTree tree, TreeNode node) { 272 273 UndoableEdit edit = new ChangeParamEdit(param, field, index, 274 tree, node); 275 undoSupport.postEdit(edit); 276 } 259 277 } -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/BrowserUI.java
r5600 r5610 130 130 add(leftSplitPane, BorderLayout.CENTER); 131 131 132 //add(new ToolBar(controller, treeDisplay), BorderLayout.NORTH);132 add(new ToolBar(controller, treeDisplay), BorderLayout.NORTH); 133 133 } 134 134 -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/FieldEditorDisplay.java
r5601 r5610 48 48 49 49 /** 50 * A container to display a FieldEditorPanel for the currently highlighted51 * field of the JTree.50 * A container to display a {@link FieldEditorPanel} for the currently 51 * highlighted field of the JTree. 52 52 * 53 53 * @author William Moore -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/paramUIs/editTemplate/AttributeEditArea.java
r5597 r5610 163 163 } 164 164 165 /** 166 * This allows other classes to manipulate the text box, to set cols or 167 * set Text etc. 168 * 169 * @return The Text Area used by this UI for editing text 170 */ 171 public JTextArea getTextArea() { return textBox; } 165 172 166 173 /** -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/paramUIs/editTemplate/BooleanTemplate.java
r5608 r5610 74 74 } 75 75 76 76 /** 77 * Creates an instance. 78 * 79 * @param param The parameter in which to edit the default boolean value 80 */ 77 81 public BooleanTemplate(IAttributes param) 78 82 { … … 82 86 } 83 87 84 88 /** 89 * Implemented as specified by the {@link ITreeEditComp} interface. 90 * 91 * @see {@link ITreeEditComp#getEditDisplayName() 92 */ 85 93 public String getEditDisplayName() { 86 // TODO Auto-generated method stub 87 return null; 94 return "Checkbox default"; 88 95 } 89 96 -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/paramUIs/editTemplate/EnumTemplate.java
r5608 r5610 110 110 } 111 111 112 public String getEditDisplayName() { 113 return "Drop-down options"; 114 } 112 /** 113 * Implemented as specified by the {@link ITreeEditComp} interface. 114 * 115 * @see {@link ITreeEditComp#getEditDisplayName() 116 */ 117 public String getEditDisplayName() { return "Drop-down options"; } 115 118 116 119 /** -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/paramUIs/editTemplate/FieldEditorPanel.java
r5608 r5610 297 297 private void paramTypeChanged(String newType) { 298 298 299 if (field.getParamCount() > 0) { 300 IParam oldParam = field.getParamAt(0); 301 field.removeParam(oldParam); 302 } 303 IParam newParam = FieldParamsFactory.getFieldParam(newType); 304 field.addParam(0, newParam); 305 306 /* refresh this node in the JTree, and rebuild this panel*/ 307 updateEditingOfTreeNode(); 308 rebuildEditorPanel(); 299 int paramIndex = 0; 300 301 IParam newParam = null; 302 if (newType != null) 303 newParam = FieldParamsFactory.getFieldParam(newType); 304 305 // if newParam is null, this will simply remove first parameter 306 controller.changeParam(field, newParam, paramIndex, 307 tree, treeNode); 309 308 } 310 309 -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/paramUIs/editTemplate/ParamTemplateUIFactory.java
r5608 r5610 37 37 import org.openmicroscopy.shoola.agents.editor.model.DataFieldConstants; 38 38 import org.openmicroscopy.shoola.agents.editor.model.params.AbstractParam; 39 import org.openmicroscopy.shoola.agents.editor.model.params.DateTimeParam; 39 40 import org.openmicroscopy.shoola.agents.editor.model.params.IParam; 40 41 import org.openmicroscopy.shoola.agents.editor.model.params.SingleParam; 42 import org.openmicroscopy.shoola.agents.editor.model.params.TableParam; 43 import org.openmicroscopy.shoola.agents.editor.model.params.TimeParam; 41 44 42 45 /** … … 86 89 } 87 90 91 if (inputType.equals(DateTimeParam.DATE_TIME_PARAM)) { 92 return new DateTimeTemplate(paramObject); 93 } 94 95 if (inputType.equals(TableParam.TABLE_PARAM)) { 96 return new TableTemplate(paramObject); 97 } 98 99 if (inputType.equals(TimeParam.TIME_PARAM)) { 100 return new TimerTemplate(paramObject); 101 } 102 88 103 if (inputType.equals(SingleParam.NUMBER_PARAM)) { 89 104 return new NumberTemplate(paramObject); -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/model/params/MutableTableModel.java
r5594 r5610 75 75 return columnNames.get(column); 76 76 } 77 78 /** 79 * Sets the name of the column at the specified index. 80 * If the column index is too high (too few columns) then 81 * a new column is created. 82 * Either way, {@link #fireTableStructureChanged()} is called 83 * to notify the Table that the model has changed. 84 * 85 * @param columnIndex The index of the column 86 * @param name The new name for the column 87 */ 88 public void setColumnName(int columnIndex, String name) 89 { 90 if (columnIndex >= getColumnCount()) { 91 addEmptyColumn(name); 92 } else { 93 columnNames.remove(columnIndex); 94 columnNames.add(columnIndex, name); 95 } 96 } 77 97 78 98 /** … … 231 251 for (int i=rowIndecies.length-1; i>-1; i--) { 232 252 int rowToRemove = rowIndecies[i]; 233 System.out.println("InteractiveTableModel Removing row " + rowToRemove);234 253 data.remove(rowToRemove); 235 254 fireTableRowsDeleted(rowToRemove, rowToRemove); -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/model/undoableEdits/AttributeEdit.java
r5601 r5610 128 128 if ((tree != null) && (node != null)) { 129 129 130 DefaultMutableTreeNode dmtNode = (DefaultMutableTreeNode)node;131 132 130 DefaultTreeModel treeModel = (DefaultTreeModel)tree.getModel(); 133 131 treeModel.nodeChanged(node); -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/model/undoableEdits/DeleteFieldsEdit.java
r5594 r5610 32 32 import javax.swing.tree.TreePath; 33 33 34 import org.openmicroscopy.shoola.agents.editor.model.TreeModelMethods;35 36 34 //Third-party libraries 37 35 38 36 //Application-internal dependencies 37 38 import org.openmicroscopy.shoola.agents.editor.model.TreeModelMethods; 39 39 40 40 /** … … 51 51 */ 52 52 public class DeleteFieldsEdit 53 extends UndoableTreeEdit { 53 extends UndoableTreeEdit 54 { 54 55 55 56 /** -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/view/EditorComponent.java
r5588 r5610 166 166 public void setFileToEdit(File file) 167 167 { 168 if ( model.getState() != LOADING)168 if ((model.getState() != LOADING) && (model.getState() != NEW)) 169 169 throw new IllegalStateException("This method should only be " + 170 "invoked in the LOADING state.");170 "invoked in the LOADING or NEW states."); 171 171 172 172 model.setFileToEdit(file); -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/view/EditorFactory.java
r5588 r5610 75 75 { 76 76 EditorModel model = new EditorModel(fileName, fileID, fileSize); 77 return singleton.getEditor(model); 78 } 79 80 /** 81 * Returns the {@link Editor}. 82 * 83 * @param file The file to open in Editor. 84 * @return See above. 85 */ 86 public static Editor getEditor(File file) 87 { 88 EditorModel model = new EditorModel(file); 77 89 return singleton.getEditor(model); 78 90 }
