|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sibvisions.rad.ui.awt.impl.AwtFactory
public abstract class AwtFactory
The AwtFactory
class encapsulates methods to
create and access AWT components.
Constructor Summary | |
---|---|
AwtFactory()
Create a new instance of AwtFactory to create and
access AWT components. |
Method Summary | |
---|---|
IColor |
createColor(int pRGB)
Creates an sRGB color with the specified combined RGBA value consisting of the alpha component in bits 24-31, the red component in bits 16-23, the green component in bits 8-15, and the blue component in bits 0-7. |
IComponent |
createCustomComponent(Object pCustomComponent)
Creates a new Instance of IComponent that contains any Custom Component. |
IContainer |
createCustomContainer(Object pCustomContainer)
Creates a new Instance of IContainer that contains any Custom Container. |
IDimension |
createDimension(int pWidth,
int pHeight)
Creates a new instance of IDimension with the given with and height. |
IFont |
createFont(String pName,
int pStyle,
int pSize)
Creates a new instance of IFont from the specified name,
style and point size. |
IInsets |
createInsets(int pTop,
int pLeft,
int pBottom,
int pRight)
Creates a new instance of IInsets . |
IPoint |
createPoint(int pX,
int pY)
Creates a new instance of IPoint with the given x and y. |
IRectangle |
createRectangle(int pX,
int pY,
int pWidth,
int pHeight)
Creates a new instance of IRectangle with the given x, y, width and height. |
String[] |
getAvailableFontFamilyNames()
Returns an array containing the names of all font families in this GraphicsEnvironment localized for the default locale,
as returned by Locale.getDefault() . |
static int |
getCurrentModifiers()
Gets the modifiers of the current event, if it's a InputEvent or ActionEvent. |
static long |
getMostRecentEventTime()
Returns the timestamp of the most recent event that had a timestamp, and that was dispatched from the EventQueue associated with the
calling thread. |
ICursor |
getPredefinedCursor(int pType)
Gets a ICursor object with the specified type. |
ICursor |
getSystemCustomCursor(String pCursorName)
Returns a system-specific custom ICursor object matching the
specified name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AwtFactory()
AwtFactory
to create and
access AWT components.
Method Detail |
---|
public String[] getAvailableFontFamilyNames()
GraphicsEnvironment
localized for the default locale,
as returned by Locale.getDefault()
.
Typical usage would be for presentation to a user for selection of a particular family name. An application can then specify this name when creating a font, in conjunction with a style, such as bold or italic, giving the font system flexibility in choosing its own best match among multiple fonts in the same font family.
getAvailableFontFamilyNames
in interface IFactory
String
containing font family names
localized for the default locale, or a suitable alternative
name if no name exists for this locale.IFont
,
IFont.getFamily()
public IFont createFont(String pName, int pStyle, int pSize)
IFont
from the specified name,
style and point size.
The font name can be a font face name or a font family name.
It is used together with the style to find an appropriate font face.
When a font family name is specified, the style argument is used to
select the most appropriate face from the family. When a font face
name is specified, the face's style and the style argument are
merged to locate the best matching font from the same family.
For example if face name "Arial Bold" is specified with style
IFont.ITALIC
, the font system looks for a face in the
"Arial" family that is bold and italic, and may associate the font
instance with the physical font face "Arial Bold Italic".
The style argument is merged with the specified face's style, not
added or subtracted.
This means, specifying a bold face and a bold style does not
double-embolden the font, and specifying a bold face and a plain
style does not lighten the font.
If no face for the requested style can be found, the font system
may apply algorithmic styling to achieve the desired style.
For example, if ITALIC
is requested, but no italic
face is available, glyphs from the plain face may be algorithmically
obliqued (slanted).
Font name lookup is case insensitive, using the case folding rules of the US locale.
If the name
parameter represents something other than a
logical font, i.e. is interpreted as a physical font face or family, and
this cannot be mapped by the implementation to a physical font or a
compatible alternative, then the font system will map the Font
to a standard font.
createFont
in interface IFactory
pName
- the font name. This can be a font face name or a font
family name, and may represent either a logical font or a physical
font found in this GraphicsEnvironment
.pStyle
- the style constant for the IFont
The style argument is an integer bitmask that may
be PLAIN, or a bitwise union of BOLD and/or ITALIC
(for example, ITALIC or BOLD|ITALIC).
If the style argument does not conform to one of the expected
integer bitmasks then the style is set to PLAIN.pSize
- the point size of the IFont
IFont
IFont
,
IFactory.getAvailableFontFamilyNames()
public IColor createColor(int pRGB)
pHasalpha
argument is false
, alpha
is defaulted to 255.
createColor
in interface IFactory
pRGB
- the combined RGBA components
IColor
IColor
,
IColor.getRed()
,
IColor.getGreen()
,
IColor.getBlue()
,
IColor.getAlpha()
,
IColor.getRGBA()
public ICursor getPredefinedCursor(int pType)
ICursor
object with the specified type.
getPredefinedCursor
in interface IFactory
pType
- the type of cursor
ICursor
ICursor
public ICursor getSystemCustomCursor(String pCursorName)
ICursor
object matching the
specified name. Cursor names are, for example: "Invalid.16x16"
getSystemCustomCursor
in interface IFactory
pCursorName
- a string describing the desired system-specific custom cursor
ICursor
public IPoint createPoint(int pX, int pY)
IPoint
with the given x and y.
createPoint
in interface IFactory
pX
- the x valuepY
- the y value
IPoint
IPoint
public IDimension createDimension(int pWidth, int pHeight)
IDimension
with the given with and height.
createDimension
in interface IFactory
pWidth
- the widthpHeight
- the height
IDimension
IDimension
public IRectangle createRectangle(int pX, int pY, int pWidth, int pHeight)
IRectangle
with the given x, y, width and height.
createRectangle
in interface IFactory
pX
- the x valuepY
- the y valuepWidth
- the widthpHeight
- the height
IRectangle
IRectangle
public IInsets createInsets(int pTop, int pLeft, int pBottom, int pRight)
IInsets
.
createInsets
in interface IFactory
pTop
- the toppLeft
- the leftpBottom
- the bottompRight
- the right
IInsets
IInsets
public IComponent createCustomComponent(Object pCustomComponent)
createCustomComponent
in interface IFactory
pCustomComponent
- the custom Component.
IComponent
custom component.public IContainer createCustomContainer(Object pCustomContainer)
createCustomContainer
in interface IFactory
pCustomContainer
- the custom Container.
IContainer
custom container.public static int getCurrentModifiers()
public static long getMostRecentEventTime()
EventQueue
associated with the
calling thread. If an event with a timestamp is currently being
dispatched, its timestamp will be returned. If no events have yet
been dispatched, the EventQueue's initialization time will be
returned instead.In the current version of
the JDK, only InputEvent
s,
ActionEvent
s, and InvocationEvent
s have
timestamps; however, future versions of the JDK may add timestamps to
additional event types. Note that this method should only be invoked
from an application's event dispatching thread. If this method is
invoked from another thread, the current system time (as reported by
System.currentTimeMillis()
) will be returned instead.
InputEvent
,
ActionEvent
, or InvocationEvent
to be
dispatched, or System.currentTimeMillis()
if this
method is invoked on a thread other than an event dispatching
threadInputEvent.getWhen()
,
ActionEvent.getWhen()
,
InvocationEvent.getWhen()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |