com.pnp.xfeature.utils
Class Decode

java.lang.Object
  extended by com.pnp.xfeature.utils.Decode

public class Decode
extends java.lang.Object

Auxiliary class to decode constants used in display models.

Author:
Kamil Ekstein, created on 6.11.2004

Field Summary
static RGB FMT_DEFAULTCOLOR
           
 
Constructor Summary
Decode()
           
 
Method Summary
static boolean boolValue(java.lang.String s)
          Parses the passed string s provided that it contains a logical value
static RGB colorString(java.lang.String s)
          Transforms the passed string s to the RGB triplet provided that s contains either a color name or #-introduced RGB descriptor
static boolean equalColor(Color c1, Color c2)
          Returns true when the two passed colors are equal by means of their RGB values
static java.lang.String fontName(java.lang.String s)
          Transforms the passed string s to a valid font name, mainly used to avoid problems when the value is empty and to state what font to use when 'default' is desired
static int fontSize(java.lang.String s)
          Transforms the passed string s to an integer to be used as Graphics.* methods parameter describing the font size
static int fontStyle(java.lang.String s)
          Transforms the passed string s to an integer to be used as Graphics.* methods parameter describing the font style
static boolean isInteger(java.lang.String s)
          Checks whether the passed string s can be converted to a valid integer
static int lineStyle(java.lang.String s)
          Transforms the passed string s to an integer to be used as Graphics.* methods parameter describing the line style
static int lineWidth(java.lang.String s)
          Transforms the passed string s to an integer to be used as Graphics.* methods parameter describing the line thickness
static java.lang.String positionModifier(java.lang.String s)
          Parses the position modifier specifying the layout of graphical sub-elements in the FeatureNodeFigure class
static int size(java.lang.String s)
          Transforms the passed string s to an integer to be used as Graphics.* methods parameter describing the font size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FMT_DEFAULTCOLOR

public static final RGB FMT_DEFAULTCOLOR
Constructor Detail

Decode

public Decode()
Method Detail

colorString

public static RGB colorString(java.lang.String s)
Transforms the passed string s to the RGB triplet provided that s contains either a color name or #-introduced RGB descriptor


lineStyle

public static int lineStyle(java.lang.String s)
Transforms the passed string s to an integer to be used as Graphics.* methods parameter describing the line style


lineWidth

public static int lineWidth(java.lang.String s)
Transforms the passed string s to an integer to be used as Graphics.* methods parameter describing the line thickness


fontSize

public static int fontSize(java.lang.String s)
Transforms the passed string s to an integer to be used as Graphics.* methods parameter describing the font size


fontStyle

public static int fontStyle(java.lang.String s)
Transforms the passed string s to an integer to be used as Graphics.* methods parameter describing the font style


fontName

public static java.lang.String fontName(java.lang.String s)
Transforms the passed string s to a valid font name, mainly used to avoid problems when the value is empty and to state what font to use when 'default' is desired


isInteger

public static boolean isInteger(java.lang.String s)
Checks whether the passed string s can be converted to a valid integer


boolValue

public static boolean boolValue(java.lang.String s)
Parses the passed string s provided that it contains a logical value


equalColor

public static boolean equalColor(Color c1,
                                 Color c2)
Returns true when the two passed colors are equal by means of their RGB values


positionModifier

public static java.lang.String positionModifier(java.lang.String s)
Parses the position modifier specifying the layout of graphical sub-elements in the FeatureNodeFigure class


size

public static int size(java.lang.String s)
Transforms the passed string s to an integer to be used as Graphics.* methods parameter describing the font size



Copyright © 2004 - 2008 ETH Zurich and P&P Software GmbH, All Rights Reserved.