微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

javax.swing.Icon的实例源码

项目:Openjsharp    文件SynthTableuI.java   
/**
 * {@inheritDoc}
 */
@Override
protected void uninstallDefaults() {
    table.setDefaultRenderer(Date.class,dateRenderer);
    table.setDefaultRenderer(Number.class,numberRenderer);
    table.setDefaultRenderer(Double.class,doubleRender);
    table.setDefaultRenderer(Float.class,floatRenderer);
    table.setDefaultRenderer(Icon.class,iconRenderer);
    table.setDefaultRenderer(ImageIcon.class,imageIconRenderer);
    table.setDefaultRenderer(Boolean.class,booleanRenderer);
    table.setDefaultRenderer(Object.class,objectRenderer);

    if (table.getTransferHandler() instanceof UIResource) {
        table.setTransferHandler(null);
    }
    SynthContext context = getContext(table,ENABLED);
    style.uninstallDefaults(context);
    context.dispose();
    style = null;
}
项目:rapidminer    文件ButtonDialog.java   
private JPanel makeInfoPanel(String message,Icon icon) {
    JLabel infoIcon = new JLabel(icon);
    infoIcon.setVerticalAlignment(SwingConstants.TOP);
    JPanel infoPanel = new JPanel(new BorderLayout(20,0));
    infoPanel.setBorder(BorderFactory.createEmptyBorder(12,16,4));
    infoPanel.add(infoIcon,BorderLayout.WEST);
    int width;
    if (centerComponent != null) {
        width = (int) centerComponent.getPreferredSize().getWidth() - 88; // icon plus padding
        if (width < 420) {
            width = 420;
        }
    } else {
        width = 420;
    }

    infoTextLabel = new FixedWidthEditorPane(width,message);
    // set the background as for infoPanel such that infoTextLabel looks like a JLabel
    infoTextLabel.setBackground(infoPanel.getBackground());

    infoPanel.add(infoTextLabel,BorderLayout.CENTER);

    return infoPanel;
}
项目:litiengine    文件IconTreeListRenderer.java   
private static Icon getIcon(Prop prop) {
  String cacheKey = Game.getEnvironment().getMap().getName() + "-" + prop.getName() + "-" + prop.getMapId() + "-tree";
  BufferedImage propImag;
  if (ImageCache.IMAGES.containsKey(cacheKey)) {
    propImag = ImageCache.IMAGES.get(cacheKey);
  } else {

    final String name = "prop-" + prop.getSpritesheetName().toLowerCase() + "-" + PropState.INTACT.toString().toLowerCase();
    final String fallbackName = "prop-" + prop.getSpritesheetName().toLowerCase();
    Spritesheet sprite = Spritesheet.find(name);
    if (sprite == null) {
      sprite = Spritesheet.find(fallbackName);
    }

    if (sprite == null) {
      return null;
    }

    propImag = ImageProcessing.scaleImage(sprite.getSprite(0),true);
    ImageCache.IMAGES.put(cacheKey,propImag);
  }

  return new ImageIcon(propImag);
}
项目:jdk8u-jdk    文件SynthTableuI.java   
/**
 * {@inheritDoc}
 */
@Override
protected void uninstallDefaults() {
    table.setDefaultRenderer(Date.class,ENABLED);
    style.uninstallDefaults(context);
    context.dispose();
    style = null;
}
项目:rapidminer    文件PlotterChooser.java   
private Icon getIcon(String plotterName,boolean selected) {

            // check to decide which icon size should be loaded
            if (!isSmallIconsUsed()) {
                if (selected) {
                    return SwingTools.createImage("icons/chartPreview/" + ICON_SIZE + "/" + plotterName.replace(' ','_')
                            + ".png");
                } else {
                    return SwingTools.createImage("icons/chartPreview/" + ICON_SIZE + "/" + plotterName.replace(' ','_')
                            + "-grey.png");
                }
            } else {
                if (selected) {
                    return SwingTools.createImage("icons/chartPreview/" + SMALL_ICON_SIZE + "/"
                            + plotterName.replace(' ','_') + ".png");
                } else {
                    return SwingTools.createImage("icons/chartPreview/" + SMALL_ICON_SIZE + "/"
                            + plotterName.replace(' ','_') + "-grey.png");
                }
            }
        }
