superwaba.ext.xplat.ui
Class ImageScroller

java.lang.Object
  |
  +--waba.ui.Control
        |
        +--superwaba.ext.xplat.ui.ImageScroller

public class ImageScroller
extends Control

A control that can show an image bigger than its area and that can be dragged using a pen to show the hidden parts.


Field Summary
 Color borderColor
          Change this member to set the border color to something different of RED.
 
Fields inherited from class waba.ui.Control
AFTER, appId, appObj, asContainer, asWindow, backColor, backDis, BEFORE, BOTTOM, CENTER, clearValueInt, clearValueStr, enabled, FILL, FIT, fm, fmH, focusLess, focusTraversable, font, foreColor, foreDis, height, highlightRectsCount, isHighlighting, LEFT, parent, PREFERRED, RANGE, RIGHT, SAME, TOP, uiCE, uiFlat, uiPalm, uiVista, visible, width, x, x2, y, y2
 
Constructor Summary
ImageScroller()
          Constructs a scroller with no initial image.
ImageScroller(java.lang.String name)
          Constructs a scroller loading the given the fully qualified bmp image name.
 
Method Summary
 int getPreferredHeight()
          Returns the preffered height of this control.
 int getPreferredWidth()
          Returns the preffered width of this control.
protected  void onBoundsChanged()
          Called after a setRect.
 void onEvent(Event event)
          Called to process key, pen, control and other posted events.
 void onPaint(Graphics g)
          Called to draw the control.
 void setImage(Image img)
          Sets the image to the given one
 
Methods inherited from class waba.ui.Control
addTimer, changeHighlighted, clear, contains, createGraphics, drawHighlight, getAbsoluteRect, getBackColor, getFont, getFontMetrics, getForeColor, getNext, getParent, getParentWindow, getPos, getRect, getSize, isDisplayed, isEnabled, isVisible, onColorsChanged, onFontChanged, onWindowPaintFinished, postEvent, removeTimer, repaint, repaintNow, requestFocus, setBackColor, setBackForeColors, setEnabled, setFocusLess, setFont, setForeColor, setRect, setRect, setRect, setVisible, translateFromOrigin, uiStyleChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

borderColor

public Color borderColor
Change this member to set the border color to something different of RED. You may also set it to null if you don't want a border color.
Since:
SuperWaba 5.66
Constructor Detail

ImageScroller

public ImageScroller(java.lang.String name)
Constructs a scroller loading the given the fully qualified bmp image name.

ImageScroller

public ImageScroller()
Constructs a scroller with no initial image. You must set the image with the setImage method.
Method Detail

setImage

public void setImage(Image img)
Sets the image to the given one

onEvent

public void onEvent(Event event)
Description copied from class: Control
Called to process key, pen, control and other posted events.
Overrides:
onEvent in class Control
Tags copied from class: Control
Parameters:
event - the event to process
See Also:
Event, KeyEvent, PenEvent

onBoundsChanged

protected void onBoundsChanged()
Description copied from class: Control
Called after a setRect.
Overrides:
onBoundsChanged in class Control

onPaint

public void onPaint(Graphics g)
Description copied from class: Control
Called to draw the control. When this method is called, the graphics object passed has been translated into the coordinate system of the control and the area behind the control has already been painted. The background is painted by the top-level window control.
Overrides:
onPaint in class Control
Tags copied from class: Control
Parameters:
g - the graphics object for drawing
See Also:
Graphics

getPreferredWidth

public int getPreferredWidth()
Description copied from class: Control
Returns the preffered width of this control.
Overrides:
getPreferredWidth in class Control

getPreferredHeight

public int getPreferredHeight()
Description copied from class: Control
Returns the preffered height of this control.
Overrides:
getPreferredHeight in class Control