Changeset 5613
- Timestamp:
- 09/16/08 10:01:41 (2 months ago)
- Location:
- trunk/SRC/org/openmicroscopy/shoola/agents
- Files:
-
- 3 added
- 9 modified
-
editor/EditorAgent.java (modified) (4 diffs)
-
editor/IconManager.java (modified) (2 diffs)
-
editor/actions/OpenLocalFileAction.java (added)
-
editor/browser/BrowserUI.java (modified) (1 diff)
-
editor/graphx/nuvola_folder_open16.png (added)
-
editor/view/Editor.java (modified) (1 diff)
-
editor/view/EditorComponent.java (modified) (3 diffs)
-
editor/view/EditorControl.java (modified) (3 diffs)
-
editor/view/EditorFactory.java (modified) (1 diff)
-
editor/view/EditorToolBar.java (modified) (1 diff)
-
editor/view/EditorUI.java (modified) (2 diffs)
-
events/editor/ShowEditorEvent.java (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/org/openmicroscopy/shoola/agents/editor/EditorAgent.java
r5610 r5613 35 35 import org.openmicroscopy.shoola.agents.editor.view.EditorFactory; 36 36 import org.openmicroscopy.shoola.agents.events.editor.EditFileEvent; 37 import org.openmicroscopy.shoola.agents.events.editor.ShowEditorEvent; 37 38 import org.openmicroscopy.shoola.env.Agent; 38 39 import org.openmicroscopy.shoola.env.LookupNames; … … 98 99 } 99 100 101 /** 102 * Creates or recycles an editor. 103 * @param event The event to handle. 104 */ 105 private void handleShowEditor(ShowEditorEvent event) 106 { 107 } 108 100 109 /** Creates a new instance. */ 101 110 public EditorAgent() {} … … 122 131 EventBus bus = registry.getEventBus(); 123 132 bus.register(this, EditFileEvent.class); 133 bus.register(this, ShowEditorEvent.class); 124 134 } 125 135 … … 154 164 if (e instanceof EditFileEvent) 155 165 handleFileEdition((EditFileEvent) e); 166 167 if (e instanceof ShowEditorEvent) 168 handleShowEditor((ShowEditorEvent) e); 156 169 } 157 170 -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/IconManager.java
r5596 r5613 222 222 public static int CONFIGURE_ICON = 51; 223 223 224 /** The <code>Open Folder</code> icon. */ 225 public static int OPEN_FOLDER = 52; 226 224 227 /** 225 228 * The maximum ID used for the icon IDs. 226 229 * Allows to correctly build arrays for direct indexing. 227 230 */ 228 private static int MAX_ID = 5 1;231 private static int MAX_ID = 52; 229 232 230 233 /** Paths of the icon files. */ … … 290 293 relPaths[DELETE_ICON] = "nuvola_cancel16.png"; 291 294 relPaths[CONFIGURE_ICON] = "nuvola_package_utilities16.png"; 295 relPaths[OPEN_FOLDER] = "nuvola_folder_open16.png"; 292 296 } 293 297 -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/BrowserUI.java
r5610 r5613 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/view/Editor.java
r5588 r5613 119 119 */ 120 120 public Browser getBrowser(); 121 122 /** 123 * Opens a file that exists on the local machine. 124 * (The file is "in hand", not on the server) 125 * 126 * @param file The file to open in a new Editor window. 127 */ 128 public void openLocalFile(File file); 121 129 } -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/view/EditorComponent.java
r5610 r5613 30 30 //Application-internal dependencies 31 31 import org.openmicroscopy.shoola.agents.editor.browser.Browser; 32 import org.openmicroscopy.shoola.util.ui.UIUtilities;33 32 import org.openmicroscopy.shoola.util.ui.component.AbstractComponent; 34 33 … … 110 109 model.fireFileLoading(); 111 110 fireStateChange(); 112 //UIUtilities.centerAndShow(view); 113 view.setOnScreen(); 111 //view.setOnScreen(); // called by EditorUI initialize() 114 112 break; 115 113 case DISCARDED: … … 196 194 return model.getBrowser(); 197 195 } 196 197 /** 198 * Implemented as specified by the {@link Editor} interface. 199 * @see Editor#openLocalFile(File file) 200 */ 201 public void openLocalFile(File file) { 202 203 Editor editor = EditorFactory.getEditor(file); 204 205 if (editor != null) { 206 if (editor.getState() == Editor.NEW) 207 editor.setFileToEdit(file); 208 209 editor.activate(); 210 } 211 } 198 212 } -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/view/EditorControl.java
r5596 r5613 46 46 import org.openmicroscopy.shoola.agents.editor.actions.CloseEditorAction; 47 47 import org.openmicroscopy.shoola.agents.editor.actions.EditorAction; 48 import org.openmicroscopy.shoola.agents.editor.actions.OpenLocalFileAction; 48 49 import org.openmicroscopy.shoola.agents.editor.browser.Browser; 49 50 … … 68 69 static final Integer CLOSE_EDITOR = new Integer(1); 69 70 71 /** Identifies the <code>Open Local File</code> Action. */ 72 static final Integer OPEN_LOCAL_FILE = new Integer(2); 73 70 74 /** 71 75 * Reference to the {@link Editor} component, which, in this context, … … 84 88 { 85 89 actionsMap.put(CLOSE_EDITOR, new CloseEditorAction(model)); 90 actionsMap.put(OPEN_LOCAL_FILE, new OpenLocalFileAction(model)); 86 91 } 87 92 -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/view/EditorFactory.java
r5610 r5613 155 155 while (v.hasNext()) { 156 156 comp = (EditorComponent) v.next(); 157 if (comp.getModel().getFileID() == model.getFileID()) 157 if ((comp.getModel().getFileID() == model.getFileID()) && 158 (comp.getModel().getFileName().equals(model.getFileName()))) 158 159 return comp; 159 160 } 160 comp = new EditorComponent(model); 161 comp.initialize(); 161 comp = new EditorComponent(model); // creates View and Controller 162 comp.initialize(); // initialises MVC 162 163 comp.addChangeListener(this); 163 164 editors.add(comp); -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/view/EditorToolBar.java
r5588 r5613 63 63 bar.setBorder(null); 64 64 JButton b = new CustomButton(controller.getAction( 65 EditorControl. CLOSE_EDITOR));65 EditorControl.OPEN_LOCAL_FILE)); 66 66 b.setText(""); 67 67 bar.add(b); -
trunk/SRC/org/openmicroscopy/shoola/agents/editor/view/EditorUI.java
r5600 r5613 136 136 setJMenuBar(createMenuBar()); 137 137 buildGUI(); 138 setOnScreen(); 138 139 } 139 140 … … 174 175 175 176 setVisible(true); 176 177 177 } 178 178
