code: public Glyph.State createStateVar(EntityFeature ef, ObjectFactory factory)
  	{
  		if (ef instanceof FragmentFeature)
  		{
  			FragmentFeature ff = (FragmentFeature) ef;
  			SequenceLocation loc = ff.getFeatureLocation();
  			if (loc instanceof SequenceInterval)
  			{
  				SequenceInterval si = (SequenceInterval) loc;
  				SequenceSite begin = si.getSequenceIntervalBegin();
  				SequenceSite end = si.getSequenceIntervalEnd();
  				
  				if (begin != null && end != null)
  				{
  					Glyph.State state = factory.createGlyphState();
  					state.setValue("x[" + begin.getSequencePosition() + " - " +
  						end.getSequencePosition() + "]");
  					return state;
  				}
  			}
  		}
  		else if (ef instanceof ModificationFeature)
  		{
  			ModificationFeature mf = (ModificationFeature) ef;
  			SequenceModificationVocabulary modType = mf.getModificationType();
  			
  			if (modType != null)
  			{
  				Set<String> terms = modType.getTerm();
  				if (terms != null && !terms.isEmpty())
  				{
  					String orig = terms.iterator().next();
  					String term = orig.toLowerCase();
  					
  					String s = symbolMapping.containsKey(term) ? symbolMapping.get(term) : orig;
  
  					Glyph.State state = factory.createGlyphState();
  					state.setValue(s);
  					
  					SequenceLocation loc = mf.getFeatureLocation();
  					if (locMapping.containsKey(term))
  					{
  						state.setVariable(locMapping.get(term));
  					}
  
  					if (loc instanceof SequenceSite)
  					{
  						SequenceSite ss = (SequenceSite) loc;
  						if (ss.getSequencePosition() > 0)
  						{
  							state.setVariable(
  								(state.getVariable() != null ? state.getVariable() : "") +
  								ss.getSequencePosition());
  						}
  					}
  					
  					return state;
  				}
  			}
  		}
  
  		// Binding features are ignored
  		return null;
  	}
docs: Creates State to represent the entity feature.
  @param ef feature to represent
  @param factory factory that can create the State class
  @return State representing the feature