44 |
import java.awt.Insets; |
import java.awt.Insets; |
45 |
|
|
46 |
import javax.swing.AbstractButton; |
import javax.swing.AbstractButton; |
47 |
|
import javax.swing.BorderFactory; |
48 |
import javax.swing.ButtonModel; |
import javax.swing.ButtonModel; |
49 |
import javax.swing.JInternalFrame; |
import javax.swing.JInternalFrame; |
50 |
import javax.swing.JMenu; |
import javax.swing.JMenu; |
85 |
private static Border textFieldBorder; |
private static Border textFieldBorder; |
86 |
|
|
87 |
/** |
/** |
88 |
|
* The shared instance for getTextBorder(). |
89 |
|
*/ |
90 |
|
private static Border textBorder; |
91 |
|
|
92 |
|
/** |
93 |
* A MarginBorder that gets shared by multiple components. |
* A MarginBorder that gets shared by multiple components. |
94 |
* Created on demand by the private helper function {@link |
* Created on demand by the private helper function {@link |
95 |
* #getMarginBorder()}. |
* #getMarginBorder()}. |
172 |
} |
} |
173 |
} |
} |
174 |
else |
else |
175 |
{ |
{ |
176 |
// draw disabled border |
// draw disabled border |
177 |
g.setColor(MetalLookAndFeel.getControlDisabled()); |
g.setColor(MetalLookAndFeel.getInactiveControlTextColor()); |
178 |
g.drawRect(x, y, w - 2, h - 2); |
g.drawRect(x, y, w - 2, h - 2); |
179 |
} |
} |
180 |
} |
} |
181 |
|
|
182 |
/** |
/** |
1153 |
public static Border getTextFieldBorder() |
public static Border getTextFieldBorder() |
1154 |
{ |
{ |
1155 |
if (textFieldBorder == null) |
if (textFieldBorder == null) |
1156 |
textFieldBorder = new TextFieldBorder(); |
{ |
1157 |
|
Border inner = getMarginBorder(); |
1158 |
|
Border outer = new TextFieldBorder(); |
1159 |
|
textFieldBorder = BorderFactory.createCompoundBorder(outer, inner); |
1160 |
|
} |
1161 |
return textFieldBorder; |
return textFieldBorder; |
1162 |
} |
} |
1163 |
|
|
1164 |
/** |
/** |
1165 |
|
* Returns the border that is used for text components (except text fields, |
1166 |
|
* which use {@link #getTextFieldBorder}. |
1167 |
|
* |
1168 |
|
* @return the border that is used for text components |
1169 |
|
* |
1170 |
|
* @since 1.3 |
1171 |
|
*/ |
1172 |
|
public static Border getTextBorder() |
1173 |
|
{ |
1174 |
|
if (textBorder == null) |
1175 |
|
{ |
1176 |
|
Border inner = getMarginBorder(); |
1177 |
|
Border outer = new Flush3DBorder(); |
1178 |
|
textBorder = |
1179 |
|
new BorderUIResource.CompoundBorderUIResource(outer, inner); |
1180 |
|
} |
1181 |
|
return textBorder; |
1182 |
|
} |
1183 |
|
|
1184 |
|
/** |
1185 |
* Returns a border for Toolbar buttons in the Metal Look & Feel. |
* Returns a border for Toolbar buttons in the Metal Look & Feel. |
1186 |
* |
* |
1187 |
* @return a border for Toolbar buttons in the Metal Look & Feel |
* @return a border for Toolbar buttons in the Metal Look & Feel |