|
org.netbeans.swing.tabcontrol 1.8 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.swing.tabcontrol.plaf.DefaultTabLayoutModel
public final class DefaultTabLayoutModel
Default implementation of TabLayoutModel. Simply provides a series of
rectangles for each tab starting at 0 and ending at the last element, with
the width set to the calculated width for the string plus a padding value
assigned in 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.
Field Summary | |
---|---|
protected TabDataModel |
model
|
protected int |
padX
|
protected int |
padY
|
protected JComponent |
renderTarget
|
protected int |
textHeight
|
Constructor Summary | |
---|---|
DefaultTabLayoutModel(TabDataModel model,
JComponent renderTarget)
Creates a new instance of DefaultTabLayoutModel |
Method Summary | |
---|---|
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected TabDataModel model
protected int textHeight
protected int padX
protected int padY
protected JComponent renderTarget
Constructor Detail |
---|
public DefaultTabLayoutModel(TabDataModel model, JComponent renderTarget)
Method Detail |
---|
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)
TabLayoutModel
index
in the data model.
getX
in interface TabLayoutModel
index
- The tab index
public int getY(int index)
TabLayoutModel
index
in the data model.
getY
in interface TabLayoutModel
index
- The tab index
public int getH(int index)
TabLayoutModel
index
in the data model.
getH
in interface TabLayoutModel
index
- The tab index
public int getW(int index)
TabLayoutModel
index
in the data model.
getW
in interface TabLayoutModel
index
- The tab index
public int indexOfPoint(int x, int y)
TabLayoutModel
indexOfPoint
in interface TabLayoutModel
x
- X coordinate of a point representing a set of pixel coordinate in the space
modeled by this layout modely
- Y coordinate
public int dropIndexOfPoint(int x, int y)
TabLayoutModel
dropIndexOfPoint
in interface TabLayoutModel
public void setPadding(Dimension d)
setPadding
in interface TabLayoutModel
|
org.netbeans.swing.tabcontrol 1.8 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |