com.tekann.ui
Class BlobBean

java.lang.Object
  extended by totalcross.ui.gfx.GfxSurface
      extended by totalcross.ui.Control
          extended by totalcross.ui.Container
              extended by com.tekann.ui.Bean
                  extended by com.tekann.ui.BlobBean
All Implemented Interfaces:
IBean

public class BlobBean
extends Bean

BLOB's control.

Author:
guilherme

Field Summary
protected  totalcross.ui.Button btnFileChooser
          File chooser's button.
static byte CANCEL_FILE_OPTION
           
static byte CLEAR_FILE_OPTION
           
protected  totalcross.ui.dialog.FileChooserBox fcb
           
protected  totalcross.ui.ImageControl imcBlob
          ImageControl to show BLOB data.
static int MAX_FILE_LEGTH
          Max file length (10MB).
 java.lang.String rootFilePath
          The root from where the tree will be mounted.
static byte SELECT_FILE_OPTION
           
 boolean showAsImage
          Flag to show loaded data as image.
 int volume
          The volume used in Palm OS only.
 int xGap
          X gap.
 int yGap
          Y gap.
 
Fields inherited from class totalcross.ui.Container
alwaysEraseBackground, BORDER_LOWERED, BORDER_NONE, BORDER_RAISED, BORDER_SIMPLE, children, finishedStart, ignoreOnAddAgain, ignoreOnRemove, insets, lastH, lastScreenWidth, lastW, lastX, lastY, started, tabOrder, tail
 
Fields inherited from class totalcross.ui.Control
AFTER, appId, appObj, asContainer, asWindow, backColor, BEFORE, BOTTOM, BOTTOM_OF, CENTER, CENTER_OF, clearValueInt, clearValueStr, enabled, enableUpdateScreen, FILL, FIT, fm, fmH, focusHandler, focusLess, focusOnPenDown, focusTraversable, font, foreColor, height, isHighlighting, KEEP, LEFT, onEventFirst, parent, PREFERRED, RANGE, repositionAllowed, RIGHT, RIGHT_OF, SAME, setFont, setH, setRel, setW, setX, setY, TOP, transparentBackground, uiCE, uiFlat, uiPalm, uiVista, visible, width, WILL_RESIZE, x, y
 
Constructor Summary
BlobBean()
           
 
Method Summary
 void clear()
           
protected  java.lang.String getCancelFileLabel()
           
protected  java.lang.String getClearFileLabel()
           
 byte[] getData()
           
protected  java.lang.String getDefaultIconPath()
          Icon's path for default icon when showAsImage is disabled.
protected  totalcross.ui.dialog.FileChooserBox.Filter getFileFilter()
          Get default file filter.
protected  java.lang.String getOpenFileChooserIconPath()
          File chooser's icon path.
 int getPreferredHeight()
           
 int getPreferredWidth()
           
 java.lang.String[] getProperties()
          Property list.
 java.lang.Object getProperty(java.lang.String propertyName)
          Get a property value.
protected  java.lang.String getSelectedFileLabel()
           
protected  void initImage()
           
 void initUI()
           
protected  void loadBlobImage()
           
protected  void loadDefaultImage()
           
protected  void loadNullImage()
           
 void onEvent(totalcross.ui.event.Event evt)
           
protected  void pathButtonEventAction(totalcross.ui.event.Event evt)
          Event action method for pathButton
 void setBackColor(int c)
           
 void setData(byte[] data)
           
 void setFileChooser(totalcross.ui.dialog.FileChooserBox fileChooser)
           
 void setProperty(java.lang.String propertyName, java.lang.Object property)
          Set a property value.
protected  int showFileChooserAction(java.lang.String filePath)
          Show a file chooser.
 void showMessage(java.lang.String title, java.lang.String message)
          Show a message to the user.
 
Methods inherited from class totalcross.ui.Container
add, add, add, add, add, broadcastEvent, findChild, findNextFocusControl, getBorderStyle, getChildren, getClientRect, getClientRect, getFocusableControls, getInsets, incLastX, incLastY, onAddAgain, onColorsChanged, onPaint, onRemove, paintChildren, remove, removeAll, resize, resizeHeight, resizeWidth, setBorderStyle, setEnabled, setHighlighting, setInsets, swapToTopmostWindow
 
Methods inherited from class totalcross.ui.Control
_onEvent, addFocusListener, addGridListener, addHighlightListener, addKeyListener, addPenListener, addPressListener, addTimer, addTimer, addTimerListener, addWindowListener, changeHighlighted, contains, getAbsoluteRect, getBackColor, getEventListeners, getFont, getForeColor, getGraphics, getHeight, getNext, getParent, getParentWindow, getPos, getPressedEvent, getPrev, getRect, getSize, getWidth, getX, getX2, getY, getY2, handleGeographicalFocusChangeKeys, isDisplayed, isEnabled, isVisible, isVisibleAndInside, onBoundsChanged, onFontChanged, onWindowPaintFinished, postEvent, postPressedEvent, removeListener, removeTimer, repaint, repaintNow, reposition, reposition, requestFocus, setBackForeColors, setFocusLess, setFont, setForeColor, setRect, setRect, setRect, setRect, setVisible, translateFromOrigin, uiStyleChanged, updateScreen, updateTemporary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

btnFileChooser

protected totalcross.ui.Button btnFileChooser
File chooser's button.


imcBlob

protected totalcross.ui.ImageControl imcBlob
ImageControl to show BLOB data.


showAsImage

public boolean showAsImage
Flag to show loaded data as image.


xGap

public int xGap
X gap.


yGap

public int yGap
Y gap.


fcb

protected totalcross.ui.dialog.FileChooserBox fcb

SELECT_FILE_OPTION

public static final byte SELECT_FILE_OPTION
See Also:
Constant Field Values

CANCEL_FILE_OPTION

public static final byte CANCEL_FILE_OPTION
See Also:
Constant Field Values

CLEAR_FILE_OPTION

public static final byte CLEAR_FILE_OPTION
See Also:
Constant Field Values

MAX_FILE_LEGTH

public static final int MAX_FILE_LEGTH
Max file length (10MB).

See Also:
Constant Field Values

volume

public int volume
The volume used in Palm OS only.
Usually 1 is the NVFS volume, and 2 is the card slot.


rootFilePath

public java.lang.String rootFilePath
The root from where the tree will be mounted.

Constructor Detail

BlobBean

public BlobBean()
Method Detail

clear

public void clear()
Overrides:
clear in class totalcross.ui.Container

initUI

public void initUI()
Overrides:
initUI in class totalcross.ui.Container

getDefaultIconPath

protected java.lang.String getDefaultIconPath()
Icon's path for default icon when showAsImage is disabled.

Returns:
A String

getOpenFileChooserIconPath

protected java.lang.String getOpenFileChooserIconPath()
File chooser's icon path.

Returns:
A String

initImage

protected final void initImage()

loadBlobImage

protected void loadBlobImage()
                      throws totalcross.ui.image.ImageException,
                             totalcross.io.IOException
Throws:
totalcross.ui.image.ImageException
totalcross.io.IOException

loadDefaultImage

protected void loadDefaultImage()
                         throws totalcross.ui.image.ImageException,
                                totalcross.io.IOException
Throws:
totalcross.ui.image.ImageException
totalcross.io.IOException

loadNullImage

protected void loadNullImage()

onEvent

public void onEvent(totalcross.ui.event.Event evt)
Overrides:
onEvent in class totalcross.ui.Control

pathButtonEventAction

protected void pathButtonEventAction(totalcross.ui.event.Event evt)
Event action method for pathButton


setData

public void setData(byte[] data)

showFileChooserAction

protected int showFileChooserAction(java.lang.String filePath)
Show a file chooser. Returns a String, the selected file.


getSelectedFileLabel

protected java.lang.String getSelectedFileLabel()

getCancelFileLabel

protected java.lang.String getCancelFileLabel()

getClearFileLabel

protected java.lang.String getClearFileLabel()

showMessage

public void showMessage(java.lang.String title,
                        java.lang.String message)
Show a message to the user.


getPreferredHeight

public int getPreferredHeight()
Overrides:
getPreferredHeight in class totalcross.ui.Control

getPreferredWidth

public int getPreferredWidth()
Overrides:
getPreferredWidth in class totalcross.ui.Control

getProperties

public java.lang.String[] getProperties()
Description copied from interface: IBean
Property list.

Returns:
A String array

getData

public byte[] getData()

getFileFilter

protected totalcross.ui.dialog.FileChooserBox.Filter getFileFilter()
Get default file filter. Files with size > MAX_FILE_LEGTH not be listed.

Returns:
A Filter

getProperty

public java.lang.Object getProperty(java.lang.String propertyName)
Description copied from interface: IBean
Get a property value.

Returns:
An Object

setBackColor

public void setBackColor(int c)
Overrides:
setBackColor in class totalcross.ui.Control

setFileChooser

public void setFileChooser(totalcross.ui.dialog.FileChooserBox fileChooser)

setProperty

public void setProperty(java.lang.String propertyName,
                        java.lang.Object property)
Description copied from interface: IBean
Set a property value.