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

org.intrigus.smartgraph.graphview.SmartStylableNode Maven / Gradle / Ivy

The newest version!
/*
 * The MIT License
 *
 * Copyright 2019 brunomnsilva.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package org.intrigus.smartgraph.graphview;

/**
 * A stylable node can have its css properties changed at runtime.
 * 
* All Java FX nodes used by {@link SmartGraphPanel} to represent graph entities * should implement this interface. * * @see SmartGraphPanel * * @author brunomnsilva */ public interface SmartStylableNode { /** * Applies cumulatively the css inline styles to the node. * * These inline JavaFX styles have higher priority and are not overwritten by * any css classes set by {@link SmartStylableNode#addStyleClass(java.lang.String) }. * But will be discarded if you use {@link SmartStylableNode#setStyleClass(java.lang.String) } * * If you need to clear any previously set inline styles, use * .setStyle(null) * * @param css styles */ public void setStyle(String css); /** * Applies the CSS styling defined in class selector cssClass. * * The cssClass string must not contain a preceding dot, e.g., * "myClass" instead of ".myClass". * * The CSS Class must be defined in smartpgraph.css file or * in the custom provided stylesheet. * * The expected behavior is to remove all current styling before * applying the class css. * * @param cssClass name of the CSS class. */ public void setStyleClass(String cssClass); /** * Applies cumulatively the CSS styling defined in class selector * cssClass. * * The CSS Class must be defined in smartpgraph.css file or * in the custom provided stylesheet. * * The cumulative operation will overwrite any existing styling elements * previously defined for previous classes. * * @param cssClass name of the CSS class. */ public void addStyleClass(String cssClass); /** * Removes a previously cssClass existing CSS styling. * * Given styles can be added sequentially, the removal of a css class * will be a removal that keeps the previous ordering of kept styles. * * @param cssClass name of the CSS class. * * @return true if successful; false if cssClass wasn't * previously set. */ public boolean removeStyleClass(String cssClass); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy