Package zebkit.util

Number of different utilities methods and classes.



public void intersection (x1, y1, w1, h1, x2, y2, w2, h2, r)

Compute intersection of the two given rectangular areas


Parameters:
  • x1 <Integer>

    a x coordinate of the first rectangular area

  • y1 <Integer>

    a y coordinate of the first rectangular area

  • w1 <Integer>

    a width of the first rectangular area

  • h1 <Integer>

    a height of the first rectangular area

  • x2 <Integer>

    a x coordinate of the first rectangular area

  • y2 <Integer>

    a y coordinate of the first rectangular area

  • w2 <Integer>

    a width of the first rectangular area

  • h2 <Integer>

    a height of the first rectangular area

  • r <Object>

    an object to store result

     { x: {Integer}, y:{Integer}, width:{Integer}, height:{Integer} }
public <Boolean> isIntersect (x1, y1, w1, h1, x2, y2, w2, h2)

Test if two rectangular areas have intersection


Parameters:
  • x1 <Integer>

    a x coordinate of the first rectangular area

  • y1 <Integer>

    a y coordinate of the first rectangular area

  • w1 <Integer>

    a width of the first rectangular area

  • h1 <Integer>

    a height of the first rectangular area

  • x2 <Integer>

    a x coordinate of the first rectangular area

  • y2 <Integer>

    a y coordinate of the first rectangular area

  • w2 <Integer>

    a width of the first rectangular area

  • h2 <Integer>

    a height of the first rectangular area


Returns: <Boolean>

true if the given two rectangular areas intersect

public void unite (x1, y1, w1, h1, x2, y2, w2, h2, r)

Unite two rectangular areas to one rectangular area.


Parameters:
  • x1 <Integer>

    a x coordinate of the first rectangular area

  • y1 <Integer>

    a y coordinate of the first rectangular area

  • w1 <Integer>

    a width of the first rectangular area

  • h1 <Integer>

    a height of the first rectangular area

  • x2 <Integer>

    a x coordinate of the first rectangular area

  • y2 <Integer>

    a y coordinate of the first rectangular area

  • w2 <Integer>

    a width of the first rectangular area

  • h2 <Integer>

    a height of the first rectangular area

  • r <Object>

    an object to store result

     { x: {Integer}, y:{Integer}, width:{Integer}, height:{Integer} }
protected void validateValue (value, [allowedValues])

Validate the specified value to be equal one of the given values


Parameters:
  • value <Value>

    a value to be validated

  • [allowedValues] <Object> (*..n)

    a number of valid values to test against


Throws:

Error if the value doesn't match any valid value


Example:
 // test if the alignment is equal one of the possible values
 // throws error otherwise
 zebkit.util.validateValue(alignment, "top", "left", "right", "bottom");

public <zebkit.util.TasksSet> tasksSet

Predefined default tasks set.