/** Find an icon for this node. Uses an {@link #setIconBase icon set}. * * @param type constants from {@link java.beans.BeanInfo} * * @return icon to use to represent the bean */ public Image getIcon(int type) { return findIcon(type, ICON_BASE); }
/** Finds an icon for this node when opened. This icon should represent the node * only when it is opened (when it can have children). * * @param type as in {@link #getIcon} * @return icon to use to represent the bean when opened */ public Image getOpenedIcon(int type) { return findIcon(type, OPENED_ICON_BASE); }
/** Tries to find the right icon for the iconbase. * @param type type of icon (from BeanInfo constants) * @param ib base where to scan in the array */ private Image findIcon(int type, int ib) { String res = iconBase + icons[type + ib] + iconExtension; Image im = ImageUtilities.loadImage(res, true); if (im != null) { return im; } // try the first icon res = iconBase + icons[java.beans.BeanInfo.ICON_COLOR_16x16 + ib] + iconExtension; im = ImageUtilities.loadImage(res, true); if (im != null) { return im; } if (ib == OPENED_ICON_BASE) { // try closed icon also return findIcon(type, ICON_BASE); } // if still not found return default icon return getDefaultIcon(); }
/** Finds an icon for this node when opened. This icon should represent the node * only when it is opened (when it can have children). * * @param type as in {@link #getIcon} * @return icon to use to represent the bean when opened */ public Image getOpenedIcon (int type) { return findIcon (type, OPENED_ICON_BASE); }
/** Find an icon for this node. Uses an {@link #setIconBase icon set}. * * @param type constants from {@link java.beans.BeanInfo} * * @return icon to use to represent the bean */ public Image getIcon (int type) { return findIcon (type, ICON_BASE); }
/** Finds an icon for this node when opened. This icon should represent the node * only when it is opened (when it can have children). * * @param type as in {@link #getIcon} * @return icon to use to represent the bean when opened */ public Image getOpenedIcon (int type) { return findIcon (type, OPENED_ICON_BASE); }
/** Find an icon for this node. Uses an {@link #setIconBase icon set}. * * @param type constants from {@link java.beans.BeanInfo} * * @return icon to use to represent the bean */ public Image getIcon (int type) { return findIcon (type, ICON_BASE); }
/** Tries to find the right icon for the iconbase. * @param type type of icon (from BeanInfo constants) * @param ib base where to scan in the array */ private Image findIcon (int type, int ib) { String res = iconBase + icons[type + ib]; Image im = Utilities.loadImage (res); if (im != null) return im; // try the first icon res = iconBase + icons[java.beans.BeanInfo.ICON_COLOR_16x16 + ib]; im = Utilities.loadImage (res); if (im != null) return im; if (ib == OPENED_ICON_BASE) { // try closed icon also return findIcon (type, ICON_BASE); } // if still not found return default icon return getDefaultIcon (); }
/** Tries to find the right icon for the iconbase. * @param type type of icon (from BeanInfo constants) * @param ib base where to scan in the array */ private Image findIcon (int type, int ib) { String res = iconBase + icons[type + ib]; Image im = Utilities.loadImage (res); if (im != null) return im; // try the first icon res = iconBase + icons[java.beans.BeanInfo.ICON_COLOR_16x16 + ib]; im = Utilities.loadImage (res); if (im != null) return im; if (ib == OPENED_ICON_BASE) { // try closed icon also return findIcon (type, ICON_BASE); } // if still not found return default icon return getDefaultIcon (); }