00001 package cedar.hepdata.webapp.components;
00002
00003 import org.apache.tapestry.MarkupWriter;
00004 import org.apache.tapestry.annotations.*;
00005 import cedar.hepdata.model.*;
00006 import cedar.hepdata.webapp.pages.*;
00007
00008 import java.text.*;
00009
00010 public class DisplayYAxisProperties {
00011
00012 @BeginRender
00013 void renderMessage(MarkupWriter writer) {
00014
00015 if (_yaxis != null) {
00016
00017
00018 for ( Property prop: _yaxis.getProperties() ){
00019 writer.write( prop.getName() + " : ");
00020 if (prop.getLowValue() != null && prop.getHighValue() != null &&
00021 prop.getLowValue().equals(prop.getHighValue())) {
00022 writer.write(prop.getLowValue().toString());
00023 }
00024 else{writer.write(prop.getLowValue().toString() + " TO " + prop.getHighValue().toString());}
00025 if (!prop.getUnit().toString().equals("num")){
00026 writer.write(" " + prop.getUnit().toString());
00027 }
00028 }
00029 }
00030 }
00031 @Parameter(name="yax")
00032 private YAxis _yaxis;
00033
00034 }