net.sf.magicproject.ui
Class ToolKit

java.lang.Object
  extended by net.sf.magicproject.ui.ToolKit

public final class ToolKit
extends java.lang.Object

Since:
0.80
Author:
Fabrice Daugan

Method Summary
static void addCancelByEscapeKey(javax.swing.JDialog dialog, javax.swing.JButton cancelButton)
          Force the escape key to call the same action as pressing the Cancel button.
static java.awt.image.BufferedImage getScaledInstance(java.awt.image.BufferedImage img, int targetWidth, int targetHeight, int borderWidth, java.awt.Color borderColor)
          Convenience method that returns a scaled instance of the provided BufferedImage.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addCancelByEscapeKey

public static void addCancelByEscapeKey(javax.swing.JDialog dialog,
                                        javax.swing.JButton cancelButton)
Force the escape key to call the same action as pressing the Cancel button. This does not always work. See class comment.

Parameters:
dialog -
cancelButton -

getScaledInstance

public static java.awt.image.BufferedImage getScaledInstance(java.awt.image.BufferedImage img,
                                                             int targetWidth,
                                                             int targetHeight,
                                                             int borderWidth,
                                                             java.awt.Color borderColor)
Convenience method that returns a scaled instance of the provided BufferedImage.

Parameters:
img - the original image to be scaled
targetWidth - the desired width of the scaled instance, in pixels
targetHeight - the desired height of the scaled instance, in pixels
borderWidth - the border width.
borderColor - the border color.
Returns:
a scaled version of the original BufferedImage


Copyright © 2003-2007 Magic-Project. All Rights Reserved.