Class DarkTabFrameUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- com.github.weisj.darklaf.components.tabframe.TabFrameUI
-
- com.github.weisj.darklaf.ui.tabframe.DarkTabFrameUI
-
- All Implemented Interfaces:
AWTEventListener
,EventListener
public class DarkTabFrameUI extends TabFrameUI implements AWTEventListener
UI class forJTabFrame
.- Since:
- 2018
-
-
Field Summary
Fields Modifier and Type Field Description protected static TabFrameTransferHandler
TRANSFER_HANDLER
-
Constructor Summary
Constructors Constructor Description DarkTabFrameUI()
-
Method Summary
Modifier and Type Method Description void
clearSourceIndicator()
void
clearTargetIndicator()
protected TabFrameLayout
createLayout()
static ComponentUI
createUI(JComponent c)
void
eventDispatched(AWTEvent event)
JComponent
getBottomContainer()
com.github.weisj.darklaf.util.Alignment
getDestAlign()
int
getDestIndex()
Color
getDragBorderColor()
JComponent
getDropComponent(com.github.weisj.darklaf.util.Alignment a)
JComponent
getDropComponentBottom()
JComponent
getDropComponentLeft()
JComponent
getDropComponentRight()
JComponent
getDropComponentTop()
JTabFrame.TabFramePosition
getDropPosition(JTabFrame tabFrame, Point p)
Dimension
getDropSize()
JComponent
getLeftContainer()
JTabFrame.TabFramePosition
getNearestTabIndexAt(JTabFrame tabFrame, Point pos)
protected com.github.weisj.darklaf.util.Pair<JTabFrame.TabFramePosition,Point>
getNearestTabIndexAtImpl(JTabFrame tabFrame, Point pos)
JComponent
getRightContainer()
com.github.weisj.darklaf.util.Alignment
getSourceAlign()
int
getSourceIndex()
protected Component
getTabContainer(com.github.weisj.darklaf.util.Alignment a)
Rectangle
getTabContainerBounds(JTabFrame tabFrame, com.github.weisj.darklaf.util.Alignment a)
int
getTabHeight(JTabFrame tabFrame, com.github.weisj.darklaf.util.Alignment a, int index)
JTabFrame.TabFramePosition
getTabIndexAt(JTabFrame tabFrame, Point p)
protected com.github.weisj.darklaf.util.Pair<JTabFrame.TabFramePosition,Point>
getTabIndexAtImpl(JTabFrame tabFrame, Point p)
protected Rectangle
getTabRect(TabFrameTab tab, com.github.weisj.darklaf.util.Alignment a, Component tabComp, boolean includeDropRect)
int
getTabSize(JTabFrame tabFrame)
int
getTabWidth(JTabFrame tabFrame, com.github.weisj.darklaf.util.Alignment a, int index)
JComponent
getTopContainer()
protected void
installDefaults()
protected void
installDnD()
protected void
installListeners()
void
installUI(JComponent c)
protected boolean
isForward(com.github.weisj.darklaf.util.Alignment a)
protected JTabFrame.TabFramePosition
maybeRestoreTabContainer(JTabFrame tabFrame, Point p)
void
setDropSize(int width, int height)
void
setSourceIndicator(com.github.weisj.darklaf.util.Alignment a, int tabIndex)
void
setTargetIndicator(com.github.weisj.darklaf.util.Alignment a, int tabIndex)
protected void
uninstallListeners()
void
uninstallUI(JComponent c)
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, paint, update
-
-
-
-
Field Detail
-
TRANSFER_HANDLER
protected static final TabFrameTransferHandler TRANSFER_HANDLER
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent c)
-
installUI
public void installUI(JComponent c)
- Overrides:
installUI
in classComponentUI
-
installDefaults
protected void installDefaults()
-
installListeners
protected void installListeners()
-
installDnD
protected void installDnD()
-
createLayout
protected TabFrameLayout createLayout()
-
uninstallUI
public void uninstallUI(JComponent c)
- Overrides:
uninstallUI
in classComponentUI
-
uninstallListeners
protected void uninstallListeners()
-
getTabSize
public int getTabSize(JTabFrame tabFrame)
- Specified by:
getTabSize
in classTabFrameUI
-
clearTargetIndicator
public void clearTargetIndicator()
- Specified by:
clearTargetIndicator
in classTabFrameUI
-
clearSourceIndicator
public void clearSourceIndicator()
- Specified by:
clearSourceIndicator
in classTabFrameUI
-
getDragBorderColor
public Color getDragBorderColor()
- Specified by:
getDragBorderColor
in classTabFrameUI
-
setSourceIndicator
public void setSourceIndicator(com.github.weisj.darklaf.util.Alignment a, int tabIndex)
- Specified by:
setSourceIndicator
in classTabFrameUI
-
setTargetIndicator
public void setTargetIndicator(com.github.weisj.darklaf.util.Alignment a, int tabIndex)
- Specified by:
setTargetIndicator
in classTabFrameUI
-
getTabIndexAt
public JTabFrame.TabFramePosition getTabIndexAt(JTabFrame tabFrame, Point p)
- Specified by:
getTabIndexAt
in classTabFrameUI
-
getTabWidth
public int getTabWidth(JTabFrame tabFrame, com.github.weisj.darklaf.util.Alignment a, int index)
- Specified by:
getTabWidth
in classTabFrameUI
-
getTopContainer
public JComponent getTopContainer()
-
getBottomContainer
public JComponent getBottomContainer()
-
getLeftContainer
public JComponent getLeftContainer()
-
getRightContainer
public JComponent getRightContainer()
-
getTabHeight
public int getTabHeight(JTabFrame tabFrame, com.github.weisj.darklaf.util.Alignment a, int index)
- Specified by:
getTabHeight
in classTabFrameUI
-
getTabContainerBounds
public Rectangle getTabContainerBounds(JTabFrame tabFrame, com.github.weisj.darklaf.util.Alignment a)
- Specified by:
getTabContainerBounds
in classTabFrameUI
-
getTabIndexAtImpl
protected com.github.weisj.darklaf.util.Pair<JTabFrame.TabFramePosition,Point> getTabIndexAtImpl(JTabFrame tabFrame, Point p)
-
getNearestTabIndexAt
public JTabFrame.TabFramePosition getNearestTabIndexAt(JTabFrame tabFrame, Point pos)
- Specified by:
getNearestTabIndexAt
in classTabFrameUI
-
getDropPosition
public JTabFrame.TabFramePosition getDropPosition(JTabFrame tabFrame, Point p)
- Specified by:
getDropPosition
in classTabFrameUI
-
maybeRestoreTabContainer
protected JTabFrame.TabFramePosition maybeRestoreTabContainer(JTabFrame tabFrame, Point p)
-
setDropSize
public void setDropSize(int width, int height)
- Specified by:
setDropSize
in classTabFrameUI
-
getTabRect
protected Rectangle getTabRect(TabFrameTab tab, com.github.weisj.darklaf.util.Alignment a, Component tabComp, boolean includeDropRect)
-
isForward
protected boolean isForward(com.github.weisj.darklaf.util.Alignment a)
-
getNearestTabIndexAtImpl
protected com.github.weisj.darklaf.util.Pair<JTabFrame.TabFramePosition,Point> getNearestTabIndexAtImpl(JTabFrame tabFrame, Point pos)
-
getTabContainer
protected Component getTabContainer(com.github.weisj.darklaf.util.Alignment a)
-
getSourceAlign
public com.github.weisj.darklaf.util.Alignment getSourceAlign()
-
getSourceIndex
public int getSourceIndex()
-
getDestAlign
public com.github.weisj.darklaf.util.Alignment getDestAlign()
-
getDestIndex
public int getDestIndex()
-
eventDispatched
public void eventDispatched(AWTEvent event)
- Specified by:
eventDispatched
in interfaceAWTEventListener
-
getDropSize
public Dimension getDropSize()
-
getDropComponent
public JComponent getDropComponent(com.github.weisj.darklaf.util.Alignment a)
-
getDropComponentTop
public JComponent getDropComponentTop()
-
getDropComponentRight
public JComponent getDropComponentRight()
-
getDropComponentBottom
public JComponent getDropComponentBottom()
-
getDropComponentLeft
public JComponent getDropComponentLeft()
-
-