public Insets getInsets(){ int edgeWidthInset = (int) (getUnzoomedBorderWidth() - 1); final ShapeConfigurationModel shapeConfiguration = getShapeConfiguration(); int horizontalMargin = shapeConfiguration.getHorizontalMargin().toBaseUnitsRounded() + edgeWidthInset; int verticalMargin = shapeConfiguration.getVerticalMargin().toBaseUnitsRounded() + edgeWidthInset; return new Insets(verticalMargin, horizontalMargin, verticalMargin, horizontalMargin); }
protected double getMinimumVerticalInset(){ return getShapeConfiguration().getVerticalMargin().toBaseUnits() * getZoom()+ getPaintedBorderWidth() - 1; }
@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()); } }
BackwardCompatibleQuantityWriter.forWriter(writer).writeQuantity("SHAPE_HORIZONTAL_MARGIN", shapeHorizontalMargin); final Quantity<LengthUnits> shapeVerticalMargin = shapeConfiguration.getVerticalMargin(); if (! shapeVerticalMargin.equals(ShapeConfigurationModel.DEFAULT_MARGIN)) { BackwardCompatibleQuantityWriter.forWriter(writer).writeQuantity("SHAPE_VERTICAL_MARGIN", shapeVerticalMargin);