use of org.freeplane.core.ui.LengthUnits in project freeplane by freeplane.
the class MenuIconScaling method scaleIcon.
static void scaleIcon(final AbstractButton actionComponent) {
final Icon icon = actionComponent.getIcon();
final IconFactory imageIconFactory = IconFactory.getInstance();
if (icon != null && imageIconFactory.canScaleIcon(icon)) {
final Font font = actionComponent.getFont();
final int fontHeight = actionComponent.getFontMetrics(font).getHeight();
final Quantity<LengthUnits> iconHeight = new Quantity<LengthUnits>(1.2 * fontHeight, LengthUnits.px);
actionComponent.setIcon(FreeplaneIconFactory.toImageIcon(imageIconFactory.getScaledIcon(icon, iconHeight)));
}
}
use of org.freeplane.core.ui.LengthUnits in project freeplane by freeplane.
the class NodeShapeControlGroup method addControlGroup.
public void addControlGroup(DefaultFormBuilder formBuilder) {
mSetNodeShape = new BooleanProperty(ControlGroup.SET_RESOURCE);
mNodeShape = ComboProperty.of(NODE_SHAPE, NodeStyleModel.Shape.class);
mShapeHorizontalMargin = new QuantityProperty<LengthUnits>(SHAPE_HORIZONTAL_MARGIN, 0, 1000, 0.1, LengthUnits.pt);
mShapeVerticalMargin = new QuantityProperty<LengthUnits>(SHAPE_VERTICAL_MARGIN, 0, 1000, 0.1, LengthUnits.pt);
mUniformShape = new BooleanProperty(UNIFORM_SHAPE);
propertyChangeListener = new NodeShapeChangeListener(mSetNodeShape, mNodeShape, mShapeHorizontalMargin, mShapeVerticalMargin, mUniformShape);
mSetNodeShape.addPropertyChangeListener(propertyChangeListener);
mNodeShape.addPropertyChangeListener(propertyChangeListener);
mShapeHorizontalMargin.addPropertyChangeListener(propertyChangeListener);
mShapeVerticalMargin.addPropertyChangeListener(propertyChangeListener);
mUniformShape.addPropertyChangeListener(propertyChangeListener);
mSetNodeShape.layout(formBuilder);
mNodeShape.layout(formBuilder);
new NextColumnProperty(2).layout(formBuilder);
mShapeHorizontalMargin.layout(formBuilder);
new NextColumnProperty(2).layout(formBuilder);
mShapeVerticalMargin.layout(formBuilder);
new NextColumnProperty(2).layout(formBuilder);
mUniformShape.layout(formBuilder);
}
use of org.freeplane.core.ui.LengthUnits in project freeplane by freeplane.
the class BorderWidthAndBorderWidthMatchesEdgeControlGroup method addBorderWidthControl.
private void addBorderWidthControl(DefaultFormBuilder formBuilder) {
mSetBorderWidth = new BooleanProperty(ControlGroup.SET_RESOURCE);
mBorderWidth = new QuantityProperty<LengthUnits>(BORDER_WIDTH, 0, 100000, 0.1, LengthUnits.px);
borderWidthListener = new BorderWidthListener(mSetBorderWidth, mBorderWidth);
mSetBorderWidth.addPropertyChangeListener(borderWidthListener);
mBorderWidth.addPropertyChangeListener(borderWidthListener);
mSetBorderWidth.layout(formBuilder);
mBorderWidth.layout(formBuilder);
}
use of org.freeplane.core.ui.LengthUnits in project freeplane by freeplane.
the class ChildDistanceControlGroup method addControlGroup.
public void addControlGroup(DefaultFormBuilder formBuilder) {
mSetChildDistance = new BooleanProperty(ControlGroup.SET_RESOURCE);
mChildDistance = new QuantityProperty<LengthUnits>(VERTICAL_CHILD_GAP, 0, 1000, 0.1, LengthUnits.px);
propertyChangeListener = new ChildDistanceChangeListener(mSetChildDistance, mChildDistance);
mSetChildDistance.addPropertyChangeListener(propertyChangeListener);
mChildDistance.addPropertyChangeListener(propertyChangeListener);
mSetChildDistance.layout(formBuilder);
mChildDistance.layout(formBuilder);
}
use of org.freeplane.core.ui.LengthUnits in project freeplane by freeplane.
the class IconController method getIconSize.
public Quantity<LengthUnits> getIconSize(NodeModel node) {
final MapModel map = node.getMap();
final ModeController modeController = Controller.getCurrentModeController();
final LogicalStyleController styleController = LogicalStyleController.getController(modeController);
final Collection<IStyle> styles = styleController.getStyles(node);
final Quantity<LengthUnits> size = getStyleIconSize(map, styles);
return size;
}
Aggregations