Ejemplo n.º 1
0
 public void paint( Graphics g1 ) {
     Graphics2D g = (Graphics2D)g1;
     g.clipRect( 0, 0, this.Width, m_height );
     g.clearRect( 0, 0, this.Width, this.Height );
     if ( m_credit_mode ) {
         float times = (float)(((DateTime.Now).Subtract( m_scroll_started )).TotalSeconds) - 3f;
         float speed = (float)((2.0 - cadencii.math.erfc( times * 0.8 )) / 2.0) * m_speed;
         float dt = times - m_last_t;
         m_shift += (speed + m_last_speed) * dt / 2f;
         m_last_t = times;
         m_last_speed = speed;
         float dx = (this.Width - m_scroll.getWidth( null )) * 0.5f;
         if ( m_scroll != null ) {
             g.drawImage( m_scroll, (int)dx, (int)(90f - m_shift), null );
             if ( 90f - m_shift + m_scroll.getHeight( null ) < 0 ) {
                 m_shift = -m_height * 1.5f;
             }
         }
         int grad_height = 60;
         Rectangle top = new Rectangle( 0, 0, this.Width, grad_height );
         /*using ( LinearGradientBrush lgb = new LinearGradientBrush( top, Color.White, Color.Transparent, LinearGradientMode.Vertical ) ) {
             g.FillRectangle( lgb, top );
         }*/
         Rectangle bottom = new Rectangle( 0, m_height - grad_height, this.Width, grad_height );
         g.clipRect( 0, m_height - grad_height + 1, this.Width, grad_height - 1 );
         /*using ( LinearGradientBrush lgb = new LinearGradientBrush( bottom, Color.Transparent, Color.White, LinearGradientMode.Vertical ) ) {
             g.FillRectangle( lgb, bottom );
         }*/
         g.setClip( null );
     } else {
         g.setFont( new Font( "Century Gorhic", java.awt.Font.BOLD, 24 ) );
         g.setColor( m_app_name_color );
         g.drawString( m_app_name, 20, 110 );
         g.setFont( new Font( "Arial", 0, 10 ) );
         g.drawString( "version " + m_version, 25, 150 );
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 描画に使用するグラフィックスを指定します
 /// </summary>
 /// <param name="g"></param>
 public void setGraphics(java.awt.Graphics g)
 {
     mGraphics = g.nativeGraphics;
 }