All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.palexdev.mfxcomponents.controls.base.MFXSkinBase Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (C) 2022 Parisi Alessandro - [email protected]
 * This file is part of MaterialFX (https://github.com/palexdev/MaterialFX)
 *
 * MaterialFX is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 3 of the License,
 * or (at your option) any later version.
 *
 * MaterialFX is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with MaterialFX. If not, see .
 */

package io.github.palexdev.mfxcomponents.controls.base;

import io.github.palexdev.mfxcore.behavior.BehaviorBase;
import io.github.palexdev.mfxcore.behavior.WithBehavior;
import io.github.palexdev.mfxcore.controls.SkinBase;
import javafx.scene.control.Control;

/**
 * Simple extension of {@link SkinBase} that makes all the width and height related methods public.
 */
public abstract class MFXSkinBase, B extends BehaviorBase> extends SkinBase {

	//================================================================================
	// Constructors
	//================================================================================
	protected MFXSkinBase(C control) {
		super(control);
	}

	//================================================================================
	// Overridden Methods
	//================================================================================

	/**
	 * {@inheritDoc}
	 * 

* This override avoids boiler plate code by automatically calling {@link B#init()}. */ @Override protected void initBehavior(B behavior) { behavior.init(); } @Override public double computeMinWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) { return super.computeMinWidth(height, topInset, rightInset, bottomInset, leftInset); } @Override public double computeMinHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) { return super.computeMinHeight(width, topInset, rightInset, bottomInset, leftInset); } @Override public double computeMaxWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) { return super.computeMaxWidth(height, topInset, rightInset, bottomInset, leftInset); } @Override public double computeMaxHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) { return super.computeMaxHeight(width, topInset, rightInset, bottomInset, leftInset); } @Override public double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) { return super.computePrefWidth(height, topInset, rightInset, bottomInset, leftInset); } @Override public double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) { return super.computePrefHeight(width, topInset, rightInset, bottomInset, leftInset); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy