it is a composite of label and the controlFigure(control figure is textbox/textArea/dropdown or so controlFigure = new Figure();)
controlFigure's layout manager is ToolBarLayout
- Code: Select all
private void createControl(String displayName) {
setLayoutManager(new XYLayout());
setPreferredSize(100, 19);
setOpaque(false);
label = new Label();
label.setFont(ResourceUtil
.getFont(WindowDesignerConstants.FIELD_LABEL_FONT));
label.setLabelAlignment(PositionConstants.LEFT);
if(!isFullHeight())
add(label);
Label labelTip = new Label();
label.setToolTip(labelTip);
tooltip = new Label();
setToolTip(tooltip);
controlFigure = new Figure();
ToolbarLayout controllayout = new ToolbarLayout(false);
controllayout.setSpacing(WindowDesignerConstants.FIELD_HPADD ING + 5);
controllayout.setStretchMinorAxis(true);
controllayout.setMinorAlignment(ToolbarLayout.ALIGN_BOTTOMRI GHT);
controlFigure.setLayoutManager(controllayout);
controlFigure.setOpaque(true);
if (hasLabel && !fullHeight)
controlFigure.setPreferredSize(getBounds().width
//- label.getBounds().width
- 2*WindowDesignerConstants.FIELD_HPADDING,
getBounds().height -label.getBounds().height
- 3 * WindowDesignerConstants.FIELD_VPADDING);
this.add(controlFigure);
createControlFigure(displayName);
imageFigure = new ImageFigure();
imageFigure.setImage(ImageManager.getImage("LOV"));
add(imageFigure);
}
public void createControlFigure(String displayName) {
controlFigure.setBorder(new LineBorder(1));
controlFigure.setBackgroundColor(WindowDesignerConstants.HEA DER_COLOR);
Label name = new Label(displayName);
name.setFont(ResourceUtil
.getFont(WindowDesignerConstants.FIELD_WIDGET_FONT));
controlFigure.add(name);
name.setPreferredSize(controlFigure.getPreferredSize());
}
public IFigure getControlFigure() {
return controlFigure;
}
I'm able to select the entire widget and resize using mouse
but i want to select only the controlfigure inside the composite and to resize it using mouse
can anybody suggest me in achieving this