• 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 Change
  • Next Change →

Changeset 5546 for branches/OmeroEditor/src/fields/AbstractParam.java

Show
Ignore:
Timestamp:
07/23/08 15:32:07 (4 months ago)
Author:
will
Message:

Actions and UndoableEdit? framework setup.
Can open Beta 3.0 XML files (not all fields rendered yet)

Files:
1 moved

  • branches/OmeroEditor/src/fields/AbstractParam.java (moved) (moved from branches/OmeroEditor/src/fields/AbstractValueObject.java) (3 diffs)

Legend:

Unmodified
Added
Removed
  • branches/OmeroEditor/src/fields/AbstractParam.java

    r5543 r5546  
    2323package fields; 
    2424 
    25 import java.util.HashMap; 
    26  
    27 import tree.DataFieldConstants; 
    2825 
    2926//Java imports 
     27import java.util.HashMap; 
    3028 
    3129//Third-party libraries 
    … …  
    3331//Application-internal dependencies 
    3432 
     33import tree.DataFieldConstants; 
     34 
     35 
    3536/**  
    36  *  
     37 * An abstract example 
    3738 * 
    3839 * @author  William Moore      
    … …  
    4445 * @since OME3.0 
    4546 */ 
    46 public abstract class AbstractValueObject  
     47public abstract class AbstractParam  
    4748        implements 
    48         IFieldValue { 
     49        IParam { 
    4950         
    50         private String fieldType; 
     51        public static final String PARAM_TYPE = "paramType"; 
     52         
     53        public static final String PARAM_NAME = "paramName"; 
     54         
    5155         
    5256        private HashMap<String, String> valueAttributesMap; 
    5357 
    5458         
    55         public AbstractValueObject(String fieldType) { 
    56                 this.fieldType = fieldType; 
     59        public AbstractParam(String fieldType) { 
    5760                valueAttributesMap = new HashMap<String, String>(); 
     61                valueAttributesMap.put(PARAM_TYPE, fieldType); 
    5862        } 
    5963         
     64        /** 
     65         * This method returns a list of the names of attributes.  
     66         * These attributes represent the experimental "value" of this 
     67         * parameter (rather than other attributes such as name or default 
     68         * values that represent the "template" part of the parameter.  
     69         * This method is used for eg. clearing the value of a parameter by  
     70         * setting all value attributes to null.  
     71         */ 
    6072        public abstract String[] getValueAttributes(); 
    6173 
    62         public abstract boolean isFieldFilled(); 
    63  
    6474        /** 
    65          * A convenience method to test whether the attribute is included in 
    66          * the list of value attributes.  
     75         * Unless specified by subclasses, parameter has no default values. 
     76         * If a list of default values is given, these should be given in the  
     77         * same order as the value attributes to which they apply  
    6778         *  
    68          * @param attributeName         The name of the attribute to test.  
    69          * @return              True if the attribute is a value attribute.  
     79         * @see getValueAttributes(); 
    7080         */ 
    71         public boolean isValueAttribute(String attributeName) { 
    72                  
    73                 if (attributeName == null) return false; 
    74                  
    75                 String[] attributes = getValueAttributes(); 
    76                 for (int i=0; i<attributes.length; i++) { 
    77                         if (attributeName.equals(attributes[i])) 
    78                                 return true; 
    79                 } 
    80                 return false; 
     81        public String[] getDefaultAttributes() { 
     82                return new String[] {}; 
    8183        } 
    8284         
     85        public abstract boolean isParamFilled(); 
     86 
     87         
     88         
    8389        public String getFieldType() { 
    84                 return fieldType; 
     90                return getAttribute(PARAM_TYPE); 
    8591        } 
    8692         

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/