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

it.cnr.imaa.essi.lablib.gui.checkboxtree.CheckboxTreeCellRenderer Maven / Gradle / Ivy

Go to download

manufacturing Management dedicated to manage all related with production BOM, costing, and manufacturing.

There is a newer version: shw-air-terminal-vertical-1.0.57
Show newest version
/*
 * Copyright 2006,2007 Enrico Boldrini, Lorenzo Bigagli This file is part of
 * CheckboxTree. CheckboxTree 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 2 of the License, or (at your
 * option) any later version. CheckboxTree 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 CheckboxTree; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301, USA
 */
package it.cnr.imaa.essi.lablib.gui.checkboxtree;

import java.awt.Component;

import javax.swing.JTree;
import javax.swing.tree.TreeCellRenderer;

/**
 * The renderer for a cell in a CheckboxTree.
 * 
 * @author bigagli
 */
public interface CheckboxTreeCellRenderer extends TreeCellRenderer {

    /**
         * This method is redeclared just to underline that the implementor has
         * to properly display the checking/graying state of value.
         * This should go in the method parameters, but would imply changes to
         * Swing classes that were considered unpractical. For example in
         * DefaultCheckboxTreeCellRenderer the following code is used to get the
         * checking/graying states:
         * 
         * 
         * TreeCheckingModel checkingModel = ((CheckboxTree) tree).getCheckingModel();
         * 
         * TreePath path = tree.getPathForRow(row);
         * 
         * boolean enabled = checkingModel.isPathEnabled(path);
         * 
         * boolean checked = checkingModel.isPathChecked(path);
         * 
         * boolean greyed = checkingModel.isPathGreyed(path);
         * 
* * You could use a QuadristateCheckbox to properly renderer the states * (as in DefaultCheckboxTreeCellRenderer). * * @see TreeCellRenderer#getTreeCellRendererComponent */ Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus); /** * Returns whether the specified relative coordinates insist on the * intended checkbox control. May be used by a mouse listener to figure * out whether to toggle a node or not. */ public boolean isOnHotspot(int x, int y); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy