/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Factory object that can vend Borders appropriate for the basic L & F.
* @author Georges Saab
* @author Amy Fowler
*/
public class BasicBorders {
new BasicBorders.ButtonBorder(
new MarginBorder());
return buttonBorder;
}
new MarginBorder());
return radioButtonBorder;
}
new MarginBorder());
return toggleButtonBorder;
}
);
return menuBarBorder;
}
return splitPaneBorder;
}
/**
* Returns a border instance for a JSplitPane divider
* @since 1.3
*/
return splitPaneBorder;
}
return textFieldBorder;
}
return progressBarBorder;
}
return internalFrameBorder;
}
/**
* Special thin border for rollover toolbar buttons.
* @since 1.4
*/
}
AbstractButton b = (AbstractButton) c;
shade = darkShadow;
}
model.isSelected()) {
g.translate(x, y);
// Draw the pressd button
} else {
// Draw a rollover button
}
g.translate(-x, -y);
}
}
}
/**
* A border which is like a Margin border but it will only honor the margin
* if the margin has been explicitly set by the developer.
*
* Note: This is identical to the package private class
* MetalBorders.RolloverMarginBorder and should probably be consolidated.
*/
public RolloverMarginBorder() {
super(3,3,3,3); // hardcoded margin for JLF requirements.
}
if (c instanceof AbstractButton) {
}
// default margin so replace
} else {
// Margin which has been explicitly set by the user.
}
return insets;
}
}
this.darkShadow = darkShadow;
this.lightHighlight = lightHighlight;
}
boolean isPressed = false;
boolean isDefault = false;
if (c instanceof AbstractButton) {
AbstractButton b = (AbstractButton)c;
if (c instanceof JButton) {
}
}
}
// leave room for default visual
return insets;
}
}
}
false, false,
}
return insets;
}
}
}
if (c instanceof AbstractButton) {
AbstractButton b = (AbstractButton)c;
} else {
false, b.isFocusPainted() && b.hasFocus(),
}
} else {
}
}
return insets;
}
}
}
g.translate(x, y);
g.translate(-x,-y);
}
return insets;
}
}
//
// Ideally we'd have an interface defined for classes which
// support margins (to avoid this hackery), but we've
// decided against it for simplicity
//
if (c instanceof AbstractButton) {
AbstractButton b = (AbstractButton)c;
} else if (c instanceof JToolBar) {
} else if (c instanceof JTextComponent) {
JTextComponent t = (JTextComponent)c;
}
return insets;
}
}
this.darkShadow = darkShadow;
this.lightHighlight = lightHighlight;
}
}
if (c instanceof JTextComponent) {
}
return insets;
}
}
/**
* Draws the border around the divider in a splitpane
* (when BasicSplitPaneUI is used). To get the appropriate effect, this
* needs to be used with a SplitPaneBorder.
*/
}
if (!(c instanceof BasicSplitPaneDivider)) {
return;
}
// This is needed for the space between the divider and end of
// splitpane.
g.setColor(c.getBackground());
}
}
} else {
}
}
}
}
if (c instanceof BasicSplitPaneDivider) {
if (splitPane.getOrientation() ==
return insets;
}
// VERTICAL_SPLIT
return insets;
}
}
}
return insets;
}
public boolean isBorderOpaque() { return true; }
}
/**
* Draws the border around the splitpane. To work correctly you shoudl
* also install a border on the divider (property SplitPaneDivider.border).
*/
}
if (!(c instanceof JSplitPane)) {
return;
}
// The only tricky part with this border is that the divider is
// not positioned at the top (for horizontal) or left (for vert),
// so this border draws to where the divider is:
// -----------------
// |xxxxxxx xxxxxxx|
// |x --- x|
// |x | | x|
// |x |D| x|
// |x | | x|
// |x --- x|
// |xxxxxxx xxxxxxx|
// -----------------
// The above shows (rather excessively) what this looks like for
// a horizontal orientation. This border then draws the x's, with
// the SplitPaneDividerBorder drawing its own border.
// This is needed for the space between the divider and end of
// splitpane.
g.setColor(c.getBackground());
}
}
} else {
}
}
}
}
}
public boolean isBorderOpaque() { return true; }
}
}