Results 1 to 2 of 2
Thread: Gef
- 06-09-2010, 02:18 PM #1
Member
- Join Date
- Jun 2010
- Posts
- 1
- Rep Power
- 0
Gef
I,ve a widget Figure whose layout manger is XYLayout
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
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.F IELD_HPADDING + 5);
controllayout.setStretchMinorAxis(true);
controllayout.setMinorAlignment(ToolbarLayout.ALIG N_BOTTOMRIGHT);
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(WindowDesignerCon stants.HEADER_COLOR);
Label name = new Label(displayName);
name.setFont(ResourceUtil
.getFont(WindowDesignerConstants.FIELD_WIDGET_FONT ));
controlFigure.add(name);
name.setPreferredSize(controlFigure.getPreferredSi ze());
}
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
- 06-09-2010, 03:54 PM #2


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks