Skip to main content



      Home
Home » Eclipse Projects » GEF » Figure toggle not receiving selected/button down events
Figure toggle not receiving selected/button down events [message #169970] Mon, 28 February 2005 11:18 Go to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

All,
I'm trying to implement an expand/collapse figure on my figures in
GEF, and am having trouble getting the toggle to see any mouse eens
other than mouseover. The toggle figure is about 2 figures from the root
figure of the edit part. Here is a snippet:

label = new LabelFigure();
label.setText("+");
t = new Toggle(label);
expanded = false;
t.setBorder(BUTTON_BORDER);
t.setRolloverEnabled(true);
t.setRequestFocusEnabled(false);

t.addChangeListener(new ChangeListener() {
public void handleStateChanged(ChangeEvent event) {
if
(event.getPropertyName().equals(ButtonModel.SELECTED_PROPERT Y)) {
if (!expanded) {
expanded = true;
rightCompartment.add(scrollpane);
rightCompartment.revalidate();
label.setText("-");
me.revalidate();
} else {
expanded=false;
label.setText("+");
rightCompartment.remove(scrollpane);
rightCompartment.revalidate();
me.revalidate();
}
}
});

When I click on the figure only the edit policy is receiving any events
for the root figure. Am I missing something?

Thanks!

Pierre
Re: Figure toggle not receiving selected/button down events [message #170545 is a reply to message #169970] Sat, 05 March 2005 02:55 Go to previous message
Eclipse UserFriend
What is LabelFigure? Are you adding any listeners to it? If that is the
case, the events will go to the label and not the toggle.

"Pierre Padovani" <none@us.ibm.com> wrote in message
news:cvvg98$kgr$1@www.eclipse.org...
> All,
> I'm trying to implement an expand/collapse figure on my figures in
> GEF, and am having trouble getting the toggle to see any mouse eens
> other than mouseover. The toggle figure is about 2 figures from the root
> figure of the edit part. Here is a snippet:
>
> label = new LabelFigure();
> label.setText("+");
> t = new Toggle(label);
> expanded = false;
> t.setBorder(BUTTON_BORDER);
> t.setRolloverEnabled(true);
> t.setRequestFocusEnabled(false);
>
> t.addChangeListener(new ChangeListener() {
> public void handleStateChanged(ChangeEvent event) {
> if
> (event.getPropertyName().equals(ButtonModel.SELECTED_PROPERT Y)) {
> if (!expanded) {
> expanded = true;
> rightCompartment.add(scrollpane);
> rightCompartment.revalidate();
> label.setText("-");
> me.revalidate();
> } else {
> expanded=false;
> label.setText("+");
> rightCompartment.remove(scrollpane);
> rightCompartment.revalidate();
> me.revalidate();
> }
> }
> });
>
> When I click on the figure only the edit policy is receiving any events
> for the root figure. Am I missing something?
>
> Thanks!
>
> Pierre
Previous Topic:Question about EDiagram example
Next Topic:Scrolling in a view
Goto Forum:
  


Current Time: Wed Jun 18 08:45:04 EDT 2025

Powered by FUDForum. Page generated in 0.04420 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top