|
Quaqua 8.0 2011-10-02 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.border.AbstractBorder
ch.randelshofer.quaqua.border.VisualMarginBorder
public class VisualMarginBorder
The VisualMarginBorder is used to visually align components using bounds based on other criterias than the clip bounds of the component. For example: The clip bounds of a JButton includes its cast shadow and its focus ring. When we align the JButton with a JLabel, we want to align the baseline of the Text of the JButton with the text in the JLabel. The visual margin may be quite large. We allow to programmatically set a smaller margin using the client property "Quaqua.Component.margin".
Constructor Summary | |
---|---|
VisualMarginBorder()
Creates a new VisualMarginBorder. |
|
VisualMarginBorder(boolean ftop,
boolean fleft,
boolean fbottom,
boolean fright)
|
|
VisualMarginBorder(java.awt.Insets layoutMargin)
Creates a new VisualMarginBorder. |
|
VisualMarginBorder(int top,
int left,
int bottom,
int right)
Creates a new VisualMarginBorder. |
|
VisualMarginBorder(int top,
int left,
int bottom,
int right,
boolean ftop,
boolean fleft,
boolean fbottom,
boolean fright)
|
Method Summary | |
---|---|
java.awt.Insets |
getBorderInsets(java.awt.Component c)
|
java.awt.Insets |
getBorderInsets(java.awt.Component c,
java.awt.Insets insets)
Reinitializes the insets parameter with this Border's current Insets. |
java.awt.Insets |
getVisualMargin(java.awt.Component c)
|
protected java.awt.Insets |
getVisualMargin(java.awt.Component c,
java.awt.Insets insets)
Reinitializes the insets parameter with this Border's current Insets. |
boolean |
hasPressedCue(javax.swing.JComponent c)
Returns true, if this border has a visual cue for the pressed state of the button. |
void |
setFixed(boolean top,
boolean left,
boolean bottom,
boolean right)
|
void |
setPropertyName(java.lang.String propertyName)
The UIManager Property to be used for the default margin. |
Methods inherited from class javax.swing.border.AbstractBorder |
---|
getBaseline, getBaselineResizeBehavior, getInteriorRectangle, getInteriorRectangle, isBorderOpaque, paintBorder |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.border.Border |
---|
isBorderOpaque, paintBorder |
Constructor Detail |
---|
public VisualMarginBorder()
public VisualMarginBorder(int top, int left, int bottom, int right)
top
- Defines the margin from the clip bounds of the
component to its visual bounds.left
- Defines the margin from the clip bounds of the
component to its visual bounds.bottom
- Defines the margin from the clip bounds of the
component to its visual bounds.right
- Defines the margin from the clip bounds of the
component to its visual bounds.public VisualMarginBorder(int top, int left, int bottom, int right, boolean ftop, boolean fleft, boolean fbottom, boolean fright)
public VisualMarginBorder(boolean ftop, boolean fleft, boolean fbottom, boolean fright)
public VisualMarginBorder(java.awt.Insets layoutMargin)
layoutMargin
- Defines the margin from the clip bounds of the
component to its visual bounds. The margin has usually negative values!Method Detail |
---|
public void setPropertyName(java.lang.String propertyName)
public void setFixed(boolean top, boolean left, boolean bottom, boolean right)
public final java.awt.Insets getVisualMargin(java.awt.Component c)
getVisualMargin
in interface VisualMargin
public final java.awt.Insets getBorderInsets(java.awt.Component c)
getBorderInsets
in interface javax.swing.border.Border
getBorderInsets
in class javax.swing.border.AbstractBorder
public java.awt.Insets getBorderInsets(java.awt.Component c, java.awt.Insets insets)
getBorderInsets
in class javax.swing.border.AbstractBorder
c
- the component for which this border insets value appliesinsets
- the object to be reinitialized
insets
objectprotected java.awt.Insets getVisualMargin(java.awt.Component c, java.awt.Insets insets)
c
- the component for which this border insets value appliesinsets
- the object to be reinitialized
insets
objectpublic boolean hasPressedCue(javax.swing.JComponent c)
PressedCueBorder
hasPressedCue
in interface PressedCueBorder
|
Copyright 2003-2007 (c) Werner Randelshofer. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |