private void processObjectSegment(ObjectSegment segment, Node object, String prefix) {
   NamedNodeMap atts = object.getAttributes();
   Node id = atts.getNamedItem("href"); // $NON-NLS-1$
   Node align = atts.getNamedItem("align"); // $NON-NLS-1$
   if (id != null) {
     String value = id.getNodeValue();
     segment.setObjectId(prefix + value);
   }
   if (align != null) {
     String value = align.getNodeValue().toLowerCase();
     if (value.equals("top")) // $NON-NLS-1$
     segment.setVerticalAlignment(ImageSegment.TOP);
     else if (value.equals("middle")) // $NON-NLS-1$
     segment.setVerticalAlignment(ImageSegment.MIDDLE);
     else if (value.equals("bottom")) // $NON-NLS-1$
     segment.setVerticalAlignment(ImageSegment.BOTTOM);
   }
 }
示例#2
0
 public void layout(GC gc, int width, Locator loc, Hashtable resourceTable, boolean selected) {
   super.layout(gc, width, loc, resourceTable, selected);
   Control control = getControl(resourceTable);
   if (control != null) control.setBounds(getBounds());
 }