borland Packages Class Hierarchy dbswing Package
java.lang.Object +----com.borland.dbswing.DBUtilities
Properties Methods
A collection of utility methods for dbSwing.
public static boolean containsMnemonic(String text)Determines whether the mnemonic character prefix symbol is in the text.
text
public static int convertJBCLToSwingAlignment(int jbclAlignment, boolean horizontal)Maps JBCL-style alignments to Swing alignments. JBCL-style alignments combine the horizontal and vertical alignments into a single value, whereas Swing keeps them separate. Set horizontal to
true
to extract the equivalent SwingConstants horizontal alignment value from jbclAlignment
. Set horizontal to false
to extract the vertical value.
jbclAlignment
Alignment.LEFT
, Alignment.RIGHT
, Alignment.TOP
, or Alignment.BOTTOM
.
horizontal
horizontal
is true
, the alignment is horizontal (Alignment.LEFT
or Alignment.RIGHT
); if it is false
, the alignment is vertical (Alignment.TOP
, or Alignment.BOTTOM
).
public static String excludeMnemonicSymbol(String text)Returns the text without its embedded mnemonic symbol. An ampersand character (&) within the text implies the character following the ampersand is the mnemonic character. A back slash before the ampersand causes the ampersand to not be treated as the mnemonic character indicator. Only the first occurrence of a mnemonic is removed from the
String
.
This method also has the side effect of caching the mnemonic character for subsequent retrieval by extractMnemonicChar()
. When parsing a string containing a mnemonic character, call this method first followed by extractMnemonicChar()
for improved efficiency.
text
public static char extractMnemonicChar(String text)Returns the mnemonic character embedded in the text.
text
public static DataSetAware[] findDataAwareChildren(Container container)Finds
DataSetAware
components that have data-aware child components in the specified container.
container
public static DataSetAware[] findDataAwareComponents(Component component)Finds
DataSetAware
components that are in the same container as the specified component.
component
public static byte[] getByteArrayFromStream(InputStream inputStream)Returns the specified input stream as a byte array. Returns
null
on an error reading the input stream.
public static Dialog getDialog(Component component)Returns the parent dialog of the specified component, or
null
if one can't be found.
public static Frame getFrame(Component component)Returns the parent frame of the specified component. It returns
null
if a frame for the component can't be found.
component
Component
you want to find the parent frame for.
public static String[] getWrappedText(String text)Returns the specified
String
parameter as an array of String
s, where no array element has a width greater than 60 characters. The default locale is used.
text
String
to return as an array of String
s.
public static String[] getWrappedText(String text, int width)Returns the specified
String
parameter as an array of String
s, where no array element has a width greater than the width
parameter. The default locale is used.
text
String
to return as an array of Strings
s.
width
public static String[] getWrappedText(String text, int width, Locale locale)Returns the specified
String
parameter as an array of String
s, where no array element has a width greater than the width
parameter. The specified locale is used.
text
String
to return as an array of Strings
s.
width
locale
public static boolean is1pt3()
public static boolean isBMPFile(InputStream inputStream)Returns whether the specified input stream contains a bitmap (.BMP) file.
public static boolean isGIForJPGFile(InputStream inputStream)Returns whether the specified input stream contains a .GIF or .JPEG file.
public static Image makeBMPImage(InputStream inputStream)Creates a Java image object out of the specified input stream, which is expected to contain a .BMP file.
isBMPFile