public void setShape(final NodeModel node, final Shape shape) { final ShapeConfigurationModel oldShape = NodeStyleModel.getShapeConfiguration(node); setShapeConfiguration(node, oldShape.withShape(shape)); }
public void setShape(final Shape shape) { this.setShapeConfiguration(getShapeConfiguration().withShape(shape)); }
public void setShape(final String shape) { try { this.setShapeConfiguration(getShapeConfiguration().withShape(shape != null ? Shape.valueOf(shape) : null)); } catch (IllegalArgumentException e) { LogUtils.warn("unknown shape " + shape); } }
root = mapReader.createNodeTreeFromXml(styleMap, styleReader, hints); NodeStyleModel.setShapeConfiguration(root, ShapeConfigurationModel.NULL_SHAPE.withShape(NodeStyleModel.Shape.oval).withUniform(true)); NodeStyleModel.createNodeStyleModel(root).setFontSize(24); styleMap.setRoot(root);
@Override void applyValue(final boolean enabled, final NodeModel node, final PropertyChangeEvent evt) { final MNodeStyleController styleController = (MNodeStyleController) Controller .getCurrentModeController().getExtension( NodeStyleController.class); if(enabled){ styleController.setShapeConfiguration(node, ShapeConfigurationModel.NULL_SHAPE .withShape(NodeStyleModel.Shape.valueOf(mNodeShape.getValue())) .withHorizontalMargin(mShapeHorizontalMargin.getQuantifiedValue()) .withVerticalMargin(mShapeVerticalMargin.getQuantifiedValue()) .withUniform(mUniformShape.getBooleanValue()) ); } else { styleController.setShapeConfiguration(node, ShapeConfigurationModel.NULL_SHAPE); } final Shape shape = styleController.getShape(node); enableShapeConfigurationProperties(enabled, shape); }
private ShapeConfigurationModel shapeConfiguration(NodeView node) { final ModeController modeController = node.getMap().getModeController(); final NodeModel model = node.getModel(); ShapeConfigurationModel shapeConfiguration = NodeStyleController.getController(modeController).getShapeConfiguration(model); if (shapeConfiguration.getShape().equals(NodeStyleModel.Shape.combined)) { if (node.isFolded()) { shapeConfiguration= shapeConfiguration.withShape(NodeStyleModel.Shape.bubble); } else { shapeConfiguration = ShapeConfigurationModel.FORK; } } else while(shapeConfiguration.getShape().equals(NodeStyleModel.Shape.as_parent)){ NodeView parent = node.getParentView(); if (parent == null) shapeConfiguration = ShapeConfigurationModel.DEFAULT_ROOT_OVAL; else if (parent.getParentView() == null) shapeConfiguration = ShapeConfigurationModel.FORK; else shapeConfiguration = parent.getMainView().getShapeConfiguration(); } return shapeConfiguration; }