choco.visu.components.bricks
Class AChocoBrick

java.lang.Object
  extended by choco.visu.components.bricks.AChocoBrick
All Implemented Interfaces:
IChocoBrick
Direct Known Subclasses:
ColorValueBrick, DotBrick, FullDomainBrick, HazardOrValueBrick, NameOrValueBrick, NodeBrick, QuestionMarkOrValueBrick

public abstract class AChocoBrick
extends Object
implements IChocoBrick


Field Summary
static int CENTER
          constants for text alignement
protected  AChocoPApplet chopapplet
          The mother AChocoPApplet where the brick appears.
static int LEFT
          constants for text alignement
protected  int policy
          the policy of text alignement
static int RIGHT
          constants for text alignement
protected  Var var
          The Var represented by the brick
 
Constructor Summary
AChocoBrick(AChocoPApplet chopapplet, Var var)
           
 
Method Summary
protected  float alignText(float y, float length)
          Returns the y coordinate where a text has to be write.
protected  int alignText(int y, int length)
          Returns the y coordinate where a text has to be write.
protected  DisposableIntIterator getDomainValues()
          Return an IntIterator over the values of a specific variable
protected  int getLowBound()
          Return the lower bound of a variable
protected  int getUppBound()
          Return the upper bound of a variable
protected  String getValues()
          Return a string that represents the instantiated values of Var.
 Var getVar()
          Return the var of the brick
protected  int getVarSize()
          Return the domain size of a variable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface choco.kernel.visu.components.bricks.IChocoBrick
drawBrick, refresh
 

Field Detail

CENTER

public static final int CENTER
constants for text alignement

See Also:
Constant Field Values

LEFT

public static final int LEFT
constants for text alignement

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
constants for text alignement

See Also:
Constant Field Values

policy

protected int policy
the policy of text alignement


chopapplet

protected final AChocoPApplet chopapplet
The mother AChocoPApplet where the brick appears.


var

protected final Var var
The Var represented by the brick

Constructor Detail

AChocoBrick

public AChocoBrick(AChocoPApplet chopapplet,
                   Var var)
Method Detail

getVar

public final Var getVar()
Return the var of the brick

Specified by:
getVar in interface IChocoBrick
Returns:

getVarSize

protected final int getVarSize()
Return the domain size of a variable

Returns:
the domain size

getLowBound

protected final int getLowBound()
Return the lower bound of a variable

Returns:
the domain size

getUppBound

protected final int getUppBound()
Return the upper bound of a variable

Returns:
the domain size

getDomainValues

protected final DisposableIntIterator getDomainValues()
Return an IntIterator over the values of a specific variable

Returns:
an IntIterator

alignText

protected final int alignText(int y,
                              int length)
Returns the y coordinate where a text has to be write. It depends on the policy, the lenght of the text to print and the original y.

Parameters:
y -
length -
Returns:

alignText

protected final float alignText(float y,
                                float length)
Returns the y coordinate where a text has to be write. It depends on the policy, the lenght of the text to print and the original y.

Parameters:
y -
length -
Returns:

getValues

protected final String getValues()
Return a string that represents the instantiated values of Var.

Returns:


Copyright © 2012. All Rights Reserved.