|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Canvas
|
+--com.webcab.chat.gui.CaptionView
The CaptionView is a JavaBeanTM,
which creates an active
area that reacts like a button to mouse clicks and movements, allowing the
user to use images instead of text. There are six positions a caption can have:
The CaptionView bean can resize the images according to the
full size of the active area, or can simply use the image without changing
its dimensions. The caching is done using ImageCache class
which prevents any web-related errors to alter the quality of the display.
At present, the BeanInfo class doesn't return any editable
properties, so when added to an IDE, the properties will be set by
hand-written code.
ImageCache, Serialized Form| Inner classes inherited from class java.awt.Canvas |
java.awt.Canvas.AccessibleAWTCanvas |
| Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
| Field Summary | |
static int |
SCALE_FULL
This constant specifies that the images will be scaled to the maximum in order to fit the active area. |
static int |
SCALE_MINIMUM
This constant specifies that the images will be scaled to the initial value of their specified dimension. |
static int |
SCALE_NONE
This constant specifies that no scaling will be done upon the images. |
| 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 | |
CaptionView()
This is the non-zero constructor required by the java.beans.Bean
class in order to instantiate the bean. |
|
| Method Summary | |
void |
addCaptionViewListener(CaptionViewListener l)
Adds a new listener to notify whenever an important event occurs. |
void |
addNotify()
|
void |
flush()
Disposes all the resources held by this component. |
boolean |
getAnimated()
Get the animated flag value. |
java.awt.Dimension |
getCaptionSize()
Gets the size of this caption. |
java.lang.String[] |
getImageNames()
This method returns the array of strings corresponding to each image in the six states. |
java.awt.Dimension |
getMinimumSize()
Returns the minimum size this caption can have. |
java.awt.Dimension |
getPreferredSize()
Returns the preferred size of this caption. |
int |
getScaleFlag()
Gets the scaling method for this caption. |
void |
mouseClicked(java.awt.event.MouseEvent e)
MouseListener interface |
void |
mouseDragged(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
MouseMotionListener methods |
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
paint(java.awt.Graphics g)
|
void |
removeCaptionViewListener(CaptionViewListener l)
Removes the specified listener. |
void |
removeNotify()
|
void |
setAnimated(boolean animated)
Sets the animated flag to true or false. |
void |
setBounds(int x,
int y,
int w,
int h)
Sets the dimension of this caption. |
void |
setCaptionSize(java.awt.Dimension captionSize)
Defines the size of the caption. |
void |
setImageNames(java.lang.String[] imageNames)
This method defines all of the six images which will be displayed according to the caption's state: normal, over, pressed, visited, visited over and visited pressed. |
void |
setScaleFlag(int flag)
Sets the style of render, when changes of size occur to the bean. |
void |
update(java.awt.Graphics g)
|
| Methods inherited from class java.awt.Canvas |
getAccessibleContext |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, validate |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int SCALE_NONE
setScaleFlag(int),
getScaleFlag()public static final int SCALE_MINIMUM
setScaleFlag(int),
getScaleFlag()public static final int SCALE_FULL
setScaleFlag(int),
getScaleFlag()| Constructor Detail |
public CaptionView()
java.beans.Bean
class in order to instantiate the bean.| Method Detail |
public void addCaptionViewListener(CaptionViewListener l)
l - The listener to be addedremoveCaptionViewListener(com.webcab.chat.gui.CaptionViewListener),
CaptionViewListenerpublic void removeCaptionViewListener(CaptionViewListener l)
l - The listener to be removedaddCaptionViewListener(com.webcab.chat.gui.CaptionViewListener),
CaptionViewListenerpublic void setCaptionSize(java.awt.Dimension captionSize)
set/getScaleFlag method. If one of the
width or height is -1, then at the
next resize or at the next setImageNames invocation
the corresponding dimension will be replaced.captionSize - the caption's dimensiongetCaptionSize()public java.awt.Dimension getCaptionSize()
setCaptionSize(java.awt.Dimension)public void setImageNames(java.lang.String[] imageNames)
imageNames - the array of string containing the image URLsgetImageNames(),
ImageCachepublic java.lang.String[] getImageNames()
setImageNames(java.lang.String[])public void setScaleFlag(int flag)
SCALE_NONE, SCALE_MINIMUM,
SCALE_FULL.flag - One of the three possible scaling flags.getScaleFlag(),
SCALE_NONE,
SCALE_MINIMUM,
SCALE_FULLpublic int getScaleFlag()
SCALE_NONE,
SCALE_MINIMUM, SCALE_FULL.setScaleFlag(int),
SCALE_NONE,
SCALE_MINIMUM,
SCALE_FULLpublic void setAnimated(boolean animated)
SCALE_FULL flag. If the animated
flag is false, then animated gifs are not properly displayed, but static gifs
get an improved performance and speed.animated - the animated flag. By default, this is false.getAnimated()public boolean getAnimated()
setAnimated(boolean)public java.awt.Dimension getPreferredSize()
getPreferredSize in class java.awt.ComponentgetMinimumSize(),
getCaptionSize()public java.awt.Dimension getMinimumSize()
getMinimumSize in class java.awt.ComponentgetPreferredSize(),
getCaptionSize()
public void setBounds(int x,
int y,
int w,
int h)
SCALE_FULL,
this method sets the size of the active area to the same dimension.setBounds in class java.awt.ComponentsetCaptionSize(java.awt.Dimension)public void addNotify()
addNotify in class java.awt.Canvaspublic void removeNotify()
removeNotify in class java.awt.Componentpublic void update(java.awt.Graphics g)
update in class java.awt.Componentpublic void paint(java.awt.Graphics g)
paint in class java.awt.Canvaspublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenerpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void flush()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||