Skip to content

Commit

Permalink
added static SMT.addZone methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwistrongis committed Dec 19, 2014
1 parent 1d52639 commit bc22ce1
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 26 deletions.
60 changes: 60 additions & 0 deletions src/vialab/SMT/SMT.java
Original file line number Diff line number Diff line change
Expand Up @@ -1281,6 +1281,66 @@ public static boolean add(Zone... zones){
return SMT.sketch.add(zones);
}


/**
* Add a new zone, with the given name and default position and size.
*
* @param name name of the zone, used in the draw, touch ,etc methods
*/
public static void addZone( String name){
SMT.add( new Zone( name));
}

/**
* Add a new zone, with the given name and renderer, and default position and size.
*
* @param name name of the zone, used in the draw, touch ,etc methods
* @param renderer the PGraphics renderer that draws the Zone
*/
public static void addZone( String name, String renderer){
SMT.add( new Zone( name, renderer));
}

/**
* Add a new zone, with the given name and size, and default position.
*
* @param name name of the zone, used in the draw, touch ,etc methods
* @param width the width of the zone
* @param height the height of the zone
*/
public static void addZone( String name, int width, int height){
SMT.add( new Zone( name, width, height));
}

/**
* Add a new zone, with the given name, position, and size.
*
* @param name The name of the zone, used for the reflection methods
* (drawname(),touchname(),etc)
* @param x The x position of the zone
* @param y The y position of the zone
* @param width The width of the zone
* @param height The height of the zone
*/
public static void addZone( String name, int x, int y, int width, int height){
SMT.add( new Zone( name, x, y, width, height));
}

/**
* Add a new zone, with the given name, renderer, position, and size.
*
* @param name The name of the zone, used for the reflection methods (drawname(),touchname(),etc)
* @param x The x position of the zone
* @param y The y position of the zone
* @param width The width of the zone
* @param height The height of the zone
* @param renderer The renderer that draws the zone
*/
public static void addZone( String name, int x, int y,
int width, int height, String renderer){
SMT.add( new Zone( name, x, y, width, height, renderer));
}

/**
* This adds zones by creating them from XML specs, the XML needs "zone"
* tags, and currently supports the following variables: name, x, y, width,
Expand Down
52 changes: 26 additions & 26 deletions src/vialab/SMT/Zone.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public Zone(){
/**
* Zone constructor, with a name, position of (0,0), width and height of 100
*
* @param name - String: Name of the zone, used in the draw, touch ,etc methods
* @param name name of the zone, used in the draw, touch ,etc methods
*/
public Zone( String name){
this( name, SMT.zone_renderer);
Expand All @@ -192,29 +192,29 @@ public Zone( String name){
/**
* Zone constructor, with a name, position of (0,0), width and height of 100
*
* @param name - String: Name of the zone, used in the draw, touch ,etc methods
* @param renderer - String: The PGraphics renderer that draws the Zone
* @param name name of the zone, used in the draw, touch ,etc methods
* @param renderer the PGraphics renderer that draws the Zone
*/
public Zone( String name, String renderer){
this( name, 0, 0, 100, 100, renderer);
}

/**
* @param x The x position of the zone
* @param y The y position of the zone
* @param width The width of the zone
* @param height The height of the zone
* @param x the x position of the zone
* @param y the y position of the zone
* @param width the width of the zone
* @param height the height of the zone
*/
public Zone( int x, int y, int width, int height){
this( x, y, width, height, SMT.zone_renderer);
}

/**
* @param x The x position of the zone
* @param y The y position of the zone
* @param width The width of the zone
* @param height The height of the zone
* @param renderer The renderer that draws the zone
* @param x the x position of the zone
* @param y the y position of the zone
* @param width the width of the zone
* @param height the height of the zone
* @param renderer the renderer that draws the zone
*/
public Zone( int x, int y, int width, int height, String renderer){
this( null, x, y, width, height, renderer);
Expand All @@ -223,33 +223,33 @@ public Zone( int x, int y, int width, int height, String renderer){
/**
* Zone constructor, with a name, position of (0,0)
*
* @param name - String: Name of the zone, used in the draw, touch ,etc methods
* @param width The width of the zone
* @param height The height of the zone
* @param name name of the zone, used in the draw, touch ,etc methods
* @param width the width of the zone
* @param height the height of the zone
*/
public Zone( String name, int width, int height){
this( name, 0, 0, width, height);
}

/**
* @param name The name of the zone, used for the reflection methods
* @param name the name of the zone, used for the reflection methods
* (drawname(),touchname(),etc)
* @param x The x position of the zone
* @param y The y position of the zone
* @param width The width of the zone
* @param height The height of the zone
* @param x the x position of the zone
* @param y the y position of the zone
* @param width the width of the zone
* @param height the height of the zone
*/
public Zone( String name, int x, int y, int width, int height){
this( name, x, y, width, height, SMT.zone_renderer);
}

/**
* @param name The name of the zone, used for the reflection methods (drawname(),touchname(),etc)
* @param x The x position of the zone
* @param y The y position of the zone
* @param width The width of the zone
* @param height The height of the zone
* @param renderer The renderer that draws the zone
* @param name the name of the zone, used for the reflection methods (drawname(),touchname(),etc)
* @param x the x position of the zone
* @param y the y position of the zone
* @param width the width of the zone
* @param height the height of the zone
* @param renderer the renderer that draws the zone
*/
public Zone( String name, int x, int y, int width, int height, String renderer){
super();
Expand Down

0 comments on commit bc22ce1

Please sign in to comment.