ewe.ui
Class FontChooser

java.lang.Object
  extended byewe.data.DataObject
      extended byewe.data.LiveObject
          extended byewe.ui.FontChooser
All Implemented Interfaces:
Comparable, Copyable, DataUnit, FieldListener, LiveData

public class FontChooser
extends LiveObject


Field Summary
 boolean bold
           
 boolean chooseName
           
 boolean chooseSize
           
 boolean chooseStyle
           
static boolean dontShowDifferentFonts
          If this is set true, then the text in the drop-down menu for Fonts will be in the same Font instead of being rendered in their own face.
 String font
           
protected static Vector fontItems
           
static String[] fonts
           
 boolean italic
           
 int size
           
 boolean underline
           
 
Constructor Summary
FontChooser()
           
FontChooser(boolean chooseStyle)
           
 
Method Summary
 boolean _getSetField(String fieldName, Wrapper wrapper, boolean isGet)
          This is used for data transfer using a ewe.reflect.FieldTransfer object.
 void action(String fieldName, Editor ed)
          This gets called by action(FieldTransfer ft,Editor ed) and by fieldChanged(FieldTransfer ft,Editor ed) if the field changed is a menu item.
 void addToPanel(CellPanel cp, Editor ed, int which)
          Override this to provide the user interface for editing the Object.
 void fieldChanged(String fieldName, Editor ed)
          This gets called by fieldChanged(FieldTransfer ft,Editor ed).
 void fromFont(Font f)
           
protected  ScrollablePanel getEditorScroller(CellPanel cp)
          This is called by the default getEditor() should return a ScrollBarPanel for the CellPanel that the editor is being placed in.
 Font toFont()
           
 
Methods inherited from class ewe.data.LiveObject
action, addMeToPanel, addObjectToPanel, decode, decoded, decodeFields, enableEditorScrolling, encode, encoded, encodeFields, fieldChanged, fieldEvent, getEditor, getIcon, getName, input, makeNewEditor, runAsApp, textDecode, textEncode
 
Methods inherited from class ewe.data.DataObject
appendAllFields, compareTo, copied, copyFrom, equals, getCopy, getDeclaredField, getDeclaredFieldValue, getDeclaredFieldValue, getFieldList, getFieldList, getMyFieldList, getNew
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, toString
 
Methods inherited from interface ewe.data.DataUnit
copyFrom, getNew
 
Methods inherited from interface ewe.util.Copyable
getCopy
 
Methods inherited from interface ewe.util.Comparable
compareTo
 

Field Detail

dontShowDifferentFonts

public static boolean dontShowDifferentFonts
If this is set true, then the text in the drop-down menu for Fonts will be in the same Font instead of being rendered in their own face.


fonts

public static String[] fonts

fontItems

protected static Vector fontItems

size

public int size

font

public String font

bold

public boolean bold

italic

public boolean italic

underline

public boolean underline

chooseStyle

public boolean chooseStyle

chooseSize

public boolean chooseSize

chooseName

public boolean chooseName
Constructor Detail

FontChooser

public FontChooser()

FontChooser

public FontChooser(boolean chooseStyle)
Method Detail

_getSetField

public boolean _getSetField(String fieldName,
                            Wrapper wrapper,
                            boolean isGet)
Description copied from class: DataObject
This is used for data transfer using a ewe.reflect.FieldTransfer object. It is used if the programmer requests a field transfer but there is no such field in the object. In that case the _getSetField() method will be called and the programmer can programatically get/set the field data.

By default this method calls getProperties() and then calls the _getSetField() method in PropertyList.

Overrides:
_getSetField in class DataObject
Parameters:
fieldName - The name of the field.
wrapper - A wrapper containing the data to be assigned to the field or the wrapper into which you should place the field data.
isGet - if this is true then it is a get operation (in which case you should set the wrapper value to be the field value) if it is false it is a set operation and the wrapper contains the field value to assign to the field.
Returns:
the Object should return true if the field data was successfully transfered, false if not.

getEditorScroller

protected ScrollablePanel getEditorScroller(CellPanel cp)
Description copied from class: LiveObject
This is called by the default getEditor() should return a ScrollBarPanel for the CellPanel that the editor is being placed in. By default, this is a ScrollBarPanel except on a SmartPhone, where it will be a VerticalScrollPanel.

You may return null from this.

Overrides:
getEditorScroller in class LiveObject

addToPanel

public void addToPanel(CellPanel cp,
                       Editor ed,
                       int which)
Description copied from class: LiveObject
Override this to provide the user interface for editing the Object. Add all your controls to the CellPanel cp, and your fields to the Editor ed. The options parameter may be used to specify a different Editor for the Object for different situations - it is the same parameter that is passed to the LiveData.getEditor(int options) call.

Overrides:
addToPanel in class LiveObject

fromFont

public void fromFont(Font f)

toFont

public Font toFont()

action

public void action(String fieldName,
                   Editor ed)
Description copied from class: LiveObject
This gets called by action(FieldTransfer ft,Editor ed) and by fieldChanged(FieldTransfer ft,Editor ed) if the field changed is a menu item. By default it will look for a method called void _action(Editor ed) and if it finds it, it will be executed.

Overrides:
action in class LiveObject

fieldChanged

public void fieldChanged(String fieldName,
                         Editor ed)
Description copied from class: LiveObject
This gets called by fieldChanged(FieldTransfer ft,Editor ed). By default it will look for a method called void _changed(Editor ed) and if it finds it, it will be executed.

Overrides:
fieldChanged in class LiveObject