/* * [IncludeState.java] * * Summary: Possible visible states a dir of file can hav in the JTree. * * Copyright: (c) 2011-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.0 2011-01-31 initial version */ package com.mindprod.constellation; import javax.swing.ImageIcon; /** * Possible visible states a dir of file can hav in the JTree. * * @author Roedy Green, Canadian Mind Products * @version 1.0 2011-01-31 initial version * @since 2011-01-31 */ public enum IncludeState { INCLUDE( "includedir.png", "includefile.png" ), EXCLUDE( "excludedir.png", "excludefile.png" ), INHERIT( "inheritdir.png", "inheritfile.png" ), INHERIT_INCLUDE( "inheritincludedir.png", "inheritincludefile.png" ), INHERIT_EXCLUDE( "inheritexcludedir.png", "inheritexcludefile.png" ); /** * png icon for dir for this state in the constellation/image resource directory */ private final ImageIcon dirIcon; /** * png icon for file for this state in the constellation/image resource directory */ private final ImageIcon fileIcon; /** * Constructor * * @param dirPng png icon for dir for this state in the constellation/image resource directory * @param filePng png icon for file for this state in the constellation/image resource directory */ IncludeState( final String dirPng, final String filePng ) { this.dirIcon = new ImageIcon( IncludeState.class.getResource( dirPng ) ); this.fileIcon = new ImageIcon( IncludeState.class.getResource( filePng ) ); } /** * get the icon to render this dir node based in include/exclude status * * @return ImageIcon for dirNode based in IncludedState */ ImageIcon getDirIcon() { return this.dirIcon; } /** * get the icon to render this file leaf based in include/exclude status * * @return ImageIcon for dirNode based in IncludedState */ ImageIcon getFileIcon() { return this.fileIcon; } }