if ("main".equalsIgnoreCase(strp)) {
x += CAMERA_PANEL_WIDTH; // main panel is shifted over.
}
Point loc = new Point();
loc.setLocation(x, y);
LayoutAllocation la = LayoutAllocator.forceAllocate(loc, size.width, size.height);
if (la != null) {
elem.setLayoutAllocation(la);
m_elemPanel.add(elem);
elem.setSize(size.width, size.height);
elem.setLocation(la.point);
m_elemPanel.revalidate();
m_elemPanel.repaint();
} else {
elem.disconnect();
System.err
.println("Unable to allocate new DisplayElement of width "
+ size.width
+ " pixels and height "
+ size.height + " pixels.");
}
}
else if (props == null || props.size()==0) {
Dimension size = elem.getPreferredSize();
LayoutAllocation la = LayoutAllocator.allocate(size.width,
size.height);
if (la != null) {
elem.setLayoutAllocation(la);
m_elemPanel.add(elem);
elem.setSize(size.width, size.height);