public final class DefaultTabLayoutModel extends Object
setPadding.
To implement TabLayoutModel, it is often useful to create an implementation which
wraps an instance of DefaultTabLayoutModel, and uses it to calculate
tab sizes.
| Modifier and Type | Field and Description |
|---|---|
protected TabDataModel |
model |
protected int |
padX |
protected int |
padY |
protected JComponent |
renderTarget |
protected int |
textHeight |
| Constructor and Description |
|---|
DefaultTabLayoutModel(TabDataModel model,
JComponent renderTarget)
Creates a new instance of DefaultTabLayoutModel
|
| Modifier and Type | Method and Description |
|---|---|
int |
dropIndexOfPoint(int x,
int y)
Gets the index of possibly dropped component (as a new tab).
|
int |
getH(int index)
Get the height of the tab rectangle for the tab at index
index in the data model. |
int |
getW(int index)
Get the width of the tab rectangle for the tab at index
index in the data model. |
int |
getX(int index)
Get the x coordinate of the tab rectangle for the tab at index
index in the data model. |
int |
getY(int index)
Get the y coordinate of the tab rectangle for the tab at index
index in the data model. |
protected int |
iconHeight(int index) |
protected int |
iconWidth(int index) |
int |
indexOfPoint(int x,
int y)
Get the index of the tab in the data model for the supplied point.
|
void |
setPadding(Dimension d) |
protected int |
textHeight(int index) |
protected int |
textWidth(int index) |
protected TabDataModel model
protected int textHeight
protected int padX
protected int padY
protected JComponent renderTarget
public DefaultTabLayoutModel(TabDataModel model, JComponent renderTarget)
protected int iconWidth(int index)
protected int iconHeight(int index)
protected int textWidth(int index)
protected int textHeight(int index)
public int getX(int index)
TabLayoutModelindex in the data model.getX in interface TabLayoutModelindex - The tab indexpublic int getY(int index)
TabLayoutModelindex in the data model.getY in interface TabLayoutModelindex - The tab indexpublic int getH(int index)
TabLayoutModelindex in the data model.getH in interface TabLayoutModelindex - The tab indexpublic int getW(int index)
TabLayoutModelindex in the data model.getW in interface TabLayoutModelindex - The tab indexpublic int indexOfPoint(int x,
int y)
TabLayoutModelindexOfPoint in interface TabLayoutModelx - X coordinate of a point representing a set of pixel coordinate in the space
modeled by this layout modely - Y coordinatepublic int dropIndexOfPoint(int x,
int y)
TabLayoutModeldropIndexOfPoint in interface TabLayoutModelpublic void setPadding(Dimension d)
setPadding in interface TabLayoutModelBuilt on May 24 2013. | Portions Copyright 1997-2013 Oracle. All rights reserved.