jInfer

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

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

public class Utils
extends Object

Some Rule Displayer utils.


Field Summary
static Color ALTER_COLOR_DEFAULT
          Color of alternation vertex default value.
static String ALTER_COLOR_PROP
          Color of alternation vertex property name.
static VertexShape ALTER_SHAPE_DEFAULT
          Shape of alternation vertex default value.
static String ALTER_SHAPE_PROP
          Shape of alternation vertex property name.
static int ALTER_SIZE_DEFAULT
          Size of alternation vertex default value.
static String ALTER_SIZE_PROP
          Size of alternation vertex property name.
static Color ATTRIBUTE_COLOR_DEFAULT
          Color of attribute vertex default value.
static String ATTRIBUTE_COLOR_PROP
          Color of attribute vertex property name.
static VertexShape ATTRIBUTE_SHAPE_DEFAULT
          Shape of attribute vertex default value.
static String ATTRIBUTE_SHAPE_PROP
          Shape of attribute vertex property name.
static int ATTRIBUTE_SIZE_DEFAULT
          Size of attribute vertex default value.
static String ATTRIBUTE_SIZE_PROP
          Size of attribute vertex property name.
static Color BG_COLOR_DEFAULT
          Background color default value.
static String BG_COLOR_PROP
          Background color property name.
static Color CONCAT_COLOR_DEFAULT
          Color of concatenation vertex default value.
static String CONCAT_COLOR_PROP
          Color of concatenation vertex property name.
static VertexShape CONCAT_SHAPE_DEFAULT
          Shape of concatenation vertex default value.
static String CONCAT_SHAPE_PROP
          Shape of concatenation vertex property name.
static int CONCAT_SIZE_DEFAULT
          Size of concatenation vertex default value.
static String CONCAT_SIZE_PROP
          Size of concatenation vertex property name.
static Color ELEMENT_COLOR_DEFAULT
          Color of element vertex default value.
static String ELEMENT_COLOR_PROP
          Color of element vertex property name.
static VertexShape ELEMENT_SHAPE_DEFAULT
          Shape of element vertex default value.
static String ELEMENT_SHAPE_PROP
          Shape of element vertex property name.
static int ELEMENT_SIZE_DEFAULT
          Size of element vertex default value.
static String ELEMENT_SIZE_PROP
          Size of element vertex property name.
static int HORIZONTAL_DISTANCE_DEFAULT
          Horizontal distance of vertices default value.
static String HORIZONTAL_DISTANCE_PROP
          Horizontal distance of vertices property name.
static Color LAMBDA_COLOR_DEFAULT
          Color of lambda vertex default value.
static String LAMBDA_COLOR_PROP
          Color of lambda vertex property name.
static VertexShape LAMBDA_SHAPE_DEFAULT
          Shape of lambda vertex default value.
static String LAMBDA_SHAPE_PROP
          Shape of lambda vertex property name.
static int LAMBDA_SIZE_DEFAULT
          Size of lambda vertex default value.
static String LAMBDA_SIZE_PROP
          Size of lambda vertex property name.
static Color PERMUT_COLOR_DEFAULT
          Color of permutation vertex default value.
static String PERMUT_COLOR_PROP
          Color of permutation vertex property name.
static VertexShape PERMUT_SHAPE_DEFAULT
          Shape of permutation vertex default value.
static String PERMUT_SHAPE_PROP
          Shape of permutation vertex property name.
static int PERMUT_SIZE_DEFAULT
          Size of permutation vertex default value.
static String PERMUT_SIZE_PROP
          Size of permutation vertex property name.
static Color ROOT_COLOR_DEFAULT
          Color of root vertex default value.
static String ROOT_COLOR_PROP
          Color of root vertex property name.
static VertexShape ROOT_SHAPE_DEFAULT
          Shape of root vertex default value.
static String ROOT_SHAPE_PROP
          Shape of root vertex property name.
static int ROOT_SIZE_DEFAULT
          Size of root vertex default value.
static String ROOT_SIZE_PROP
          Size of root vertex property name.
static Color SIMPLE_DATA_COLOR_DEFAULT
          Color of simple data vertex default value.
static String SIMPLE_DATA_COLOR_PROP
          Color of simple data vertex property name.
