Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » BorderDecorator for Visible Rectangle instead of InvisibleRectangle
BorderDecorator for Visible Rectangle instead of InvisibleRectangle [message #1624119] Thu, 19 February 2015 15:25 Go to next message
Abhishek Chakraborty is currently offline Abhishek ChakrabortyFriend
Messages: 69
Registered: July 2009
Location: Cologne, Germany
Member

Can we get the borderDecorator only for the visible Rectangle instead of the Invisible rectangle , eg. in Tutorial Example , the BorderDecorator creates the border for the invisibleRectangle which is there to support the boxanchor instead of the Visible Rectangle .

Regards,
Abhishek Chakraborty
Re: BorderDecorator for Visible Rectangle instead of InvisibleRectangle [message #1625652 is a reply to message #1624119] Fri, 20 February 2015 14:41 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1899
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Abhishek Chakraborty,

not sure which example you're refencing, but in the Chess example (part of
the SDK) there is an example of using the BorderDecorator for the visible
rectangle of a shape. See the ChessToolBehaviorProvider:

@Override
public IDecorator[] getDecorators(PictogramElement pe) {
Object object =
getFeatureProvider().getBusinessObjectForPictogramElement(pe);
// Check if the business object of the given pictogram element (the
// square) is one of the allowed squares (see CreateChessMoveFeature)
// for a move in progress
if (object instanceof Square) {
if (allowedSquaresForMove.contains(object)) {
// Yes --> decorate with an orange border
BorderDecorator decorator = new BorderDecorator();
decorator.setBorderColor(IColorConstant.ORANGE);
decorator.setBorderWidth(2);
return new IDecorator[] { decorator };
}
}
return super.getDecorators(pe);
}


Michael

"Abhishek Chakraborty" schrieb im Newsbeitrag
news:mc4v8t$996$1@xxxxxxxxe.org...

Can we get the borderDecorator only for the visible Rectangle instead of the
Invisible rectangle , eg. in Tutorial Example , the BorderDecorator creates
the border for the invisibleRectangle which is there to support the
boxanchor instead of the Visible Rectangle .
--
Regards,
Abhishek Chakraborty
Previous Topic:Inconsistency in SVG export
Next Topic:Add Object to the UI Programmatically
Goto Forum:
  


Current Time: Tue Oct 23 08:36:39 GMT 2018

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

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

Back to the top