lime.uga.edu.wsworkflow.main
Class IconImage

java.lang.Object
  extended by lime.uga.edu.wsworkflow.main.IconImage

public class IconImage
extends java.lang.Object

given types, size, one image, create an image with three parts (left part denotes the inputtypes, middle part is the given image, right part denotes the outputtypes) including seven methods: 1. createIcon() is the primary method invoking three other methods 2. alterImageSize() changes the given image to the given size 3. mergeImage() merges three same size images to one image 4. getTypeColor() maps type to colors for gradient paint rectangle 5. gradientRect(), given size, creates image of several gradient rectangles according to the given types 6. smallGradientRect() generage image file, bottom 25% and top25% are transparent, middle 50% contains some color rectangles according to the given types 7. testImage() create an image with given file name, width, height the image contains the given text with the given font size 8. merge2Images() merge two images into one image, one on the top, one on the bottom the two image should be same width 9. addTextToImage() given text and one image file, add text at the bottom of the image this method will invoke textImage() to create image containing given text with same width of given image the maximum font size of the text is 8 point, and the default height of the image containing text is 15 pixels and invoke merge2Images() to merge given image and text image into one image 10. createTextIcon() final method, create icon with text at the bottom, output and input rectangles in each side invoke createIcon() to create icon with input&output rectangles in each side invoke addTextToImage() to add given text at the bottom of the image 11. IconImage() is the constructor 12. main() contains all test codes for all methods, just comment or uncomment to test

Author:
Rui

Constructor Summary
IconImage()
          constructor
 
Method Summary
 java.awt.Image createTextIcon(double middlePercentage, int width, int height, java.lang.String[] inputTypes, java.lang.String[] outputTypes, java.awt.Image middleImage, java.lang.String text)
          final method, create icon with text at the bottom, color output and input rectangles in each side invoke createIcon() to create icon with input&output rectangles in each side invoke addTextToImage() to add given text at the bottom of the image
static java.util.Map<java.lang.String,java.awt.Image> getServiceIcons()
           
 java.awt.Image gradientRect(java.lang.String fileName, int width, int height, java.lang.String[] typeNames)
          given typeNames, create an image with many gradient rectangles representing the types
static void main(java.lang.String[] args)
          main method for testing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IconImage

public IconImage()
constructor

Method Detail

gradientRect

public java.awt.Image gradientRect(java.lang.String fileName,
                                   int width,
                                   int height,
                                   java.lang.String[] typeNames)
given typeNames, create an image with many gradient rectangles representing the types

Parameters:
fileName - the file name of the final generated image
width - width of the generated image
height - height of the generated image
typeNames - the imput types which will decide number and color of rectangles

createTextIcon

public java.awt.Image createTextIcon(double middlePercentage,
                                     int width,
                                     int height,
                                     java.lang.String[] inputTypes,
                                     java.lang.String[] outputTypes,
                                     java.awt.Image middleImage,
                                     java.lang.String text)
final method, create icon with text at the bottom, color output and input rectangles in each side invoke createIcon() to create icon with input&output rectangles in each side invoke addTextToImage() to add given text at the bottom of the image

Parameters:
middlePercentage - double, percentage of the middle image width of whole image width
width - width of the top image without text
height - height of the top image without text
inputTypes - all type names for imput
outputTypes - all type names for output
middleImage - the given icon file name will be in the middle of the final image
newImage - final image file name
text - given text to be add to the bottom of final image

main

public static void main(java.lang.String[] args)
main method for testing

Parameters:
args -

getServiceIcons

public static java.util.Map<java.lang.String,java.awt.Image> getServiceIcons()