static VertexShape SIMPLE_DATA_SHAPE_DEFAULT
          Shape of simple data vertex default value.
static String SIMPLE_DATA_SHAPE_PROP
          Shape of simple data vertex property name.
static int SIMPLE_DATA_SIZE_DEFAULT
          Size of simple data vertex default value.
static String SIMPLE_DATA_SIZE_PROP
          Size of simple data vertex property name.
static int VERTEX_LABEL_MAX_LENGHT
           
static int VERTICAL_DISTANCE_DEFAULT
          Vertical distance of vertices default value.
static String VERTICAL_DISTANCE_PROP
          Vertical distance of vertices property name.
 
Constructor Summary
Utils(List<Regexp<AbstractStructuralNode>> roots)
          Default contructor.
 
Method Summary
 Color getBackgroundColor()
          Get background color of canvas where rules are displayed.
static Color getColorProperty(String property, Color defaultValue)
          Get Color property value for particular property.
 int getHorizontalDistance()
          Get horizontal distance between vertices in rule trees.
static int getProperty(String property, int defaultValue)
          Get property value for particular property.
 List<Regexp<AbstractStructuralNode>> getRoots()
          Get list of regexp which are represented as root vertex in each rule tree.
static VertexShape getShapeProperty(String property, VertexShape defaultValue)
          Get VertexShape property value for particular property.
static String getVertexLabel(Regexp<? extends AbstractNamedNode> regexp, boolean trim)
           
 Shape getVertexShape(edu.uci.ics.jung.visualization.util.VertexShapeFactory<Regexp<? extends AbstractNamedNode>> shapeFactory, Regexp<? extends AbstractNamedNode> regexp)
          Get Shape of Vertex for particular Regexp.
 int getVerticalDistance()
          Get vertical distance between vertices in rule trees.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BG_COLOR_PROP

public static final String BG_COLOR_PROP
Background color property name.

See Also:
Constant Field Values

BG_COLOR_DEFAULT

public static final Color BG_COLOR_DEFAULT
Background color default value.


HORIZONTAL_DISTANCE_PROP

public static final String HORIZONTAL_DISTANCE_PROP
Horizontal distance of vertices property name.

See Also:
Constant Field Values

HORIZONTAL_DISTANCE_DEFAULT

public static final int HORIZONTAL_DISTANCE_DEFAULT
Horizontal distance of vertices default value.

See Also:
Constant Field Values

VERTICAL_DISTANCE_PROP

public static final String VERTICAL_DISTANCE_PROP
Vertical distance of vertices property name.

See Also:
Constant Field Values

VERTICAL_DISTANCE_DEFAULT

public static final int VERTICAL_DISTANCE_DEFAULT
Vertical distance of vertices default value.

See Also:
Constant Field Values

ROOT_SHAPE_PROP

public static final String ROOT_SHAPE_PROP
Shape of root vertex property name.

See Also:
Constant Field Values

ROOT_SHAPE_DEFAULT

public static final VertexShape ROOT_SHAPE_DEFAULT
Shape of root vertex default value.


ELEMENT_SHAPE_PROP

public static final String ELEMENT_SHAPE_PROP
Shape of element vertex property name.

See Also:
Constant Field Values

ELEMENT_SHAPE_DEFAULT

public static final VertexShape ELEMENT_SHAPE_DEFAULT
Shape of element vertex default value.


CONCAT_SHAPE_PROP

public static final String CONCAT_SHAPE_PROP
Shape of concatenation vertex property name.

See Also:
Constant Field Values

CONCAT_SHAPE_DEFAULT

public static final VertexShape CONCAT_SHAPE_DEFAULT
Shape of concatenation vertex default value.


ALTER_SHAPE_PROP

public static final String ALTER_SHAPE_PROP
Shape of alternation vertex property name.

See Also:
Constant Field Values

ALTER_SHAPE_DEFAULT

public static final VertexShape ALTER_SHAPE_DEFAULT
Shape of alternation vertex default value.


PERMUT_SHAPE_PROP

public static final String PERMUT_SHAPE_PROP
Shape of permutation vertex property name.

See Also:
Constant Field Values

PERMUT_SHAPE_DEFAULT

public static final VertexShape PERMUT_SHAPE_DEFAULT
Shape of permutation vertex default value.


LAMBDA_SHAPE_PROP

