Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ve-dev] Surrounding Components with a JPanel in VE

Hi,
here's what I want to do:

(1) Create a normal Swing Gui in VE with "trivial" Components like
JButton etc.
(2) Select some of the trivial Components
(3) Click on my newly created Button in the Menu (there is an example
extension shipped with PDE), which should then do the following:
    (3.1) Change the layout of the surrounding container (e.g. JPanel or
JFrame) to null layout if it isn't already so:
        (3.1.1) before doing that, get the absolute position of the
elements in this container as coordinates
        (3.1.2) create a new JPanel with null layout and put the objects
in it
    (3.1.3) adopt the new JPanel in such way that it only contains the
selected components and place it so that the selected components have
still the same absolute positions

So what I need to know is,

a) how can I get the selected components in VE (step 2)? Trough
org.eclipse.gef.ui.actions.SelectionAction.getSelectedObjects() ?
b) how can I read the absolute positions of some Objects which are in a
layout manager (assuming that the current positioning will be the final,
regarding resizing .. etc.) (step 3.1.1) ? Something like
MyButton1.getAbsolutePosition()
c) how could I modifiy the source (and update the Graphical Editor) to
add a generic JPanel and then to modify it's position (step 3.1.2), and
add the old trivial components in it?


With kind regards

Ali Ikinci


Back to the top