public void setBackgroundImage(String name) { backgroundImage = Icons.getIcon(name); }
/** * Gets an Icon by its file name. e.g. add.png would return the icon depicted in the add.png file on the * class path. * @param name The name of the icon file in the class path. May be {@code null}. * @return The Icon for the specified file name, or {@code null} if the file does not exist in the class path, or * {@code null} if the specified file name is {@code null}. */ public static Icon getIcon(String name) { if(name == null) { return null; } try { URL url = getIconURLFromIconFileName(name); if(url == null) { return null; } return new ImageIcon(url); } catch (Exception e) { return null; } }
/** * Gets the URL of the specified (icon) file fileName. * @param fileName The file name. May be {@code null}. * @return The URL of the specified file name in the class path. May be {@code null}. */ private static URL getIconURLFromIconFileName(String fileName) { if(fileName == null) { return null; } Bundle b = PluginUtilities.getInstance().getApplicationBundle(); URL url = b.getResource(fileName); if(url != null) { return url; } if(!isNameAbsolute(fileName)) { return b.getResource(ALTERNATIVE_ICONS_PATH + fileName); } return null; }
public void setBackgroundImage(String name) { backgroundImage = Icons.getIcon(name); }
/** * Gets the URL of the specified (icon) file fileName. * @param fileName The file name. May be {@code null}. * @return The URL of the specified file name in the class path. May be {@code null}. */ private static URL getIconURLFromIconFileName(String fileName) { if(fileName == null) { return null; } Bundle b = PluginUtilities.getInstance().getApplicationBundle(); URL url = b.getResource(fileName); if(url != null) { return url; } if(!isNameAbsolute(fileName)) { return b.getResource(ALTERNATIVE_ICONS_PATH + fileName); } return null; }
/** * Gets an Icon by its file name. e.g. add.png would return the icon depicted in the add.png file on the * class path. * @param name The name of the icon file in the class path. May be {@code null}. * @return The Icon for the specified file name, or {@code null} if the file does not exist in the class path, or * {@code null} if the specified file name is {@code null}. */ public static Icon getIcon(String name) { if(name == null) { return null; } try { URL url = getIconURLFromIconFileName(name); if(url == null) { return null; } return new ImageIcon(url); } catch (Exception e) { return null; } }
public void setBackgroundImage(String name) { backgroundImage = Icons.getIcon(name); }
public ZoomOutCommand(OWLVizViewI view) { super("Zoom Out", Icons.getIcon("zoom.out.png")); this.putValue(AbstractAction.SHORT_DESCRIPTION, "Zoom Out"); this.view = view; }
public ZoomInCommand(OWLVizViewI view) { super("Zoom In", Icons.getIcon("zoom.in.png")); this.putValue(AbstractAction.SHORT_DESCRIPTION, "Zoom In"); this.view = view; }
public BackgroundTaskLabel(BackgroundTaskManager mngr) { super(Icons.getIcon("busy.gif")); setOpaque(false); setVisible(false); this.mngr = mngr; t = new Timer(DELAY_MILLIS, timeout); t.setRepeats(false); mngr.addBusyListener(this); setupMouseHandler(); }
public BackgroundTaskLabel(BackgroundTaskManager mngr) { super(Icons.getIcon("busy.gif")); setOpaque(false); setVisible(false); this.mngr = mngr; t = new Timer(DELAY_MILLIS, timeout); t.setRepeats(false); mngr.addBusyListener(this); setupMouseHandler(); }
public BackgroundTaskLabel(BackgroundTaskManager mngr) { super(Icons.getIcon("busy.gif")); setOpaque(false); setVisible(false); this.mngr = mngr; t = new Timer(DELAY_MILLIS, timeout); t.setRepeats(false); mngr.addBusyListener(this); setupMouseHandler(); }
final protected void createUI() { backgroundImage = Icons.getIcon("logo.wizard.png"); setLayout(new BorderLayout(7, 7)); marginPanel.setPreferredSize(new Dimension(150, 400));
public PluginTable(List<PluginInfo> plugins) { setOpaque(false); this.provider = new ArrayList<>(plugins); addComponentListener(componentAdapter); setLayout(new BorderLayout()); setPreferredSize(new Dimension(500, 200)); waitLabel = new JLabel("Checking for plugins...", Icons.getIcon("busy.gif"), SwingConstants.CENTER); add(waitLabel, BorderLayout.CENTER); handleTableShown(); }
public PluginTable(PluginRegistry provider) { setOpaque(false); this.provider = provider; addComponentListener(componentAdapter); setLayout(new BorderLayout()); setPreferredSize(new Dimension(500, 200)); waitLabel = new JLabel("Checking for plugins...", Icons.getIcon("busy.gif"), SwingConstants.CENTER); add(waitLabel, BorderLayout.CENTER); }
iconLabel.setIcon(Icons.getIcon("logo.48x48.png")); holder.add(iconLabel, new GridBagConstraints( 0, 1,
private void markCheckedMenu(boolean marked) { if (marked) { JCheckBoxMenuItem it = new JCheckBoxMenuItem(); it.setSelected(true); /* * This is unfortunate. We cannot easily get the checkbox * icon from the L&F. Actually we get it, and then it * throws a class cast exception when it tries to paint it, * because it expects the component to be a JCheckBox. */ menu.setIcon(Icons.getIcon("hierarchy.collapsed.gif")); } else { menu.setIcon(null); } }
final protected void createUI() { backgroundImage = Icons.getIcon("logo.wizard.png"); setLayout(new BorderLayout(7, 7)); marginPanel = new JPanel(new BorderLayout());
iconLabel.setIcon(Icons.getIcon("logo.48x48.png")); holder.add(iconLabel, new GridBagConstraints( 0, 1,
final protected void createUI() { backgroundImage = Icons.getIcon("logo.wizard.png"); setLayout(new BorderLayout(7, 7)); marginPanel = new JPanel(new BorderLayout());