亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? nimrodutils.java

?? NimROD L&F是一個具有多種主題的Swing皮膚
?? JAVA
字號:
/*
 *                 (C) Copyright 2005 Nilo J. Gonzalez
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser Gereral Public Licence as published by the Free
 * Software Foundation; either version 2 of the Licence, or (at your opinion) any
 * later version.
 * 
 * This library is distributed in the hope that it will be usefull, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of merchantability or fitness for a
 * particular purpose. See the GNU Lesser General Public Licence for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public Licence along
 * with this library; if not, write to the Free Software Foundation, Inc., 59
 * Temple Place, Suite 330, Boston, Ma 02111-1307 USA.
 *
 * http://www.gnu.org/licenses/lgpl.html (English)
 * http://gugs.sindominio.net/gnu-gpl/lgpl-es.html (Espa?ol)
 *
 *
 * Original author: Nilo J. Gonz?lez
 */

package com.nilo.plaf.nimrod;

import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.io.*;

import javax.swing.*;

class NimRODUtils {
  
  protected static Color rollColor;
  
  static final int THIN = 0;
  static final int FAT = 1;
  
  static final int MATRIX_FAT = 5;  // Esto define el grosor de la sombra de los titulos
  static Kernel kernelFat;
  
  static final int MATRIX_THIN = 3;  // Esto define el grosor de la sombra de los menus
  static Kernel kernelThin;

  //static Color brillo = new Color( 255,255,255, 64);
  //static Color sombra = new Color( 20,20,20, 50);
  
  static Color getSombra() {
    return getColorAlfa( getColorTercio( NimRODLookAndFeel.getControlDarkShadow(), Color.black),
                         64);
  }
  
  static Color getBrillo() {
    return getColorAlfa( getColorTercio( NimRODLookAndFeel.getControlHighlight(), Color.white),
                         64);
  }
  
  static Color getSombraMenu() {
    return new Color( 20,20,20, 50);
  }
  
  static Color getBrilloMenu() {
    return new Color( 255,255,255, 64);
  }
  
  /**
   * Esta funcion se usa para inicializar los colores del tema segun los argumentos que se le pasen.
   */
  static NimRODTheme iniCustomColors( NimRODTheme nt, String selection, String background, 
                                      String p1, String p2, String p3, 
                                      String s1, String s2, String s3, 
                                      String w, String b, String opMenu, String opFrame) {
    if ( selection != null ) {
      nt.setPrimary( Color.decode( selection));
    }
    if ( background != null ) {
      nt.setSecondary( Color.decode( background));
    }
    
    if ( p1 != null ) { nt.setPrimary1( Color.decode( p1)); }
    if ( p2 != null ) { nt.setPrimary2( Color.decode( p2)); }
    if ( p3 != null ) { nt.setPrimary3( Color.decode( p3)); }
    
    if ( s1 != null ) { nt.setSecondary1( Color.decode( s1)); }
    if ( s2 != null ) { nt.setSecondary2( Color.decode( s2)); }
    if ( s3 != null ) { nt.setSecondary3( Color.decode( s3)); }
    
    if ( w != null ) { nt.setWhite( Color.decode( w)); }
    if ( b != null ) { nt.setBlack( Color.decode( b)); }
    
    if ( opMenu != null) { nt.setMenuOpacity( Integer.parseInt( opMenu)); }
    if ( opFrame != null) { nt.setFrameOpacity( Integer.parseInt( opFrame)); }
    
    return nt;
  }
  
  static ImageIcon loadRes( String fich) {
    try {
      return new ImageIcon( Toolkit.getDefaultToolkit().createImage( readStream( NimRODLookAndFeel.class.getResourceAsStream( fich))));
    }
    catch ( Exception ex) {
      ex.printStackTrace();
      System.out.println( "No se puede cargar el recurso " + fich);
      return null;
    }
  }

  static byte[] readStream( InputStream input) throws IOException {
    ByteArrayOutputStream bytes = new ByteArrayOutputStream();
    int read;
    byte[] buffer = new byte[256];
    
    while ( (read = input.read( buffer, 0, 256)) != -1 ) {
      bytes.write( buffer, 0, read);
    }
    
    return bytes.toByteArray();
  }

