Level Edit
Editor of TH .level files
Loading...
Searching...
No Matches
Public Member Functions | List of all members
com.corsixth.leveledit.GridPanel Class Reference
Inheritance diagram for com.corsixth.leveledit.GridPanel:

Public Member Functions

 GridPanel (int noColumns)
 
void setInsets (int inset)
 
void setInsets (int top, int left, int bottom, int right)
 
Component add (Component comp)
 
Component add (Component comp, boolean newRow)
 
void remove (Component comp)
 
void swap (Component oldComp, Component newComp)
 
void next (int times)
 
void next ()
 
void nextRow ()
 

Detailed Description

A panel that uses the GridBagLayout to layout its components. This is a rudimentary implementation tailored for the LevelEdit project. It supplies similar functionality as MigLayout, but only the parts we need. The constructor takes a column argument that specifies the number of columns used in the grid. Each added component is put at the end of the grid left to right, top to bottom.

Author
Edvin "Lego3" Linge

Constructor & Destructor Documentation

◆ GridPanel()

com.corsixth.leveledit.GridPanel.GridPanel ( int  noColumns)
inline

Member Function Documentation

◆ add() [1/2]

Component com.corsixth.leveledit.GridPanel.add ( Component  comp)
inline

◆ add() [2/2]

Component com.corsixth.leveledit.GridPanel.add ( Component  comp,
boolean  newRow 
)
inline

Adds a new component to the container and advances one row i newRow is true. If the component is added to the last column in the current row the advancement is still only one row.

Parameters
compComponent to add.
newRowWhether to advance one row after adding the new component.
Returns

◆ next() [1/2]

void com.corsixth.leveledit.GridPanel.next ( )
inline

Skips one cell in the grid.

◆ next() [2/2]

void com.corsixth.leveledit.GridPanel.next ( int  times)
inline

Skips 'times' cells in the grid so that the next component will be added further down.

Parameters
timeshow many cells to skip.

◆ nextRow()

void com.corsixth.leveledit.GridPanel.nextRow ( )
inline

Advances the layout one row so that the next added component will be on a new one.

◆ remove()

void com.corsixth.leveledit.GridPanel.remove ( Component  comp)
inline

◆ setInsets() [1/2]

void com.corsixth.leveledit.GridPanel.setInsets ( int  inset)
inline

Set insets in all directions to 'inset' all for each object added in the future.

Parameters
insetInset to use in all directions.

◆ setInsets() [2/2]

void com.corsixth.leveledit.GridPanel.setInsets ( int  top,
int  left,
int  bottom,
int  right 
)
inline

Set insets in each direction according to the parameters, will be used for all objects added to the JGridPanel from this point onwards.

Parameters
topTop inset value
leftLeft inset value
bottomBottom inset value
rightRight inset value

◆ swap()

void com.corsixth.leveledit.GridPanel.swap ( Component  oldComp,
Component  newComp 
)
inline

Finds the oldComp in the grid of added components and swaps it for the newComp.

Parameters
oldComp
newComp

The documentation for this class was generated from the following file: