public class MaterialTheme extends Windows10Theme
ClassicTheme.TextLookAndFeelImpl
Theme.TextLookAndFeel
Modifier and Type | Field and Description |
---|---|
private static int |
BACKGROUND
The palette entry for background color, by default WHITE.
|
private java.awt.Color[] |
DEFAULT_PALETTE
The default basic palette.
|
private java.util.Map<java.lang.Integer,ColorRgb> |
defaultColors
Cached map with default system colors.
|
private java.util.Map<java.lang.String,java.lang.String> |
defaultFontAliases
Cached map with font aliases.
|
private java.util.Map<java.lang.String,java.lang.String> |
defaultFontTable
Cached map with font table.
|
private static int |
DISABLED
The palette entry for disabled widgets, by default some kind of GREY.
|
private static int |
FOREGROUND
The palette entry for foreground color (text), by default BLACK.
|
private static int |
HIGHLIGHTED
The palette entry for highlighted widget components, by default ORANGE-ish
|
private java.util.Map<java.lang.String,ImageWrapper<java.awt.image.BufferedImage>> |
imgCache
Cache with read /decoded images.
|
private static int |
NORMAL
The palette entry for normal widget components, by default BLUE-GREEN-ish
|
private java.awt.Color[] |
pal
The color palette that is currently in use.
|
COMBOBOX_BUTTON_WIDTH, MENU_CHECKMARK_WIDTH, MENU_LEFT_PAD
ROW_TOGGLE_SIZE, SCROLLBAR_THUMB_MIN_SIZE, SCROLLBAR_WIDTH, THREE_D_BORDER_OFFSET
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_NONE, ALIGN_RIGHT, ALIGN_TOP, HORIZONTAL_ALIGN_MASK, VERTICAL_ALIGN_MASK
Constructor and Description |
---|
MaterialTheme()
The constructor initializes the working palette.
|
Modifier and Type | Method and Description |
---|---|
private java.awt.Color |
brighter(java.awt.Color c,
float level)
Creates a new, brighter
Color version of color c . |
private java.awt.Color |
brighter(int palEntry)
Creates a new, darker
Color version of palEntry in color palette. |
private java.awt.Color |
brighter(int palEntry,
float level)
Creates a new, brighter
Color version of palEntry in color palette. |
private java.awt.Color |
darker(java.awt.Color c,
float level)
Creates a new, darker
Color version of color c . |
private java.awt.Color |
darker(int palEntry)
Creates a new, darker
Color version of palEntry in color palette. |
private java.awt.Color |
darker(int palEntry,
float level)
Creates a new, darker
Color version of palEntry in color palette. |
void |
draw3DBorder(ThreeDBorderGuiImpl border,
GuiDriver gd,
int x,
int y,
int width,
int height)
Draws a
ThreeDBorderGuiImpl widget. |
protected void |
drawBrowseCellText(BrowseColumnGuiImpl column,
GuiDriver gd,
boolean label,
boolean selectedRow,
java.lang.String text,
NativeRectangle clipRectangle,
int lineNumber,
int viewportRowIndex)
Draw the text inside a label or cell.
|
void |
drawBrowseColumnLabel(BrowseColumnGuiImpl column,
GuiDriver gd,
int x,
int y,
int width,
int height)
Draw the label on a
BrowseColumnGuiImpl widget. |
protected void |
drawBrowseColumnLabelBorder(BrowseColumnGuiImpl column,
GuiDriver gd,
int xOffset,
int yOffset,
int w,
int h)
Draw label-style rectangle.
|
protected void |
drawBrowseColumnLabelRect(BrowseColumnGuiImpl column,
GuiDriver gd,
int topOffset,
boolean markersBody,
boolean markersLabel,
boolean selectedRow)
Draw label-style rectangle.
|
private void |
drawBrowseColumnMarker(BrowseGuiImpl browse,
GuiDriver gd,
boolean selected,
int topOffset,
int w,
int h)
Draw browse row marker column rectangle.
|
void |
drawBrowseMarkersColumn(BrowseColumnGuiImpl column,
GuiDriver gd,
int x,
int y,
int width,
int height)
Draw a browse marker column
BrowseColumnGuiImpl widget (without label). |
void |
drawBrowseNormalColumn(BrowseColumnGuiImpl column,
GuiDriver gd,
int x,
int y,
int width,
int height)
Draw a normal column
BrowseColumnGuiImpl widget (without label). |
void |
drawBrowseRowHighlight(BrowseGuiImpl browse,
GuiDriver gd,
int x,
int y,
int width,
int height)
Highlight the currently active row in a
BrowseGuiImpl widget. |
void |
drawBrowseTitlePanel(BrowseGuiImpl browse,
GuiDriver gd,
GuiColorResolver gc,
GuiFontResolver gf,
int x,
int y,
int width,
int height)
Draw the title panel of a
BrowseGuiImpl widget. |
void |
drawButton(ButtonGuiImpl button,
GuiDriver gd,
GuiColorResolver gc,
GuiFontResolver gf,
int x,
int y,
int width,
int height)
Renders borders of a top-level window.
|
private void |
drawCheckmark(GuiDriver gd,
int x,
int y,
int width,
int height,
boolean check)
Draws a checkmark in the designated area.
|
void |
drawFillInBorder(GuiDriver gd,
GuiColorResolver gc,
int x,
int y,
int width,
int height,
boolean border3D,
boolean hasFocus,
boolean hover)
Renders the border (and possibly the background) of the fill-in widget.
|
void |
drawFillInCaret(FillInGuiImpl fillIn,
GuiDriver gd,
int x1,
int y1,
int x2,
int y2)
Renders caret of the fill-in widget.
|
void |
drawFrameTitle(FrameGuiImpl frame,
GuiDriver gd,
GuiColorResolver gc,
GuiFontResolver gf,
int x,
int y,
int width,
int height)
Draw the title panel of a
BrowseGuiImpl widget. |
void |
drawLineBorder(LineBorderGuiImpl border,
GuiDriver gd,
GuiColorResolver gc,
int x,
int y,
int width,
int height)
Draw the line border
LineBorderGuiImpl widget. |
void |
drawMenuBackground(GuiDriver gd,
int x,
int y,
int width,
int height,
boolean popup)
Renders the background of a menu widget.
|
void |
drawMenuBarElement(MenuElement me,
GuiDriver gd,
GuiFontResolver gf,
int x,
int y,
int width,
int height,
boolean hover)
Draws an element of a menu in a menubar.
|
void |
drawMenuItemBackground(AbstractWidget item,
GuiDriver gd,
int x,
int y,
int width,
int height,
boolean hover)
Renders the background of an item in a menu widget.
|
void |
drawMenuItemContent(AbstractWidget item,
GuiDriver gd,
GuiFontResolver gf,
int x,
int y,
int width,
int height,
int textHeight,
boolean focused)
Renders the foreground content of menu item in a popup menu.
|
void |
drawMenuSeparator(GuiDriver gd,
int x,
int y,
int width,
int height)
Renders the separator line in a menu widget.
|
private void |
drawRadioButton(GuiDriver gd,
int x,
int y,
int width,
int height,
boolean selected)
Draws a radio-button in the designated area.
|
void |
drawRadioButton(RadioButtonGuiImpl rb,
GuiDriver gd,
GuiColorResolver gc,
GuiFontResolver gf,
int x,
int y,
int width,
int height,
boolean focused,
boolean hover)
Renders a GUI radio button widget.
|
void |
drawRectangle(RectangleGuiImpl rect,
GuiDriver gd,
GuiColorResolver gc,
int x,
int y,
int width,
int height)
Draws a
RectangleGuiImpl widget. |
void |
drawScrollBarButton(GuiDriver gd,
GuiColorResolver gc,
int x,
int y,
int width,
int height,
ScrollBar.Position pos,
boolean horizontal,
boolean enabled,
boolean pressed,
boolean highlighted)
Renders a button of the scrollbar widget.
|
void |
drawScrollBarGauge(GuiDriver gd,
GuiColorResolver gc,
int x,
int y,
int width,
int height,
boolean horizontal)
Renders the gauge (background) of the scrollbar widget.
|
void |
drawScrollBarThumb(GuiDriver gd,
GuiColorResolver gc,
int x,
int y,
int width,
int height,
boolean pressed,
boolean hover,
boolean horizontal)
Renders the thumb/slider of the scrollbar widget.
|
void |
drawSelectionListBackground(GuiDriver gd,
GuiColorResolver gc,
int x,
int y,
int width,
int height)
Renders the background of a selection list.
|
void |
drawToggleBox(ToggleBoxGuiImpl cb,
GuiDriver gd,
GuiColorResolver gc,
GuiFontResolver gf,
int x,
int y,
int width,
int height,
boolean pressed,
boolean hover)
Renders a GUI toggle box widget.
|
void |
drawWindowBorder(GuiDriver gd,
int x,
int y,
int width,
int height,
NativeInsets border,
boolean active)
Renders borders of a top-level window.
|
int |
get3DBorderOffset()
Obtain the offset in a 3D bordered widget.
|
int |
getAlertBoxPadding()
Obtain the padding for alert boxes.
|
java.lang.String |
getBinaryResourceLocation()
Obtain the location of binary resources (like pixmaps and sprites) used by this theme.
|
ColorRgb |
getBrowseCellForegroundColor(BrowseColumnGuiImpl column,
boolean label,
boolean selected,
int viewportRowIndex)
Get foreground color of the selected cell type.
|
ColorRgb |
getBrowseCellSeparatorColor(BrowseGuiImpl browse)
Get the cell separator color.
|
int |
getCheckBoxSize()
Obtain the size of image on a checkbox widget.
|
int |
getCheckBoxSpace()
Obtains the space needed by a checkbox widget.
|
java.util.Map<java.lang.String,java.lang.String> |
getDefaultFontAliases()
Obtain the map of default font aliases specific to current
Theme , to which a key
defaults, if not overridden in the directory. |
java.util.Map<java.lang.Integer,ColorRgb> |
getDefaultSystemPalette()
Obtain the default system palette for this theme.
|
ColorRgb |
getHyperlinkColor(boolean selectedRow)
Get the hyperlink color.
|
FontDetails |
getHyperlinkFont(WidgetId windowId,
FontDetails sourceFont)
Get the hyperlink font basing on the regular text font.
|
ImageWrapper |
getImage(java.lang.String name,
int w,
int h,
boolean antialias)
Obtain an image resource specific to this
Theme . |
int |
getMenuBarElementMinSize(boolean horiz)
Obtain the minimum size of a titlebar element for this Theme, including any border.
|
int |
getMenuCheckmarkWidth()
Obtain the width of the check mark to for togglable menus.
|
NativeInsets |
getMenuInsets()
Obtain the insets of a popup menu.
|
int |
getMenuItemHeight(MenuElement menuItem)
Obtain the height of a
MenuElement in a menu widget. |
int |
getMenuSeparatorHeight()
Obtain the fixed height of a separator in a popup menu widget.
|
int |
getMenuSmArrowWidth()
Obtain the width of the arrow marking menus with submenus (including additional space).
|
java.lang.String |
getName()
Get the name of this
Theme . |
char |
getPasswordCharacter()
Obtain the character used to replace text in password fields.
|
protected ImageWrapper<java.awt.image.BufferedImage> |
getPngImage(java.lang.String imagePath)
Utility method that loads a image (recommended in PNG format because it is lossless and has
support for full 8 bit alpha channel, but not otherwise restricted to).
|
int |
getRadioButtonExtraDist()
Obtain the extra distance in a radio button.
|
int |
getRadioButtonImageSpace()
Obtain the distance before text, including the radio button (text offset).
|
int |
getScrollBarButtonHeight()
Obtain the size of the scroll button on the direction of the scroll.
|
int |
getScrollBarButtonWidth()
Obtain the size of the scroll button on the direction perpendicular to scroll direction.
|
int |
getScrollBarGaugeWidth()
Obtain the width of the gauge of a scrollbar widget.
|
int |
getScrollBarThumbMinSize()
Obtain the minimum size of the thumb/slider of a scrollbar widget.
|
int |
getScrollBarThumbWidth()
Obtain the thumb/slider width in a scrollbar widget.
|
java.util.Map<java.lang.String,java.lang.String> |
getStandardFontTable()
Obtain the map of standard fonts specific to current
Theme , to which a key defaults,
if not overridden in the directory. |
boolean |
isClassic()
Check whether this is a classic theme.
|
boolean |
isFlat()
Checks whether this theme is flat.
|
boolean |
isMouseHoverSensitive()
Check if the theme is mouse hover sensitive.
|
protected void |
setBrowseCellBackgroundSelectionColor(GuiDriver gd,
ColorRgb unselColor)
Set the selected cell background color into the
gd GuiDriver . |
protected void |
setCompositeXorColor(GuiDriver gd)
Sets the composite color for XOR operations on browse widgets.
|
drawBrowseColumnMarker, drawCaptionButton, drawComboBoxButton, drawComboBoxEntryField, drawComboBoxFieldBorder, drawFileChooserThumbnailBackground, drawSelectionFocus, drawSelectionListItem, drawSliderThumb, drawSliderTrack, drawStatusBar, drawToolTip, drawWindowTitle, drawWindowTitleBar, getBrowseDataOffsetLeft, getBrowseLabelOffsetLeft, getBrowseMarkerArrow, getCaptionButtonHeight, getCaptionButtonsAlignment, getCaptionButtonWidth, getComboBoxButtonSize, getComboBoxDropDownOffset, getComboBoxEntryShift, getComboBoxFieldExtraSpace, getFileChooserForegroundColor, getMenuLeftPad, getMenuRightPad, getRadioButtonImage, getRowToggleImage, getRowToggleOffset, getRowToggleSize, getSliderTicmarkColor, getSpaceBeforeButton, getTextLookAndFeel, getTitleBarHeight, getWindowBorderInsets, getWindowIconAlignment, getWindowTitleAlignment, layoutTitleBar, releaseResources
drawAlertBox, drawBrowseCell, drawBrowseCellLabel, drawBrowseColumnDrag, drawBrowseResizingColumn, drawCaret, drawEditorCaret, drawEditorContent, drawLabel, drawLabelUnderline, drawRowToggleImage, drawSliderBackground, drawSliderFrame, drawSliderTicMarks, drawSliderValue, getBrowseLabelOffsetRight, getColumnBackgroundColor, getColumnLabelBackgroundColor, getPrebuiltArrowImageSize, getRowToggleOffsetCentered, getTextLookAndFeel, getTitleBarFont, getTitleBarTextColor, isBrowseLabelBorderDrawQuirk
private static final int BACKGROUND
private static final int FOREGROUND
private static final int NORMAL
private static final int HIGHLIGHTED
private static final int DISABLED
private final java.awt.Color[] DEFAULT_PALETTE
brighter(int)
and darker(int)
APIs.private final java.awt.Color[] pal
private java.util.Map<java.lang.Integer,ColorRgb> defaultColors
private java.util.Map<java.lang.String,java.lang.String> defaultFontTable
private java.util.Map<java.lang.String,java.lang.String> defaultFontAliases
private java.util.Map<java.lang.String,ImageWrapper<java.awt.image.BufferedImage>> imgCache
public MaterialTheme()
public java.lang.String getName()
Theme
.getName
in interface Theme
getName
in class Windows10Theme
public java.lang.String getBinaryResourceLocation()
getBinaryResourceLocation
in interface Theme
getBinaryResourceLocation
in class Windows10Theme
public ImageWrapper getImage(java.lang.String name, int w, int h, boolean antialias)
Theme
. The image can be cached for
performance reasons. It will be automatically released when Windows10Theme.releaseResources()
is
called, when a new Theme
is loaded and this one is removed.getImage
in interface Theme
getImage
in class Windows10Theme
name
- The name of the image as path within jar bundle.w
- The desired with of the returned image. This is only a hint. If available, an
image with exact width is returned. One need to check the size of the returned
ImageWrapper
to know the exact value.h
- The desired with of the returned image. This is only a hint. If available, an
image with exact width is returned. One need to check the size of the returned
ImageWrapper
to know the exact value.antialias
- if true
and image is scaled to meet the size hints, an smooth scaling
algorithm will be used, otherwise a faster one will be used but the image quality
will be lower. If image is not scaled the parameter is ignored.ImageWrapper
containing the requested image resource if it can be found
and loaded and null
otherwise.public boolean isMouseHoverSensitive()
isMouseHoverSensitive
in interface Theme
isMouseHoverSensitive
in class Windows10Theme
true
. This theme is mouse hover sensitive.public boolean isClassic()
isClassic
in interface Theme
isClassic
in class Windows10Theme
false
.public boolean isFlat()
true
if this Theme
is flat.public java.util.Map<java.lang.Integer,ColorRgb> getDefaultSystemPalette()
getDefaultSystemPalette
in interface Theme
getDefaultSystemPalette
in class Windows10Theme
public java.util.Map<java.lang.String,java.lang.String> getStandardFontTable()
Theme
, to which a key defaults,
if not overridden in the directory.getStandardFontTable
in interface Theme
getStandardFontTable
in class Windows10Theme
Theme
.public java.util.Map<java.lang.String,java.lang.String> getDefaultFontAliases()
Theme
, to which a key
defaults, if not overridden in the directory.getDefaultFontAliases
in interface Theme
getDefaultFontAliases
in class Windows10Theme
Theme
.public void drawWindowBorder(GuiDriver gd, int x, int y, int width, int height, NativeInsets border, boolean active)
Windows10Theme
drawWindowBorder
in interface Theme
drawWindowBorder
in class Windows10Theme
gd
- The GuiDriver
used for drawing operations.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.border
- The width of the border on each side.active
- true
if the drawn windows is active.public void drawButton(ButtonGuiImpl button, GuiDriver gd, GuiColorResolver gc, GuiFontResolver gf, int x, int y, int width, int height)
drawButton
in interface Theme
drawButton
in class Windows10Theme
button
- The ButtonGuiImpl
to be rendered.gd
- The GuiDriver
used for drawing operations.gc
- The GuiColorResolver
to be used for color selection.gf
- The GuiFontResolver
to be used.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.public void drawToggleBox(ToggleBoxGuiImpl cb, GuiDriver gd, GuiColorResolver gc, GuiFontResolver gf, int x, int y, int width, int height, boolean pressed, boolean hover)
drawToggleBox
in interface Theme
drawToggleBox
in class Windows10Theme
cb
- The ToggleBoxGuiImpl
to be rendered.gd
- The GuiDriver
used for drawing operations.gc
- The GuiColorResolver
to be used for color selection.gf
- The GuiFontResolver
to be used.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.pressed
- true
if the checkbox is pressed (the mouse button is down on the button).hover
- true
if mouse is hovering over the checkbox. Some styles are mouse hoveringpublic void drawRadioButton(RadioButtonGuiImpl rb, GuiDriver gd, GuiColorResolver gc, GuiFontResolver gf, int x, int y, int width, int height, boolean focused, boolean hover)
drawRadioButton
in interface Theme
drawRadioButton
in class Windows10Theme
rb
- The RadioButtonGuiImpl
to be rendered.gd
- The GuiDriver
used for drawing operations.gc
- The GuiColorResolver
to be used for color selection.gf
- The GuiFontResolver
to be used.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.focused
- true
if the radio button have the focushover
- true
if mouse is hovering over the checkbox. Some styles are mouse hoveringpublic int getAlertBoxPadding()
ClassicTheme
getAlertBoxPadding
in interface Theme
getAlertBoxPadding
in class ClassicTheme
public int getRadioButtonExtraDist()
getRadioButtonExtraDist
in interface Theme
getRadioButtonExtraDist
in class ClassicTheme
public int getRadioButtonImageSpace()
getRadioButtonImageSpace
in interface Theme
getRadioButtonImageSpace
in class Windows10Theme
public int getCheckBoxSpace()
getCheckBoxSpace
in interface Theme
getCheckBoxSpace
in class Windows10Theme
public int getCheckBoxSize()
getCheckBoxSize
in interface Theme
getCheckBoxSize
in class Windows10Theme
public int getScrollBarButtonWidth()
getScrollBarButtonWidth
in interface Theme
getScrollBarButtonWidth
in class Windows10Theme
public int getScrollBarThumbWidth()
getScrollBarThumbWidth
in interface Theme
getScrollBarThumbWidth
in class Windows10Theme
public int getScrollBarThumbMinSize()
getScrollBarThumbMinSize
in interface Theme
getScrollBarThumbMinSize
in class ClassicTheme
public int getScrollBarGaugeWidth()
getScrollBarGaugeWidth
in interface Theme
getScrollBarGaugeWidth
in class Windows10Theme
public int getScrollBarButtonHeight()
getScrollBarButtonHeight
in interface Theme
getScrollBarButtonHeight
in class Windows10Theme
public void drawScrollBarGauge(GuiDriver gd, GuiColorResolver gc, int x, int y, int width, int height, boolean horizontal)
drawScrollBarGauge
in interface Theme
drawScrollBarGauge
in class Windows10Theme
gd
- The GuiDriver
used for drawing operations.gc
- The GuiColorResolver
used color selection.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.horizontal
- The direction of the scrollbar, true
for horizontal.public void drawScrollBarThumb(GuiDriver gd, GuiColorResolver gc, int x, int y, int width, int height, boolean pressed, boolean hover, boolean horizontal)
drawScrollBarThumb
in interface Theme
drawScrollBarThumb
in class Windows10Theme
gd
- The GuiDriver
used for drawing operations.gc
- The GuiColorResolver
used color selection.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.pressed
- If the mouse is dragging the thumb of the scrollbar.hover
- Is mouse hovering this component ?horizontal
- The direction of the scrollbar, true
for horizontal.public int get3DBorderOffset()
get3DBorderOffset
in interface Theme
get3DBorderOffset
in class ClassicTheme
public void drawScrollBarButton(GuiDriver gd, GuiColorResolver gc, int x, int y, int width, int height, ScrollBar.Position pos, boolean horizontal, boolean enabled, boolean pressed, boolean highlighted)
drawScrollBarButton
in interface Theme
drawScrollBarButton
in class Windows10Theme
gd
- The GuiDriver
used for drawing operations.gc
- The GuiColorResolver
used color selection.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.pos
- The position of the button (UP/DOWN, LEFT/RIGHT).horizontal
- The direction of the scrollbar, true
for horizontal.enabled
- If the button is enabled.pressed
- If the button is down (pressed by mouse).highlighted
- If the mouse is hovering over the button.public char getPasswordCharacter()
getPasswordCharacter
in interface Theme
getPasswordCharacter
in class Windows10Theme
public void drawFillInBorder(GuiDriver gd, GuiColorResolver gc, int x, int y, int width, int height, boolean border3D, boolean hasFocus, boolean hover)
drawFillInBorder
in interface Theme
drawFillInBorder
in class Windows10Theme
gd
- The GuiDriver
used for drawing operations.gc
- The GuiColorResolver
used color selection.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.border3D
- If fill-in widget has a 3d border. Some flat Theme
s may ignore this.hasFocus
- The fill-in widget is focused.hover
- The mouse is hovering over the fill-in widget.public void drawFillInCaret(FillInGuiImpl fillIn, GuiDriver gd, int x1, int y1, int x2, int y2)
drawFillInCaret
in interface Theme
drawFillInCaret
in class ClassicTheme
fillIn
- The FillInGuiImpl
widget whose caret is to be rendered.gd
- The GuiDriver
used for drawing operations.x1
- The left extremity of the caret.y1
- The top extremity of the caret.x2
- The right extremity of the caret.y2
- The bottom extremity of the caret.public void drawSelectionListBackground(GuiDriver gd, GuiColorResolver gc, int x, int y, int width, int height)
drawSelectionListBackground
in interface Theme
drawSelectionListBackground
in class Windows10Theme
gd
- The GuiDriver
used for drawing operations.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.gc
- The GuiColorResolver
used color selection.public NativeInsets getMenuInsets()
getMenuInsets
in interface Theme
getMenuInsets
in class ClassicTheme
public int getMenuCheckmarkWidth()
getMenuCheckmarkWidth
in interface Theme
getMenuCheckmarkWidth
in class Windows10Theme
public int getMenuSmArrowWidth()
getMenuSmArrowWidth
in interface Theme
getMenuSmArrowWidth
in class ClassicTheme
public int getMenuBarElementMinSize(boolean horiz)
getMenuBarElementMinSize
in interface Theme
getMenuBarElementMinSize
in class Windows10Theme
horiz
- If true
returns the minimum width, if false
returns minimum height.public void drawMenuBackground(GuiDriver gd, int x, int y, int width, int height, boolean popup)
drawMenuBackground
in interface Theme
drawMenuBackground
in class Windows10Theme
gd
- The GuiDriver
used for drawing operations.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.popup
- true
for popup menus.public void drawMenuSeparator(GuiDriver gd, int x, int y, int width, int height)
drawMenuSeparator
in interface Theme
drawMenuSeparator
in class Windows10Theme
gd
- The GuiDriver
used for drawing operations.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.public int getMenuSeparatorHeight()
getMenuSeparatorHeight
in interface Theme
getMenuSeparatorHeight
in class Windows10Theme
public int getMenuItemHeight(MenuElement menuItem)
MenuElement
in a menu widget.getMenuItemHeight
in interface Theme
getMenuItemHeight
in class Windows10Theme
public void drawMenuItemContent(AbstractWidget item, GuiDriver gd, GuiFontResolver gf, int x, int y, int width, int height, int textHeight, boolean focused)
drawMenuItemContent
in interface Theme
drawMenuItemContent
in class Windows10Theme
item
- The MenuItemGuiImpl
or SubMenuGuiImpl
to be drawn.gd
- The GuiDriver
used for drawing operations.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.textHeight
- The height of the text.focused
- true
if this item is highlighted/focused.gf
- The GuiFontResolver
to be used.public void drawMenuItemBackground(AbstractWidget item, GuiDriver gd, int x, int y, int width, int height, boolean hover)
drawMenuItemBackground
in interface Theme
drawMenuItemBackground
in class Windows10Theme
item
- The MenuItemGuiImpl
or SubMenuGuiImpl
to be drawn.gd
- The GuiDriver
used for drawing operations.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.hover
- true
if this item is highlighted/focused.public void drawMenuBarElement(MenuElement me, GuiDriver gd, GuiFontResolver gf, int x, int y, int width, int height, boolean hover)
drawMenuBarElement
in interface Theme
drawMenuBarElement
in class Windows10Theme
me
- The MenuElement
widget to be painted.gd
- The GuiDriver
used for drawing operations.gf
- GUI font resolver.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.hover
- true
if this item is highlighted/focused.public void drawBrowseRowHighlight(BrowseGuiImpl browse, GuiDriver gd, int x, int y, int width, int height)
BrowseGuiImpl
widget.drawBrowseRowHighlight
in interface Theme
drawBrowseRowHighlight
in class ClassicTheme
gd
- The GuiDriver
used for drawing operations.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.browse
- The BrowseGuiImpl
widget.public void drawBrowseTitlePanel(BrowseGuiImpl browse, GuiDriver gd, GuiColorResolver gc, GuiFontResolver gf, int x, int y, int width, int height)
BrowseGuiImpl
widget.drawBrowseTitlePanel
in interface Theme
drawBrowseTitlePanel
in class Windows10Theme
browse
- The BrowseGuiImpl
widget.gd
- The GuiDriver
used for drawing operations.gc
- The GuiColorResolver
used color selection.gf
- The GuiFontResolver
to be used.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.public void drawBrowseColumnLabel(BrowseColumnGuiImpl column, GuiDriver gd, int x, int y, int width, int height)
BrowseColumnGuiImpl
widget.drawBrowseColumnLabel
in interface Theme
drawBrowseColumnLabel
in class ClassicTheme
column
- The BrowseGuiImpl
widget.gd
- The GuiDriver
used for drawing operations.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.public void drawBrowseMarkersColumn(BrowseColumnGuiImpl column, GuiDriver gd, int x, int y, int width, int height)
ClassicTheme
BrowseColumnGuiImpl
widget (without label).drawBrowseMarkersColumn
in interface Theme
drawBrowseMarkersColumn
in class ClassicTheme
column
- The BrowseGuiImpl
widget.gd
- The GuiDriver
used for drawing operations.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.public void drawBrowseNormalColumn(BrowseColumnGuiImpl column, GuiDriver gd, int x, int y, int width, int height)
BrowseColumnGuiImpl
widget (without label).drawBrowseNormalColumn
in interface Theme
drawBrowseNormalColumn
in class ClassicTheme
column
- The BrowseGuiImpl
widget.gd
- The GuiDriver
used for drawing operations.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.public void drawFrameTitle(FrameGuiImpl frame, GuiDriver gd, GuiColorResolver gc, GuiFontResolver gf, int x, int y, int width, int height)
BrowseGuiImpl
widget.drawFrameTitle
in interface Theme
drawFrameTitle
in class Windows10Theme
frame
- The FrameGuiImpl
widget.gd
- The GuiDriver
used for drawing operations.gc
- The GuiColorResolver
used color selection.gf
- The GuiFontResolver
to be used.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.public void drawLineBorder(LineBorderGuiImpl border, GuiDriver gd, GuiColorResolver gc, int x, int y, int width, int height)
LineBorderGuiImpl
widget.drawLineBorder
in interface Theme
drawLineBorder
in class Windows10Theme
border
- The FrameGuiImpl
widget.gd
- The GuiDriver
used for drawing operations.gc
- The GuiColorResolver
used color selection.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.public void drawRectangle(RectangleGuiImpl rect, GuiDriver gd, GuiColorResolver gc, int x, int y, int width, int height)
RectangleGuiImpl
widget.drawRectangle
in interface Theme
drawRectangle
in class Windows10Theme
rect
- The RectangleGuiImpl
widget.gd
- The GuiDriver
used for drawing operations.gc
- The GuiColorResolver
used color selection.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.public void draw3DBorder(ThreeDBorderGuiImpl border, GuiDriver gd, int x, int y, int width, int height)
ThreeDBorderGuiImpl
widget.draw3DBorder
in interface Theme
draw3DBorder
in class Windows10Theme
border
- The RectangleGuiImpl
widget.gd
- The GuiDriver
used for drawing operations.x
- The horizontal location (in pixel units) of the widget to be painted/component.y
- The vertical location (in pixel units) of the widget to be painted/component.width
- The width of the painted widget/component.height
- The height of the painted widget/component.public ColorRgb getBrowseCellForegroundColor(BrowseColumnGuiImpl column, boolean label, boolean selected, int viewportRowIndex)
getBrowseCellForegroundColor
in interface Theme
getBrowseCellForegroundColor
in class ClassicTheme
column
- The parent BrowseColumnGuiImpl
of the cell.label
- true
for label cell, false
for normal cell.selected
- true
if the row is selected.viewportRowIndex
- 0-based number of the target row in the viewport (for cells only). -1 for general
cell foreground color.public ColorRgb getBrowseCellSeparatorColor(BrowseGuiImpl browse)
getBrowseCellSeparatorColor
in interface Theme
getBrowseCellSeparatorColor
in class Windows10Theme
browse
- The browse widget.public FontDetails getHyperlinkFont(WidgetId windowId, FontDetails sourceFont)
getHyperlinkFont
in interface Theme
getHyperlinkFont
in class ClassicTheme
windowId
- ID of the currentWindow.sourceFont
- Regular font.public ColorRgb getHyperlinkColor(boolean selectedRow)
getHyperlinkColor
in interface Theme
getHyperlinkColor
in class ClassicTheme
selectedRow
- true
if the hyperlink belongs to the selected row.protected void setBrowseCellBackgroundSelectionColor(GuiDriver gd, ColorRgb unselColor)
gd
GuiDriver
.
TODO: this is a dependency of ClassicTheme
. It is being used only temporary, until
the {#code broswe} support is added to this Theme
. The goal of this method is
to give the browse selected line a color from standard palette.setBrowseCellBackgroundSelectionColor
in class Windows10Theme
gd
- The GuiDriver
to set the color for separators.unselColor
- The color for unselected cells. If null
then the unselected cells'
background is not drawn.protected void drawBrowseColumnLabelRect(BrowseColumnGuiImpl column, GuiDriver gd, int topOffset, boolean markersBody, boolean markersLabel, boolean selectedRow)
drawBrowseColumnLabelRect
in class Windows10Theme
column
- The BrowseGuiImpl
widget.gd
- The GuiDriver
used for drawing operations.topOffset
- Top offset, in pixels.markersBody
- true
if it is a cell in the markers column.markersLabel
- true
if it is the label area in the markers column.selectedRow
- Is the current row selected ?private void drawBrowseColumnMarker(BrowseGuiImpl browse, GuiDriver gd, boolean selected, int topOffset, int w, int h)
browse
- The browse widget.gd
- The GuiDriver
used for drawing operations.selected
- Is the current row selected ?topOffset
- Top offset, in pixels.w
- The border width in pixels.h
- The border height in pixels.protected void drawBrowseColumnLabelBorder(BrowseColumnGuiImpl column, GuiDriver gd, int xOffset, int yOffset, int w, int h)
drawBrowseColumnLabelBorder
in class Windows10Theme
column
- The BrowseColumnGuiImpl
widget.gd
- The GuiDriver
used for drawing operations.xOffset
- Left offset, in pixels.yOffset
- Top offset, in pixels.w
- The border width in pixels.h
- The border height in pixels.protected void drawBrowseCellText(BrowseColumnGuiImpl column, GuiDriver gd, boolean label, boolean selectedRow, java.lang.String text, NativeRectangle clipRectangle, int lineNumber, int viewportRowIndex)
drawBrowseCellText
in class ClassicTheme
column
- The BrowseGuiImpl
widget.gd
- The GuiDriver
used for drawing operations.label
- true
to draw the text inside a label. false
to draw the text inside
a cell.selectedRow
- true
if the row the cell belongs to is selected.text
- ext to draw.clipRectangle
- Clipping rectangle.lineNumber
- 0-based number of line in the label/cell.viewportRowIndex
- 0-based number of the target row in the viewport (for cells only).protected ImageWrapper<java.awt.image.BufferedImage> getPngImage(java.lang.String imagePath)
getPngImage
in class Windows10Theme
imagePath
- The path to image resource inside the bundle (jar).ImageWrapper
containing the requested image resource or null
if
some error occurred (resource could not be found or it could not be decoded).protected void setCompositeXorColor(GuiDriver gd)
setCompositeXorColor
in class Windows10Theme
gd
- the active GuiDriver
used to draw the browse widget.private void drawRadioButton(GuiDriver gd, int x, int y, int width, int height, boolean selected)
gd
.gd
- The GuiDriver
used for drawing operations.x
- The X coordinate of the checkmark.y
- The Y coordinate of the checkmark.width
- The width of the checkmark.height
- The height of the checkmark.selected
- Whether to draw the radio-button as selected.private void drawCheckmark(GuiDriver gd, int x, int y, int width, int height, boolean check)
gd
.gd
- The GuiDriver
used for drawing operations.x
- The X coordinate of the checkmark.y
- The Y coordinate of the checkmark.width
- The width of the checkmark.height
- The height of the checkmark.check
- Whether to draw a checkmark or an indeterminate state.private java.awt.Color darker(int palEntry)
Color
version of palEntry
in color palette.
This method uses a constant factor of 0.83 to each of the three RGB components of reference
to create a darker version of it. The alpha
value is preserved.
palEntry
- The color to be used as reference for creating the new darker value.Color
object that is a darker version of this c
with the
same alpha
value.private java.awt.Color darker(int palEntry, float level)
Color
version of palEntry
in color palette.
This method uses level
factor to each of the three RGB components of reference to
create a darker version of it. The alpha
value is preserved.
palEntry
- The color to be used as reference for creating the new darker value.level
- The level of values to be kept. For 1, the same color is returned. As {code level}
drops to 0, the darker the new color will be generated. When 0, Color.BLACK
is returned.Color
object that is a darker version of this c
with the
same alpha
value.private java.awt.Color darker(java.awt.Color c, float level)
Color
version of color c
.
This method uses level
factor to each of the three RGB components of c
to
create a darker version of it. The alpha
value is preserved.
c
- The color to be used as reference for creating the new darker value.level
- The level of values to be kept. For 1, the same color is returned. As {code level}
drops to 0, the darker the new color will be generated. When 0, Color.BLACK
is returned.Color
object that is a darker version of this c
with the
same alpha
value.private java.awt.Color brighter(int palEntry)
Color
version of palEntry
in color palette.
This method uses a constant factor of 0.83 to each of the three RGB components of reference
to create a darker version of it. The alpha
value is preserved.
palEntry
- The color to be used as reference for creating the new darker value.Color
object that is a darker version of this c
with the
same alpha
value.private java.awt.Color brighter(int palEntry, float level)
Color
version of palEntry
in color palette.
This method uses level
factor to each of the three RGB components of reference to
create a brighter version of it. The alpha
value is preserved.
palEntry
- The color to be used as reference for creating the new brighter value.level
- The level of values to be kept. For 1, the same color is returned. As {code level}
drops to 0, the brighter the new color will be generated. When 0,
Color.WHITE
is returned.Color
object that is a brighter version of this c
with the
same alpha
value.private java.awt.Color brighter(java.awt.Color c, float level)
Color
version of color c
.
This method uses level
factor to each of the three RGB components of c
to
create a brighter version of it. The alpha
value is preserved.
c
- The color to be used as reference for creating the new brighter value.level
- The level of values to be kept. For 1, the same color is returned. As {code level}
drops to 0, the brighter the new color will be generated. When 0,
Color.WHITE
is returned.Color
object that is a brighter version of this c
with the
same alpha
value.