  /**
   * Esta funcion se usa para pintar la barra de seleccion de los menus. Esta aqui
   * para no repetirla en todas partes...
   */
  static void pintaBarraMenu( Graphics g, JMenuItem menuItem, Color bgColor) {
    ButtonModel model = menuItem.getModel();
    Color oldColor = g.getColor();
  
    int menuWidth = menuItem.getWidth();
    int menuHeight = menuItem.getHeight();
  
    if ( menuItem.isOpaque() ) {
      g.setColor( menuItem.getBackground());
      g.fillRect( 0,0, menuWidth, menuHeight);
    }
    
    if ( (menuItem instanceof JMenu && !(((JMenu)menuItem).isTopLevelMenu()) && model.isSelected())
         ||
         model.isArmed() ) {
      RoundRectangle2D.Float boton = new RoundRectangle2D.Float(); 
      boton.x = 1;
      boton.y = 0;
      boton.width = menuWidth - 3;
      boton.height = menuHeight - 1;
      boton.arcwidth = 8;
      boton.archeight = 8;
      
      GradientPaint grad = new GradientPaint( 1,1, getBrilloMenu(), 
                                              0,menuHeight, getSombraMenu());
      
      Graphics2D g2D = (Graphics2D)g;
      
      g.setColor( bgColor);
      g2D.fill( boton);
      
      g.setColor( bgColor.darker());
      g2D.draw( boton);
      
      g2D.setPaint( grad);
      g2D.fill( boton);
    }
  
    g.setColor( oldColor);
  }

  static void paintFocus( Graphics g, int x, int y, int width, int height, int r1, int r2, Color color) {
    paintFocus( g, x, y, width, height, r1, r2, 2.0f, color);
  }
  
  static void paintFocus( Graphics g, int x, int y, int width, int height, int r1, int r2, float grosor, Color color) {
    Graphics2D g2d = (Graphics2D)g;
    Stroke oldStroke = g2d.getStroke();
    
    g2d.setColor( color);
    g2d.setStroke( new BasicStroke( grosor));
    g.drawRoundRect( x,y, width,height, r1,r2);
    
    g2d.setStroke( oldStroke);
  }
  
  static Color getRolloverColor() {
    if ( rollColor == null ) {
      rollColor = getColorAlfa( UIManager.getColor( "Button.focus"), 40);
    }
    
    return rollColor;
  }
  
  static Color getColorAlfa( Color col, int alfa) {
    return new Color( col.getRed(), col.getGreen(), col.getBlue(), alfa);
  }

  static Color getColorTercio( Color a, Color b) {
    return new Color( tercioInt( a.getRed(), b.getRed()),
                      tercioInt( a.getGreen(), b.getGreen()),
                      tercioInt( a.getBlue(), b.getBlue()));
  }
  
  private static int tercioInt( int a, int b) {
    return b + 2*((a-b) / 3);
  }
  
  
  static void paintShadowTitleFat( Graphics g, String title, int x, int y, Color frente) {
    paintShadowTitle( g, title, x, y, frente, Color.black, 1, FAT, SwingConstants.HORIZONTAL);
  }

  static void paintShadowTitleFat( Graphics g, String title, int x, int y, Color frente, Color shadow) {
    paintShadowTitle( g, title, x, y, frente, shadow, 1, FAT, SwingConstants.HORIZONTAL);
  }

  static void paintShadowTitleFat( Graphics g, String title, int x, int y, Color frente, Color shadow, int desp) {
    paintShadowTitle( g, title, x, y, frente, shadow, desp, FAT, SwingConstants.HORIZONTAL);
  }

  static void paintShadowTitleThin( Graphics g, String title, int x, int y, Color frente) {
    paintShadowTitle( g, title, x, y, frente, Color.black, 1, THIN, SwingConstants.HORIZONTAL);
  }

  static void paintShadowTitleThin( Graphics g, String title, int x, int y, Color frente, Color shadow) {
    paintShadowTitle( g, title, x, y, frente, shadow, 1, THIN, SwingConstants.HORIZONTAL);
  }

  static void paintShadowTitleThin( Graphics g, String title, int x, int y, Color frente, Color shadow, int desp) {
    paintShadowTitle( g, title, x, y, frente, shadow, desp, THIN, SwingConstants.HORIZONTAL);
  }

  static void paintShadowTitleFatV( Graphics g, String title, int x, int y, Color frente) {
    paintShadowTitle( g, title, x, y, frente, Color.black, 1, FAT, SwingConstants.VERTICAL);
  }

  static void paintShadowTitleFatV( Graphics g, String title, int x, int y, Color frente, Color shadow) {
    paintShadowTitle( g, title, x, y, frente, shadow, 1, FAT, SwingConstants.VERTICAL);
  }

  static void paintShadowTitleFatV( Graphics g, String title, int x, int y, Color frente, Color shadow, int desp) {
    paintShadowTitle( g, title, x, y, frente, shadow, desp, FAT, SwingConstants.VERTICAL);
  }

  static void paintShadowTitleThinV( Graphics g, String title, int x, int y, Color frente) {
    paintShadowTitle( g, title, x, y, frente, Color.black, 1, THIN, SwingConstants.VERTICAL);
  }

  static void paintShadowTitleThinV( Graphics g, String title, int x, int y, Color frente, Color shadow) {
    paintShadowTitle( g, title, x, y, frente, shadow, 1, THIN, SwingConstants.VERTICAL);
  }

  static void paintShadowTitleThinV( Graphics g, String title, int x, int y, Color frente, Color shadow, int desp) {
    paintShadowTitle( g, title, x, y, frente, shadow, desp, THIN, SwingConstants.VERTICAL);
  }

  static void paintShadowTitle( Graphics g, String title, 
                                int x, int y, Color frente, Color shadow, 
                                int desp, int tipo, int orientation) {
    
    // Si hay que rotar la fuente, se rota 
    Font f = g.getFont();
    if ( orientation == SwingConstants.VERTICAL ) {
      AffineTransform rotate = AffineTransform.getRotateInstance( Math.PI / 2);
      f = f.deriveFont( rotate);
    }
    
    // Si hay que pintar sombra, se hacen un monton de cosas
    if ( shadow != null ) {
      int matrix = ( tipo == THIN ? MATRIX_THIN : MATRIX_FAT);
      
      Rectangle2D rect = g.getFontMetrics().getStringBounds( title, g);
      
      int w, h;
      if ( orientation == SwingConstants.HORIZONTAL ) {
        w = (int)rect.getWidth() + 6*matrix;    // Hay que dejar espacio para las sombras y el borde
        h = (int)rect.getHeight() + 6*matrix;   // que ConvolveOp ignora por el EDGE_NO_OP
      }
      else {
        h = (int)rect.getWidth() + 6*matrix;    // Hay que dejar espacio para las sombras y el borde
        w = (int)rect.getHeight() + 6*matrix;   // que ConvolveOp ignora por el EDGE_NO_OP
      }
      
      // La sombra del titulo
      BufferedImage iTitulo = new BufferedImage( w,h, BufferedImage.TYPE_INT_ARGB);
      BufferedImage iSombra = new BufferedImage( w,h, BufferedImage.TYPE_INT_ARGB);
      
      Graphics2D g2 = iTitulo.createGraphics();
      g2.setFont( f);
      g2.setColor( shadow);
      g2.drawString( title, 3*matrix, 3*matrix);  // La pintamos en el centro
  
      ConvolveOp cop = new ConvolveOp( ( tipo == THIN ? kernelThin : kernelFat), ConvolveOp.EDGE_NO_OP, null);
      cop.filter( iTitulo, iSombra);              // A ditorsionar
      
      // Por fin, pintamos el jodio titulo
      g.drawImage( iSombra, 
                   x - 3*matrix + desp,              // Lo llevamos a la posicion original y le sumamos 1          
                   y - 3*matrix + desp,              // para que la sombra quede pelin desplazada 
                   null); 
    }
    
    // Si hay que pintar el frente, se pinta
    if ( frente != null ) {
      g.setFont( f);
      g.setColor( frente);
      g.drawString( title, x, y);
    }
  }

