public Composite getComposite() {
return mainComposite;
}
public void init( RuleWrapper ruleWrapper ) {
PointSymbolizerWrapper pointSymbolizerWrapper = ruleWrapper.getGeometrySymbolizersWrapper().adapt(
PointSymbolizerWrapper.class);
mainComposite = new Composite(parent, SWT.NONE);
mainComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
mainComposite.setLayout(new GridLayout(3, true));
// rule name
Label nameLabel = new Label(mainComposite, SWT.NONE);
nameLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
nameLabel.setText(Messages.PointGeneralParametersComposite_0);
nameText = new Text(mainComposite, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
GridData nameTextGD = new GridData(SWT.FILL, SWT.CENTER, true, false);
nameTextGD.horizontalSpan = 2;
nameText.setLayoutData(nameTextGD);
nameText.setText(ruleWrapper.getName());
nameText.addFocusListener(this);
// header
new Label(mainComposite, SWT.NONE);
Label valueLabel = new Label(mainComposite, SWT.NONE);
valueLabel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false));
valueLabel.setText(Messages.PointGeneralParametersComposite_1);
Label fieldsLabel = new Label(mainComposite, SWT.NONE);
fieldsLabel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false));
fieldsLabel.setText(Messages.PointGeneralParametersComposite_2);
// size
Label sizeLabel = new Label(mainComposite, SWT.NONE);
sizeLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
sizeLabel.setText(Messages.PointGeneralParametersComposite_3);
sizeSpinner = new Spinner(mainComposite, SWT.BORDER);
sizeSpinner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
sizeSpinner.setMaximum(200);
sizeSpinner.setMinimum(0);
sizeSpinner.setIncrement(1);
String size = pointSymbolizerWrapper.getSize();
Double tmpSize = isDouble(size);
int tmp = 3;
if (tmpSize != null) {
tmp = tmpSize.intValue();
}
sizeSpinner.setSelection(tmp);
sizeSpinner.addSelectionListener(this);
sizeAttributecombo = new Combo(mainComposite, SWT.DROP_DOWN | SWT.READ_ONLY);
sizeAttributecombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
sizeAttributecombo.setItems(numericAttributesArrays);
sizeAttributecombo.addSelectionListener(this);
if (tmpSize == null) {
int index = getAttributeIndex(size, numericAttributesArrays);
if (index != -1) {
sizeAttributecombo.select(index);
}
}
Label rotationLabel = new Label(mainComposite, SWT.NONE);
rotationLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
rotationLabel.setText(Messages.PointGeneralParametersComposite_4);
rotationSpinner = new Spinner(mainComposite, SWT.BORDER);
rotationSpinner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
rotationSpinner.setMaximum(360);
rotationSpinner.setMinimum(0);
rotationSpinner.setIncrement(5);
String rotation = pointSymbolizerWrapper.getRotation();
Double tmpRotation = isDouble(rotation);
tmp = 0;
if (tmpRotation != null) {
tmp = tmpRotation.intValue();
}
rotationSpinner.setSelection(tmp);
rotationSpinner.addSelectionListener(this);
rotationAttributecombo = new Combo(mainComposite, SWT.DROP_DOWN | SWT.READ_ONLY);
rotationAttributecombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
rotationAttributecombo.setItems(numericAttributesArrays);
rotationAttributecombo.addSelectionListener(this);
if (tmpSize == null) {
int index = getAttributeIndex(rotation, numericAttributesArrays);
if (index != -1) {
rotationAttributecombo.select(index);
}
}
// offset
Label offsetLabel = new Label(mainComposite, SWT.NONE);
GridData offsetLabelGD = new GridData(SWT.FILL, SWT.CENTER, true, false);
offsetLabel.setLayoutData(offsetLabelGD);
offsetLabel.setText(Messages.PointGeneralParametersComposite_5);
String xOffset = pointSymbolizerWrapper.getxOffset();
String yOffset = pointSymbolizerWrapper.getyOffset();
Double tmpXOffset = Utilities.isNumber(xOffset, Double.class);
Double tmpYOffset = Utilities.isNumber(yOffset, Double.class);
if (tmpXOffset == null || tmpYOffset == null) {
tmpXOffset = 0.0;
tmpYOffset = 0.0;