|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Window | +--java.awt.Frame | +--javax.swing.JFrame | +--guk.editIM.EditIM
EditIM.java in guk.editIM: An Editor for Input Methods (for their keymap files, that is). Main file of the Input Method Editor.
Inner classes inherited from class javax.swing.JFrame |
javax.swing.JFrame.AccessibleJFrame |
Inner classes inherited from class java.awt.Frame |
java.awt.Frame.AccessibleAWTFrame |
Inner classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock |
Field Summary | |
(package private) javax.swing.JToggleButton |
blockIMButton
The button to select NONE as the current GUK IM. |
(package private) FileCommands |
fileCommandProcessor
the fileCommandProcessor is responsible for reading, writing and merging files into the editor. |
(package private) javax.swing.JFrame |
frame
The frame that we are. |
(package private) javax.swing.JPanel |
glyphBar
The glyphBar is a whole panel where another class can create additional user interface elements. |
(package private) javax.swing.JButton |
glyphButton
a button that serves as a glyph preview window. |
(package private) char |
glyphChar
The char that is currently visible on the glyph preview button. |
(package private) LocaleHotkey[] |
hotkeys
Ten buttons, each selecting ONE of the GUK IMs as the IM that is used to edit the tables and the jumpField. |
(package private) java.lang.Object |
imControl
Have a global InputMethod control object for virtual keyboard control and maybe other things. |
(package private) java.util.List |
installedLocales
We collect lists of installed locales and unicode ranges here. |
(package private) javax.swing.JTextField |
jumpField
Here, the user can enter a glyph or a glyph number, preferrably in \\u12ab syntax, to scroll to that glyph. |
(package private) MenuHelpers |
menu
The MenuHelpers class provides functions like creating menu items and buttons. |
(package private) javax.swing.JLabel |
statusBar
A status bar, and the frame that represents the this-object. |
(package private) EditIMPopups |
subMenuProcessor
the subMenuProcessor is used to display some sub menus. |
(package private) javax.swing.JTable |
table1
The first table is implemented in GlyphTable.java as data model. |
(package private) javax.swing.JTable |
table2
The second table (for many to many compositions, using the data model defined in StringTable.java). |
Fields inherited from class javax.swing.JFrame |
accessibleContext, defaultCloseOperation, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
base, CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, frameSerializedDataVersion, HAND_CURSOR, icon, ICONIFIED, mbManagement, menuBar, MOVE_CURSOR, N_RESIZE_CURSOR, nameCounter, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, ownedWindows, resizable, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, serialVersionUID, state, SW_RESIZE_CURSOR, TEXT_CURSOR, title, W_RESIZE_CURSOR, WAIT_CURSOR, weakThis |
Fields inherited from class java.awt.Window |
active, dbg, focusMgr, inputContext, inputContextLock, OPENED, ownedWindowList, showWithParent, warningString, windowListener, windowSerializedDataVersion |
Fields inherited from class java.awt.Container |
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads |
Fields inherited from class java.awt.Component |
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y |
Fields inherited from interface javax.swing.WindowConstants |
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
EditIM(java.awt.Font unifont,
java.awt.im.spi.InputMethodDescriptor iMDesc,
java.awt.im.spi.InputMethod iM,
java.awt.Frame pFrame)
The constructor calls methods to build the look and feel |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
This collects all user activity in form of events, parses it, and distributes it as needed. |
private void |
connectIM(java.awt.im.spi.InputMethodDescriptor iMDesc,
java.awt.im.spi.InputMethod iM)
Init IM connection and Locale list. |
private void |
editIMFeelInit()
Here we add the FUNCTIONALITY to the menu items, if not done already in editIMLookInit(). |
private void |
editIMLookInit(java.awt.Font unifont)
Here we pile up lots of menu items in front of the user. |
static void |
main(java.lang.String[] args)
main - to allow running of the Input Method Editor as standalone. |
protected void |
processWindowEvent(java.awt.event.WindowEvent e)
Overridden so that we can exit when window is closed. |
(package private) void |
updateGlyphButton(char glyph)
Shows a new glyph on the glyph button and updates the related action command and tool tip. |
void |
updateTitle()
A classical method: set the title depending on whether the edited document is changed (and should be saved before leaving the Input Method Editor). |
void |
valueChanged(javax.swing.event.ListSelectionEvent e)
If the user has selected some table1 row, update the glyph button. |
Methods inherited from class javax.swing.JFrame |
addImpl, createRootPane, createRootPaneException, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Frame |
|
Methods inherited from class java.awt.Window |
addOwnedWindow, addWindowListener, adjustListeningChildren, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, dispose, eventEnabled, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isActive, isShowing, nextFocus, ownedInit, pack, postEvent, postWindowEvent, preProcessKeyEvent, processEvent, removeOwnedWindow, removeWindowListener, resetGC, setCursor, setFocusOwner, setWarningString, show, toBack, toFront, transferFocus |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, numListening, paint, paintComponents, paintHeavyweightComponents, postsOldMouseEvents, preferredSize, print, printComponents, printHeavyweightComponents, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, removeAll, removeContainerListener, setFont, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
Field Detail |
javax.swing.JTextField jumpField
javax.swing.JToggleButton blockIMButton
LocaleHotkey[] hotkeys
javax.swing.JButton glyphButton
javax.swing.JPanel glyphBar
char glyphChar
javax.swing.JTable table1
GlyphTable
javax.swing.JTable table2
StringTable
javax.swing.JLabel statusBar
javax.swing.JFrame frame
java.util.List installedLocales
java.lang.Object imControl
EditIMPopups subMenuProcessor
FileCommands fileCommandProcessor
MenuHelpers menu
Constructor Detail |
public EditIM(java.awt.Font unifont, java.awt.im.spi.InputMethodDescriptor iMDesc, java.awt.im.spi.InputMethod iM, java.awt.Frame pFrame)
unifont
- is a Unicode-capable font. If null, a default
font will be used (with the help of the FontLoader).iMDesc
- an input method descriptor to be used, or null,
which will cause the editor to connect to GUK IM itself.iM
- an input method object to connect to. If null, the
editor will request one itself.pFrame
- the frame to which the user should be able to
send key events, using the type to client function. If null,
type to client will not be available.Method Detail |
private void connectIM(java.awt.im.spi.InputMethodDescriptor iMDesc, java.awt.im.spi.InputMethod iM)
iMDesc
- An input method descriptor, or null. If null,
we will open connection to GUK IM ourselves, and also ignore
the iM parameter.iM
- An input method, or null. When null, several features
will not be available!private void editIMLookInit(java.awt.Font unifont) throws java.lang.Exception
unifont
- Several items will use this font and assume
that it can display all Unicode chars. If null, a default
font will be loaded with the help of FontLoader
.java.lang.Exception
- If anything goes wrong, the Exception
will be passed on to the caller.private void editIMFeelInit() throws java.lang.Exception
java.lang.Exception
- If anything goes wrong, the Exception
will simply be passed on to the caller.void updateGlyphButton(char glyph)
glyph
- The Unicode character which should be associated
to the glyph button GUI component.public void updateTitle()
public void actionPerformed(java.awt.event.ActionEvent e)
One actionPerformed method where all the events meet :-) This also dispatches events to other parts of EditIM. It calls actionPerformed rather than processEvent to bypass unnecessary processing. Please READ THE CODE to know which commands are parsed by which of the EditIM classes!
Things that are handled directly here: addcharif char - append char to table2 selected row, left column, IF a row is selected. Be careful not to disturb editing sessions in table2. Use "addchar row char" command which itself is interpreted by table2/processCommand... activatelocale locale (not file) - activate locale for our IM (do not edit, just activate it as our InputContext IM). (also "clicks" the newly assigned first button) selectlocale locale - as activatelocale, but without click setlocalebuttonlocale button locale - just call appropriate hotkeys[...].loadlocale(Locale). ... Things that use the "checked" boolean value: showvirtualkeyboard tracking - enable/disable normal GUK IM virtual keyboard (shows the mapping for the current state) showvirtualkeyboard type - enable extended GUK virtual keyboard of special type (e.g. "what-happens-when Ctrl-Alt-something is pressed") - NOT IMPLEMENTED (not even in GUK!). blockimusage where - disable usage of IM in our input context (where value ignored). Only the system keyboard driver is used in that mode for table and jumpfield editing. exit localeeditor - leave this editor, by dispose or by exit, depending on whether there is a parent Frame.
actionPerformed
in interface java.awt.event.ActionListener
public void valueChanged(javax.swing.event.ListSelectionEvent e)
valueChanged
in interface javax.swing.event.ListSelectionListener
protected void processWindowEvent(java.awt.event.WindowEvent e)
processWindowEvent
in class javax.swing.JFrame
e
- A window event, telling us about closing,
iconifying, activation, similar things.public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |