Package org.omegat.gui.matches
Class MatchesTextArea
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.text.JTextComponent
-
- javax.swing.JEditorPane
-
- javax.swing.JTextPane
-
- org.omegat.gui.common.EntryInfoPane<T>
-
- org.omegat.gui.common.EntryInfoThreadPane<java.util.List<NearString>>
-
- org.omegat.gui.matches.MatchesTextArea
-
- All Implemented Interfaces:
java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,javax.accessibility.Accessible
,javax.swing.Scrollable
,IEntryEventListener
,IProjectEventListener
,IMatcher
,IPaneMenu
public class MatchesTextArea extends EntryInfoThreadPane<java.util.List<NearString>> implements IMatcher, IPaneMenu
This is a Match pane, that displays fuzzy matches.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.text.JTextComponent
javax.swing.text.JTextComponent.AccessibleJTextComponent, javax.swing.text.JTextComponent.DropLocation, javax.swing.text.JTextComponent.KeyBinding
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
-
Nested classes/interfaces inherited from interface org.omegat.core.events.IProjectEventListener
IProjectEventListener.PROJECT_CHANGE_TYPE
-
-
Field Summary
-
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
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
-
Fields inherited from interface org.omegat.util.gui.IPaneMenu
PROPERTY_PANE_MENU_ACTION_LISTENER
-
-
Constructor Summary
Constructors Constructor Description MatchesTextArea(IMainWindow mw)
Creates new form MatchGlossaryPane
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears up the pane.NearString
getActiveMatch()
Get selected match.void
onEntryActivated(SourceTextEntry newEntry)
Called on new entry activated or current entry deactivated.void
populatePaneMenu(javax.swing.JPopupMenu menu)
void
setActiveMatch(int activeMatch)
Sets the index of an active match.void
setNextActiveMatch()
Make the next match activevoid
setPrevActiveMatch()
Make the previous match activejava.lang.String
substituteNumbers(java.lang.String source, java.lang.String sourceMatch, java.lang.String targetMatch)
Attempts to substitute numbers in a match with numbers from the source segment.-
Methods inherited from class org.omegat.gui.common.EntryInfoThreadPane
onNewFile, onProjectChanged
-
Methods inherited from class org.omegat.gui.common.EntryInfoPane
setEditable
-
Methods inherited from class javax.swing.JTextPane
addStyle, getCharacterAttributes, getInputAttributes, getLogicalStyle, getParagraphAttributes, getStyle, getStyledDocument, getUIClassID, insertComponent, insertIcon, removeStyle, replaceSelection, setCharacterAttributes, setDocument, setEditorKit, setLogicalStyle, setParagraphAttributes, setStyledDocument
-
Methods inherited from class javax.swing.JEditorPane
addHyperlinkListener, createEditorKitForContentType, fireHyperlinkUpdate, getAccessibleContext, getContentType, getEditorKit, getEditorKitClassNameForContentType, getEditorKitForContentType, getHyperlinkListeners, getPage, getPreferredSize, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getText, read, registerEditorKitForContentType, registerEditorKitForContentType, removeHyperlinkListener, scrollToReference, setContentType, setEditorKitForContentType, setPage, setPage, setText
-
Methods inherited from class javax.swing.text.JTextComponent
addCaretListener, addInputMethodListener, addKeymap, copy, cut, getActions, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getDropLocation, getDropMode, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPreferredScrollableViewportSize, getPrintable, getScrollableBlockIncrement, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, modelToView2D, moveCaretPosition, paste, print, print, print, read, removeCaretListener, removeKeymap, removeNotify, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setDropMode, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setUI, updateUI, viewToModel, viewToModel2D, write
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Constructor Detail
-
MatchesTextArea
public MatchesTextArea(IMainWindow mw)
Creates new form MatchGlossaryPane
-
-
Method Detail
-
onEntryActivated
public void onEntryActivated(SourceTextEntry newEntry)
Description copied from interface:IEntryEventListener
Called on new entry activated or current entry deactivated.- Specified by:
onEntryActivated
in interfaceIEntryEventListener
- Overrides:
onEntryActivated
in classEntryInfoThreadPane<java.util.List<NearString>>
- Parameters:
newEntry
- new entry instance which activated, or null if entry deactivated
-
getActiveMatch
public NearString getActiveMatch()
Get selected match. Must be called from UI thread only.- Specified by:
getActiveMatch
in interfaceIMatcher
-
substituteNumbers
public java.lang.String substituteNumbers(java.lang.String source, java.lang.String sourceMatch, java.lang.String targetMatch)
Attempts to substitute numbers in a match with numbers from the source segment. For substitution to be done, the number of numbers must be the same between source and matches, and the numbers must be the same between the source match and the target match. The order of the numbers can be different between the source match and the target match. Numbers will be substituted at the correct location.- Specified by:
substituteNumbers
in interfaceIMatcher
- Parameters:
source
- The source segmentsourceMatch
- The source of the matchtargetMatch
- The target of the match- Returns:
- The target match with numbers possibly substituted
-
setActiveMatch
public void setActiveMatch(int activeMatch)
Sets the index of an active match. It basically highlights the fuzzy match string selected. (numbers start from 0)- Specified by:
setActiveMatch
in interfaceIMatcher
- Parameters:
activeMatch
- new active match Must be called from UI thread only.
-
clear
public void clear()
Clears up the pane.- Overrides:
clear
in classEntryInfoPane<java.util.List<NearString>>
-
setNextActiveMatch
public void setNextActiveMatch()
Make the next match active- Specified by:
setNextActiveMatch
in interfaceIMatcher
-
setPrevActiveMatch
public void setPrevActiveMatch()
Make the previous match active- Specified by:
setPrevActiveMatch
in interfaceIMatcher
-
populatePaneMenu
public void populatePaneMenu(javax.swing.JPopupMenu menu)
- Specified by:
populatePaneMenu
in interfaceIPaneMenu
-
-