public abstract class CloseableTab extends TearOffTab
TearOffTab
having Close button and also a popup menu
containing a Move Tab to the Opposite Side item and
a Close item.TabbedSplitPane
Modifier and Type | Field and Description |
---|---|
protected Color |
background |
protected static Color |
CLOSE_BUTTON_COLOR |
protected static int |
CLOSE_BUTTON_PAD |
protected static int |
CLOSE_BUTTON_SIZE |
protected static BasicStroke |
CLOSE_BUTTON_STROKE |
protected int |
closeButtonX |
protected int |
closeButtonY |
protected Color |
reliefHighlight |
buttons, hideLabelUnlessSelected, icon, ICON_GAP, label, LABEL_MARGIN_HEIGHT, LABEL_MARGIN_WIDTH, rotateIcon, TEAR_OFF_THICKNESS
Modifier | Constructor and Description |
---|---|
protected |
CloseableTab(String label,
Icon icon,
Component component,
boolean atStart,
boolean hideLabelUnlessSelected,
boolean rotateIcon)
Constructs a closeable tab having specified characteristics.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
closeAction() |
protected JPopupMenu |
createPopupMenu() |
Color |
getBackground()
Returns the background color which is specific to this tab.
|
protected void |
getButtons(Rectangle[] buttons) |
protected int |
getLabelHeight(FontMetrics metrics) |
protected int |
getLabelWidth(FontMetrics metrics) |
protected boolean |
hasReliefLabel()
Returns
true if the label is to be drawn
as if it was engraved; false otherwise. |
void |
mousePressed(MouseEvent event,
int buttonIndex) |
void |
mouseReleased(MouseEvent event,
int buttonIndex) |
protected void |
moveToOppositeSideAction() |
protected void |
paintLabel(Graphics g,
int x,
int y,
int h,
Font font,
FontMetrics metrics,
Color color,
Color backgroundColor) |
void |
setBackground(Color color)
Specifies the specific color of this tab.
|
getButtons, getIcon, getIntrinsicSize, getLabel, getLabelFont, getToolTip, isHidingLabelUnlessSelected, isRotatingIcon, paint, paintTearOff, setHidingLabelUnlessSelected, setRotatingIcon, showLabel
drawSeparator, getComponent, getPane, getUserData, isAtStart, isSelected, paintSimpleTab, setUserData, toString
protected Color background
protected Color reliefHighlight
protected int closeButtonX
protected int closeButtonY
protected static int CLOSE_BUTTON_SIZE
protected static int CLOSE_BUTTON_PAD
protected static Color CLOSE_BUTTON_COLOR
protected static BasicStroke CLOSE_BUTTON_STROKE
public void setBackground(Color color)
null
to use the normal tab color.public Color getBackground()
Tab
null
if this tab has no specific background color.getBackground
in class Tab
protected boolean hasReliefLabel()
true
if the label is to be drawn
as if it was engraved; false
otherwise.
The default implementation returns false
.
protected int getLabelWidth(FontMetrics metrics)
getLabelWidth
in class TearOffTab
protected int getLabelHeight(FontMetrics metrics)
getLabelHeight
in class TearOffTab
protected void paintLabel(Graphics g, int x, int y, int h, Font font, FontMetrics metrics, Color color, Color backgroundColor)
paintLabel
in class TearOffTab
protected void getButtons(Rectangle[] buttons)
getButtons
in class TearOffTab
public void mousePressed(MouseEvent event, int buttonIndex)
mousePressed
in class TearOffTab
public void mouseReleased(MouseEvent event, int buttonIndex)
mouseReleased
in class TearOffTab
protected JPopupMenu createPopupMenu()
protected void moveToOppositeSideAction()
protected abstract void closeAction()