项目:incubator-netbeans    文件ToggleButtonMenuItem.java   
private static Icon createMenuIcon(Icon icon,Component decorator) {
    int h = menuIconSize();
    int w = UIUtils.isAquaLookAndFeel() ? h + 4 : h;

    BufferedImage i = new BufferedImage(w,h,BufferedImage.TYPE_INT_ARGB);
    Graphics g = i.getGraphics();

    if (decorator != null) {
        decorator.setSize(w,h);
        decorator.paint(g);
    }

    icon.paintIcon(null,g,(w - icon.getIconWidth()) / 2,(h - icon.getIconHeight()) / 2);
    g.dispose();

    return new ImageIcon(i);
}
项目:incubator-netbeans    文件GenericToolbar.java   
public Dimension getPreferredSize() {
    Dimension dim = super.getPreferredSize();
    if (PREFERRED_HEIGHT == -1) {
        GenericToolbar tb = new GenericToolbar();
        tb.setBorder(getBorder());
        tb.setBorderPainted(isBorderPainted());
        tb.setRollover(isRollover());
        tb.setFloatable(isFloatable());
        Icon icon = Icons.getIcon(GeneralIcons.SAVE);
        tb.add(new JButton("Button",icon)); // NOI18N
        tb.add(new JToggleButton("Button",icon)); // NOI18N
        tb.add(new JTextField("Text")); // NOI18N
        JComboBox c = new JComboBox();
        c.setEditor(new BasicComboBoxEditor());
        c.setRenderer(new BasicComboBoxRenderer());
        tb.add(c);
        tb.addSeparator();
        PREFERRED_HEIGHT = tb.getSuperPreferredSize().height;
    }
    dim.height = getParent() instanceof JToolBar ? 1 :
                 Math.max(dim.height,PREFERRED_HEIGHT);
    return dim;
}
项目:Logisim    文件AddTool.java   
@Override
public void paintIcon(ComponentDrawContext c,int x,int y) {
    FactoryDescription desc = description;
    if (desc != null && !desc.isFactoryLoaded()) {
        Icon icon = desc.getIcon();
        if (icon != null) {
            icon.paintIcon(c.getDestination(),c.getGraphics(),x + 2,y + 2);
            return;
        }
    }

    ComponentFactory source = getFactory();
    if (source != null) {
        AttributeSet base = getBaseAttributes();
        source.paintIcon(c,x,y,base);
    }
}
项目:incubator-netbeans    文件LocationChooser.java   
public @Override Icon getIcon(File _f) {
    File f = FileUtil.normalizefile(_f);
    Icon original = fsv.getSystemIcon(f);
    if (original == null) {
        // L&F (e.g. GTK) did not specify any icon.
        original = EMPTY;
    }
    if ( isPlatformDir( f ) ) {
        if ( original.equals( lastOriginal ) ) {
            return lastMerged;
        }
        lastOriginal = original;
        lastMerged = new MergedIcon(original,BADGE,-1,-1);                
        return lastMerged;
    }
    else {
        return original;
    }
}
项目:incubator-netbeans    文件DependencyGraphTopComponent.java   
/**
 * @return map of maven artifact mapped to project icon
 */
