public Shape getShape(final NodeModel node) { final ShapeConfigurationModel shapeConfiguration = shapeHandlers.getProperty(node); return shapeConfiguration.getShape(); }
public Shape getShape() { return getShapeConfiguration().getShape(); }
@Override protected void draw(final Graphics2D g) { final Color color = getColor(); g.setColor(color); final Stroke stroke = getStroke(); g.setStroke(stroke); g.drawLine(start.x, start.y, start.x, end.y); g.drawLine(start.x, end.y, end.x, end.y); if(getTarget().isSummary()){ final int gap = getWidth(); final int y1 = end.y + gap * 13/8; g.drawLine(start.x, start.y, start.x, y1); int x2 = end.x; if(NodeStyleModel.Shape.fork.equals(getTarget().getMainView().getShapeConfiguration().getShape())) x2 += getTarget().getContent().getWidth(); g.drawLine(start.x, y1, x2, y1); } }
private ShapeConfigurationModel getStyleShape(final MapModel map, final Collection<IStyle> style) { final MapStyleModel model = MapStyleModel.getExtension(map); for(IStyle styleKey : style){ final NodeModel styleNode = model.getStyleNode(styleKey); if (styleNode == null) { continue; } final NodeStyleModel styleModel = NodeStyleModel.getModel(styleNode); if (styleModel == null) { continue; } final ShapeConfigurationModel shapeConfiguration = styleModel.getShapeConfiguration(); if (shapeConfiguration.getShape() == null) { continue; } return shapeConfiguration; } return null; }
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; }
@Override void setStyleOnExternalChange(NodeModel node) { final NodeStyleController styleController = NodeStyleController.getController(); final NodeStyleModel.Shape shape = NodeStyleModel.getShape(node); ShapeConfigurationModel viewShape = styleController.getShapeConfiguration(node); final boolean enabled = shape != null; mSetNodeShape.setValue(enabled); mNodeShape.setValue(viewShape.getShape().toString()); enableShapeConfigurationProperties(enabled, shape); mShapeHorizontalMargin.setQuantifiedValue(viewShape.getHorizontalMargin()); mShapeVerticalMargin.setQuantifiedValue(viewShape.getVerticalMargin()); mUniformShape.setValue(viewShape.isUniform()); } }
final Shape shape = shapeConfiguration.getShape(); if (shape != null) { writer.addAttribute("STYLE", shape.toString());