|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--com.sun.jimi.core.component.JimiCanvasLW
An java.awt.Canvas
for easily displaying any image in a J.I.M.I. supported
image format, or any java.awt.Image
. Subclasses will support using this as a Bean.
The following features exist :
java.net.URL
or a java.awt.Image
Field Summary | |
static int |
AREA_AVERAGING
One of two possible scaling mode policies. |
static int |
BEST_FIT
One of three possible resizing policies. |
static int |
CENTER
One of nine possilbe justification policies. |
static int |
CROP_AS_NECESSARY
One of three possible resizing policies. |
static int |
EAST
One of nine possible justification policies. |
static int |
FIT_TO_WIDTH
|
protected int |
justificationPolicy
One of eight possible imageJustifications. |
protected java.awt.Image |
myImage
The java.awt.Image that this JimiCanvas represents. |
protected java.net.URL |
myImageLocation
Tells J.I.M.I. where to load myImage from. |
static int |
NORTH
One of nine possible justification policies. |
static int |
NORTHEAST
One of nine possible justification policies. |
static int |
NORTHWEST
One of nine possible justification policies. |
static int |
REPLICATE
One of two possible scaling mode policies. |
protected int |
resizePolicy
One of three possible resize policies. |
static int |
SCALE
One of three possible resizing policies. |
protected int |
scalingPolicy
One of two possible scaling policies. |
static int |
SCROLL
|
static int |
SOUTH
One of nine possible justification policies. |
static int |
SOUTHEAST
One of nine possible justification policies. |
static int |
SOUTHWEST
One of nine possible justification policies. |
static int |
WEST
One of nine possible justification policies. |
protected boolean |
willSizeToFit
This JimiCanvas will automatically resize to fit the
Image if true. |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Constructor Summary | |
JimiCanvasLW()
No argument constructor for use in beanboxes. |
|
JimiCanvasLW(java.awt.Image anImage)
Create me |
|
JimiCanvasLW(java.net.URL aLocation)
Create me |
Method Summary | |
protected java.awt.Image |
getCacheImage()
|
java.awt.Image |
getImage()
The image that this canvas is currently displaying. |
java.net.URL |
getImageLocation()
Where J.I.M.I. should look to find the image. |
int |
getJustificationPolicy()
Which of the nine justification policies we use to place the image on the canvas return One of nine justification policies |
java.awt.Dimension |
getPreferredSize()
If 'willSizeToFit', ask for the size of the image. |
int |
getResizePolicy()
Do we crop the image, scale it, or scale it so that it fits best? |
int |
getScalingPolicy()
Retrieve the scaling mode currently in effect. |
boolean |
getWillSizeToFit()
If true, the canvas will resize itself so that it exactly fits the canvas. |
protected void |
LoadImage()
We've been given an imageLocation, and we want to pull the image from that location by using J.I.M.I. to do it. |
void |
paint(java.awt.Graphics g)
|
void |
setFitWidth(int width)
Set the width to be used for FIT_TO_WIDTH. |
void |
setImage(java.awt.Image anImage)
We can explicitly set an Image instead of relying upon J.I.M.I. to load it. |
void |
setImageLocation(java.net.URL newLocation)
Where should J.I.M.I. look to find the image? This value need not be set, and is mutually exclusive with setImage . |
void |
setJustificationPolicy(int newPolicy)
Which of the nine justification policies we use to place the image on the canvas |
void |
setResizePolicy(int newPolicy)
Do we crop the image, scale it, or scale it so that it fits best? |
void |
setScalingPolicy(int newPolicy)
Set the scaling mode for this canvas. |
void |
setWillSizeToFit(boolean newPolicy)
If true, the canvas will resize itself so that it exactly fits the the canvas. |
void |
update(java.awt.Graphics g)
|
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
addNotify,
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,
getHeight,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocation,
getLocationOnScreen,
getMaximumSize,
getMinimumSize,
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,
processInputMethodEvent,
processKeyEvent,
processMouseEvent,
processMouseMotionEvent,
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,
validate |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int EAST
setJustificationPolicy
public static final int NORTH
setJustificationPolicy
public static final int NORTHEAST
setJustificationPolicy
public static final int NORTHWEST
setJustificationPolicy
public static final int SOUTH
setJustificationPolicy
public static final int SOUTHEAST
setJustificationPolicy
public static final int SOUTHWEST
setJustificationPolicy
public static final int WEST
setJustificationPolicy
public static final int CENTER
setJustificationPolicy
public static final int BEST_FIT
setResizePolicy
,
CROP_AS_NECESSARY
,
SCALE
public static final int CROP_AS_NECESSARY
setResizePolicy
,
BEST_FIT
,
SCALE
public static final int SCALE
setResizePolicy
,
BEST_FIT
,
CROP_AS_NECESSARY
public static final int SCROLL
public static final int FIT_TO_WIDTH
public static final int AREA_AVERAGING
setScalingPolicy
,
REPLICATE
public static final int REPLICATE
setScalingPolicy
,
AREA_AVERAGING
protected transient java.awt.Image myImage
java.awt.Image
that this JimiCanvas
represents.setImage
,
loadImage
,
getImage
protected java.net.URL myImageLocation
myImage
from. This
value may be null if you wish to explicitly set myImage
.setImage
,
setImageLocation
,
getImageLocation
,
loadImage
protected boolean willSizeToFit
JimiCanvas
will automatically resize to fit the
Image
if true.getWillResize
,
setWillResize
protected int justificationPolicy
getImageJustification
,
setJustificationPolicy
protected int resizePolicy
getResizePolicy
,
setResizePolicy
protected int scalingPolicy
getScalingPolicy
,
setScalingPolicy
Constructor Detail |
public JimiCanvasLW()
public JimiCanvasLW(java.awt.Image anImage)
anImage
- The image to displaysetImage
public JimiCanvasLW(java.net.URL aLocation)
aLocation
- Where to load the image using J.I.M.I. fromsetImageLocation
Method Detail |
protected void LoadImage()
setImageLocation
,
setImage
public void setFitWidth(int width)
public void setJustificationPolicy(int newPolicy)
newPolicy
- The new justification policyCENTER
,
NORTH
,
NORTHEAST
,
EAST
,
SOUTHEAST
,
SOUTH
,
SOUTHWEST
,
WEST
,
NORTHWEST
public int getJustificationPolicy()
CENTER
,
NORTH
,
NORTHEAST
,
EAST
,
SOUTHEAST
,
SOUTH
,
SOUTHWEST
,
WEST
,
NORTHWEST
public void setResizePolicy(int newPolicy)
newPolicy
- One of three policies which specify how to fit the
image into the canvasCROP_AS_NECESSARY
,
SCALE
,
BEST_FIT
public int getResizePolicy()
CROP_AS_NECESSARY
,
SCALE
,
BEST_FIT
public void setScalingPolicy(int newPolicy)
newPolicy
- One of two policies which specify how to scale the
image into the canvasAREA_AVERAGING
,
REPLICATE
public int getScalingPolicy()
AREA_AVERAGING
,
REPLICATE
public void setWillSizeToFit(boolean newPolicy)
newPolicy
- If true, will resize the canvas to fit the new imagesetImage
,
setImageLocation
public boolean getWillSizeToFit()
public void setImageLocation(java.net.URL newLocation)
setImage
.
setImagetakes precedence.newLocation
- Where J.I.M.I. should go to find
the imagegetImageLocation
,
setImage
,
getImage
public java.net.URL getImageLocation()
setImage
this value may be null
setImageLocation
,
setImage
,
getImage
public void setImage(java.awt.Image anImage)
setImage
takes precedence over setImageLocation
anImage
- The java.awt.Image
that we wish to displaysetImageLocation
,
getImageLocation
,
getImage
public java.awt.Image getImage()
setImage
,
setImageLocation
,
getImageLocation
public java.awt.Dimension getPreferredSize()
public void update(java.awt.Graphics g)
protected java.awt.Image getCacheImage()
public void paint(java.awt.Graphics g)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |