|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--dog.gui.DComponent
The base class for lightweight components.
All DComponents are beans, and property change listeners can register themselves for property changes. All DComponents can have a tooltip set, which will be managed by its root pane. Also you can set an arbitrary object reference for any component.
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
static int |
CENTER
The centre alignment. |
static int |
CENTER_TILE
Tiles the background image in the panel from the centre. |
protected java.beans.PropertyChangeSupport |
changes
The property change support for components. |
static int |
EAST
The east alignment. |
static int |
INTEGER_TILE
Tiles the background image in the panel, resizing the image such that it its dimensions are factors of the panel dimensions. |
static int |
MAXIMIZE
Renders the background image to fit exactly into the panel, resizing its dimensions as necessary. |
static int |
MAXIMIZE_ASPECT
Renders the background image to fit into the panel, preserving the aspect ratio. |
static int |
MAXIMIZE_HORIZONTAL
Renders the background image to fit the width of the image into the panel. |
static int |
MAXIMIZE_VERTICAL
Renders the background image to fit the height of the image into the panel. |
static int |
NORTH
The north alignment. |
static int |
NORTHEAST
The northeast alignment. |
static int |
NORTHWEST
The northwest alignment. |
protected java.lang.Object |
reference
|
static int |
SOUTH
The south alignment. |
static int |
SOUTHEAST
The southeast alignment. |
static int |
SOUTHWEST
The southwest alignment. |
static int |
TILE
Tiles the background image in the panel from the top left-hand corner. |
protected java.lang.String |
tooltip
|
static int |
WEST
The west alignment. |
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 | |
DComponent()
Construct a component. |
Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds a property change listener to receive notification of changes to this component. |
protected java.lang.String |
alignParamString(int align)
Returns a description of alignment for debugging. |
protected static void |
drawActiveButtonBorder(java.awt.Graphics g,
java.awt.Rectangle r,
java.awt.Color ds,
java.awt.Color h,
java.awt.Color c,
java.awt.Color pc,
java.awt.Color pcds)
Draws a border for active buttons. |
protected static void |
drawActiveOptionBorder(java.awt.Graphics g,
java.awt.Rectangle r,
java.awt.Color ds,
java.awt.Color h,
java.awt.Color c,
java.awt.Color cs,
java.awt.Color pc,
java.awt.Color pcds)
Draws a border for active options. |
protected static void |
drawArrow(java.awt.Graphics g,
java.awt.Rectangle r,
boolean active,
int orientation,
java.awt.Color ds,
java.awt.Color h,
java.awt.Color pc)
Draws an arrow inside the specified bounds rectangle. |
protected static void |
drawBackgroundImage(java.awt.Graphics g,
java.awt.Image image,
java.awt.Rectangle bounds,
java.awt.Dimension bs,
java.awt.Rectangle br,
int mode,
java.awt.image.ImageObserver observer)
Draws a background image for a root pane into the specified bounds rectangle according to the specified mode. |
protected static void |
drawBorder(java.awt.Graphics g,
java.awt.Rectangle r,
java.awt.Color ds,
java.awt.Color h,
java.awt.Color c)
Draws a border inside the specified bounds rectangle. |
protected static void |
drawButtonBorder(java.awt.Graphics g,
java.awt.Rectangle r,
boolean active,
java.awt.Color ds,
java.awt.Color h,
java.awt.Color c,
java.awt.Color pc,
java.awt.Color pcds)
Draws a border for buttons. |
protected static void |
drawCheckbox(java.awt.Graphics g,
java.awt.Rectangle r,
boolean active,
boolean value,
java.awt.Color ds,
java.awt.Color h,
java.awt.Color c,
java.awt.Color cs,
java.awt.Color pc,
java.awt.Color pcds,
java.awt.Color f)
Draws a checkbox inside the specified bounds rectangle. |
protected static void |
drawDarkBorder(java.awt.Graphics g,
java.awt.Rectangle r,
java.awt.Color ds,
java.awt.Color h,
java.awt.Color c,
java.awt.Color cs)
Draws a dark border for things like sticky buttons. |
protected static void |
drawDefaultButtonBorder(java.awt.Graphics g,
java.awt.Rectangle r,
boolean active,
java.awt.Color ds,
java.awt.Color h,
java.awt.Color c,
java.awt.Color pc,
java.awt.Color pcds)
Draws a border for the default button in a pane. |
protected static void |
drawDisabledBorder(java.awt.Graphics g,
java.awt.Rectangle r,
java.awt.Color d)
Draws a disabled border inside the specified bounds rectangle. |
protected static void |
drawDisabledCheckbox(java.awt.Graphics g,
java.awt.Rectangle r,
boolean value,
java.awt.Color d)
Draws a disabled checkbox inside the specified bounds rectangle. |
protected static void |
drawDisabledOption(java.awt.Graphics g,
java.awt.Rectangle r,
boolean value,
java.awt.Color d)
Draws a disabled option inside the specified bounds rectangle. |
protected static void |
drawExpander(java.awt.Graphics g,
java.awt.Rectangle r,
boolean active,
boolean collapsed,
java.awt.Color pc,
java.awt.Color pch,
java.awt.Color pcs,
java.awt.Color pcds,
java.awt.Color f)
Draws an expansion symbol. |
protected static void |
drawFocusBorder(java.awt.Graphics g,
java.awt.Rectangle r,
java.awt.Color f)
Draws a focus border inside the specified bounds rectangle. |
protected static void |
drawImage(java.awt.Graphics g,
java.awt.Rectangle r,
java.awt.Image image,
java.awt.image.ImageObserver observer,
int align)
Draws an image into the specified bounds rectangle, rescaling it if necessary. |
protected static void |
drawLabel(java.awt.Graphics g,
java.awt.Rectangle r,
java.awt.FontMetrics fm,
java.lang.String label,
int align,
java.awt.Color f)
Draws a multiline label in the specified bounds rectangle. |
protected static void |
drawOption(java.awt.Graphics g,
java.awt.Rectangle r,
boolean active,
boolean value,
java.awt.Color ds,
java.awt.Color h,
java.awt.Color c,
java.awt.Color cs,
java.awt.Color pc,
java.awt.Color pcds,
java.awt.Color f)
Draws an option inside the specified bounds rectangle. |
protected static void |
drawOptionBorder(java.awt.Graphics g,
java.awt.Rectangle r,
java.awt.Color ds,
java.awt.Color h,
java.awt.Color c)
Draws a border for options. |
protected static void |
drawPressedBorder(java.awt.Graphics g,
java.awt.Rectangle r,
java.awt.Color ds,
java.awt.Color h,
java.awt.Color c,
java.awt.Color cs)
Draws a pressed border inside the specified bounds rectangle. |
protected static void |
drawTick(java.awt.Graphics g,
java.awt.Rectangle r,
java.awt.Color c)
Draws a tick inside the specified bounds rectangle. |
static java.awt.Toolkit |
getDefaultToolkit()
Returns the default toolkit. |
static java.awt.Image |
getImage(java.awt.Image image,
java.awt.image.ImageObserver observer)
Returns images for observers. |
static java.awt.Image |
getImage(java.lang.String file,
java.awt.image.ImageObserver observer)
Returns images for observers. |
static java.awt.Image |
getImage(java.net.URL url,
java.awt.image.ImageObserver observer)
Returns images for observers. |
java.lang.Object |
getReference()
Returns the object reference. |
DRootPane |
getRootPane()
Returns the root pane for this component. |
protected static java.lang.String[] |
getRows(java.awt.FontMetrics fm,
java.lang.String label,
int width)
Returns the array of strings resulting from attempting to fit a string into a specified width, according to the specified font metrics and splitting the original string at spaces. |
java.lang.String |
getTooltip()
Returns the tooltip label for this component. |
static boolean |
isPreloadImages()
Indicates whether to preload images from files or URLs. |
protected java.lang.String |
paramString()
Returns additional parameters about the component. |
static java.awt.Color |
parseColor(java.lang.String rgb)
Returns a colour matching the specified RGB string. |
static java.awt.Font |
parseFont(java.lang.String font)
Returns a font matching the supplied font specification. |
protected void |
processCancelAction(java.awt.event.ActionEvent event)
Activates the cancel button in the nearest container. |
protected void |
processDefaultAction(java.awt.event.ActionEvent event)
Activates the default button in the nearest container. |
protected void |
processEvent(java.awt.AWTEvent event)
|
protected void |
processMouseEvent(java.awt.event.MouseEvent event)
|
protected void |
processMouseMotionEvent(java.awt.event.MouseEvent event)
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes a property change listener so it no longer receives notification of changes to this component. |
void |
setEnabled(boolean flag)
Overrides setEnabled to repaint the component. |
static void |
setPreloadImages(boolean flag)
Sets whether to preload images from files or URLs. |
void |
setReference(java.lang.Object reference)
Sets the object reference. |
void |
setTooltip(java.lang.String tooltip)
Sets the tooltip label for this component. |
java.lang.String |
toString()
Returns a string description of this component. |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleContext, 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, getMinimumSize, getName, getParent, getPeer, getPreferredSize, 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, paint, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, transferFocus, update, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int CENTER
public static final int NORTH
public static final int EAST
public static final int SOUTH
public static final int WEST
public static final int NORTHEAST
public static final int SOUTHEAST
public static final int SOUTHWEST
public static final int NORTHWEST
public static final int TILE
public static final int INTEGER_TILE
public static final int CENTER_TILE
public static final int MAXIMIZE
public static final int MAXIMIZE_ASPECT
public static final int MAXIMIZE_VERTICAL
public static final int MAXIMIZE_HORIZONTAL
protected java.beans.PropertyChangeSupport changes
protected java.lang.Object reference
protected java.lang.String tooltip
Constructor Detail |
public DComponent()
Method Detail |
public java.lang.String getTooltip()
public void setTooltip(java.lang.String tooltip)
protected void processDefaultAction(java.awt.event.ActionEvent event)
protected void processCancelAction(java.awt.event.ActionEvent event)
public void setEnabled(boolean flag)
setEnabled
in class java.awt.Component
public static java.awt.Toolkit getDefaultToolkit()
public static java.awt.Image getImage(java.awt.Image image, java.awt.image.ImageObserver observer)
public static java.awt.Image getImage(java.lang.String file, java.awt.image.ImageObserver observer)
public static java.awt.Image getImage(java.net.URL url, java.awt.image.ImageObserver observer)
public static boolean isPreloadImages()
public static void setPreloadImages(boolean flag)
public java.lang.Object getReference()
getReference
in interface Referential
public void setReference(java.lang.Object reference)
setReference
in interface Referential
reference
- the object reference to store.public DRootPane getRootPane()
DRootPane
public java.lang.String toString()
toString
in class java.awt.Component
protected java.lang.String paramString()
paramString
in class java.awt.Component
protected java.lang.String alignParamString(int align)
public static java.awt.Color parseColor(java.lang.String rgb)
rgb
- a string in RGB formatpublic static java.awt.Font parseFont(java.lang.String font)
font
- a font specification of the form [name[,size | ,style[,size]]]protected static void drawBorder(java.awt.Graphics g, java.awt.Rectangle r, java.awt.Color ds, java.awt.Color h, java.awt.Color c)
g
- the graphics contextr
- the bounding rectangle of the borderds
- the control dark shadow colour to useh
- the control highlight colour to usec
- the control colour to useprotected static void drawFocusBorder(java.awt.Graphics g, java.awt.Rectangle r, java.awt.Color f)
g
- the graphics contextr
- the bounding rectangle of the borderf
- the control focus to useprotected static void drawPressedBorder(java.awt.Graphics g, java.awt.Rectangle r, java.awt.Color ds, java.awt.Color h, java.awt.Color c, java.awt.Color cs)
g
- the graphics contextr
- the bounding rectangle of the borderds
- the control dark shadow colour to useh
- the control highlight colour to usec
- the control colour to usecs
- the control shadow colour to useprotected static void drawDisabledBorder(java.awt.Graphics g, java.awt.Rectangle r, java.awt.Color d)
g
- the graphics contextr
- the bounding rectangle of the borderd
- the control disabled colour to useprotected static void drawDarkBorder(java.awt.Graphics g, java.awt.Rectangle r, java.awt.Color ds, java.awt.Color h, java.awt.Color c, java.awt.Color cs)
g
- the graphics contextr
- the bounding rectangle of the borderc
- the control colour to usecs
- the control shadow colour to useprotected static void drawButtonBorder(java.awt.Graphics g, java.awt.Rectangle r, boolean active, java.awt.Color ds, java.awt.Color h, java.awt.Color c, java.awt.Color pc, java.awt.Color pcds)
g
- the graphics contextr
- the bounding rectangle of the borderactive
- whether the button is activeds
- the control dark shadow colour to useh
- the control highlight colour to usec
- the control colour to usepc
- the primary control colour to usepcds
- the primary control dark shadow colour to useprotected static void drawActiveButtonBorder(java.awt.Graphics g, java.awt.Rectangle r, java.awt.Color ds, java.awt.Color h, java.awt.Color c, java.awt.Color pc, java.awt.Color pcds)
g
- the graphics contextr
- the bounding rectangle of the borderds
- the control dark shadow colour to useh
- the control highlight colour to usec
- the control colour to usepc
- the primary control colour to usepcds
- the primary control dark shadow colour to useprotected static void drawDefaultButtonBorder(java.awt.Graphics g, java.awt.Rectangle r, boolean active, java.awt.Color ds, java.awt.Color h, java.awt.Color c, java.awt.Color pc, java.awt.Color pcds)
g
- the graphics contextr
- the bounding rectangle of the borderactive
- whether the button is activeds
- the control dark shadow colour to useh
- the control highlight colour to usec
- the control colour to usepc
- the primary control colour to usepcds
- the primary control dark shadow colour to useprotected static void drawArrow(java.awt.Graphics g, java.awt.Rectangle r, boolean active, int orientation, java.awt.Color ds, java.awt.Color h, java.awt.Color pc)
g
- the graphics contextr
- the bounding rectangle of the arrowactive
- if true, fills the arrow with the primary control colourorientation
- the orientation of the apex of the arrow (NORTH, EAST, SOUTH, or WEST)ds
- the control dark shadow colour to useh
- the control highlight colour to usepc
- the primary control colour to useprotected static void drawCheckbox(java.awt.Graphics g, java.awt.Rectangle r, boolean active, boolean value, java.awt.Color ds, java.awt.Color h, java.awt.Color c, java.awt.Color cs, java.awt.Color pc, java.awt.Color pcds, java.awt.Color f)
g
- the graphics contextr
- the bounding rectangle of the checkactive
- whether the checkbox is activevalue
- if true, draws a check markds
- the control dark shadow colour to useh
- the control highlight colour to usec
- the control colour to usepc
- the primary control colour to usepcds
- the primary control dark shadow colour to usef
- the colour to draw the check inprotected static void drawDisabledCheckbox(java.awt.Graphics g, java.awt.Rectangle r, boolean value, java.awt.Color d)
g
- the graphics contextr
- the bounding rectangle of the checkvalue
- if true, draws a check markd
- the control disabled colour to useprotected static void drawTick(java.awt.Graphics g, java.awt.Rectangle r, java.awt.Color c)
g
- the graphics contextr
- the bounding rectangle of the checkc
- the colour to useprotected static void drawOption(java.awt.Graphics g, java.awt.Rectangle r, boolean active, boolean value, java.awt.Color ds, java.awt.Color h, java.awt.Color c, java.awt.Color cs, java.awt.Color pc, java.awt.Color pcds, java.awt.Color f)
g
- the graphics contextr
- the bounding rectangle of the circleactive
- whether the option is activevalue
- if true, draws a dot in the circleds
- the control dark shadow colour to useh
- the control highlight colour to usec
- the control colour to usepc
- the primary control colour to usepcds
- the primary control dark shadow colour to usef
- the colour to draw the dot inprotected static void drawDisabledOption(java.awt.Graphics g, java.awt.Rectangle r, boolean value, java.awt.Color d)
g
- the graphics contextr
- the bounding rectangle of the circlevalue
- if true, draws a dot in the circled
- the control disabled colour to useprotected static void drawOptionBorder(java.awt.Graphics g, java.awt.Rectangle r, java.awt.Color ds, java.awt.Color h, java.awt.Color c)
g
- the graphics contextr
- the bounding rectangle of the borderds
- the control dark shadow colour to useh
- the control highlight colour to usec
- the control colour to useprotected static void drawActiveOptionBorder(java.awt.Graphics g, java.awt.Rectangle r, java.awt.Color ds, java.awt.Color h, java.awt.Color c, java.awt.Color cs, java.awt.Color pc, java.awt.Color pcds)
g
- the graphics contextr
- the bounding rectangle of the borderds
- the control dark shadow colour to useh
- the control highlight colour to usec
- the control colour to usepc
- the primary control colour to usepcds
- the primary control dark shadow colour to useprotected static void drawExpander(java.awt.Graphics g, java.awt.Rectangle r, boolean active, boolean collapsed, java.awt.Color pc, java.awt.Color pch, java.awt.Color pcs, java.awt.Color pcds, java.awt.Color f)
g
- the graphics contextr
- the bounding rectangle of the symbolactive
- whether the symbol is active (pressed)collapsed
- whether the symbol is collapsedpc
- the primary control colour to usepch
- the primary control highlight colour to usepcs
- the primary control shadow colour to usepcds
- the primary control dark shadow colour to usef
- the foreground colour to useprotected static void drawLabel(java.awt.Graphics g, java.awt.Rectangle r, java.awt.FontMetrics fm, java.lang.String label, int align, java.awt.Color f)
g
- the graphics contextr
- the bounding rectangle of the labelfm
- the font metrics to apply to the stringlabel
- the label stringalign
- the alignment of the label within the boundsf
- the colour of the textprotected static java.lang.String[] getRows(java.awt.FontMetrics fm, java.lang.String label, int width)
protected static void drawImage(java.awt.Graphics g, java.awt.Rectangle r, java.awt.Image image, java.awt.image.ImageObserver observer, int align)
g
- the graphics contextr
- the bounding rectangle of the imageimage
- the image to drawalign
- how to align the image within the boundsprotected static void drawBackgroundImage(java.awt.Graphics g, java.awt.Image image, java.awt.Rectangle bounds, java.awt.Dimension bs, java.awt.Rectangle br, int mode, java.awt.image.ImageObserver observer)
g
- the graphics contextbs
- the size of the imagebounds
- the bounding rectangle of the target areabr
- the bounding rectangle of the target areaimage
- the image to drawmode
- how to render the image within the boundspublic void addPropertyChangeListener(java.beans.PropertyChangeListener l)
addPropertyChangeListener
in class java.awt.Component
l
- the listenerpublic void removePropertyChangeListener(java.beans.PropertyChangeListener l)
removePropertyChangeListener
in class java.awt.Component
l
- the listenerprotected void processEvent(java.awt.AWTEvent event)
processEvent
in class java.awt.Component
protected void processMouseEvent(java.awt.event.MouseEvent event)
processMouseEvent
in class java.awt.Component
protected void processMouseMotionEvent(java.awt.event.MouseEvent event)
processMouseMotionEvent
in class java.awt.Component
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |