// Check if has a Name and if not see if there is generated name
String componentName = c.getName();
if (!StringUtils.hasText(componentName)) {
if (c instanceof GridField) {
GridField gf = (GridField) c;
componentName = gf.getGeneratedName();
}
}
// TF:16/11/07:First do standard properties...
stdProperties.add(new TableData("<html><b>Name</b></html>", componentName));
stdProperties.add(new TableData("<html><b>Sizing</b></html>", ""));
stdProperties.add(new TableData(" location", "[x="+ c.getX()+",y="+c.getY()+"]"));
stdProperties.add(new TableData(" size", "[width="+ c.getWidth()+",height="+ c.getHeight()+"]"));
stdProperties.add(new TableData(" minimumSize", c.isMinimumSizeSet() ? showDimension(c.getMinimumSize()): "<html><i>Not set</i></html>"));
stdProperties.add(new TableData(" maximumSize", c.isMaximumSizeSet() ? showDimension(c.getMaximumSize()): "<html><i>Not set</i></html>"));
stdProperties.add(new TableData(" preferredSize", c.isPreferredSizeSet() ? showDimension(c.getPreferredSize()): "<html><i>Not set</i></html>"));
if (c instanceof JComponent) {
JComponent comp = (JComponent)c;
GridCell cell = GridCell.get(comp);
stdProperties.add(new TableData("<html><b>Layout Info</b></html>", ""));
stdProperties.add(new TableData(" cell", "[row="+ cell.getRow()+",column="+cell.getColumn()+"]"));
stdProperties.add(new TableData(" widthPolicy", cell.sizePolicyToString(cell.getWidthPolicy())));
if (cell.getWidthPolicy() == Constants.SP_TO_PARTNER) {
JComponent comp1 = LayoutManagerHelper.getWidthPartner(comp);
for (int i = 1; comp1 != null && comp1 != comp; i++) {
stdProperties.add(new TableData(" ["+i+"]", " " + comp1.toString()));
comp1 = LayoutManagerHelper.getWidthPartner(comp1);
}
}
else if (cell.getWidthPolicy() == Constants.SP_TO_MATRIX_PARTNER && comp instanceof GridField) {
GridField partner = ((GridField)comp).getWidthMatrixPartner();
for (int i = 1; partner != null && partner != comp; i++) {
stdProperties.add(new TableData(" ["+i+"]", " " + partner.toString()));
partner = partner.getWidthMatrixPartner();
}
}
stdProperties.add(new TableData(" heightPolicy", cell.sizePolicyToString(cell.getHeightPolicy())));
if (cell.getHeightPolicy() == Constants.SP_TO_PARTNER) {
JComponent comp1 = LayoutManagerHelper.getHeightPartner(comp);
for (int i = 1; comp1 != null && comp1 != comp; i++) {
stdProperties.add(new TableData(" ["+i+"]", " " + comp1.toString()));
comp1 = LayoutManagerHelper.getHeightPartner(comp1);
}
}
else if (cell.getHeightPolicy() == Constants.SP_TO_MATRIX_PARTNER && comp instanceof GridField) {
GridField partner = ((GridField)comp).getHeightMatrixPartner();
for (int i = 1; partner != null && partner != comp; i++) {
stdProperties.add(new TableData(" ["+i+"]", " " + partner.toString()));
partner = partner.getHeightMatrixPartner();
}
}
stdProperties.add(new TableData(" gravity", cell.gravityAsString()));
stdProperties.add(new TableData(" margins", "[t="+cell.getTopMargin()+
",l="+cell.getLeftMargin()+
",b="+cell.getBottomMargin()+
",r="+cell.getRightMargin()+"]"));
if (comp.getParent() instanceof GridField) {
GridField gf = (GridField)comp.getParent();
stdProperties.add(new TableData(" rowWeight", ""+gf.getRowJustifyWeight(cell.getRow())));
stdProperties.add(new TableData(" columnWeight", ""+gf.getColumnJustifyWeight(cell.getColumn())));
}
if (comp instanceof GridField) {
StringBuilder buffer = new StringBuilder(50);
GridField gf = (GridField)comp;
int[] rowWeights = gf.getRowJustifyWeight();
buffer.append('[');
for (int i = 0; i < rowWeights.length; i++) {
if (i > 0) {
buffer.append(',');
}
buffer.append(rowWeights[i]);
}
buffer.append(']');
stdProperties.add(new TableData(" rowWeights", buffer.toString()));
buffer = new StringBuilder(50);
int[] colWeights = gf.getColumnJustifyWeight();
buffer.append('[');
for (int i = 0; i < colWeights.length; i++) {
if (i > 0) {
buffer.append(',');
}