public static final String LAMBDA_SHAPE_PROP
Shape of lambda vertex property name.

See Also:
Constant Field Values

LAMBDA_SHAPE_DEFAULT

public static final VertexShape LAMBDA_SHAPE_DEFAULT
Shape of lambda vertex default value.


SIMPLE_DATA_SHAPE_PROP

public static final String SIMPLE_DATA_SHAPE_PROP
Shape of simple data vertex property name.

See Also:
Constant Field Values

SIMPLE_DATA_SHAPE_DEFAULT

public static final VertexShape SIMPLE_DATA_SHAPE_DEFAULT
Shape of simple data vertex default value.


ATTRIBUTE_SHAPE_PROP

public static final String ATTRIBUTE_SHAPE_PROP
Shape of attribute vertex property name.

See Also:
Constant Field Values

ATTRIBUTE_SHAPE_DEFAULT

public static final VertexShape ATTRIBUTE_SHAPE_DEFAULT
Shape of attribute vertex default value.


ROOT_SIZE_PROP

public static final String ROOT_SIZE_PROP
Size of root vertex property name.

See Also:
Constant Field Values

ROOT_SIZE_DEFAULT

public static final int ROOT_SIZE_DEFAULT
Size of root vertex default value.

See Also:
Constant Field Values

ELEMENT_SIZE_PROP

public static final String ELEMENT_SIZE_PROP
Size of element vertex property name.

See Also:
Constant Field Values

ELEMENT_SIZE_DEFAULT

public static final int ELEMENT_SIZE_DEFAULT
Size of element vertex default value.

See Also:
Constant Field Values

CONCAT_SIZE_PROP

public static final String CONCAT_SIZE_PROP
Size of concatenation vertex property name.

See Also:
Constant Field Values

CONCAT_SIZE_DEFAULT

public static final int CONCAT_SIZE_DEFAULT
Size of concatenation vertex default value.

See Also:
Constant Field Values

ALTER_SIZE_PROP

public static final String ALTER_SIZE_PROP
Size of alternation vertex property name.

See Also:
Constant Field Values

ALTER_SIZE_DEFAULT

public static final int ALTER_SIZE_DEFAULT
Size of alternation vertex default value.

See Also:
Constant Field Values

PERMUT_SIZE_PROP

public static final String PERMUT_SIZE_PROP
Size of permutation vertex property name.

See Also:
Constant Field Values

PERMUT_SIZE_DEFAULT

public static final int PERMUT_SIZE_DEFAULT
Size of permutation vertex default value.

See Also:
Constant Field Values

LAMBDA_SIZE_PROP

public static final String LAMBDA_SIZE_PROP
Size of lambda vertex property name.

See Also:
Constant Field Values

LAMBDA_SIZE_DEFAULT

public static final int LAMBDA_SIZE_DEFAULT
Size of lambda vertex default value.

See Also:
Constant Field Values

SIMPLE_DATA_SIZE_PROP

public static final String SIMPLE_DATA_SIZE_PROP
Size of simple data vertex property name.

See Also:
Constant Field Values

SIMPLE_DATA_SIZE_DEFAULT

public static final int SIMPLE_DATA_SIZE_DEFAULT
Size of simple data vertex default value.

See Also:
Constant Field Values

ATTRIBUTE_SIZE_PROP

public static final String ATTRIBUTE_SIZE_PROP
Size of attribute vertex property name.

See Also:
Constant Field Values

ATTRIBUTE_SIZE_DEFAULT

public static final int ATTRIBUTE_SIZE_DEFAULT
Size of attribute vertex default value.

See Also:
Constant Field Values

ROOT_COLOR_PROP

public static final String ROOT_COLOR_PROP
Color of root vertex property name.

See Also:
Constant Field Values

ROOT_COLOR_DEFAULT

public static final Color ROOT_COLOR_DEFAULT
Color of root vertex default value.


ELEMENT_COLOR_PROP

public static final String ELEMENT_COLOR_PROP
Color of element vertex property name.

See Also:
Constant Field Values

ELEMENT_COLOR_DEFAULT

public static final Color ELEMENT_COLOR_DEFAULT
Color of element vertex default value.


CONCAT_COLOR_PROP

public static final String CONCAT_COLOR_PROP
Color of concatenation vertex property name.

See Also:
Constant Field Values

CONCAT_COLOR_DEFAULT

public static final Color CONCAT_COLOR_DEFAULT
Color of concatenation vertex default value.


ALTER_COLOR_PROP

public static final String ALTER_COLOR_PROP
Color of alternation vertex property name.

See Also:
Constant Field Values

ALTER_COLOR_DEFAULT

public static final Color ALTER_COLOR_DEFAULT
Color of alternation vertex default value.


PERMUT_COLOR_PROP

public static final String PERMUT_COLOR_PROP
Color of permutation vertex property name.

See Also:
Constant Field Values

PERMUT_COLOR_DEFAULT

public static final Color PERMUT_COLOR_DEFAULT
Color of permutation vertex default value.


LAMBDA_COLOR_PROP

public static final String LAMBDA_COLOR_PROP
Color of lambda vertex property name.

See Also:
Constant Field Values

LAMBDA_COLOR_DEFAULT

public static final Color LAMBDA_COLOR_DEFAULT
Color of lambda vertex default value.


SIMPLE_DATA_COLOR_PROP

public static final String SIMPLE_DATA_COLOR_PROP
Color of simple data vertex property name.

See Also:
Constant Field Values

SIMPLE_DATA_COLOR_DEFAULT

public static final Color SIMPLE_DATA_COLOR_DEFAULT
Color of simple data vertex default value.


ATTRIBUTE_COLOR_PROP

public static final String ATTRIBUTE_COLOR_PROP
Color of attribute vertex property name.

See Also:
Constant Field Values

ATTRIBUTE_COLOR_DEFAULT

public static final Color ATTRIBUTE_COLOR_DEFAULT
Color of attribute vertex default value.


VERTEX_LABEL_MAX_LENGHT

public static final int VERTEX_LABEL_MAX_LENGHT
See Also:
Constant Field Values
Constructor Detail

Utils

public Utils(List<Regexp<AbstractStructuralNode>> roots)
Default contructor.

Parameters:
roots - List of root Regexp of each rule tree.
Method Detail

getProperty

public static int getProperty(String property,
                              int defaultValue)
Get property value for particular property.

Parameters:
property - Name of property for which to get value.
defaultValue - Default value to be returned, if no value is saved for particular property.
Returns:
Property value if exists for particular property, otherwise is returned defaultValue.

getShapeProperty

public static VertexShape getShapeProperty(String property,
                                           VertexShape defaultValue)
Get VertexShape property value for particular property.

Parameters:
property - Name of property for which to get value.
defaultValue - Default value to be returned, if no value is saved for particular property.
Returns:
Property value if exists for particular property, otherwise is returned defaultValue.

getColorProperty

public static Color getColorProperty(String property,
                                     Color defaultValue)
Get Color property value for particular property.

Parameters:
property - Name of property for which to get value.
defaultValue - Default value to be returned, if no value is saved for particular property.
Returns:
Property value if exists for particular property, otherwise is returned defaultValue.

getVertexShape

public Shape getVertexShape(edu.uci.ics.jung.visualization.util.VertexShapeFactory<Regexp<? extends AbstractNamedNode>> shapeFactory,
                            Regexp<? extends AbstractNamedNode> regexp)
Get Shape of Vertex for particular Regexp.

Parameters:
shapeFactory - Shape facotry which creates shape for particular regexp.
regexp - Regexp for which is shape returned.
Returns:
Shape of Vertex for particular regexp.

getBackgroundColor

public Color getBackgroundColor()
Get background color of canvas where rules are displayed.

Returns:
Background color of canvas.

getHorizontalDistance

public int getHorizontalDistance()
Get horizontal distance between vertices in rule trees.

Returns:
Horizontal distance between vertices in rule trees.

getVerticalDistance

public int getVerticalDistance()
Get vertical distance between vertices in rule trees.

Returns:
Vertical distance between vertices in rule trees.

getRoots

public List<Regexp<AbstractStructuralNode>> getRoots()
Get list of regexp which are represented as root vertex in each rule tree.

Returns:
list of regexp which are represented as root vertex in each rule tree.

getVertexLabel

public static String getVertexLabel(Regexp<? extends AbstractNamedNode> regexp,
                                    boolean trim)

jInfer

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