@ColorCodes(value={"station.screen.border","station.screen.border.line","station.screen.border.line.highlight.inner","station.screen.border.line.highlight.outer","station.screen.border.line.shadow.inner","station.screen.border.line.shadow.outer","station.screen.border.highlight.inner","station.screen.border.highlight.outer","station.screen.border.shadow.inner","station.screen.border.shadow.outer","station.screen.border.hover","station.screen.border.highlight.inner.hover","station.screen.border.highlight.outer.hover","station.screen.border.shadow.inner.hover","station.screen.border.shadow.outer.hover","station.screen.border.selected","station.screen.border.highlight.inner.selected","station.screen.border.highlight.outer.selected","station.screen.border.shadow.inner.selected","station.screen.border.shadow.outer.selected"}) public class DefaultScreenDockWindowBorder extends Object implements ScreenDockWindowBorder
ScreenDockWindows to paint a border. The border itself offers methods
to paint indications whether the user currently moves or presses the mouse over it. The states however have to
be set by window itself.| Modifier and Type | Class and Description |
|---|---|
protected class |
DefaultScreenDockWindowBorder.BorderColor
A
DockColor representing a color used by this border. |
ScreenDockWindowBorder.Position| Constructor and Description |
|---|
DefaultScreenDockWindowBorder(ScreenDockWindow window,
JComponent target)
Creates a new border
|
| Modifier and Type | Method and Description |
|---|---|
protected Color |
defaultModify(Color color,
boolean inner,
boolean shadow)
Creates colors for parts of this border based on some basic color.
|
Insets |
getBorderInsets(Component c) |
DockController |
getController()
Gets the
DockController which is currently associated with this border |
int |
getCornerSize()
Gets the size of the corners in pixels.
|
protected Color |
getHoverColor(Component c)
Gets the base color used for painting a region under the mouse
|
protected Color |
getHoverColor(Component c,
boolean inner,
boolean shadow)
Gets a color to paint some part of this border that is under the mouse.
|
protected Color |
getLine(Component c)
Gets the color that should be used for painting a line.
|
protected Color |
getLine(Component c,
boolean inner,
boolean shadow)
Gets the color that should be used for painting a line.
|
int |
getMoveSize()
Gets the size of the area at the top that can be grabbed in pixels.
|
protected Color |
getNormalColor(Component c)
Gets a color to paint some part of this border.
|
protected Color |
getNormalColor(Component c,
boolean inner,
boolean shadow)
Gets a color to paint some part of this.
|
protected Color |
getSelectedColor(Component c)
Gets a color to paint some part of this border that is under the pressed mouse.
|
protected Color |
getSelectedColor(Component c,
boolean inner,
boolean shadow)
Gets a color to paint some part of this border that is under the pressed mouse.
|
boolean |
isBorderOpaque() |
boolean |
isDrawDividers()
Tells whether dividing lines are painted
|
boolean |
isMoveable()
Tells whether the window can be moved by grabbing
this border. |
boolean |
isMoveOnlyOnSameSideAsTitle()
Tells whether the position of the move are is set automatically.
|
boolean |
isResizeable()
Tells whether the window can be resized by grabbing
this border. |
void |
paintBorder(Component c,
Graphics g,
int x,
int y,
int width,
int height) |
void |
setController(DockController controller)
Sets the
DockController which should be monitored for receiving colors. |
void |
setCornerSize(int cornerSize)
Sets the size of the corners in pixels.
|
void |
setDrawDividers(boolean drawDividers)
Sets whether dividing lines are to be painted or not
|
void |
setMouseOver(ScreenDockWindowBorder.Position mouseOver)
Sets where the mouse is currently hovering.
|
void |
setMousePressed(ScreenDockWindowBorder.Position mousePressed)
Sets where the mouse is currently pressed.
|
void |
setMoveable(boolean moveable)
Informs this border whether the window can be moved by grabbing
this. |
void |
setMoveOnlyOnSameSideAsTitle(boolean moveOnlyOnSameSideAsTitle)
Sets whether the move-area should appear on the same side as the
DockTitle, this property
only has an effect if isResizeable() is false. |
void |
setMoveSize(int moveSize)
Sets the size of the area at the top that can be grabbed and used
to move the window.
|
void |
setResizeable(boolean resizeable)
Informs this border whether the window can be resized by grabbing
this. |
public static final ScreenDockWindowBorderFactory FACTORY
DefaultScreenDockWindowBorders.protected final DefaultScreenDockWindowBorder.BorderColor colorLine
protected final DefaultScreenDockWindowBorder.BorderColor colorLineHighlightInner
protected final DefaultScreenDockWindowBorder.BorderColor colorLineHighlightOuter
protected final DefaultScreenDockWindowBorder.BorderColor colorLineShadowInner
protected final DefaultScreenDockWindowBorder.BorderColor colorLineShadowOuter
protected final DefaultScreenDockWindowBorder.BorderColor color
protected final DefaultScreenDockWindowBorder.BorderColor colorHighlightInner
protected final DefaultScreenDockWindowBorder.BorderColor colorHighlightOuter
protected final DefaultScreenDockWindowBorder.BorderColor colorShadowInner
protected final DefaultScreenDockWindowBorder.BorderColor colorShadowOuter
protected final DefaultScreenDockWindowBorder.BorderColor colorHover
protected final DefaultScreenDockWindowBorder.BorderColor colorHighlightInnerHover
protected final DefaultScreenDockWindowBorder.BorderColor colorHighlightOuterHover
protected final DefaultScreenDockWindowBorder.BorderColor colorShadowInnerHover
protected final DefaultScreenDockWindowBorder.BorderColor colorShadowOuterHover
protected final DefaultScreenDockWindowBorder.BorderColor colorSelected
protected final DefaultScreenDockWindowBorder.BorderColor colorHighlightInnerSelected
protected final DefaultScreenDockWindowBorder.BorderColor colorHighlightOuterSelected
protected final DefaultScreenDockWindowBorder.BorderColor colorShadowInnerSelected
protected final DefaultScreenDockWindowBorder.BorderColor colorShadowOuterSelected
public DefaultScreenDockWindowBorder(ScreenDockWindow window, JComponent target)
window - the window for which this border is usedtarget - the component which is painted by thispublic void setController(DockController controller)
ScreenDockWindowBorderDockController which should be monitored for receiving colors.setController in interface ScreenDockWindowBordercontroller - the new controller, can be nullpublic DockController getController()
DockController which is currently associated with this bordernullpublic void setCornerSize(int cornerSize)
ScreenDockWindowBorderresizeable, otherwise
it can be ignoredsetCornerSize in interface ScreenDockWindowBordercornerSize - the size in pixels, at least 0public int getCornerSize()
public void setMoveSize(int moveSize)
setMoveSize in interface ScreenDockWindowBordermoveSize - the size, at least 0public int getMoveSize()
public void setMoveable(boolean moveable)
ScreenDockWindowBorderthis.setMoveable in interface ScreenDockWindowBordermoveable - whether the window can be movedpublic boolean isMoveable()
this border.public void setResizeable(boolean resizeable)
ScreenDockWindowBorderthis.setResizeable in interface ScreenDockWindowBorderresizeable - whether the window can be resizedpublic boolean isResizeable()
this border.public void setDrawDividers(boolean drawDividers)
drawDividers - true if lines should be paintedpublic boolean isDrawDividers()
true if lines are paintedpublic void setMoveOnlyOnSameSideAsTitle(boolean moveOnlyOnSameSideAsTitle)
DockTitle, this property
only has an effect if isResizeable() is false.moveOnlyOnSameSideAsTitle - if the position of the move area should be set automaticallypublic boolean isMoveOnlyOnSameSideAsTitle()
setMoveOnlyOnSameSideAsTitle(boolean)public void setMouseOver(ScreenDockWindowBorder.Position mouseOver)
ScreenDockWindowBordersetMouseOver in interface ScreenDockWindowBordermouseOver - the position, null equals ScreenDockWindowBorder.Position.NOTHINGpublic void setMousePressed(ScreenDockWindowBorder.Position mousePressed)
ScreenDockWindowBordersetMousePressed in interface ScreenDockWindowBordermousePressed - the position, null equals ScreenDockWindowBorder.Position.NOTHINGpublic Insets getBorderInsets(Component c)
getBorderInsets in interface Borderpublic boolean isBorderOpaque()
isBorderOpaque in interface Borderpublic void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
paintBorder in interface Borderprotected Color getLine(Component c)
c - the component for which the line is paintednullprotected Color getLine(Component c, boolean inner, boolean shadow)
c - the component for which the line is paintedinner - whether the inner or the outer rectangle is paintedshadow - whether the shadow or the highlight part is paintednullprotected Color getHoverColor(Component c)
c - the component for which the border is paintednullprotected Color getHoverColor(Component c, boolean inner, boolean shadow)
c - the component for which the border is paintedinner - whether the inner or the outer rectangle is paintedshadow - whether the shadow or the highlight part is paintednullprotected Color getSelectedColor(Component c)
c - the component for which the border is paintednullprotected Color getSelectedColor(Component c, boolean inner, boolean shadow)
c - the component for which the border is paintedinner - whether the inner or the outer rectangle is paintedshadow - whether the shadow or the highlight part is paintednullprotected Color getNormalColor(Component c)
c - the component for which the border is paintednullprotected Color getNormalColor(Component c, boolean inner, boolean shadow)
c - the component for which the border is paintedinner - whether the inner or the outer rectangle is paintedshadow - whether the shadow or the highlight part is paintednullprotected Color defaultModify(Color color, boolean inner, boolean shadow)
color - the basic colorinner - whether the inner or the outer rectangle is paintedshadow - whether the shadow or the highlight part is paintedCopyright © 2017 Docking Frames. All rights reserved.