Project MVC architecture
version 0.1 - 010723

lib.gui
Class ImageLabel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--lib.gui.ImageCanvas
                    |
                    +--lib.gui.ImageLabel
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable

public class ImageLabel
extends ImageCanvas

A Label that displays a gif image region.

The image region is an offset portion of the image displayed at the instance bounding box.

Version:
1.0 18/05/2000
Author:
Ivan Wellesz
See Also:
ImageCanvas, 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, java.awt.Component.AWTTreeLock
 
Field Summary
 java.lang.String alternateLabel
           
private static int CENTER
           
(package private) static java.awt.Font defaultFont
          Class level default Font;
private  java.awt.FontMetrics fm
           
 java.awt.Font font
          Label Font.
 java.lang.String initialLabel
           
private  int justification
           
 java.lang.String label
          Label names.
private static int LEFT
          Justification;
private static int RIGHT
           
 
Fields inherited from class lib.gui.ImageCanvas
image, regionHeight, regionOffsetX, regionOffsetY, regionWidth
 
Fields inherited from class java.awt.Canvas
base, nameCounter, serialVersionUID
 
Fields inherited from class java.awt.Component
accessibleContext, actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dbg, dropTarget, enabled, eventMask, focusListener, focusListenerK, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ImageLabel()
           
ImageLabel(java.awt.Image image, java.lang.String label, int regionOffsetX, int regionOfsfetY, int regionWidth, int regionHeight)
           
ImageLabel(java.awt.Image image, java.lang.String label, java.awt.Rectangle r)
           
ImageLabel(java.lang.String label)
           
 
Method Summary
 java.lang.String getLabel()
           
 java.lang.String getText()
           
 void justify_CENTER()
           
 void justify_LEFT()
          Set the justification.
 void justify_RIGHT()
           
 void moveRegion(java.awt.Point location)
           
 void paint(java.awt.Graphics g)
          Draw graphics.
private  void paintLabel(java.awt.Graphics g)
          Display the label String.
protected  java.lang.String paramString()
          Construct the instance String desctiption.
 void setFont(java.awt.Font font)
          Set the instance Font.
static void setFontDefault(java.awt.Font font)
           
 void setImage(java.awt.Image image)
          Change image.
 void setLabel(java.lang.String label)
           
 void setRegion(java.awt.Rectangle r)
           
 void setText(java.lang.String label)
          Change label string.
 
Methods inherited from class lib.gui.ImageCanvas
isDoubleBuffered, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, process_mouseClicked, process_mouseDragged, process_mouseEntered, process_mouseExited, process_mouseMoved, process_mousePressed, process_mouseReleased, update
 
Methods inherited from class java.awt.Canvas
, addNotify, constructComponentName, getAccessibleContext, postsOldMouseEvents
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkGD, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createChildHierarchyEvents, createHierarchyEvents, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, dispatchEventImpl, doLayout, enable, enable, enableEvents, enableInputMethods, eventEnabled, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, initIDs, inside, invalidate, isDisplayable, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isShowing, isValid, isVisible, keyDown, keyUp, layout, lightweightPaint, lightweightPrint, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, numListening, paintAll, paintHeavyweightComponents, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, printHeavyweightComponents, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, readObject, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, resetGC, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, validate, writeObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

LEFT

private static final int LEFT
Justification;

CENTER

private static final int CENTER

RIGHT

private static final int RIGHT

defaultFont

static java.awt.Font defaultFont
Class level default Font;

label

public java.lang.String label
Label names.

alternateLabel

public java.lang.String alternateLabel

initialLabel

public java.lang.String initialLabel

font

public java.awt.Font font
Label Font.

fm

private java.awt.FontMetrics fm

justification

private int justification
Constructor Detail

ImageLabel

public ImageLabel()

ImageLabel

public ImageLabel(java.lang.String label)
Parameters:
label - Label name.

ImageLabel

public ImageLabel(java.awt.Image image,
                  java.lang.String label,
                  java.awt.Rectangle r)
Parameters:
image - image from which to draw a region
label - Label name.
r - region geometry

ImageLabel

public ImageLabel(java.awt.Image image,
                  java.lang.String label,
                  int regionOffsetX,
                  int regionOfsfetY,
                  int regionWidth,
                  int regionHeight)
Parameters:
image - image from which to draw a region
label - Label name.
regionOffsetX - region origin left offset
regionOffsetY - region origin top offset
regionWidth - region width
regionHeight - region height
Method Detail

setFontDefault

public static void setFontDefault(java.awt.Font font)

setFont

public void setFont(java.awt.Font font)
Set the instance Font.
Overrides:
setFont in class java.awt.Component

justify_LEFT

public void justify_LEFT()
Set the justification.

justify_CENTER

public void justify_CENTER()

justify_RIGHT

public void justify_RIGHT()

setText

public void setText(java.lang.String label)
Change label string.

setLabel

public void setLabel(java.lang.String label)

setImage

public void setImage(java.awt.Image image)
Change image.
Parameters:
image - image from which to draw a region

setRegion

public void setRegion(java.awt.Rectangle r)

moveRegion

public void moveRegion(java.awt.Point location)

getText

public java.lang.String getText()

getLabel

public java.lang.String getLabel()

paint

public void paint(java.awt.Graphics g)
Draw graphics.
Overrides:
paint in class ImageCanvas
Parameters:
g - the graphics to use for painting

paintLabel

private void paintLabel(java.awt.Graphics g)
Display the label String.

paramString

protected java.lang.String paramString()
Construct the instance String desctiption.
Overrides:
paramString in class java.awt.Component

MVC architecture

Document Tech Infos - Ivan Wellesz