Class TabPreviewPainter
- java.lang.Object
-
- org.pushingpixels.substance.extras.api.tabbed.TabPreviewPainter
-
- Direct Known Subclasses:
DefaultTabPreviewPainter
public abstract class TabPreviewPainter extends java.lang.ObjectBase class for tab preview painters.
-
-
Constructor Summary
Constructors Constructor Description TabPreviewPainter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.JFramegetModalOwner(javax.swing.JTabbedPane tabPane)Returns the owner of the overview dialog of the specified tabbed pane.SubstanceExtrasSlices.TabOverviewKindgetOverviewKind(javax.swing.JTabbedPane tabPane)Returns the tab overview kind for the specified tabbed pane.java.awt.RectanglegetPreviewDialogScreenBounds(javax.swing.JTabbedPane tabPane)Returns the screen bounds of the tab preview dialog window.java.awt.DimensiongetPreviewWindowDimension(javax.swing.JTabbedPane tabPane, int tabIndex)Returns the dimension for the tab preview window.intgetPreviewWindowExtraDelay(javax.swing.JTabbedPane tabPane, int tabIndex)Returns extra delay (in milliseconds) for showing the tab preview window.intgetUpdateCycle(javax.swing.JTabbedPane tabPane)If the result oftoUpdatePeriodically(JTabbedPane)istrue, returns the update cycle length in milliseconds.booleanhasOverviewDialog(javax.swing.JTabbedPane tabPane)Checks whether the specified tabbed pane has an overview dialog.booleanhasPreview(javax.swing.JTabbedPane tabPane, int tabIndex)Checks whether the specified tab component is previewable.booleanhasPreviewWindow(javax.swing.JTabbedPane tabPane, int tabIndex)Checks whether the specified tabbed pane has a preview window for the specified tab.booleanisSensitiveToEvents(javax.swing.JTabbedPane tabPane, int tabIndex)Checks whether the specified tab component is sensitive to events.voidpreviewTab(javax.swing.JTabbedPane tabPane, int tabIndex, java.awt.image.BufferedImage bufferedImage, int x, int y, int w, int h)Draws a tab preview on the specified graphics.booleantoDisposeOverviewOnFocusLoss()Returns indication whether the tab overview dialog should be automatically disposed when it loses focus.booleantoUpdatePeriodically(javax.swing.JTabbedPane tabPane)Returns indication whether the thumbnail preview should be updated periodically.
-
-
-
Method Detail
-
previewTab
public void previewTab(javax.swing.JTabbedPane tabPane, int tabIndex, java.awt.image.BufferedImage bufferedImage, int x, int y, int w, int h)Draws a tab preview on the specified graphics.- Parameters:
tabPane- Tabbed pane.tabIndex- tabIndex Tab index for the preview paint.bufferedImage- Buffered image to draw the preview into.x- X coordinate of the preview area.y- Y coordinate of the preview area.w- Width of the preview area.h- Height of the preview area.
-
hasPreview
public boolean hasPreview(javax.swing.JTabbedPane tabPane, int tabIndex)Checks whether the specified tab component is previewable.- Parameters:
tabPane- Tabbed pane.tabIndex- Tab index for the preview paint.- Returns:
trueif the specified tab component is previewable,falseotherwise.
-
isSensitiveToEvents
public boolean isSensitiveToEvents(javax.swing.JTabbedPane tabPane, int tabIndex)Checks whether the specified tab component is sensitive to events. Overriding implementation may decide that disabled tabs do not respond to mouse and keyboard events, thus not allowing selecting the corresponding tab.- Parameters:
tabPane- Tabbed pane.tabIndex- Tab index.- Returns:
trueif the specified tab component is sensitive to events,falseotherwise.
-
getPreviewDialogScreenBounds
public java.awt.Rectangle getPreviewDialogScreenBounds(javax.swing.JTabbedPane tabPane)
Returns the screen bounds of the tab preview dialog window.- Parameters:
tabPane- Tabbed pane.- Returns:
- Screen bounds of the preview dialog window of the specified tabbed pane.
-
getModalOwner
public javax.swing.JFrame getModalOwner(javax.swing.JTabbedPane tabPane)
Returns the owner of the overview dialog of the specified tabbed pane. If this function retuns a non-nullvalue, the overview dialog will be modal for the corresponding frame.- Parameters:
tabPane- Tabbed pane.- Returns:
- If not
null, the overview dialog for the specified tabbed pane will be modal for the corresponding frame.
-
hasOverviewDialog
public boolean hasOverviewDialog(javax.swing.JTabbedPane tabPane)
Checks whether the specified tabbed pane has an overview dialog.- Parameters:
tabPane- Tabbed pane.- Returns:
trueif the specified tabbed pane has an overview dialog,falseotherwise.
-
hasPreviewWindow
public boolean hasPreviewWindow(javax.swing.JTabbedPane tabPane, int tabIndex)Checks whether the specified tabbed pane has a preview window for the specified tab.- Parameters:
tabPane- Tabbed pane.tabIndex- Tab index.- Returns:
trueif the specified tabbed pane has a preview window for the specified tab,falseotherwise.
-
getPreviewWindowDimension
public java.awt.Dimension getPreviewWindowDimension(javax.swing.JTabbedPane tabPane, int tabIndex)Returns the dimension for the tab preview window.- Parameters:
tabPane- Tabbed pane.tabIndex- Tab index.- Returns:
- Dimension of the tab preview window for the specified tab in the specified tabbed pane.
-
getPreviewWindowExtraDelay
public int getPreviewWindowExtraDelay(javax.swing.JTabbedPane tabPane, int tabIndex)Returns extra delay (in milliseconds) for showing the tab preview window. The base delay is 2000 milliseconds (2 seconds). This function must return a non-negative value.- Parameters:
tabPane- Tabbed pane.tabIndex- Tab index.- Returns:
- Non-negative extra delay (in milliseconds) for showing the tab preview window.
-
toUpdatePeriodically
public boolean toUpdatePeriodically(javax.swing.JTabbedPane tabPane)
Returns indication whether the thumbnail preview should be updated periodically. If the return value istrue, then the implementation ofgetUpdateCycle(JTabbedPane)returns the refresh cycle length in milliseconds.- Parameters:
tabPane- Tabbed pane.- Returns:
trueif the thumbnail preview of the specified tabbed pane should be updated periodically,falseotherwise.
-
getUpdateCycle
public int getUpdateCycle(javax.swing.JTabbedPane tabPane)
If the result oftoUpdatePeriodically(JTabbedPane)istrue, returns the update cycle length in milliseconds.- Parameters:
tabPane- Tabbed pane.- Returns:
- Update cycle length in milliseconds for the thumbnail preview of the specified tabbed pane.
-
getOverviewKind
public SubstanceExtrasSlices.TabOverviewKind getOverviewKind(javax.swing.JTabbedPane tabPane)
Returns the tab overview kind for the specified tabbed pane. Relevant ifhasOverviewDialog(JTabbedPane)returnstruefor the same tabbed pane. IfhasOverviewDialog(JTabbedPane)returnstrue, the result should be notnull.- Parameters:
tabPane- Tabbed pane.- Returns:
- Tab overview kind for the specified tabbed pane.
-
toDisposeOverviewOnFocusLoss
public boolean toDisposeOverviewOnFocusLoss()
Returns indication whether the tab overview dialog should be automatically disposed when it loses focus.- Returns:
- if
true, the tab overview dialog will be disposed when it loses focus.
-
-