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

io.github.interacto.jfx.command.WidgetCommand Maven / Gradle / Ivy

The newest version!
/*
 * Interacto
 * Copyright (C) 2020 Arnaud Blouin
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * This program 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 General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see .
 */
package io.github.interacto.jfx.command;

import io.github.interacto.command.CommandImpl;

/**
 * Defines an abstract command that concerns a widget.
 * @author Arnaud BLOUIN
 */
public abstract class WidgetCommand extends CommandImpl {
	/** The component concerned by the command. */
	protected T widget;

	/**
	 * Creates the command.
	 */
	public WidgetCommand() {
		super();
	}


	@Override
	public boolean canDo() {
		return widget != null;
	}


	/**
	 * @param n The component concerned by the command.
	 * @since 0.2
	 */
	public void setWidget(final T n) {
		this.widget = n;
	}


	@Override
	public void flush() {
		super.flush();
		widget = null;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy