jInfer

cz.cuni.mff.ksi.jinfer.basicruledisplayer.logic
Class Utils

java.lang.Object
  extended by cz.cuni.mff.ksi.jinfer.basicruledisplayer.logic.Utils

public final class Utils
extends Object

Some rule painter utils.


Field Summary
static Image ARROW
           
static Image DOTS
           
static Image LAMBDA
           
 
Method Summary
static Color getColorAlternation()
          Returns the background color for an alternation from the options.
static Color getColorAttribute()
          Returns the background color for an attribute from the options.
static Color getColorBackground()
          Returns the background color for the rule displayer.
static Color getColorConcatenation()
          Returns the background color for a concatenation from the options.
static Color getColorElement()
          Returns the background color for an element from the options.
static Color getColorForeground()
          Returns the foreground color for the rule displayer.
static Color getColorSimpleData()
          Returns the background color for simple data from the options.
static int getHeight(Image image)
          Returns the height of the specified image.
static BufferedImage getImage(int width, int height)
          Creates an image of specified dimension, filled with the background color.
static BufferedImage getImage(int width, int height, Color color)
          Creates an image of specified dimension, filled with the specified color.
static Color getNodeColor(AbstractStructuralNode n)
          Return the background color for the specified node.
static int getWidth(Image image)
          Returns the width of the specified image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAMBDA

public static final Image LAMBDA

DOTS

public static final Image DOTS

ARROW

public static final Image ARROW
Method Detail

getColorElement

public static Color getColorElement()
Returns the background color for an element from the options.

Returns:
Background color for an element.

getColorAttribute

public static Color getColorAttribute()
Returns the background color for an attribute from the options.

Returns:
Background color for an attribute.

getColorSimpleData

public static Color getColorSimpleData()
Returns the background color for simple data from the options.

Returns:
Background color for simple data.

getColorConcatenation

public static Color getColorConcatenation()
Returns the background color for a concatenation from the options.

Returns:
Background color for a concatenation.

getColorAlternation

public static Color getColorAlternation()
Returns the background color for an alternation from the options.

Returns:
Background color for an alternation.

getColorBackground

public static Color getColorBackground()
Returns the background color for the rule displayer.

Returns:
Background color for the rule displayer - taken from the background color of a tabbed pane.

getColorForeground

public static Color getColorForeground()
Returns the foreground color for the rule displayer.

Returns:
Foreground color for the rule displayer - taken from the foreground color of a tabbed pane.

getNodeColor

public static Color getNodeColor(AbstractStructuralNode n)
Return the background color for the specified node.

Parameters:
n - Node for which the background color should be found.
Returns:
Background color based on the type of the node specified.

getImage

public static BufferedImage getImage(int width,
                                     int height)
Creates an image of specified dimension, filled with the background color.

Parameters:
width - Positive integer representing the width of the image.
height - Positive integer representing the height of the image.
Returns:
BufferedImage of specified dimension.

getImage

public static BufferedImage getImage(int width,
                                     int height,
                                     Color color)
Creates an image of specified dimension, filled with the specified color.

Parameters:
width - Positive integer representing the width of the image.
height - Positive integer representing the height of the image.
color - Background color of the image.
Returns:
BufferedImage of specified dimension.

getWidth

public static int getWidth(Image image)
Returns the width of the specified image.

Returns:
Width of the image, 0 if it is null.

getHeight

public static int getHeight(Image image)
Returns the height of the specified image.

Returns:
Height of the image, 0 if it is null.

jInfer

Generated on Fri Dec 9 00:01:25 CET 2011