
bibliothek.layouts.Icons Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of docking-frames-demo-layouts Show documentation
Show all versions of docking-frames-demo-layouts Show documentation
${project.name} is a demonstration of various layout styles
The newest version!
package bibliothek.layouts;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import javax.imageio.ImageIO;
import javax.swing.Icon;
import javax.swing.ImageIcon;
public class Icons {
private static Map icons = new HashMap();
private static BufferedImage iconImage;
static{
load( "xml", "xml.png" );
load( "binary", "binary.png" );
load( "load", "load.png" );
load( "add factory", "add_factory.png" );
load( "remove factory", "remove_factory.png" );
load( "add dockable", "add_dockable.png" );
load( "remove dockable", "remove_dockable.png" );
try{
iconImage = ImageIO.read( Icons.class.getResource( "/data/bibliothek/commonLayouts/icons/icon.png" ));
icons.put( "icon", new ImageIcon( iconImage ));
}
catch( IOException ex ){
ex.printStackTrace();
}
}
private static void load( String id, String path ){
URL url = Icons.class.getResource( "/data/bibliothek/commonLayouts/icons/" + path );
ImageIcon icon = new ImageIcon( url );
icons.put( id, icon );
}
public static Icon get( String id ){
return icons.get( id );
}
public static BufferedImage getIconImage() {
return iconImage;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy