|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.clearlook.DefaultClearLookPolicy
The default ClearLookPolicy
; detects visual clutter and
installs better alternatives.
The following situations are detected:
JComponent
with a BevelBorder
JScrollPane
nested in a JTabbedPane
JScrollPane
nested in a JSplitPane
JSplitPane
nested in a JSplitPane
JTabbedPane
nested in a JSplitPane
ClearLookManager
,
ClearLookPolicy
Field Summary | |
protected static Border |
EMPTY_BORDER
|
protected static Border |
MARKER_BORDER
|
protected static Border |
PINK1_BORDER
|
protected static Border |
PINK2_BORDER
|
protected static Border |
RED1_BORDER
|
protected static Border |
RED2_BORDER
|
Constructor Summary | |
DefaultClearLookPolicy()
Constructs the DefaultClearLookPolicy . |
Method Summary | |
Border |
analyse(JComponent component)
Detects decorators that are considered to be visual clutter. |
Border |
analyse(JScrollPane scrollPane)
Detects if the specified JScrollPane is nested
in a JTabbedPane or in a JSplitPane
with a non-empty Border .
|
Border |
analyse(JSplitPane splitPane)
Detects if the specified JSplitPane is nested in another
JSplitPane that has a non-empty border. |
Border |
analyse(JTabbedPane tab)
Detects if the specified JTabbedPane is a special
NetBeans component that is considered to have visual clutter. |
protected Border |
assignBorder(JComponent c,
Border newBorder)
Assigns the new border to the component - unless the component is a tabbed pane. |
protected Border |
getDoubleDecorationBorder()
Answers the Border that will be used to replace
a double decorated component. |
String |
getName()
Returns the policy's name. |
protected Border |
getScrollPaneReplacementBorder()
Answers the Border that will be used to replace
the Border of a JScrollPane that is
contained in a JSplitPane . |
protected Border |
getSplitPaneReplacementBorder()
Answers the replacement Border for SplitPane in SplitPane. |
protected Border |
getThinBevelBorder(BevelBorder bevelBorder)
Answers the Border that will be used to replace
a BevelBorder. |
protected Border |
getThinLoweredBevelBorder()
Answers the replacement Border for lowered BevelBorder s. |
protected Border |
getThinRaisedBevelBorder()
Answers the replacement Border for raised BevelBorder s. |
protected boolean |
hasEmptyBorder(JComponent component)
Checks and answers if the given component has an empty border. |
protected boolean |
isChildDecoration(Border border)
Checks and answers whether the specified Border
wraps childs with a decoration. |
protected boolean |
isDebug()
Checks and answers if we are in debug mode. |
protected boolean |
isDecoratedChild(Component c)
Returns if the specified JComponent is decorated.
|
protected boolean |
isDecoratedSplitPane(Component c)
Returns whether the specified Component is a
JSplitPane that has a non-empty border. |
protected boolean |
isDecoratingParent(Component c)
Returns if the specified JComponent is decorated.
|
protected boolean |
isDecoration(Border border)
Checks and answers whether the specified Border
provides a visual decoration, for example a wrapping line.
|
protected boolean |
isDoubleDecorated(JComponent c)
Detects and returns if the specified component has double decoration, that is the component has a decorated border and is nested in a container that has a decorating border. |
protected boolean |
isEmptyBorder(Border b)
Checks and answers if the specified Border is kind-of empty. |
protected boolean |
isInternalFrameContent(Component c)
Checks and answer whether the given component is the content pane of a JInternalFrame . |
protected boolean |
isKindOfSplitPane(Component component)
Answers whether the specified is kind-of SplitPane .
|
protected boolean |
isParentDecoration(Border border)
Checks and answers whether the specified Border
wraps childs with a decoration. |
protected void |
log(String message)
Logs a message if we are in verbose mode. |
Border |
replaceBorder(JComponent component)
Detects and conditionally replaces the Border
of the specified JComponent . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final Border EMPTY_BORDER
protected static final Border MARKER_BORDER
protected static final Border RED1_BORDER
protected static final Border RED2_BORDER
protected static final Border PINK1_BORDER
protected static final Border PINK2_BORDER
Constructor Detail |
public DefaultClearLookPolicy()
DefaultClearLookPolicy
.
Method Detail |
public String getName()
ClearLookPolicy
getName
in interface ClearLookPolicy
public Border replaceBorder(JComponent component)
Border
of the specified JComponent
. Returns the original
Border
, or null
if we did not replace it.
replaceBorder
in interface ClearLookPolicy
component
- the component to be inspected
null
otherwiseprotected Border assignBorder(JComponent c, Border newBorder)
c
- the component that shall get a new bordernewBorder
- the border to be set
null
if the new border is null,
the new border in case of a tabbed pane,
otherwise the component's borderpublic Border analyse(JComponent component)
component
- the component to analyze
public Border analyse(JScrollPane scrollPane)
JScrollPane
is nested
in a JTabbedPane
or in a JSplitPane
with a non-empty Border
.
In both cases, returns a replacement border.
scrollPane
- the component to analyze
public Border analyse(JSplitPane splitPane)
JSplitPane
is nested in another
JSplitPane
that has a non-empty border.
splitPane
- the component to analyze
public Border analyse(JTabbedPane tab)
JTabbedPane
is a special
NetBeans component that is considered to have visual clutter.
tab
- the component to analyze
protected boolean isEmptyBorder(Border b)
Border
is kind-of empty.
b
- the border to inspect
protected boolean isDecoration(Border border)
Border
provides a visual decoration, for example a wrapping line.
Since the detected border classes are not final, we don't use the #instanceof operator to avoid replacing subclasses, that could be visually improved.
border
- the border to check
protected boolean isChildDecoration(Border border)
Border
wraps childs with a decoration.
border
- the border to check
protected boolean isParentDecoration(Border border)
Border
wraps childs with a decoration.
border
- the border to check
protected boolean hasEmptyBorder(JComponent component)
component
- the component to inspect
protected boolean isDecoratedChild(Component c)
JComponent
is decorated.
This default implementation checks, if the component's border
is decorated.Subclasses may check for special decorators.
c
- the component to analyse
protected boolean isDecoratingParent(Component c)
JComponent
is decorated.
This default implementation checks, if the component's border
is decorated.
Subclasses may check for special decorators.
c
- the parent component to analyse
protected boolean isInternalFrameContent(Component c)
JInternalFrame
.
c
- the component to check
protected boolean isKindOfSplitPane(Component component)
SplitPane
.
Subclasses may override to widen the set of panels, that
is considered as candidates to remove child borders.
component
- the component to be analysed
protected boolean isDecoratedSplitPane(Component c)
Component
is a
JSplitPane
that has a non-empty border.
c
- the component to be analysed
protected boolean isDoubleDecorated(JComponent c)
c
- the component to be analysed
protected Border getDoubleDecorationBorder()
Border
that will be used to replace
a double decorated component.
protected Border getScrollPaneReplacementBorder()
Border
that will be used to replace
the Border
of a JScrollPane
that is
contained in a JSplitPane
.
protected Border getSplitPaneReplacementBorder()
Border
for SplitPane in SplitPane.
protected Border getThinBevelBorder(BevelBorder bevelBorder)
Border
that will be used to replace
a BevelBorder.
bevelBorder
- indicates a raised or lowered mode
protected Border getThinLoweredBevelBorder()
Border
for lowered BevelBorder
s.
protected Border getThinRaisedBevelBorder()
Border
for raised BevelBorder
s.
protected final void log(String message)
message
- the message to be loggedprotected final boolean isDebug()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |