Make Label in LogicEditor example resizble [message #23953] |
Fri, 04 October 2002 20:31  |
Eclipse User |
|
|
|
Hi,
Could someone please tell me how to make Label in the logic editor example
resizable? I compare the edit policy of Label (non-resizable) with
ContainerEditPolicy (used by Circuit, which is resizable), I can't tell what
make Circuit resizable.
Thank you for any help.
|
|
|
|
|
Re: Make Label in LogicEditor example resizble [message #24234 is a reply to message #24194] |
Sat, 05 October 2002 20:32  |
Eclipse User |
|
|
|
Originally posted by: hudsonr.us.eye-bee-em.com
If you have something that is not draggable, you should probably try to make
it look like a TreeItem or ListItem. So you might show selection by
changing the background to dark blue
(ColorConstants.menuBackgroundSelected), and the font color to white
(ColorConstants.menuForegroundSelected). Maybe handles don't make sense.
Handles are not the only way to drag something. You will also need to
override EditPart.getDragTracker() to return the SelectEditPartTracker(),
which doesn't allow dragging.
"Sam" <sy_cheung@yahoo.com> wrote in message
news:annj3m$ouh$1@rogue.oti.com...
>
> Eric,
>
> Thanks for your help. How can I make a NonResizableEditPolicy NOT
> movable also? I don't see there is a method in NonResiableEditPolicy to
> make it not-movable also.
>
> Thank you.
>
>
> Eric Bordeau wrote:
> > The LogicContainerEditPart (which the main LogicDiagram is) has a
> > LogicXYLayoutEditPolicy as its LAYOUT_ROLE. When a child is created in
> > a container, createChildEditPolicy(...) returns the appropriate
> > EditPolicy (resizable or nonresizable) to be installed as the
> > PRIMARY_DRAG_ROLE on the child EditPart. These are the edit policies
> > that create the move and/or resize commands.
> >
> >
> >
> > LogicXYLayoutEditPolicy.createChildEditPolicy looks like this...
> >
> > protected EditPolicy createChildEditPolicy(EditPart child){
> > if (child instanceof LEDEditPart ||
> > child instanceof OutputEditPart ||
> > child instanceof LogicLabelEditPart) {
> > return new
org.eclipse.gef.editpolicies.NonResizableEditPolicy();
> > }
> > return new org.eclipse.gef.editpolicies.ResizableEditPolicy();
> > }
> >
> > So, when a LogicLabelEditPart gets created, it gets a
> > NonResizableEditPolicy, while a CircuitEditPart would get a
> > ResizableEditPolicy.
> >
> >
> > Hope this helps.
> >
> > Eric
> >
> >
> > Sam Cheung wrote:
> >
> >> Hi,
> >>
> >> Could someone please tell me how to make Label in the logic editor
> >> example
> >> resizable? I compare the edit policy of Label (non-resizable) with
> >> ContainerEditPolicy (used by Circuit, which is resizable), I can't
> >> tell what
> >> make Circuit resizable.
> >>
> >> Thank you for any help.
> >>
> >>
> >
>
|
|
|
Powered by
FUDForum. Page generated in 0.03883 seconds