org.sikuli.api.visual
Class StyleBuilder

java.lang.Object
  extended by org.sikuli.api.visual.StyleBuilder

public class StyleBuilder
extends Object

A StyleBuilder is used to to ease style building the Canvas.


Constructor Summary
StyleBuilder(Canvas canvas, Element element)
          Constructs a new StyleBuilder whose Canvas and Element specified with the arguments of the same name.
 
Method Summary
 void display(double seconds)
          Displays the canvas for the specified duration.
 void display(int seconds)
          Displays the canvas for the specified duration.
 StyleBuilder withBackgroundColor(Color color)
          Sets the background color of this canvas element.
 StyleBuilder withColor(Color color)
          Sets the foreground color of this canvas element.
 StyleBuilder withFontSize(int size)
          Sets the font size color of this canvas element.
 StyleBuilder withHorizontalAlignmentCenter()
          Sets the horizontal alignment of this canvas element at the center.
 StyleBuilder withHorizontalAlignmentLeft()
          Sets the horizontal alignment of this canvas element on the left.
 StyleBuilder withHorizontalAlignmentRight()
          Sets the horizontal alignment of this canvas element on the right.
 StyleBuilder withLineColor(Color color)
          Sets the line color of this canvas element.
 StyleBuilder withLineWidth(int width)
          Sets the line width of this canvas element.
 StyleBuilder withTransparency(float f)
          Sets the transparency (alpha component) value of this canvas element.
 StyleBuilder withVerticalAlignmentBottom()
          Sets the vertical alignment of this canvas element at the bottom.
 StyleBuilder withVerticalAlignmentMiddle()
          Sets the vertical alignment of this canvas element in the middle.
 StyleBuilder withVerticalAlignmentTop()
          Sets the vertical alignment of this canvas element at the top.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StyleBuilder

public StyleBuilder(Canvas canvas,
                    Element element)
Constructs a new StyleBuilder whose Canvas and Element specified with the arguments of the same name.

Parameters:
canvas - the specified Canvas.
element - the specified Element.
Method Detail

withLineColor

public StyleBuilder withLineColor(Color color)
Sets the line color of this canvas element.

Parameters:
color - the specified color.
Returns:
this StyleBuilder.

withColor

public StyleBuilder withColor(Color color)
Sets the foreground color of this canvas element.

Parameters:
color - the specified color.
Returns:
this StyleBuilder.

withBackgroundColor

public StyleBuilder withBackgroundColor(Color color)
Sets the background color of this canvas element.

Parameters:
color - the specified color.
Returns:
this StyleBuilder.

withTransparency

public StyleBuilder withTransparency(float f)
Sets the transparency (alpha component) value of this canvas element.

Parameters:
f - the specified transparency value [0..1].
Returns:
this StyleBuilder.

withFontSize

public StyleBuilder withFontSize(int size)
Sets the font size color of this canvas element.

Parameters:
size - the specified font size in points.
Returns:
this StyleBuilder.

withLineWidth

public StyleBuilder withLineWidth(int width)
Sets the line width of this canvas element.

Parameters:
width - the specified line width in points.
Returns:
this StyleBuilder.

withVerticalAlignmentMiddle

public StyleBuilder withVerticalAlignmentMiddle()
Sets the vertical alignment of this canvas element in the middle.

Returns:
this StyleBuilder.

withVerticalAlignmentTop

public StyleBuilder withVerticalAlignmentTop()
Sets the vertical alignment of this canvas element at the top.

Returns:
this StyleBuilder.

withVerticalAlignmentBottom

public StyleBuilder withVerticalAlignmentBottom()
Sets the vertical alignment of this canvas element at the bottom.

Returns:
this StyleBuilder.

withHorizontalAlignmentLeft

public StyleBuilder withHorizontalAlignmentLeft()
Sets the horizontal alignment of this canvas element on the left.

Returns:
this StyleBuilder.

withHorizontalAlignmentCenter

public StyleBuilder withHorizontalAlignmentCenter()
Sets the horizontal alignment of this canvas element at the center.

Returns:
this StyleBuilder.

withHorizontalAlignmentRight

public StyleBuilder withHorizontalAlignmentRight()
Sets the horizontal alignment of this canvas element on the right.

Returns:
this StyleBuilder.

display

public void display(int seconds)
Displays the canvas for the specified duration.

Parameters:
seconds - the specified duration in seconds.

display

public void display(double seconds)
Displays the canvas for the specified duration.

Parameters:
seconds - the specified duration in seconds.


Copyright © 2014. All rights reserved.