org.thdl.tib.input
Class Jskad

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--org.thdl.tib.input.Jskad
All Implemented Interfaces:
Accessible, DocumentListener, EventListener, ImageObserver, MenuContainer, Serializable

public class Jskad
extends JPanel
implements DocumentListener

A simple Tibetan text editor. Jskad editors lack most of the functionality of a word-processor, but they do provide multiple keyboard input methods, as well as conversion routines to go back and forth between Extended Wylie and TibetanMachineWeb.

Jskad embeds DuffPane, which is the editing window where the keyboard logic and most functionality is housed.

Depending on the object passed to the constructor, a Jskad object can be used in either an application or an applet.

Author:
Edward Garrett, Tibetan and Himalayan Digital Library
See Also:
Serialized Form

Nested Class Summary
private  class Jskad.RTFFilter
           
private  class Jskad.TXTFilter
           
 
Field Summary
 org.thdl.tib.input.DuffPane dp
          The text editing window which this Jskad object embeds.
private static String enableKeypressStatusProp
          the name of the property a developer should set to see low-level info on how keypresses in "Tibetan" input mode are being interpreted
private  JFileChooser fileChooser
           
 String fileName
          The filename, if any, associated with this instance of Jskad.
private  JComboBox fontFamilies
           
private  int fontSize
           
private  JComboBox fontSizes
           
 boolean hasChanged
          Has the document been saved since it was last changed?
private static org.thdl.tib.input.JskadKeyboardManager keybdMgr
          the middleman that keeps code regarding Tibetan keyboards clean
private static int numberOfTibsRTFOpen
           
private  Object parentObject
           
private  FileFilter rtfFilter
           
private  org.thdl.util.StatusBar statusBar
          the status bar for this frame
private  FileFilter txtFilter
           
private static int x_size
           
private static int y_size
           
 
Fields inherited from class javax.swing.JPanel
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
 
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
private Jskad()
          Do not use this JPanel constructor.
private Jskad(boolean isDB)
          Do not use this JPanel constructor.
private Jskad(LayoutManager lm)
          Do not use this JPanel constructor.
private Jskad(LayoutManager lm, boolean isDB)
          Do not use this JPanel constructor.
  Jskad(Object parent)
           
 
Method Summary
 void changedUpdate(DocumentEvent de)
          Required for implementations of DocumentListener.
private  boolean checkSave()
           
private  void copySelection()
           
private  void cutSelection()
           
 void disableRoman()
          Disables typing of Roman (non-Tibetan) text.
 void enableRoman()
          Enables typing of Roman (non-Tibetan) text along with Tibetan.
private  void getPreferences()
           
private  String getSave(String f_name)
           
private  String getSaveAs()
           
private  void importWylie()
           
 void insertUpdate(DocumentEvent de)
          Required for implementations of DocumentListener.
static void main(String[] args)
          Runs Jskad.
 void makeDependent()
          Allows use of Jskad as dependent JFrame.
private  void newFile()
           
private  void openFile()
           
private  void pasteSelection()
           
 void removeUpdate(DocumentEvent de)
          Required for implementations of DocumentListener.
private  void saveAsFile()
           
private  void saveFile()
           
private static void savePreferencesAction()
          Saves user preferences to disk if possible.
 void setContent(String wylie)
          Fills the editing pane with content.
private  void toTibetan()
           
private  void toWylie()
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

enableKeypressStatusProp

private static final String enableKeypressStatusProp
the name of the property a developer should set to see low-level info on how keypresses in "Tibetan" input mode are being interpreted

See Also:
Constant Field Values

keybdMgr

private static final org.thdl.tib.input.JskadKeyboardManager keybdMgr
the middleman that keeps code regarding Tibetan keyboards clean


fontFamilies

private JComboBox fontFamilies

fontSizes

private JComboBox fontSizes

fileChooser

private JFileChooser fileChooser

rtfFilter

private FileFilter rtfFilter

txtFilter

private FileFilter txtFilter

fontSize

private int fontSize

parentObject

private Object parentObject

numberOfTibsRTFOpen

private static int numberOfTibsRTFOpen

x_size

private static int x_size

y_size

private static int y_size

dp

public org.thdl.tib.input.DuffPane dp
The text editing window which this Jskad object embeds.


hasChanged

public boolean hasChanged
Has the document been saved since it was last changed?


fileName

public String fileName
The filename, if any, associated with this instance of Jskad.


statusBar

private org.thdl.util.StatusBar statusBar
the status bar for this frame

Constructor Detail

Jskad

private Jskad()
Do not use this JPanel constructor.


Jskad

private Jskad(boolean isDB)
Do not use this JPanel constructor.


Jskad

private Jskad(LayoutManager lm)
Do not use this JPanel constructor.


Jskad

private Jskad(LayoutManager lm,
              boolean isDB)
Do not use this JPanel constructor.


Jskad

public Jskad(Object parent)
Parameters:
parent - the object that embeds this instance of Jskad. Supported objects include JFrames and JApplets. If the parent is a JApplet then the File menu is omitted from the menu bar.
Method Detail

savePreferencesAction

private static void savePreferencesAction()
Saves user preferences to disk if possible.


getPreferences

private void getPreferences()

newFile

private void newFile()

openFile

private void openFile()

saveFile

private void saveFile()

saveAsFile

private void saveAsFile()

checkSave

private boolean checkSave()

getSave

private String getSave(String f_name)

getSaveAs

private String getSaveAs()

cutSelection

private void cutSelection()

copySelection

private void copySelection()

pasteSelection

private void pasteSelection()

toTibetan

private void toTibetan()

toWylie

private void toWylie()

importWylie

private void importWylie()

makeDependent

public void makeDependent()
Allows use of Jskad as dependent JFrame. Once you've called this method, users will be able to close Jskad without shutting down your superordinate application.


setContent

public void setContent(String wylie)
Fills the editing pane with content. If the editing pane already has content, this method does nothing.

Parameters:
wylie - the string of wylie you want to put in the editing pane

enableRoman

public void enableRoman()
Enables typing of Roman (non-Tibetan) text along with Tibetan.


disableRoman

public void disableRoman()
Disables typing of Roman (non-Tibetan) text.


changedUpdate

public void changedUpdate(DocumentEvent de)
Required for implementations of DocumentListener. Does nothing.

Specified by:
changedUpdate in interface DocumentListener

insertUpdate

public void insertUpdate(DocumentEvent de)
Required for implementations of DocumentListener. Informs the object that a change in the document has occurred.

Specified by:
insertUpdate in interface DocumentListener
Parameters:
de - a DocumentEvent

removeUpdate

public void removeUpdate(DocumentEvent de)
Required for implementations of DocumentListener. Informs the object that a change in the document has occurred.

Specified by:
removeUpdate in interface DocumentListener
Parameters:
de - a DocumentEvent

main

public static void main(String[] args)
Runs Jskad. System output, including errors, is redirected to jskad.log in addition to appearing on the console as per usual. If you discover a bug, please send us an email, making sure to include the jskad.log file as an attachment.



These API docs were created 02/02/2003 08:20 PM.
Copyright © 2001-2002 Tibetan and Himalayan Digital Library. All Rights Reserved.
Hosted by SourceForge_Logo