Package javax.swing

Examples of javax.swing.Icon


        getFolderBySize(flag_size) +UNKNOWN_COUNTRY_FLAG);
  }
 
  public static Icon getFlagAsIcon(String countryCode, FlagSize flag_size) {
   
    Icon icon = null;
   
    try {
      icon = new ImageIcon(getFlagAsURL(countryCode, flag_size));
    }catch(Throwable t) {
      return null;
View Full Code Here


      if (currentValue instanceof ActiveNode) return ((ActiveNode)currentValue).getIcon();
    return null;
  }
 
  public Icon getLeafIcon(){
    Icon i=getSceneGraphIcon();
    if(i==null){
      return super.getLeafIcon();
    }
    else{
      return i;
View Full Code Here

      return i;
    }
  }
 
  public Icon getOpenIcon(){
    Icon i=getSceneGraphIcon();
    if(i==null){
      return super.getOpenIcon();
    }
    else{
      return i;
View Full Code Here

      return i;
    }
  }
 
  public Icon getClosedIcon(){
    Icon i=getSceneGraphIcon();
    if(i==null){
      return super.getClosedIcon();
    }
    else{
      return i;
View Full Code Here

            if (value instanceof SourceNode) {
                Object o = ((SourceNode) value).getUserObject();
                if (o instanceof ExpressionDataSource) {
                    setText(DataInfo.toString(o) + " = " + DataInfo.getComment(o));
                }
                Icon icon = (Icon) dataSourceIcons.get(o.getClass());
                if (icon != null) {
                    setIcon(icon);
                } else {
                    Class parent = o.getClass().getSuperclass();
                    if (parent != null) {
View Full Code Here

      }
      final LinkedHashMap commonActions=pactions;
      Iterator it=commonActions.keySet().iterator();
      while(it.hasNext()){
        final String actionName =(String)it.next();
        Icon icon =(commonActions.get(actionName) instanceof Icon)(Icon)commonActions.get(actionName) : null;
        JMenuItem jmi = ActionPopup.createMenuItem(menu, actionName, icon);
        jmi.addActionListener(new CollectiveActionListener(x, y, getSelectedSource(), actionName))
      }
      return true;
    }
View Full Code Here

  class FlagTableCellRenderer extends ServerListTableCellRenderer {
    public Component getTableCellRendererComponent(JTable table, Object value,
        boolean isSelected, boolean hasFocus, int row, int column) {
      super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
      this.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
      Icon flag_icon = FlagPack.getFlagAsIconByIP(server.getAddress(), FlagPack.FlagSize.S25x15);
      if( flag_icon != null ) this.setIcon(flag_icon);
      if( !country_locator.isServiceDown() )
         this.setToolTipText(country_locator.getCountryName(server.getAddress()));
      return this;
    }
View Full Code Here

 
  class FlagTableCellRenderer extends DownloadPeersTableCellRenderer {
    public Component getTableCellRendererComponent(JTable table, Object value,
        boolean isSelected, boolean hasFocus, int row, int column) {
      super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
      Icon flag_icon = FlagPack.getFlagAsIconByIP(peer.getIP(), FlagPack.FlagSize.S18x25);
      this.setHorizontalAlignment(SwingConstants.CENTER);
      if( flag_icon != null ) this.setIcon(flag_icon);
      if( !country_locator.isServiceDown() )
         this.setToolTipText(country_locator.getCountryName(peer.getIP()));
      return this;
View Full Code Here

    /**
     * Get a node icon according to the graph object class name
     */
    public static Icon getIcon(Object graphObject){
        if(graphObject==null) return null; // root node
        Icon res=_icons.get(graphObject.getClass().getName());
        if(res==null){
            // look for sub types
            Class<?> c=graphObject.getClass().getSuperclass();
            while(c!=Object.class){
                res=_icons.get(c.getName());
View Full Code Here

        return (Icon)buttonIconHashmap.get(CANCEL_BUTTON_ICON_PROPERTY);
    }
   
    void setCancelButtonIcon(Icon newIcon) {
       
        Icon oldIcon = getCancelButtonIcon();       
        if (!newIcon.equals(oldIcon)) {
            buttonIconHashmap.put(CANCEL_BUTTON_ICON_PROPERTY, newIcon);
            firePropertyChange(CANCEL_BUTTON_ICON_PROPERTY, oldIcon, newIcon);
        }
    }
View Full Code Here

TOP

Related Classes of javax.swing.Icon

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.