Results 1 to 2 of 2

Thread: Gef

  1. #1
    girish1661 is offline Member
    Join Date
    Jun 2010
    Posts
    1
    Rep Power
    0

    Default 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

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,883
    Rep Power
    25

    Default

    i want to select only the controlfigure inside the composite
    Sounds like a job for a mouseListener. The listener looks at where the mouse click is and does the "select" if within the desired area.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •