Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
ParentEditPart
-> Parent of ShapeEditPart
@Override
protected void createEditPolicies() {
installEditPolicy(EditPolicy.LAYOUT_ROLE, new XYLayoutEditPolicy() {
@Override
protected Command getCreateCommand(CreateRequest request) {
return null;
}
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
return new NonResizableEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
if (getHost() instanceof ShapeEditPart) {
return Collections.EMPTY_LIST;
}
return super.createSelectionHandles();
}
};
}
});
}
Und der Hintergrund eines Shapes, kann es auch transparent gemacht werden (vielleicht mit figure#setOpaque(false)), weil wenn ich zwei Polgyons habe, und die sind von Rectangle überlappend und ich will das untere selektieren, ist es recht schwer es zu erwischen.
Polygon p = new Polygon();
p.addPoint( 2, 6 );
p.addPoint( 5, 2 );
p.addPoint( 8, 6 );
p.contains(5,2);