private Map<Artifact,Icon> getIconsForOpenProjects() {
    Map<Artifact,Icon> result = new HashMap<Artifact,Icon>();
    //NOTE: surely not the best way to get the project icon
    Project[] openProjects = OpenProjects.getDefault().getopenProjects();
    for (Project project : openProjects) {
        NbMavenProject mavenProject = project.getLookup().lookup(NbMavenProject.class);
        if (null != mavenProject) {
            Artifact artifact = mavenProject.getMavenProject().getArtifact();
            //get icon from opened project
            Icon icon = ProjectUtils.get@R_180_4045@ion(project).getIcon();
            if (null != icon) {
                result.put(artifact,icon);
            }
        }
    }
    return result;
}
项目:incubator-netbeans    文件CloseButtonFactory.java   
private static Icon getCloseTabImage() {
    if( null == closeTabImage ) {
        String path = UIManager.getString("nb.close.tab.icon.enabled.name" ); //NOI18N
        if( null != path ) {
            closeTabImage = ImageUtilities.loadImageIcon(path,true); // NOI18N
        }
    }
    if( null == closeTabImage ) {
        if( isWindows8LaF() || isWindows10LaF() ) {
            closeTabImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/win8_bigclose_enabled.png",true); // NOI18N
        } else if( isWindowsVistaLaF() ) {
            closeTabImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/vista_close_enabled.png",true); // NOI18N
        } else if( isWindowsXPLaF() ) {
            closeTabImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/xp_close_enabled.png",true); // NOI18N
        } else if( isWindowsLaF() ) {
            closeTabImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/win_close_enabled.png",true); // NOI18N
        } else if( isAquaLaF() ) {
            closeTabImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/mac_close_enabled.png",true); // NOI18N
        } else if( isGTKLaF() ) {
            closeTabImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/gtk_close_enabled.png",true); // NOI18N
        } else {
            closeTabImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/Metal_close_enabled.png",true); // NOI18N
        }
    }
    return closeTabImage;
}
项目:incubator-netbeans    文件ElementIcons.java   
/**
 * Returns an icon for the given {@link ModuleElement.DirectiveKind}.
 * @param kind the {@link ModuleElement.DirectiveKind} to return an icon for.
 * @return the icon
 * @since 1.45
 */
public static Icon getModuleDirectiveIcon(@NonNull final ModuleElement.DirectiveKind kind) {
    Parameters.notNull("kind",kind);   //NOI18N
    switch (kind) {
        case EXPORTS:
            return ImageUtilities.loadImageIcon(EXPORTS_ICON,true);
        case REQUIRES:
            return ImageUtilities.loadImageIcon(REQUIRES_ICON,true);
        case USES:
            return ImageUtilities.loadImageIcon(USES_ICON,true);
        case PROVIDES:
            return ImageUtilities.loadImageIcon(PROVIDES_ICON,true);
        case OPENS:
            return ImageUtilities.loadImageIcon(OPENS_ICON,true);
        default:
            throw new IllegalArgumentException(kind.toString());
    }
}
项目:alevin-svn2    文件FloatingTabbedPane.java   
/**
 * Creates a tabpage title component with close button and registers it to
 * hidden tabs
 * 
 * @return the new tab
 */
private JPanel createTab(String title,Icon icon,final Component component) {
    JPanel tab = new JPanel(new BorderLayout(0,0));
    tab.setopaque(false);

    JLabel lbl = new JLabel(title,icon,SwingConstants.LEFT);
    tab.add(lbl,BorderLayout.WEST);

    return tab;
}
项目:Equella    文件Editor.java   
/**
 * Creates a new button for displaying on the left hand side.
 */
private JButton createHeaderButton(String text,String iconPath)
{
    Icon icon = new ImageIcon(Editor.class.getResource(iconPath));

    JButton button = new JButton(text,icon);
    button.setBorderPainted(false);
    button.setContentAreaFilled(false);
    button.addActionListener(buttonListener);
    return button;
}
项目:incubator-netbeans    文件ETableHeader.java   
/**
 * Utility method merging 2 icons.
 */
