• Views
  • Iteration Report
  • My Iteration Report
  •  
OMERO.clients
  • Login
  • Help/Guide
  • About Trac
  • Preferences
  • Wiki
  • Timeline
  • Roadmap
  • Browse Source
  • View Tickets
  • Search

Context Navigation

  • ← Previous Changeset
  • Next Changeset →

Changeset 5614

Show
Ignore:
Timestamp:
09/16/08 13:04:22 (2 months ago)
Author:
will
Message:

Can open the Editor with no file, using ShowEditorEvent?.

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  
    100100         
    101101        /** 
    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. 
    104103         */ 
    105         private void handleShowEditor(ShowEditorEvent event) 
     104        private void handleShowEditor() 
    106105        { 
     106                Editor editor = EditorFactory.getEditor(); 
     107                if (editor != null) { 
     108                        editor.activate(); 
     109                } 
    107110        } 
    108111         
    … …  
    166169        
    167170       if (e instanceof ShowEditorEvent) 
    168            handleShowEditor((ShowEditorEvent) e); 
     171           handleShowEditor(); 
    169172    } 
    170173     
  • trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/paramUIs/EnumEditor.java

    r5601 r5614  
    3636 
    3737import org.openmicroscopy.shoola.agents.editor.model.IAttributes; 
    38 import org.openmicroscopy.shoola.agents.editor.model.params.IParam; 
    3938import org.openmicroscopy.shoola.agents.editor.model.params.SingleParam; 
    4039import org.openmicroscopy.shoola.agents.editor.uiComponents.CustomComboBox; 
  • trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/paramUIs/NumberEditor.java

    r5588 r5614  
    6464        private void buildUI() 
    6565        { 
    66                 TextFieldEditor numberField = new TextFieldEditor((IParam)getParameter(),  
     66                TextFieldEditor numberField = new TextFieldEditor(getParameter(),  
    6767                                SingleParam.PARAM_VALUE); 
    6868                numberField.addPropertyChangeListener(ITreeEditComp.VALUE_CHANGED_PROPERTY,  
  • trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/paramUIs/TextBoxEditor.java

    r5596 r5614  
    4040 
    4141import org.openmicroscopy.shoola.agents.editor.model.IAttributes; 
    42 import org.openmicroscopy.shoola.agents.editor.model.params.IParam; 
    4342import org.openmicroscopy.shoola.agents.editor.model.params.SingleParam; 
    4443import org.openmicroscopy.shoola.agents.editor.uiComponents.CustomLabel; 
  • trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/paramUIs/editTemplate/AttributeEditArea.java

    r5610 r5614  
    2626 
    2727import java.awt.BorderLayout; 
    28 import java.awt.Dimension; 
    2928 
    3029import javax.swing.BorderFactory; 
    31 import javax.swing.JScrollPane; 
    3230import javax.swing.JTextArea; 
    3331import javax.swing.border.Border; 
    3432import javax.swing.event.DocumentEvent; 
    3533import javax.swing.event.DocumentListener; 
    36 import javax.swing.text.BadLocationException; 
    3734 
    3835//Third-party libraries 
    … …  
    4340import org.openmicroscopy.shoola.agents.editor.browser.paramUIs.AttributeEditListeners; 
    4441import org.openmicroscopy.shoola.agents.editor.model.IAttributes; 
    45 import org.openmicroscopy.shoola.agents.editor.model.params.IParam; 
    4642import org.openmicroscopy.shoola.agents.editor.model.params.SingleParam; 
    4743import org.openmicroscopy.shoola.agents.editor.uiComponents.CustomLabel; 
  • trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/paramUIs/editTemplate/AttributeEditLine.java

    r5597 r5614  
    4141import org.openmicroscopy.shoola.agents.editor.browser.paramUIs.TextFieldEditor; 
    4242import 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; 
    4543import org.openmicroscopy.shoola.agents.editor.uiComponents.CustomLabel; 
    4644 
  • trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/paramUIs/editTemplate/EnumTemplate.java

    r5610 r5614  
    2323package org.openmicroscopy.shoola.agents.editor.browser.paramUIs.editTemplate; 
    2424 
     25//Java imports 
     26 
    2527import java.awt.BorderLayout; 
    26 import java.awt.event.ActionEvent; 
    27 import java.awt.event.ActionListener; 
    2828import java.beans.PropertyChangeEvent; 
    2929import java.beans.PropertyChangeListener; 
    3030import java.util.HashMap; 
    3131 
    32 import javax.swing.BoxLayout; 
    33 import javax.swing.JComboBox; 
     32//Third-party libraries 
     33 
     34//Application-internal dependencies 
    3435 
    3536import org.openmicroscopy.shoola.agents.editor.browser.paramUIs.AbstractParamEditor; 
    … …  
    3839import org.openmicroscopy.shoola.agents.editor.model.IAttributes; 
    3940import org.openmicroscopy.shoola.agents.editor.model.params.SingleParam; 
    40 import org.openmicroscopy.shoola.agents.editor.uiComponents.CustomComboBox; 
    4141import org.openmicroscopy.shoola.agents.editor.uiComponents.CustomLabel; 
    4242 
    43 //Java imports 
    44  
    45 //Third-party libraries 
    46  
    47 //Application-internal dependencies 
    48  
    4943/**  
    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.  
    5148 * 
    5249 * @author  William Moore      
    … …  
    6360{ 
    6461 
     62        /** 
     63         * The text box for entering a list of comma-delimited options. 
     64         */ 
    6565        private AttributeEditArea                       optionsFieldEditor; 
    6666         
     67        /** 
     68         * A comboBox for selecting the default option. 
     69         */ 
    6770        private AbstractParamEditor                     defaultValueComboBox; 
    6871         
  • trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/paramUIs/editTemplate/FieldEditorPanel.java

    r5610 r5614  
    377377                                 
    378378                                else if (newVal instanceof HashMap) { 
    379                                         HashMap newVals = (HashMap)newVal; 
     379                                        HashMap<String,String> newVals = (HashMap)newVal; 
    380380                                         controller.editAttributes(param, displayName, newVals,  
    381381                                                        tree, treeNode); 
  • trunk/SRC/org/openmicroscopy/shoola/agents/editor/browser/paramUIs/editTemplate/ParamTemplateUIFactory.java

    r5610 r5614  
    2727 
    2828import javax.swing.JComponent; 
    29 import javax.swing.JPanel; 
    3029 
    3130//Third-party libraries 
    … …  
    3332//Application-internal dependencies 
    3433 
    35 import org.openmicroscopy.shoola.agents.editor.browser.paramUIs.DateTimeField; 
    36 import org.openmicroscopy.shoola.agents.editor.browser.paramUIs.TextBoxEditor; 
    3734import org.openmicroscopy.shoola.agents.editor.model.DataFieldConstants; 
    3835import org.openmicroscopy.shoola.agents.editor.model.params.AbstractParam; 
  • trunk/SRC/org/openmicroscopy/shoola/agents/editor/view/EditorComponent.java

    r5613 r5614  
    107107                switch (state) { 
    108108                        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                                } 
    112117                                break; 
    113118                        case DISCARDED: 
  • trunk/SRC/org/openmicroscopy/shoola/agents/editor/view/EditorControl.java

    r5613 r5614  
    2222 */ 
    2323package org.openmicroscopy.shoola.agents.editor.view; 
    24  
    25  
    2624 
    2725//Java imports 
    … …  
    4745import org.openmicroscopy.shoola.agents.editor.actions.EditorAction; 
    4846import org.openmicroscopy.shoola.agents.editor.actions.OpenLocalFileAction; 
    49 import org.openmicroscopy.shoola.agents.editor.browser.Browser; 
    5047 
    5148/**  
    … …  
    224221         */ 
    225222        public void propertyChange(PropertyChangeEvent evt) { 
    226                 String name = evt.getPropertyName(); 
     223                //String name = evt.getPropertyName(); 
    227224                 
    228225                 
  • trunk/SRC/org/openmicroscopy/shoola/agents/editor/view/EditorFactory.java

    r5613 r5614  
    2222 */ 
    2323package org.openmicroscopy.shoola.agents.editor.view; 
    24  
    25  
    2624 
    2725//Java imports 
    … …  
    8785        { 
    8886                EditorModel model = new EditorModel(file); 
     87                 
    8988                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; 
    90112        } 
    91113         
    … …  
    158180                                        (comp.getModel().getFileName().equals(model.getFileName()))) 
    159181                                return comp; 
     182                        if (comp.getModel().getFileName().equals("")) { 
     183                                return comp; 
     184                        } 
    160185                } 
    161186                comp = new EditorComponent(model);      // creates View and Controller 
  • trunk/SRC/org/openmicroscopy/shoola/agents/editor/view/EditorModel.java

    r5590 r5614  
    107107         * Creates a new instance and sets the state to {@link Editor#NEW}. 
    108108         * {@link #fileSize} and {@link #fileID} are not set. 
     109         * File is not opened. To do this, call {@link Editor#setFileToEdit(File)} 
    109110         *  
    110111         * @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.  
    112113         */ 
    113114        EditorModel(File file)  
    114115        { 
    115116                if (file == null) throw new NullPointerException("No file."); 
    116                 if (! file.exists()) return; 
    117117                 
    118118                state = Editor.NEW; 
    119119                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 = ""; 
    120131        } 
    121132         
    … …  
    201212        { 
    202213                fileToEdit = file; 
     214                fileName = file.getName(); 
    203215                TreeModel treeModel = TreeModelFactory.getTree(file); 
    204216                browser.setTreeModel(treeModel); 
  • trunk/SRC/org/openmicroscopy/shoola/agents/editor/view/EditorUI.java

    r5613 r5614  
    2626import java.awt.BorderLayout; 
    2727import java.awt.Container; 
    28 import java.awt.Dimension; 
    29 import java.awt.Toolkit; 
    3028 
    3129import javax.swing.JMenu; 
    … …  
    10098                Container c = getContentPane(); 
    10199                c.setLayout(new BorderLayout(0, 0)); 
    102                 // c.add(toolBar, BorderLayout.NORTH); 
     100                //c.add(toolBar, BorderLayout.NORTH); 
    103101                 
    104102                c.add(statusBar, BorderLayout.SOUTH); 

Download in other formats:

  • Unified Diff
  • Zip Archive

Trac Powered

Powered by Trac 0.11
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/