@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()); } }
private void updateShape() { final ShapeConfigurationModel newShape = NodeStyleController.getController(getMap().getModeController()).getShapeConfiguration(model); final ShapeConfigurationModel oldShape; if(mainView != null) oldShape = mainView.getShapeConfiguration(); else oldShape = null; if (mainView != null && oldShape.equals(newShape)) return; final MainView newMainView = NodeViewFactory.getInstance().newMainView(this); if(newMainView.getShapeConfiguration().equals(oldShape)) return; setMainView(newMainView); if (map.getSelected() == this) { requestFocusInWindow(); } }
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; }
ColorUtils.addColorAttributes(writer, "BACKGROUND_COLOR", "BACKGROUND_ALPHA", backgroundColor); final ShapeConfigurationModel shapeConfiguration = forceFormatting ? nsc.getShapeConfiguration(node) : style.getShapeConfiguration(); final Shape shape = shapeConfiguration.getShape(); if (shape != null) {