/*
* 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.
*/
@SuppressWarnings("serial")
boolean collapsed = false;
}
}
}
super(null);
// Only add border if text is not null
if (collapsible) {
public int getBaseline(int w, int h) {
}
};
if (IS_WIN) {
} else {
}
moreOrLessButton.setContentAreaFilled(false);
moreOrLessButton.setBorderPainted(false);
} else {
}
} else {
setBorder(new FocusBorder(this));
}
}
}
}
if (!collapsed) {
if (lm instanceof BorderLayout) {
} else {
}
}
revalidate();
}
this.valueLabelStr = str;
}
}
if (collapsed) {
}
} else {
if (valueLabelStr != null) {
}
}
}
}
}
// A layout manager has been set, so delegate to it
return super.getMinimumSize();
}
if (moreOrLessButton != null) {
return d;
} else {
return super.getMinimumSize();
}
}
public void doLayout() {
// A layout manager has been set, so delegate to it
super.doLayout();
return;
}
if (collapsed) {
p.width,
p.height);
}
} else {
i.top,
}
}
}
private int direction;
}
int w = getIconWidth();
int h = w;
switch (direction) {
case EAST:
p.addPoint(x + 2, y);
break;
case SOUTH:
p.addPoint(x, y + 2);
break;
}
g.fillPolygon(p);
}
public int getIconWidth() {
return getIconHeight();
}
public int getIconHeight() {
if (g != null) {
if (h % 2 == 0) {
h += 1; // Make it odd
}
return h;
} else {
return 7;
}
}
}
/**
* A subclass of <code>TitledBorder</code> which implements an arbitrary border
* with the addition of a JComponent (JLabel, JPanel, etc) in the
* default position.
* <p>
* If the border property value is not
* specified in the constuctor or by invoking the appropriate
* set method, the property value will be defined by the current
* look and feel, using the following property name in the
* Defaults Table:
* <ul>
* <li>"TitledBorder.border"
* </ul>
*/
/**
* Creates a LabeledBorder instance.
*
* @param label the label the border should display
*/
}
/**
* Creates a LabeledBorder instance with the specified border
* and an empty label.
*
* @param border the border
*/
}
/**
* Creates a LabeledBorder instance with the specified border and
* label.
*
* @param border the border
* @param label the label the border should display
*/
super(border);
}
}
/**
* Paints the border for the specified component with the
* specified position and size.
* @param c the component for which this border is being painted
* @param g the paint graphics
* @param x the x position of the painted border
* @param y the y position of the painted border
* @param width the width of the painted border
* @param height the height of the painted border
*/
}
return;
}
int diff;
} else {
}
grooveRect.y += diff;
int justification;
if (c.getComponentOrientation().isLeftToRight()) {
} else {
}
switch (justification) {
case LEFT:
break;
case RIGHT:
break;
}
// If title is positioned in middle of border AND its fontsize
// is greater than the border's thickness, we'll need to paint
// the border in sections to leave space for the component's background
// to show through the title.
//
// save original clip
// paint strip left of text
}
// paint strip right of text
}
// paint strip below text
}
// restore clip
} else {
}
}
}
/**
* Reinitialize the insets parameter with this Border's current Insets.
* @param c the component for which this border insets value applies
* @param insets the object to be reinitialized
*/
if (border instanceof AbstractBorder) {
} else {
// Can't reuse border insets because the Border interface
// can't be enhanced.
}
} else {
}
return insets;
}
return insets;
}
/**
* Returns the label of the labeled border.
*/
return label;
}
/**
* Sets the title of the titled border.
* param title the title for the border
*/
}
/**
* Returns the minimum dimensions this border requires
* in order to fully display the border and title.
* @param c the component where this border will be drawn
*/
return minSize;
}
return false;
}
return true;
}
}
private boolean focusLostTemporarily = false;
comp.addFocusListener(this);
// This is the best guess for a L&F specific color
}
g.setColor(focusColor);
}
}
return insets;
}
}
// We will still paint focus even if lost temporarily
focusLostTemporarily = e.isTemporary();
if (!focusLostTemporarily) {
}
}
}
}