  static Icon reescala( Icon ic, int maxW, int maxH) {
    if ( ic == null ) {
      return null;
    }
    if ( ic.getIconHeight() <= maxH || ic.getIconWidth() <= maxW ) {
      return ic;
    }
    
    BufferedImage bi = new BufferedImage( ic.getIconHeight(), ic.getIconWidth(), BufferedImage.TYPE_INT_ARGB);
    
    Graphics g = bi.createGraphics();
    ic.paintIcon( null, g, 0, 0);
    g.dispose();
    
    Image bf = bi.getScaledInstance( maxW, maxH, Image.SCALE_SMOOTH);
    
    return new ImageIcon( bf);
  }

  static int getOpacity() {
    return getMenuOpacity();
  }

  static int getMenuOpacity() {
    try {
      NimRODTheme th = (NimRODTheme)NimRODLookAndFeel.theme;
      return th.getMenuOpacity();
    }
    catch ( Throwable ex) {
      return NimRODTheme.DEFAULT_MENU_OPACITY;
    }
  }

  static float getMenuOpacityFloat() {
    return getMenuOpacity() / 255f;
  }

  static int getFrameOpacity() {
    try {
      NimRODTheme th = (NimRODTheme)NimRODLookAndFeel.theme;
      return th.getFrameOpacity();
    }
    catch ( Throwable ex) {
      return NimRODTheme.DEFAULT_FRAME_OPACITY;
    }
  }

  static float getFrameOpacityFloat() {
    return getFrameOpacity() / 255f;
  }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线视频国内自拍亚洲视频| 欧美三级午夜理伦三级中视频| 中文字幕乱码一区二区免费| 欧美日韩亚洲高清一区二区| 精品影视av免费| 最新久久zyz资源站| 26uuu国产日韩综合| 欧美自拍偷拍午夜视频| 国产一区免费电影| 日韩电影网1区2区| 亚洲精品大片www| 中文字幕欧美三区| 日韩免费视频一区| 91精品国产综合久久久久久久| av在线一区二区| 国产精品系列在线观看| 美国精品在线观看| 日韩精品电影在线| 一区二区三国产精华液| 亚洲天堂久久久久久久| 国产视频视频一区| 久久久久99精品一区| 日韩欧美一级二级三级久久久| 欧美亚洲高清一区二区三区不卡| 成人av网站在线观看免费| 国产成人亚洲综合a∨婷婷| 激情综合色播五月| 日韩精品久久久久久| 国产在线一区观看| 日本vs亚洲vs韩国一区三区| 亚洲一区二区成人在线观看| 亚洲欧美激情小说另类| 国产精品久久久久四虎| 欧美国产日韩亚洲一区| 欧美激情综合网| 国产亚洲综合色| 国产婷婷色一区二区三区在线| 精品美女在线观看| 精品少妇一区二区| 精品福利视频一区二区三区| 精品处破学生在线二十三| 久久综合色8888| 久久精品亚洲一区二区三区浴池| 久久久久久久性| 中文字幕第一区第二区| 国产精品美女一区二区| 中文字幕一区二区三区在线观看 | 亚洲h动漫在线| 亚洲成av人片在线观看| 五月婷婷激情综合| 人人狠狠综合久久亚洲| 精品一区二区三区av| 国产精品一级片| www.综合网.com| 色偷偷成人一区二区三区91| 欧美性生活一区| 91精品国产乱码| 久久夜色精品国产噜噜av| 欧美激情一二三区| 国产99久久久精品| 91亚洲精品乱码久久久久久蜜桃| 色噜噜狠狠色综合中国| 8v天堂国产在线一区二区| 欧美mv和日韩mv的网站| 欧美经典三级视频一区二区三区| 亚洲女人小视频在线观看| 亚洲国产视频直播| 九一久久久久久| 99精品偷自拍| 制服丝袜激情欧洲亚洲| 国产亚洲午夜高清国产拍精品| 1区2区3区欧美| 日韩国产精品91| 丁香婷婷深情五月亚洲| 在线观看亚洲精品视频| 精品少妇一区二区三区在线播放 | 在线精品视频一区二区| 日韩一级黄色片| 国产精品久久久久久久久免费相片 | 欧美写真视频网站| 日韩欧美国产综合一区| 国产精品久久久久国产精品日日| 亚洲午夜精品网| 国产精品影视在线| 欧美日韩免费观看一区二区三区| 精品国产乱子伦一区| 亚洲免费色视频| 久久成人久久鬼色| 欧美午夜理伦三级在线观看| 久久综合九色综合欧美98 | 亚洲黄一区二区三区| 麻豆精品国产传媒mv男同| av高清久久久| 精品久久久久久亚洲综合网| 亚洲精品乱码久久久久久黑人| 久久精品国产精品亚洲综合| 色综合中文字幕国产 | 一区二区三区**美女毛片| 国产做a爰片久久毛片| 欧美三级在线播放| 国产精品家庭影院| 麻豆国产欧美一区二区三区| 欧洲精品视频在线观看| 国产精品色眯眯| 国产在线视视频有精品| 欧美日韩一区小说| 亚洲欧美日韩在线不卡| 国产aⅴ精品一区二区三区色成熟| 欧美一a一片一级一片| 国产精品国产馆在线真实露脸 | 久久精品国产久精国产爱| 日本韩国一区二区三区| 中文字幕+乱码+中文字幕一区| 麻豆精品一区二区综合av| 欧美日韩国产色站一区二区三区| 国产精品色哟哟| 国产精选一区二区三区| 欧美tk—视频vk| 日韩国产欧美三级| 欧美日韩国产精品自在自线| 亚洲精品福利视频网站| 99麻豆久久久国产精品免费优播| 久久久久99精品一区| 国产一区二区三区电影在线观看 | 国产性做久久久久久| 久久91精品国产91久久小草| 欧美日韩一区二区在线观看视频| 亚洲美女偷拍久久| 91网站黄www| 亚洲欧美日本在线| 91成人看片片| 亚洲精品国产一区二区精华液| 久久婷婷色综合| 国产麻豆一精品一av一免费| 日韩免费视频一区二区| 狠狠色丁香婷婷综合久久片| 欧美tk丨vk视频| 国产福利不卡视频| 国产精品无人区| 99久久精品国产一区| 亚洲欧洲日韩一区二区三区| 色综合天天综合给合国产| 亚洲视频电影在线| 欧美三级电影网站| 日本女人一区二区三区| 日韩久久免费av| 国产精品18久久久| 成人欧美一区二区三区1314 | 67194成人在线观看| 喷白浆一区二区| 欧美精品一区二区三| 国产福利一区二区三区视频在线 | 中文字幕一区二区三| 色综合欧美在线视频区| 亚洲成人一二三| 日韩视频中午一区| 国产不卡高清在线观看视频| 国产精品久久二区二区| 色婷婷国产精品| 五月激情六月综合| 久久一夜天堂av一区二区三区| 国产成人免费视频| 亚洲激情欧美激情| 欧美一区二区三区日韩| 国产精品888| 一区二区高清免费观看影视大全| 欧美三级电影网| 国产黑丝在线一区二区三区| 亚洲美女屁股眼交| 日韩精品专区在线影院重磅| 国产高清久久久| 舔着乳尖日韩一区| 国产欧美精品一区| 欧美美女bb生活片| 国产美女视频91| 亚洲123区在线观看| 日本成人在线不卡视频| 国产女人18水真多18精品一级做 | 91丨porny丨最新| 日韩精品一二三四| 国产精品白丝在线| 欧美电影免费观看完整版| 色综合久久九月婷婷色综合| 麻豆精品在线播放| 亚洲蜜臀av乱码久久精品| 欧美精品一区二区精品网| 欧美在线观看一二区| 国产乱码精品1区2区3区| 午夜精品久久久久久久| 国产精品久久久久影院老司| 日韩一级完整毛片| 在线免费观看不卡av| 成人精品视频一区二区三区尤物| 午夜亚洲国产au精品一区二区| 国产精品国产自产拍高清av| 91精品国产全国免费观看| 色屁屁一区二区| 国产一区二区三区四区五区入口 | 一级精品视频在线观看宜春院| 亚洲精品一区二区精华|