|
[.hacks.] [.java.] |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Panel | +--Awt
(#)Awt.java
misc effect position 0 0 0 0 0 0 0 0 0 0 0 0 - - H F U B S R W S E N r i l u u a e o a o e l i l n i s u s r f l n k k s t t t t e e e h h n dThis class also implements a simple text formating mechanism. Unicode escape sequences can be used to change fonts alignment, color etc. The syntax is pretty easy. A formatting directive is always constructed from
Font Family FFnn Serif FF00 SansSerif FF01 Monospaced FF02
Font style FBnn Plain FB00 Bold FB01 Italic FB02 Bolditalic FB03 Font Size rel. F0nn Smaller F000 two pixel smaller Larger F001 two pixel larger Font Size Absolut F5nn nn = size in pixel (hex) Text Alignment A00n North A001 East A002 South A004 West A008 NorthWest A009 SouthWest A00C NorthEast A003 SouthEast A00A Center A00F Text Tabs Dnnn Left tabs only nnn = no of char to tab Tab0 D000 Effects Ennn Flat E000 default effect Raised E001 makes objects looking raised Sunken E002 makes objects looking sunken Bulk E003 actually a drawing mode @see setBorderType() Uline E004 underline Href E0D1 start of a href Hrefend E0D0 end of a href Darker E0C1 make foreground color darker Brighter E0C2 make foreground color brighter Background E0C3 make foreground equal to current backgroundcolor Colors Cnnn nnn = rgb - eight bits per color White C000 Black CFFF
Field Summary | |
protected java.awt.event.ActionListener |
actionListener
ActionListener to notify clients |
static char |
Background
make fg color equal to bg color |
protected java.lang.Object |
bg
our Background |
protected java.awt.Graphics |
big
Grphics for bim |
protected java.awt.Image |
bim
backing image for flickerfree drawing |
static char |
Black
the color black |
static char |
BlueMask
used to determine the blue portion of this color spec |
static char |
Bold
font style bold |
static char |
Bolditalic
font style bolditalic |
protected int |
borderDepth
borderdepth - thickness of border |
protected int |
borderType
bordertype - one of NONE, RAISED, SUNKEN, BULK, TOP |
static int |
BOTTOM
Bottom position |
static char |
Brighter
make fg color brighter |
static char |
Bulk
Used to specify a border mode in property files. not used for text |
static int |
BULK
a highlighted border/text |
static int |
C
Center position |
static char |
Center
Center alignment |
static int |
CENTER
Center position |
static char |
ColorMask
colors use the format C |
protected java.util.Hashtable |
componentStates
save components states if this panel is set to disable |
static char |
Darker
make fg color darker |
static int |
E
East position |
static char |
East
East alignment |
static int |
EFFECT_MASK
effect mask - bits 4-7 |
static char |
Esc
Unicode replacement char. |
static int |
FILL
fill object (rectangle/triangle) - Outline is default |
static char |
Flat
the default 'effect' |
static char |
FontMask
Mask for computing fontsizes |
protected static java.util.Hashtable |
fonts
font cache |
static char |
FontSize0
font sizes absolute |
static char |
FontSizeMask
Mask for computing fontsizes |
static char |
Foreground
make fg color equal to fg color (same as setting it to default) |
static char |
GreenMask
used to determine the green portion of this color spec |
static char |
Href
start of a href |
static int |
HREF
the following text is a href |
static char |
Hrefend
end of a href (or use flat/default) |
protected java.awt.Insets |
innerInsets
insets within this comp |
protected java.awt.Insets |
insets
insets around this comp |
static char |
Italic
font style italic |
protected java.awt.event.ItemListener |
itemListener
ItemListener to notify clients |
protected static java.lang.String |
jvendor
java vendor |
protected static java.lang.String |
jversion
java version |
static char |
Larger
font size relative larger |
static int |
LEFT
Left position |
protected java.awt.Dimension |
minimumDimension
the dimension for comp |
static int |
MISC_MASK
mode mask - bits 8-11 |
static char |
Monospaced
font family Monospaced |
static int |
N
North position |
static int |
NE
NorthEast position |
static char |
None
reset all styles to default |
static int |
NONE
One special mode |
static char |
North
North alignment |
static char |
NorthEast
NorthEast alignment |
static char |
NorthWest
NorthWest alignment |
static char |
Null
Unicode null char. |
static int |
NW
NorthWest position |
static char |
Plain
font style plain |
static int |
POSITION_MASK
positions / directions mask - the lowest 4 bits 0-3 |
static char |
Raised
shadow effect to emphasize text |
static int |
RAISED
a raised border |
static char |
RedMask
used to determine the red portion of this color spec |
static int |
RIGHT
Right position |
static int |
S
South position |
static char |
SansSerif
font family SansSerif |
static int |
SE
SouthEast position |
static char |
Serif
font family Serif |
static char |
Smaller
font size relative smaller |
static char |
South
South alignment |
static char |
SouthEast
SouthEast alignment |
static char |
SouthWest
SouthWest alignment |
static char |
Sunken
shadow effect to make text look inaktive |
static int |
SUNKEN
a sunken border |
static int |
SW
SouthWest position |
static char |
Tab0
Tab positions absolute; Format: Dnnn nnn is the pos in hex ranging from 0 - 7FF |
static char |
TabMask
Tab mask to determine tabs |
static char |
TabSizeMask
Tab mask to determine tab positions |
static int |
TOP
Top position |
static char |
Uline
Underline text |
static int |
ULINE
underline effect |
static int |
W
West position |
static char |
West
West alignment |
static char |
White
the color white |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
Awt()
Contructor for an Awt component |
Method Summary | |
void |
addActionListener(java.awt.event.ActionListener l)
adds an actionListener |
void |
addItemListener(java.awt.event.ItemListener l)
adds an itemListener |
void |
addNotify()
override java.awt.Panel.addNotify() called shortly after instantiation first chance to call measure() |
void |
adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
implement java.awt.event.AdjustmentListener |
static java.awt.Insets |
Array2Insets(int[] i)
Return Insets from an int array (used to set Insets from property file) |
static java.awt.Font |
bold(java.awt.Font f)
Returns a bold font with same size and family |
static java.awt.Font |
bolditalic(java.awt.Font f)
Returns a bolditalic font with same size and family |
static java.awt.Color |
brighter(java.awt.Color c)
Return a brighter version of color c |
static void |
centerWindow(java.awt.Window w)
Center a window on screen. |
static java.lang.String |
Color2Esc(java.awt.Color c)
Returns the escape sequence for Color c |
static java.awt.Color |
darker(java.awt.Color c)
Return a darker version of color c |
static java.awt.Color |
dim(java.awt.Color c,
int v)
Return a dimmed version of color c |
void |
doHref(java.lang.String s,
int x,
int y,
int w,
int h)
callback routine for dynamic caption content should be overwritten by implementing classes |
void |
doMeasure()
Utility function for Awt Components re-measures an invalidates if dims changed |
static void |
drawCaption(java.awt.Graphics g,
java.awt.Color c,
java.awt.Font f,
java.lang.String s,
int x,
int y,
int w,
int h,
int m,
java.lang.String dl)
Draws a caption within the given box. drawCaption recognizes the escape sequences above for changing text characteristics and supports multiple lines |
static void |
drawCaption(java.awt.Graphics g,
java.awt.Color c,
java.awt.Font f,
java.lang.String s,
int x,
int y,
int w,
int h,
int m,
java.lang.String dl,
Awt awt)
Draws a caption within the given box. drawCaption recognizes the escape sequences above for changing text characteristics and supports multiple lines |
static void |
drawLine(java.awt.Graphics g,
java.awt.Color c,
int x,
int y,
int X,
int Y,
int d,
int m)
Draws a line between the given points |
static void |
drawRectangle(java.awt.Graphics g,
java.awt.Color c,
int x,
int y,
int w,
int h,
int d,
int m)
Draws a rectangle within the given box |
static java.awt.Dimension |
drawString(java.awt.Graphics g,
java.awt.Color c,
java.awt.Font f,
java.lang.String s,
int x,
int y,
int w,
int h,
int m)
Draws a string within the given box. |
static java.awt.Dimension |
drawString(java.awt.Graphics g,
java.awt.Color c,
java.awt.Font f,
java.lang.String s,
int x,
int y,
int w,
int h,
int m,
Awt awt)
Draws a string within the given box. |
static void |
drawTriangle(java.awt.Graphics g,
java.awt.Color c,
int x,
int y,
int w,
int h,
int d,
int m)
Draws a triangle within the given box |
static void |
error(java.lang.Object m,
java.awt.Component c)
Creates a nicely formatted error popup. |
static java.lang.String |
exHref(java.lang.String s)
Returns the invisible (left or href) part of a string resp. href. |
static java.lang.String |
exString(java.lang.String s)
Returns the visible (right) part of a string resp. href. |
void |
focusGained(java.awt.event.FocusEvent e)
implement java.awt.event.FocusListener |
void |
focusLost(java.awt.event.FocusEvent e)
implement java.awt.event.FocusListener |
static java.applet.AppletContext |
getAppletContext(java.awt.Component c)
Gets the current applet context if any |
java.lang.Object |
getBG()
return the object currently used as BG for this comp Attn: all BG's are converted to Image the first time used So this routine usually returns Object type Image |
java.awt.Image |
getBGImage()
get the BG Image if any |
Awt |
getBGParent()
walk up the component tree to find a parent with a BG ! |
java.awt.Image |
getBGParentImage()
walk up the component tree to find a BG ! |
int |
getBorderDepth()
get borderdepth |
java.awt.Rectangle |
getBorderRectangle()
Get this comps rectangle within border totalsize - insets - borderDepth |
int |
getBorderType()
get bodertype |
static java.awt.Color |
getColor(char u,
java.awt.Color c,
java.awt.Color dc,
java.awt.Color bg)
Returns the modified color for escape char u leaves color unchanged if u does not descibe any color characteristics |
static java.awt.Color |
getColor(java.lang.Object o)
Try to get color. |
static java.awt.Font |
getFont(char u,
java.awt.Font f,
java.awt.Font df)
Returns the modified font for escape char u leaves font unchanged if u does not descibe any font characteristics |
static java.awt.Font |
getFont(java.lang.Object o)
Try to get a font. |
static java.awt.Font |
getFont(java.lang.String name,
int style,
int size)
Try to get a font from our cache. |
java.awt.Insets |
getInnerInsets()
get current inner border |
java.awt.Rectangle |
getInnerRectangle()
Get this comps inner rectangle totalsize - insets - borderDepth - innerInsets |
java.awt.Insets |
getInsets()
get current border |
static java.awt.FontMetrics |
getMetrics(java.awt.Font f)
Returns Metrics for font |
java.awt.Dimension |
getMinimumSize()
override java.awt.Panel.getMinimumSize() |
static int |
getMode(char u,
int m,
int dm)
Returns the modified mode for escape char u leaves mode unchanged if u does not descibe any mode characteristics |
static int |
getPosition(int m)
Exctract position bits from m. |
java.awt.Dimension |
getPreferredSize()
override java.awt.Panel.getPreferredSize() and return our minimum size |
java.awt.Rectangle |
getRectangle()
Get this comps rectangle totalsize - insets |
java.lang.Object[] |
getSelectedObjects()
implement java.awt.ItemSelectable |
static int |
getTab(char u,
java.awt.Font f,
int dt)
Returns the tab position for escape char u return default tab if u does not descibe any tab position |
static java.awt.Component |
getTopComponent(java.awt.Component c)
Gets the toplevel component (usually a frame) |
void |
invalidate()
Overwrite java.awt.component.invalidate() to do measuring . |
static boolean |
isBulk(int m)
True if m describes effect Bulk. |
static boolean |
isEffect(int m)
True if m describes an effect (see above). |
static boolean |
isFill(int m)
True if m describes effect Fill. |
static boolean |
isHref(int m)
True if we are in Href mode. |
static boolean |
isMSJVM()
Check if this is a MS JVM |
static boolean |
isNS4JVM()
Check if this is a Netscape 4 JVM |
static boolean |
isRaised(int m)
True if m describes effect Raised. |
static boolean |
isSunken(int m)
True if m describes effect Sunken. |
static boolean |
isUline(int m)
True if m describes effect Underline. |
static java.awt.Font |
italic(java.awt.Font f)
Returns a italic font with same size and family |
void |
keyPressed(java.awt.event.KeyEvent e)
implement java.awt.event.KeyListener |
void |
keyReleased(java.awt.event.KeyEvent e)
implement java.awt.event.KeyListener |
void |
keyTyped(java.awt.event.KeyEvent e)
implement java.awt.event.KeyListener |
static java.awt.Font |
larger(java.awt.Font f)
Returns a larger font with same family and style |
java.awt.Image |
loadImage(java.lang.String n)
Creates an image either form URL or Archive Returns null on failure. |
static java.awt.Image |
loadImageFromArchive(java.lang.String n)
Creates an image from a Archive At least this is what Netscape 4.x does. |
static java.awt.Image |
loadImageFromStream(java.io.InputStream i)
Creates an image from an InputStream |
static java.awt.Image |
loadImageFromURL(java.lang.String n)
Creates an image from an url. |
void |
makeBim()
|
java.awt.Dimension |
measure()
Return currently needed Dimension Should be overridden by Awt Components |
static java.awt.Dimension |
measureCaption(java.lang.String s,
java.awt.Font f,
java.awt.Font df,
java.lang.String dl)
Calculates the box needed to draw the caption |
static java.awt.Dimension |
measureString(java.lang.String s,
java.awt.Font f)
Calculates the box needed to draw the string |
static java.awt.Font |
monospaced(java.awt.Font f)
Returns a monospaced font with same size and style |
void |
mouseClicked(java.awt.event.MouseEvent e)
implement java.awt.event.MouseListener |
void |
mouseDragged(java.awt.event.MouseEvent e)
implement java.awt.event.MouseListener |
void |
mouseEntered(java.awt.event.MouseEvent e)
implement java.awt.event.MouseListener |
void |
mouseExited(java.awt.event.MouseEvent e)
implement java.awt.event.MouseListener |
void |
mouseMoved(java.awt.event.MouseEvent e)
implement java.awt.event.MouseListener |
void |
mousePressed(java.awt.event.MouseEvent e)
implement java.awt.event.MouseListener |
void |
mouseReleased(java.awt.event.MouseEvent e)
implement java.awt.event.MouseListener |
protected void |
notifyActionListeners(java.awt.event.ActionEvent e)
notifies all actionListeners |
protected void |
notifyItemListeners(java.awt.event.ItemEvent e)
notifies all itemListeners |
void |
paint(java.awt.Graphics g)
Actually do the work ... this basic paint() routine just draws the border. |
void |
paintBackground(java.awt.Graphics g)
Paint the Background |
void |
paintBackground(java.awt.Graphics g,
int x,
int y,
int w,
int h)
Paint the Background |
void |
paintBim(java.awt.Graphics g)
|
void |
paintBorder(java.awt.Graphics g,
int x,
int y,
int w,
int h)
Paint the border |
static java.awt.Font |
plain(java.awt.Font f)
Returns a plain font with same size and family |
void |
refresh()
Refresh (force new layout) starting from this component down the tree |
static void |
refresh(java.awt.Component c)
Refresh (force new layout) starting from component up the tree |
void |
refreshAll()
Refresh (force new layout) starting from root component up the tree |
void |
removeActionListener(java.awt.event.ActionListener l)
removes an actionListener |
void |
removeItemListener(java.awt.event.ItemListener l)
removes an itemListener |
static java.awt.Font |
sansserif(java.awt.Font f)
Returns a sansserif font with same size and style |
static java.awt.Font |
serif(java.awt.Font f)
Returns a serif font with same size and style |
static void |
setBackground(java.awt.Component c)
Set BG color of a (AWT) component |
void |
setBG(java.lang.Object b)
set the BG for this comp. |
void |
setBGIfNull(java.lang.Object b)
set the BG for this comp only if none is currently present (even from parent) |
void |
setBorderDepth(int d)
set borderdepth |
void |
setBorderType(int t)
set bodertype |
void |
setBorderType(java.lang.String t)
set bodertype - String version (attributes from property file) |
void |
setBounds(int x,
int y,
int w,
int h)
Overwrite Component.setBounds() to recognize resizing |
void |
setEnabled(boolean enabled)
override java.awt.Panel.setEnabled() just to recocnize state change |
void |
setFont(java.awt.Font f)
override java.awt.Panel.setFont(Font font) just to recognize the change |
static void |
setFont(java.awt.TextComponent tc)
Set font of a (AWT) textcomponent |
static void |
setForeground(java.awt.Component c)
Set FG color of a (AWT) component |
void |
setInnerInsets(java.awt.Insets i)
sets a new border |
void |
setInsets(java.awt.Insets i)
sets a new border |
void |
setVisible(boolean v)
override java.awt.Panel.setVisible() just to recocnize state change |
static java.awt.Font |
smaller(java.awt.Font f)
Returns a smaller font with same family and style |
java.awt.Image |
tile(java.awt.Image i,
java.awt.Dimension d)
scale (grow only) an Image to specified size by just filling it with the original from left to right, top down w, h will be rounded to the next multiple of original size |
java.awt.Image |
tile(java.awt.Image i,
int w,
int h)
scale (grow only) an Image to specified size by just filling it with the original from left to right, top down w, h will be rounded to the next multiple of original size |
void |
update(java.awt.Graphics g)
Overwrite java.awt.component.update() to avoid flickering . |
java.awt.Image |
waitForImage(java.awt.Image i)
wait for an Image to load completely |
Methods inherited from class java.awt.Panel |
getAccessibleContext |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getListeners, getMaximumSize, insets, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int NONE
public static final int POSITION_MASK
public static final int N
public static final int E
public static final int S
public static final int W
public static final int NW
public static final int SW
public static final int NE
public static final int SE
public static final int C
public static final int CENTER
public static final int TOP
public static final int RIGHT
public static final int BOTTOM
public static final int LEFT
public static final int EFFECT_MASK
public static final int RAISED
public static final int SUNKEN
public static final int BULK
public static final int ULINE
public static final int MISC_MASK
public static final int FILL
public static final int HREF
public static final char Esc
public static final char Null
public static final char None
public static final char Serif
public static final char SansSerif
public static final char Monospaced
public static final char Plain
public static final char Bold
public static final char Italic
public static final char Bolditalic
public static final char Smaller
public static final char Larger
public static final char FontSize0
public static final char FontMask
public static final char FontSizeMask
public static final char North
public static final char East
public static final char South
public static final char West
public static final char NorthWest
public static final char SouthWest
public static final char NorthEast
public static final char SouthEast
public static final char Center
public static final char Tab0
public static final char TabMask
public static final char TabSizeMask
public static final char Flat
public static final char Raised
public static final char Sunken
public static final char Bulk
public static final char Uline
public static final char Href
public static final char Hrefend
public static final char Darker
public static final char Brighter
public static final char Foreground
public static final char Background
public static final char ColorMask
public static final char RedMask
public static final char GreenMask
public static final char BlueMask
public static final char White
public static final char Black
protected static final java.lang.String jversion
protected static final java.lang.String jvendor
protected static final java.util.Hashtable fonts
protected java.awt.Insets insets
protected java.awt.Insets innerInsets
protected int borderDepth
protected int borderType
protected java.awt.Dimension minimumDimension
protected java.awt.event.ActionListener actionListener
protected java.awt.event.ItemListener itemListener
protected java.util.Hashtable componentStates
protected java.lang.Object bg
protected java.awt.Image bim
protected java.awt.Graphics big
Constructor Detail |
public Awt()
Method Detail |
public static void error(java.lang.Object m, java.awt.Component c)
m
- the message; usually string or exceptionc
- comp used as parent for popup or nullpublic static java.awt.Image loadImageFromStream(java.io.InputStream i)
public static java.awt.Image loadImageFromArchive(java.lang.String n)
n
- the name of the image.public static java.awt.Image loadImageFromURL(java.lang.String n)
null
on failure.
n
- the name/url of the image.public java.awt.Image loadImage(java.lang.String n)
null
on failure.
n
- the name/url of the image.public static boolean isNS4JVM()
public static boolean isMSJVM()
public static void centerWindow(java.awt.Window w)
w
- the window to center.public static void setBackground(java.awt.Component c)
c
- Componentpublic static void setForeground(java.awt.Component c)
c
- Componentpublic static void setFont(java.awt.TextComponent tc)
tc
- TextComponentpublic static void refresh(java.awt.Component c)
c
- the component to refresh.public void refresh()
public void refreshAll()
public static java.awt.Component getTopComponent(java.awt.Component c)
c
- the component to find the toplevel component for.public static java.applet.AppletContext getAppletContext(java.awt.Component c)
c
- the component to find the applet context for.public static java.awt.Font getFont(java.lang.Object o)
obj
can be a
standard font name or already a font object.
null
on failure.public static java.awt.Font getFont(java.lang.String name, int style, int size)
name
- Font name/familystyle
- Font.PAIN Font.BOLD Font.ITALICsize
- Font size in pointspublic static java.awt.FontMetrics getMetrics(java.awt.Font f)
f
- font to use.public static java.awt.Font larger(java.awt.Font f)
f
- use this as base font.public static java.awt.Font smaller(java.awt.Font f)
f
- use this as base font.public static java.awt.Font serif(java.awt.Font f)
f
- use this as base font.public static java.awt.Font sansserif(java.awt.Font f)
f
- use this as base font.public static java.awt.Font monospaced(java.awt.Font f)
f
- use this as base font.public static java.awt.Font bold(java.awt.Font f)
f
- use this as base font.public static java.awt.Font italic(java.awt.Font f)
f
- use this as base font.public static java.awt.Font bolditalic(java.awt.Font f)
f
- use this as base font.public static java.awt.Font plain(java.awt.Font f)
f
- use this as base font.public static java.lang.String Color2Esc(java.awt.Color c)
c
- the colorpublic static java.awt.Color getColor(java.lang.Object o)
obj
can be color name
or a numeric value or already a color object.
o
- color specification.
null
on failure.public static java.awt.Color dim(java.awt.Color c, int v)
c
c
- original colorv
- value to dimpublic static java.awt.Color brighter(java.awt.Color c)
c
c
- original colorpublic static java.awt.Color darker(java.awt.Color c)
c
c
- original colorpublic static java.awt.Insets Array2Insets(int[] i)
i
- insets values (as in Insets constructor)public static void drawLine(java.awt.Graphics g, java.awt.Color c, int x, int y, int X, int Y, int d, int m)
g
- Graphics object to usec
- color to use as base for shadow, or nulld
- thickness of line in pixelm
- RAISED or SUNKENpublic static void drawRectangle(java.awt.Graphics g, java.awt.Color c, int x, int y, int w, int h, int d, int m)
g
- Graphics object to usec
- color to use as base for shadow, or nullx
- x-position of describing recty
- y-position of describing rectw
- width of describing recth
- height of describing rectd
- thickness of the line in pixelm
- combination of FILL RAISED SUNKENpublic static void drawTriangle(java.awt.Graphics g, java.awt.Color c, int x, int y, int w, int h, int d, int m)
g
- Graphics object to usec
- color to use as base for shadow, or nullx
- x-position of describing recty
- y-position of describing rectw
- width of describing recth
- height of describing rectd
- thickness of the line in pixelm
- combination of LINE FILL RAISED SUNKEN and Direction (N E S W etc)public static java.awt.Dimension drawString(java.awt.Graphics g, java.awt.Color c, java.awt.Font f, java.lang.String s, int x, int y, int w, int h, int m)
g
- Graphics object to usec
- color to use or nullf
- font to use or nulls
- the stringx
- x-position of describing recty
- y-position of describing rectw
- width of describing recth
- height of describing rectm
- mode including position & effect & miscpublic static java.awt.Dimension drawString(java.awt.Graphics g, java.awt.Color c, java.awt.Font f, java.lang.String s, int x, int y, int w, int h, int m, Awt awt)
g
- Graphics object to usec
- color to use or nullf
- font to use or nulls
- the stringx
- x-position of describing recty
- y-position of describing rectw
- width of describing recth
- height of describing rectm
- mode including position & effect & miscawt
- comp used as callback for hrefspublic static java.awt.Dimension measureString(java.lang.String s, java.awt.Font f)
s
- the stringf
- the base font to usepublic static void drawCaption(java.awt.Graphics g, java.awt.Color c, java.awt.Font f, java.lang.String s, int x, int y, int w, int h, int m, java.lang.String dl)
g
- Graphics object to usec
- color to use or nullf
- font to use or nulls
- the stringx
- x-position of describing recty
- y-position of describing rectw
- width of describing recth
- height of describing rectm
- mode including position & effectdl
- the line delimiter usually "\n" specify "" for a single linepublic static void drawCaption(java.awt.Graphics g, java.awt.Color c, java.awt.Font f, java.lang.String s, int x, int y, int w, int h, int m, java.lang.String dl, Awt awt)
g
- Graphics object to usec
- color to use or nullf
- font to use or nulls
- the stringx
- x-position of describing recty
- y-position of describing rectw
- width of describing recth
- height of describing rectm
- mode including position & effectdl
- the line delimiter usually "\n" specify "" for a single lineawt
- comp used as callback for hrefspublic static java.awt.Dimension measureCaption(java.lang.String s, java.awt.Font f, java.awt.Font df, java.lang.String dl)
s
- the stringf
- the base font to usedf
- the default font to usedl
- the line delimiter usually "\n" specify "" for a single linepublic static java.lang.String exString(java.lang.String s)
s
- the orig. stringpublic static java.lang.String exHref(java.lang.String s)
s
- the orig. stringpublic static java.awt.Font getFont(char u, java.awt.Font f, java.awt.Font df)
u
- the escape charf
- the base font to usedf
- the default font to usepublic static java.awt.Color getColor(char u, java.awt.Color c, java.awt.Color dc, java.awt.Color bg)
u
- the escape charc
- the base color to usedc
- the default color to usepublic static int getTab(char u, java.awt.Font f, int dt)
u
- the escape charf
- the base font to usedt
- the default tab to usepublic static int getMode(char u, int m, int dm)
u
- the escape charm
- the base mode to usedm
- the default mode to usepublic static int getPosition(int m)
m
- modepublic static boolean isEffect(int m)
m
- modepublic static boolean isRaised(int m)
m
- modepublic static boolean isSunken(int m)
m
- modepublic static boolean isBulk(int m)
m
- modepublic static boolean isUline(int m)
m
- modepublic static boolean isHref(int m)
m
- modepublic static boolean isFill(int m)
m
- modepublic void doHref(java.lang.String s, int x, int y, int w, int h)
s
- the href string (including href & text)x
- x pos of describing recty
- y pos of describing rectw
- width of describing recth
- height of describing rectpublic void setBounds(int x, int y, int w, int h)
setBounds
in class java.awt.Component
public java.awt.Dimension measure()
public void doMeasure()
public java.awt.Rectangle getRectangle()
public java.awt.Rectangle getBorderRectangle()
public java.awt.Rectangle getInnerRectangle()
public void invalidate()
invalidate
in class java.awt.Container
public void addNotify()
addNotify
in class java.awt.Panel
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class java.awt.Container
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class java.awt.Container
getPreferredSize()
public void update(java.awt.Graphics g)
update
in class java.awt.Container
public void paint(java.awt.Graphics g)
paint
in class java.awt.Container
g
- Graphics object to usepublic void paintBorder(java.awt.Graphics g, int x, int y, int w, int h)
g
- Graphics object to usex
- x-position of describing recty
- y-position of describing rectw
- width of describing recth
- height of describing rectpublic void paintBackground(java.awt.Graphics g)
g
- Graphics object to usepublic void paintBackground(java.awt.Graphics g, int x, int y, int w, int h)
g
- Graphics object to usex
- x-position of describing recty
- y-position of describing rectw
- width of describing recth
- height of describing rectpublic void paintBim(java.awt.Graphics g)
public void makeBim()
public void setBG(java.lang.Object b)
public void setBGIfNull(java.lang.Object b)
public java.lang.Object getBG()
public java.awt.Image getBGImage()
public Awt getBGParent()
public java.awt.Image getBGParentImage()
public java.awt.Image waitForImage(java.awt.Image i)
i
- the imagepublic java.awt.Image tile(java.awt.Image i, java.awt.Dimension d)
i
- orinigal imaged
- new dimspublic java.awt.Image tile(java.awt.Image i, int w, int h)
i
- orinigal imagew
- new widthh
- new heightpublic void setEnabled(boolean enabled)
setEnabled
in class java.awt.Component
enabled
- enabled?public void setVisible(boolean v)
setVisible
in class java.awt.Component
v
- visible?public void setInsets(java.awt.Insets i)
i
- the border around the componentpublic java.awt.Insets getInsets()
getInsets
in class java.awt.Container
public void setInnerInsets(java.awt.Insets i)
public java.awt.Insets getInnerInsets()
public void setBorderDepth(int d)
d
- depth in pixelpublic int getBorderDepth()
public void setBorderType(int t)
t
- bordertype [TOP NONE BULK RAISED SUNKENpublic void setBorderType(java.lang.String t)
t
- bordertype [North(Top) None Bulk Raised Sundekn]public int getBorderType()
public void setFont(java.awt.Font f)
setFont
in class java.awt.Container
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void keyTyped(java.awt.event.KeyEvent e)
keyTyped
in interface java.awt.event.KeyListener
public void keyPressed(java.awt.event.KeyEvent e)
keyPressed
in interface java.awt.event.KeyListener
public void keyReleased(java.awt.event.KeyEvent e)
keyReleased
in interface java.awt.event.KeyListener
public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
adjustmentValueChanged
in interface java.awt.event.AdjustmentListener
public void focusGained(java.awt.event.FocusEvent e)
focusGained
in interface java.awt.event.FocusListener
public void focusLost(java.awt.event.FocusEvent e)
focusLost
in interface java.awt.event.FocusListener
public java.lang.Object[] getSelectedObjects()
getSelectedObjects
in interface java.awt.ItemSelectable
public void addActionListener(java.awt.event.ActionListener l)
l
- the actionListener to addpublic void removeActionListener(java.awt.event.ActionListener l)
l
- the actionListener to removeprotected void notifyActionListeners(java.awt.event.ActionEvent e)
e
- the event to postpublic void addItemListener(java.awt.event.ItemListener l)
addItemListener
in interface java.awt.ItemSelectable
l
- the itemListener to addpublic void removeItemListener(java.awt.event.ItemListener l)
removeItemListener
in interface java.awt.ItemSelectable
l
- the itemListener to removeprotected void notifyItemListeners(java.awt.event.ItemEvent e)
e
- the event to post
|
[.hacks.] [.java.] |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |