com.quartercode.quarterbukkit.api.select
Class InventoryLayout

java.lang.Object
  extended by com.quartercode.quarterbukkit.api.select.InventoryLayout
All Implemented Interfaces:
org.bukkit.event.Listener

public class InventoryLayout
extends java.lang.Object
implements org.bukkit.event.Listener

This class represents the layout of the Selections in a SelectInventory.


Constructor Summary
InventoryLayout()
          Creates a new InventoryLayout.
 
Method Summary
 Selection get(int x, int y)
          Returns the Selection at the x- and y-layout-coordinates.
 java.util.List<Selection> getColumn(int x)
          Returns the column at the x-layout-coordinate as a List filled with Selections.
 java.util.List<java.util.List<Selection>> getLayout()
          Returns the whole layout as a List filled with a List filled with Selections.
 int getMaxColumns()
          Returns the maximal amount of columns.
 java.util.List<Selection> getRow(int y)
          Returns the row at the y-layout-coordinate as a List filled with Selections.
 boolean set(int x, int y, Selection selection)
          Sets the Selection at the x- and y-layout-coordinates.
 boolean setColumn(int x, java.util.List<Selection> column)
          Sets the column at the x-layout-coordinate as a List filled with Selections.
 void setLayout(java.util.List<java.util.List<Selection>> layout)
          Sets the whole new layout as a List filled with a List filled with Selections.
 boolean setRow(int y, java.util.List<Selection> row)
          Sets the row at the y-layout-coordinate as a List filled with Selections.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InventoryLayout

public InventoryLayout()
Creates a new InventoryLayout.

Method Detail

getMaxColumns

public int getMaxColumns()
Returns the maximal amount of columns.

Returns:
The maximal amount of columns.

get

public Selection get(int x,
                     int y)
Returns the Selection at the x- and y-layout-coordinates.

Parameters:
x - The x-layout-coordinate.
y - The y-layout-coordinate.
Returns:
The Selection at the x- and y-layout-coordinates.

set

public boolean set(int x,
                   int y,
                   Selection selection)
Sets the Selection at the x- and y-layout-coordinates.

Parameters:
x - The x-layout-coordinate.
y - The y-layout-coordinate.
selection - The new Selection at the x- and y-layout-coordinates.
Returns:
If the new Selection was set successfully.

getColumn

public java.util.List<Selection> getColumn(int x)
Returns the column at the x-layout-coordinate as a List filled with Selections.

Parameters:
x - The x-layout-coordinate
Returns:
The column at the x-layout-coordinate as a List filled with Selections.

setColumn

public boolean setColumn(int x,
                         java.util.List<Selection> column)
Sets the column at the x-layout-coordinate as a List filled with Selections.

Parameters:
x - The x-layout-coordinate
column - The new column as a List filled with Selections.
Returns:
If the new column was set successfully.

getRow

public java.util.List<Selection> getRow(int y)
Returns the row at the y-layout-coordinate as a List filled with Selections.

Parameters:
y - The y-layout-coordinate
Returns:
The row at the y-layout-coordinate as a List filled with Selections.

setRow

public boolean setRow(int y,
                      java.util.List<Selection> row)
Sets the row at the y-layout-coordinate as a List filled with Selections.

Parameters:
y - The y-layout-coordinate
row - The new row as a List filled with Selections.
Returns:
If the new row was set successfully.

getLayout

public java.util.List<java.util.List<Selection>> getLayout()
Returns the whole layout as a List filled with a List filled with Selections.

Returns:
The whole layout as a List filled with a List filled with Selections.

setLayout

public void setLayout(java.util.List<java.util.List<Selection>> layout)
Sets the whole new layout as a List filled with a List filled with Selections.

Parameters:
layout - The whole new layout as a List filled with a List filled with Selections.