Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class uk.co.ist.mwt.ShadowedComponent

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--uk.co.ist.mwt.ShadowedComponent
Subclasses:
BoxedButton, Scale, Separator

public class ShadowedComponent
extends java.awt.Canvas
A ShadowedComponent is a component which has shadows somewhere in its visual display

See Also:
Serialized Form

Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
ShadowedComponent()
           
 
Method Summary
void draw3DRect(java.awt.Component c, java.awt.Rectangle r, boolean in)
          A routine to draw a 3D rectangle using the object's shadow colours and thickness; pass in the bounding box of the whole object, and the component on which to draw.
void draw3DRect(java.awt.Rectangle r, boolean in)
          A routine to draw a 3D rectangle in this component using the object's shadow colours and thickness; pass in the bounding box of the whole object.
void draw3DRect(java.awt.Graphics g, java.awt.Rectangle r, boolean in)
          A routine to draw a 3D rectangle in this component using the object's shadow colours and thickness; pass in the bounding box of the whole object.
void draw3DRect(java.awt.Graphics g, java.awt.Component c, java.awt.Rectangle r, boolean in)
          A routine to draw a 3D rectangle using the object's shadow colours and thickness; pass in the bounding box of the whole object, and the component on which to draw.
void drawShadow(java.awt.Graphics g, java.awt.Component c, int x, int y, int length, boolean vertical, boolean reflect, boolean top)
          Draws a trapezium, with top right at the point passed in, with a corner cut out of the length and depth of the shadow thickness; eg.
void drawShadow(java.awt.Component c, int x, int y, int length, boolean vertical, boolean reflect, boolean top)
          Draws a trapezium, with top right at the point passed in, with a corner cut out of the length and depth of the shadow thickness; eg.
java.awt.Color getBottomShadowColor()
          Gets the color for 'bottom shadows' - those which suggest an area in shadow
int getShadowThickness()
          Gets the thickness this component is using for shadows right now
java.awt.Color getTopShadowColor()
          Gets the color for 'top shadows' - ie. those which suggest sides which are getting more than their fair share of light.
void setBottomShadowColor(java.awt.Color c)
          Sets the color for 'bottom shadows' - those which suggest an area in shadow
void setShadowThickness(int shadowThickness)
          Sets the thickness this component is using for shadows right now
void setTopShadowColor(java.awt.Color c)
          Sets the color for 'top shadows' - ie. those which suggest sides which are getting more than their fair share of light.
 
Methods inherited from class java.awt.Canvas
addNotify, paint
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, 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, paintAll, paint, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Constructor Detail

ShadowedComponent

public ShadowedComponent()
Method Detail

getTopShadowColor

public java.awt.Color getTopShadowColor()
Gets the color for 'top shadows' - ie. those which suggest sides which are getting more than their fair share of light.

setTopShadowColor

public void setTopShadowColor(java.awt.Color c)
Sets the color for 'top shadows' - ie. those which suggest sides which are getting more than their fair share of light.

getBottomShadowColor

public java.awt.Color getBottomShadowColor()
Gets the color for 'bottom shadows' - those which suggest an area in shadow

setBottomShadowColor

public void setBottomShadowColor(java.awt.Color c)
Sets the color for 'bottom shadows' - those which suggest an area in shadow

getShadowThickness

public int getShadowThickness()
Gets the thickness this component is using for shadows right now

setShadowThickness

public void setShadowThickness(int shadowThickness)
Sets the thickness this component is using for shadows right now

draw3DRect

public void draw3DRect(java.awt.Component c,
                       java.awt.Rectangle r,
                       boolean in)
A routine to draw a 3D rectangle using the object's shadow colours and thickness; pass in the bounding box of the whole object, and the component on which to draw. /in/ determines whether the rectangle is sunken in or extrudes outwards.

draw3DRect

public void draw3DRect(java.awt.Rectangle r,
                       boolean in)
A routine to draw a 3D rectangle in this component using the object's shadow colours and thickness; pass in the bounding box of the whole object. /in/ determines whether the rectangle is sunken in or extrudes outwards.

draw3DRect

public void draw3DRect(java.awt.Graphics g,
                       java.awt.Rectangle r,
                       boolean in)
A routine to draw a 3D rectangle in this component using the object's shadow colours and thickness; pass in the bounding box of the whole object. /in/ determines whether the rectangle is sunken in or extrudes outwards.

draw3DRect

public void draw3DRect(java.awt.Graphics g,
                       java.awt.Component c,
                       java.awt.Rectangle r,
                       boolean in)
A routine to draw a 3D rectangle using the object's shadow colours and thickness; pass in the bounding box of the whole object, and the component on which to draw. /in/ determines whether the rectangle is sunken in or extrudes outwards.

drawShadow

public void drawShadow(java.awt.Graphics g,
                       java.awt.Component c,
                       int x,
                       int y,
                       int length,
                       boolean vertical,
                       boolean reflect,
                       boolean top)
Draws a trapezium, with top right at the point passed in, with a corner cut out of the length and depth of the shadow thickness; eg.
  /~~~~~~~~~~~\
  ~~~~~~~~~~~~~
 
where the slashes are meant to be at 45 degrees, and the height is the shadow thickness. The /length/ parameter determines the longest side's length. The above would be drawn with /vertical/ equal to false and /reflect/ = false. Setting /vertical/ to true would rotate it 90 degrees clockwise. The effect of replfect=true is to reflect the shape in its longest axis. If /top/, the top shadow colour is used; otherwise the bottom shadow is.

drawShadow

public void drawShadow(java.awt.Component c,
                       int x,
                       int y,
                       int length,
                       boolean vertical,
                       boolean reflect,
                       boolean top)
Draws a trapezium, with top right at the point passed in, with a corner cut out of the length and depth of the shadow thickness; eg.
  /~~~~~~~~~~~\
  ~~~~~~~~~~~~~
 
where the slashes are meant to be at 45 degrees, and the height is the shadow thickness. The /length/ parameter determines the longest side's length. The above would be drawn with /vertical/ equal to false and /reflect/ = false. Setting /vertical/ to true would rotate it 90 degrees clockwise. The effect of replfect=true is to reflect the shape in its longest axis. If /top/, the top shadow colour is used; otherwise the bottom shadow is.

Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD