SelectionInfo in ToolBehaviorProvider is null [message #1503216] |
Mon, 08 December 2014 04:03  |
Eclipse User |
|
|
|
Hello!
I have a problem with moving graphical elements in my editor.
In some cases, a null pointer exception is thrown in the method adaptBackgroundToHover in class GFAbstractShape.
private boolean adaptBackgroundToHover(Graphics graphics) {
if (getVisualState().getHoverFeedback() == IVisualState.HOVER_ON) {
IToolBehaviorProvider tbp = getConfigurationProvider().getDiagramTypeProvider()
.getCurrentToolBehaviorProvider();
IFigure parent = getParent();
boolean parentSelected = false;
if (parent instanceof GFAbstractShape) {
GFAbstractShape gfa = (GFAbstractShape) parent;
IVisualState visualState = gfa.getVisualState();
parentSelected = visualState.getSelectionFeedback() == IVisualState.SELECTION_PRIMARY;
}
PictogramElement pe = getPictogramElementDelegate().getPictogramElement();
if (!(pe instanceof org.eclipse.graphiti.mm.pictograms.Shape))
return false;
org.eclipse.graphiti.mm.pictograms.Shape s = (org.eclipse.graphiti.mm.pictograms.Shape) pe;
ISelectionInfo selectionInfo = tbp.getSelectionInfoForShape(s);
IColorConstant hoverColor = null;
hoverColor = selectionInfo.getHoverColor();
if (parentSelected)
hoverColor = selectionInfo.getHoverColorParentSelected();
if (hoverColor != null) {
Color hoverColorSwt = DataTypeTransformation.toSwtColor(getConfigurationProvider()
.getResourceRegistry(), hoverColor);
graphics.setBackgroundColor(hoverColorSwt);
return true;
}
}
return false;
}
The problem is, that selectInfo and hoverColor are null. The problem concerns moving of simple graphical elements, such as rectangle, ellipse, etc.
What could cause this problem? Can someone help?
|
|
|
|
Powered by
FUDForum. Page generated in 0.02755 seconds