|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Canvas
com.sshtools.ui.awt.ImageCanvas
public class ImageCanvas
Simple component to draw an image. The image can be either centered in the container or
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.Canvas |
|---|
java.awt.Canvas.AccessibleAWTCanvas |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static int |
CENTERED
Centered in container |
static int |
STRETCH
Resize to take up all space allocated to component |
| 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 | |
|---|---|
ImageCanvas()
Construct a new image canvas |
|
ImageCanvas(java.lang.Class cls,
java.lang.String image)
Construct a new image canvas given a Class from which the
Classloader can be determined, and the resource name. |
|
ImageCanvas(java.awt.Image image)
Construct a new image canvas |
|
| Method Summary | |
|---|---|
int |
getBorder()
Get the border width around the image |
java.awt.Color |
getBorderColor()
Get the border color |
java.awt.Image |
getImage()
Set the image to display |
java.awt.Dimension |
getMinimumSize()
|
java.awt.Dimension |
getPreferredSize()
|
int |
getScale()
Get the scale. |
boolean |
isDoubleBuffered()
|
void |
paint(java.awt.Graphics g)
|
void |
setBorder(int border)
Set the border width around the image |
void |
setBorderColor(java.awt.Color borderColor)
Set the border color |
void |
setDoubleBuffered(boolean doubleBuffered)
|
void |
setHalign(float halign)
Set the horizontal alignment |
void |
setImage(java.awt.Image image)
Set the image to display |
void |
setScale(int scale)
Set the scale. |
void |
setValign(float valign)
Set the vertical alignment |
void |
update(java.awt.Graphics g)
|
| Methods inherited from class java.awt.Canvas |
|---|
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int CENTERED
public static final int STRETCH
| Constructor Detail |
|---|
public ImageCanvas()
Construct a new image canvas
public ImageCanvas(java.awt.Image image)
Construct a new image canvas
iamge - image
public ImageCanvas(java.lang.Class cls,
java.lang.String image)
Construct a new image canvas given a Class from which the
Classloader can be determined, and the resource name. The
image will be centered in the container.
cls - name of imagescale - scale| Method Detail |
|---|
public void setValign(float valign)
f - vertical alignmentpublic void setHalign(float halign)
f - horizontal alignmentpublic void setBorder(int border)
border - borderpublic int getBorder()
public java.awt.Color getBorderColor()
public void setBorderColor(java.awt.Color borderColor)
borderColor - border colorpublic void setScale(int scale)
Set the scale. Can be one of
ImageCanvas.STRETCHImageCanvas.CENTERED
scale - scalepublic int getScale()
Get the scale. Can be one of
ImageCanvas.STRETCHImageCanvas.CENTERED
public void setImage(java.awt.Image image)
image - public java.awt.Image getImage()
public void update(java.awt.Graphics g)
update in class java.awt.Canvaspublic boolean isDoubleBuffered()
isDoubleBuffered in class java.awt.Componentpublic void setDoubleBuffered(boolean doubleBuffered)
public void paint(java.awt.Graphics g)
paint in class java.awt.Canvaspublic java.awt.Dimension getPreferredSize()
getPreferredSize in class java.awt.Componentpublic java.awt.Dimension getMinimumSize()
getMinimumSize in class java.awt.Component
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||