private static Icon mergeIcons(Icon icon1,Icon icon2,int y,Component c) {
    int w = 0,h = 0;
    if (icon1 != null) {
        w = icon1.getIconWidth();
        h = icon1.getIconHeight();
    }
    if (icon2 != null) {
        w = icon2.getIconWidth()  + x > w ? icon2.getIconWidth()   + x : w;
        h = icon2.getIconHeight() + y > h ? icon2.getIconHeight()  + y : h;
    }
    if (w < 1) w = 16;
    if (h < 1) h = 16;

    java.awt.image.ColorModel model = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment ().
                                      getDefaultScreenDevice ().getDefaultConfiguration ().
                                      getColorModel (java.awt.Transparency.BITMASK);
    java.awt.image.BufferedImage buffImage = new java.awt.image.BufferedImage (model,model.createCompatibleWritableRaster (w,h),model.isAlphaPremultiplied (),null);

    java.awt.Graphics g = buffImage.createGraphics ();
    if (icon1 != null) {
        icon1.paintIcon(c,0);
    }
    if (icon2 != null) {
        icon2.paintIcon(c,y);
    }
    g.dispose();

    return new ImageIcon(buffImage);
}
项目:incubator-netbeans    文件DropDownButton.java   
private Icon _getRolloverSelectedIcon() {
    Icon icon = null;
    icon = arrowIcons.get( mouseInArrowArea ? ICON_ROLlovER_SELECTED : ICON_ROLlovER_SELECTED_LINE );
    if( null == icon ) {
        Icon orig = regIcons.get( ICON_ROLlovER_SELECTED );
        if( null == orig )
            orig = regIcons.get( ICON_ROLlovER );
        if( null == orig )
            orig = regIcons.get( ICON_norMAL );
        icon = new IconWithArrow( orig,!mouseInArrowArea );
        arrowIcons.put( mouseInArrowArea ? ICON_ROLlovER_SELECTED : ICON_ROLlovER_SELECTED_LINE,icon );
    }
    return icon;
}
项目:incubator-netbeans    文件ObjectNode.java   
protected Icon computeIcon() {
    ImageIcon icon = browserUtils.ICON_INSTANCE;

    if ((getMode() == HeapWalkerNode.MODE_REFERENCES) && getInstance().isGCRoot()) {
        icon = browserUtils.createGCRootIcon(icon);
    }

    return processLoopIcon(icon);
}
项目:VASSAL-src    文件IconFamily.java   
/**
 * Return the scalable icon directly (used by {@link IconImageConfigurer})
 *
 * @return
 */
public Icon getscalableIcon() {
  synchronized (this) {
    buildscalableIcon();
  }
  return scalableIcon;
}
项目:ProyectoPacientes    文件JDeliminar.java   
private void busquedaKeypressed(java.awt.event.KeyEvent evt) {//GEN-FirsT:event_busquedaKeypressed
    // Todo add your handling code here:
    String codigo = ecod.getText();
    String apellido = eape.getText();
    String nombre = enom.getText();
    String direccion = edir.getText();
    String telefono = etel.getText();
    String colegiado = ecole.getText();
    if(codigo.length()==0||apellido.length()==0||nombre.length()==0||direccion.length()==0||telefono.length()==0||colegiado.length()==0)
    {
        JOptionPane.showMessageDialog(null,"Los registros no pueden estar vacios\nPor favor llene los registros","Advertencia",JOptionPane.WARNING_MESSAGE);
        enom.requestFocus();
    }
    else
    {
        if(apellido.length()>50||nombre.length()>50||direccion.length()>50||telefono.length()>12||colegiado.length()>50)
        {
            JOptionPane.showMessageDialog(null,"El numero de caracteres en los registros es mayor al permitido\nNombre,Apellido,Direccion y Colegiado no pueden ser mayor a 50 caracteres\nTelefono no puede ser mayor a 12",JOptionPane.WARNING_MESSAGE);
            enom.requestFocus();
        }
        else
        {
            Icon i = new ImageIcon(getClass().getResource("/Imagenes/Aceptar.jpg"));
            Medico m = new Medico(eape.getText(),enom.getText(),edir.getText(),etel.getText(),ecole.getText());
            JOptionPane.showMessageDialog(null,m.EliminarMedico(m,ecod.getText()),"Mensaje",JOptionPane.@R_180_4045@ION_MESSAGE,i);
            Tabla t = new Tabla();
            t.LimpiarTabla(tablaEli);
            m.PresentarDatos(tablaEli);
        }
    }
}
项目:incubator-netbeans    文件DefaultTabDataModel.java   
private int[] _setIcon(int[] indices,Icon[] icons,final boolean[] widthChanged) {
    widthChanged[0] = false;
    boolean fireChange = false;
    boolean[] changed = new boolean[indices.length];
    int changedCount = 0;
    Arrays.fill(changed,false);
    boolean[] currWidthChanged = new boolean[]{false};
    boolean currChanged = false;
    for (int i = 0; i < indices.length; i++) {
        currChanged =
                _setIcon(indices[i],icons[i],currWidthChanged);
        fireChange |= currChanged;
        widthChanged[0] |= currWidthChanged[0];
        if (currChanged)
            changedCount++;
        changed[i] = currChanged;
    }
    int[] toFire;
    if (widthChanged[0] || fireChange) {
        if (changedCount == indices.length) {
            toFire = indices;
        } else {
            toFire = new int[changedCount];
            int idx = 0;
            for (int i = 0; i < indices.length; i++) {
                if (changed[i]) {
                    toFire[idx] = indices[i];
                    idx++;
                }
            }
        }
        return toFire;
    }
    return null;
}
项目:rapidminer    文件ColorRGBComboBoxCellRenderer.java   
@Override
public Component getListCellRendererComponent(JList list,Object value,int index,boolean isSelected,boolean cellHasFocus) {
    JLabel listCellRendererComponent = (JLabel) defaultRenderer.getListCellRendererComponent(list,value,index,isSelected,cellHasFocus);

    listCellRendererComponent.setPreferredSize(new Dimension(50,20));

    if (!(value instanceof Color)) {
        return listCellRendererComponent;
    }

    listCellRendererComponent.setText("");

    Color color = (Color) value;

    Icon iicon = colorMap.get(color);
    if (iicon == null) {
        colorMap.put(color,createColoredRectangleIcon(color));
        iicon = colorMap.get(color);
    }

    listCellRendererComponent.setIcon(iicon);
    listCellRendererComponent.setBackground(color);

    if (isSelected && index != -1) {
        listCellRendererComponent.setBorder(focusBorder);
    } else {
        listCellRendererComponent.setBorder(noFocusBorder);
    }

    return listCellRendererComponent;
}
项目:incubator-netbeans    文件TabControlButtonFactory.java   
public static Icon getIcon( String iconPath ) {
    Icon res = ImageUtilities.loadImageIcon( iconPath,true );
    if( null == res ) {
        Logger.getLogger( TabControlButtonFactory.class.getName() ).log( Level.INFO,"Cannot find button icon: " + iconPath );
    }
    return res;
}
项目:incubator-netbeans    文件LabelRenderer.java   
public void setIcon(Icon icon) {
    int oldIconWidth = iconWidth;
    iconWidth = icon == null ? 0 : icon.getIconWidth();
    iconHeight = icon == null ? 0 : icon.getIconHeight();
    this.icon = icon;
    if (oldIconWidth != iconWidth) resetPreferredSize(true,false);
}
项目:org.alloytools.alloy    文件OurUtil.java   
/**
 * Load the given image file from an accompanying JAR file,and return it as
 * an Icon object.
 */
public static Icon loadIcon(String pathname) {
    URL url = OurUtil.class.getClassLoader().getResource(pathname);
    if (url != null)
        return new ImageIcon(Toolkit.getDefaultToolkit().createImage(url));
    return new ImageIcon(new BufferedImage(1,1,BufferedImage.TYPE_INT_RGB));
}
项目:incubator-netbeans    文件WinClassicViewTabdisplayerUI.java   
@Override
public Icon getButtonIcon(int buttonId,int buttonState) {
    Icon res = null;
    initIcons();
    String[] paths = buttonIconPaths.get( buttonId );
    if( null != paths && buttonState >=0 && buttonState < paths.length ) {
        res = TabControlButtonFactory.getIcon( paths[buttonState] );
    }
    return res;
}
项目:openjdk-jdk10    文件AbstractButtonoperator.java   
/**
 * Maps {@code AbstractButton.getdisabledSelectedIcon()} through queue
 */
public Icon getdisabledSelectedIcon() {
    return (runMapping(new MapAction<Icon>("getdisabledSelectedIcon") {
        @Override
        public Icon map() {
            return ((AbstractButton) getSource()).getdisabledSelectedIcon();
        }
    }));
}
项目:incubator-netbeans    文件LinkButton.java   
/**
 * C'tor
 *
 * @param icon
 * @param al Action to invoke when the button is pressed,can be null but
 * the button is disabled then.
 */
public LinkButton(Icon icon,Action a) {
    setIcon(icon);
    setpressedIcon(icon);
    this.handlePopupEvents = true;
    this.underlined = true;
    init(a);
}
项目:incubator-netbeans    文件MavenProjectNode.java   
@Override
public Image getIcon(int param) {
    Icon icon = info.getIcon();
    if (icon == null) {
        LOGGER.log(Level.WARNING,"no icon in {0}",info);
        return super.getIcon(param);
    }
    return ImageUtilities.icon2Image(icon);
}
项目:incubator-netbeans    文件filetreeView.java   
private Image getFolderIcon (File file) {
    FileObject fo = FileUtil.toFileObject(FileUtil.normalizefile(file));
    Icon icon = null;
    if (fo != null) {
        try {
            ProjectManager.Result res = ProjectManager.getDefault().isProject2(fo);
            if (res != null) {
                icon = res.getIcon();
            }
        } catch (IllegalArgumentException ex) {
            Logger.getLogger(filetreeView.class.getName()).log(Level.INFO,null,ex);
        }
    }
    return icon == null ? filetreeView.getFolderIcon() : ImageUtilities.icon2Image(icon);
}
项目:Logisim    文件Toolbar.java   
@Override
public void paintComponent(Graphics g) {
    if (AppPreferences.ANTI_ALIASING.getBoolean()) {
        Graphics2D g2 = (Graphics2D) g;
        g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
    }
    g.clearRect(0,getWidth(),getHeight());
    CanvasTool current = canvas.getTool();
    for (int i = 0; i < tools.length; i++) {
        AbstractTool[] column = tools[i];
        int x = ICON_SEP + i * (ICON_SEP + ICON_WIDTH);
        int y = ICON_SEP;
        for (int j = 0; j < column.length; j++) {
            AbstractTool tool = column[j];
            if (tool == listener.toolpressed && listener.inTool) {
                g.setColor(Color.darkGray);
                g.fillRect(x,ICON_WIDTH,ICON_HEIGHT);
            }
            Icon icon = tool.getIcon();
            if (icon != null)
                icon.paintIcon(this,y);
            if (tool == current) {
                GraphicsUtil.switchToWidth(g,2);
                g.setColor(Color.black);
                g.drawRect(x - 1,y - 1,ICON_WIDTH + 2,ICON_HEIGHT + 2);
            }
            y += ICON_HEIGHT + ICON_SEP;
        }
    }
    g.setColor(Color.black);
    GraphicsUtil.switchToWidth(g,1);
}
项目:openjdk-jdk10    文件JTabbedPaneOperator.java   
/**
 * Maps {@code JTabbedPane.addTab(String,Icon,Component,String)}
 * through queue
 */
public void addTab(final String string,final Icon icon,final Component component,final String string1) {
    runMapping(new MapVoidAction("addTab") {
        @Override
        public void map() {
            ((JTabbedPane) getSource()).addTab(string,component,string1);
        }
    });
}
项目:incubator-netbeans    文件ElementNode.java   
private Description(
        @NonNull final ClassMemberPanelUI ui,@NonNull final String name,@NullAllowed final Union2<ElementHandle<?>,TreePathHandle> handle,@NonNull final ElementKind kind,final int posInKind,@NonNull final ClasspathInfo cpInfo,@NonNull final Set<Modifier> modifiers,final long pos,final boolean inherited,final boolean topLevel,@NonNull supplier<Icon> icon,@NonNull Openable openable) {
    Parameters.notNull("ui",ui);   //NOI18N
    Parameters.notNull("name",name);   //NOI18N
    Parameters.notNull("kind",kind);   //NOI18N
    Parameters.notNull("icon",icon);   //NOI18N
    Parameters.notNull("openable",openable);  //NOI18N
    this.ui = ui;
    this.name = name;
    this.handle = handle;
    this.kind = kind;
    this.posInKind = posInKind;
    this.cpInfo = cpInfo;
    this.modifiers = modifiers;
    this.pos = pos;
    this.icon = icon;
    this.isInherited = inherited;
    this.isTopLevel = topLevel;
    this.openable = openable;
}
项目:incubator-netbeans    文件WinXPEditorTabdisplayerUI.java   
@Override
public Icon getButtonIcon(int buttonId,int buttonState) {
    Icon res = null;
    initIcons();
    String[] paths = buttonIconPaths.get( buttonId );
    if( null != paths && buttonState >=0 && buttonState < paths.length ) {
        res = TabControlButtonFactory.getIcon( paths[buttonState] );
    }
    return res;
}
项目:incubator-netbeans    文件JExtendedRadioButton.java   
private static Icon getRolloverSelectedIconSafe(JRadioButton radio) {
    Icon icon = radio.getIcon();

    if (icon == null) {
        return getDefaultIcon();
    }

    Icon rolloverSelectedIcon = radio.getRolloverSelectedIcon();

    if (rolloverSelectedIcon == null) {
        rolloverSelectedIcon = radio.getSelectedIcon();
    }

    return (rolloverSelectedIcon != null) ? rolloverSelectedIcon : getIconSafe(radio);
}
项目:incubator-netbeans    文件EditorActionUtilities.java   
public static Icon createSmallIcon(Action a) {
    String iconBase = (String) a.getValue(AbstractEditorAction.ICON_RESOURCE_KEY);
    if (iconBase != null) {
        return ImageUtilities.loadImageIcon(iconBase,true);
    }
    return null;
}
项目:incubator-netbeans    文件ElementNode.java   
@Override
public Image getIcon(int type) {
    if (description.getCustomIcon() != null) {
        return ImageUtilities.icon2Image(description.getCustomIcon());
    }
    Icon icon = Icons.getElementIcon(description.getKind(),description.getModifiers());
    if (icon != null) {
        return ImageUtilities.icon2Image(icon);
    } else {
        return super.getIcon(type);
    }
}
项目:Recaf    文件Icons.java   
/**
 * Loads the icon from the given url.
 * 
 * @param url
 *            URL pointing to an icon.
 * @return
 */
private static Icon load(String url) {
    // Todo: Why does File.separator force non-relative path names but this
    // works fine?
    String prefix = "/resources/";
    String file = prefix + url;
    return new ImageIcon(Icons.class.getResource(file));
}
项目:incubator-netbeans    文件DefaultOutlineCellRenderer.java   
private static Icon getDefaultOpenIcon() {
return UIManager.getIcon("Tree.openIcon"); //NOI18N
   }
项目:JavaGraph    文件TextTab.java   
@Override
public Icon getIcon() {
    return isEditor() ? super.getIcon() : Icons.getMainTabIcon(getdisplay().getResourceKind());
}
项目:incubator-netbeans    文件IDEServicesImpl.java   
@Override
public Icon loadIcon(String resource,boolean localized) {
    return ImageUtilities.loadImageIcon(resource,localized);
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。