|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
extra.inpro.synthesis.visual.SegmentPanel
public class SegmentPanel
a Panel
that displays and handles manipulation of a SegmentModel.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
(package private) java.awt.event.MouseListener |
activateSegmentOrPMOnMousePressed
setup everything so that dragging works |
private static java.awt.Color |
BORDER_COLOR
|
(package private) javax.swing.Action |
changeSegmentAction
the action handling the label-text change of a segment |
(package private) java.awt.event.MouseMotionListener |
cursorManipulator
changes the mouse cursor depending on what can currently be done |
(package private) java.awt.event.MouseListener |
deactiveSegmentOrPMOnMouseReleased
teardown after something has been dragged |
(package private) javax.swing.Action |
deletePitchMarkAction
the action handling the deletion of a pitch mark |
(package private) javax.swing.Action |
deleteSegmentAction
the action handling the deletion of a segment |
private static int |
HEAD_ROOM
|
(package private) javax.swing.Action |
insertPitchMarkAction
the action handling the insertion of a pitch mark |
(package private) javax.swing.Action |
insertSegmentAction
the action handling the insertion of a segment |
(package private) java.awt.event.MouseMotionListener |
mouseDragHandler
handles dragging of segment boundaries and pitch marks |
private static int |
PANEL_HEIGHT
|
private static int |
PITCH_AREA_HEIGHT
|
private static int |
PITCH_AREA_START
|
private static java.awt.Color |
PITCH_BACKGROUND_COLOR
|
private static java.awt.Color |
PITCH_COLOR
|
private static float |
PITCH_HOTSPOT_SIZE
|
(package private) SegmentModel.PitchRange |
pitchRange
the current pitch range, used for auto-scaling of pitch values |
(package private) java.awt.event.MouseListener |
popupHandler
show the right popup which may trigger one of the following actions |
(package private) java.awt.Point |
popupPoint
the point in which a popup event occurred |
(package private) SegmentModel |
segmentModel
the underlying segment model |
(package private) javax.swing.JPopupMenu |
segmentPopup
|
(package private) javax.swing.Action |
synthesisAction
the action to be triggered when something has changed in the segment model that justifies resynthesizing the represented speech |
private static int |
TEXT_BASELINE
|
private static java.awt.Color |
TEXT_COLOR
|
private float |
zoom
the zoom into the segment model |
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.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 | |
---|---|
SegmentPanel(javax.swing.Action synAction,
SegmentModel segmentModel)
|
Method Summary | |
---|---|
(package private) void |
callSynthesis()
|
private int |
getCenter(SegmentModel.Segment l)
|
private int |
getLeftBoundary(SegmentModel.Segment l)
|
private SegmentModel.SegmentBoundPitchMark |
getPitchMarkAtPosition(java.awt.Point p1)
|
private java.util.List<HotSpot<SegmentModel.SegmentBoundPitchMark>> |
getPitchPoints()
|
java.awt.Dimension |
getPreferredSize()
|
private int |
getRightBoundary(SegmentModel.Segment l)
|
private SegmentModel.Segment |
getSegmentAtPosition(int mouseX)
|
(package private) SegmentModel |
getSegmentModel()
|
private boolean |
hasPitchMarkAtPosition(java.awt.Point p1)
|
private boolean |
hasSegmentBoundaryAtPosition(int mouseX)
|
(package private) boolean |
inSegmentArea(java.awt.event.MouseEvent e)
determine whether we're in the segment area or in the pitchmark area |
void |
paintComponent(java.awt.Graphics g)
|
private void |
paintPitchBackground(java.awt.Graphics g)
paint the background |
private void |
paintPitchMarks(java.awt.Graphics g)
handle painting of the pitchmark area |
private void |
paintSegments(java.awt.Graphics g)
handle painting of the segment area |
private int |
pitchForPosition(int mouseY)
|
private int |
positionAtTime(int time)
convert time in ms to position in pixels |
private int |
positionForPitch(int pitch)
|
(package private) void |
setSegmentModel(SegmentModel sm)
|
void |
setZoom(float zoom)
|
private int |
timeAtPosition(int mouseX)
convert position in pixels to time in ms |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, 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, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, 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 |
---|
private static final int PANEL_HEIGHT
private static final int TEXT_BASELINE
private static final int PITCH_AREA_START
private static final int PITCH_AREA_HEIGHT
private static final int HEAD_ROOM
private static final java.awt.Color TEXT_COLOR
private static final java.awt.Color BORDER_COLOR
private static final java.awt.Color PITCH_COLOR
private static final java.awt.Color PITCH_BACKGROUND_COLOR
private static final float PITCH_HOTSPOT_SIZE
SegmentModel segmentModel
SegmentModel.PitchRange pitchRange
final javax.swing.JPopupMenu segmentPopup
java.awt.Point popupPoint
private float zoom
javax.swing.Action synthesisAction
java.awt.event.MouseMotionListener cursorManipulator
java.awt.event.MouseListener activateSegmentOrPMOnMousePressed
java.awt.event.MouseListener deactiveSegmentOrPMOnMouseReleased
java.awt.event.MouseMotionListener mouseDragHandler
java.awt.event.MouseListener popupHandler
javax.swing.Action insertSegmentAction
javax.swing.Action changeSegmentAction
javax.swing.Action deleteSegmentAction
javax.swing.Action insertPitchMarkAction
javax.swing.Action deletePitchMarkAction
Constructor Detail |
---|
public SegmentPanel(javax.swing.Action synAction, SegmentModel segmentModel)
Method Detail |
---|
boolean inSegmentArea(java.awt.event.MouseEvent e)
void callSynthesis()
public void setZoom(float zoom)
SegmentModel getSegmentModel()
void setSegmentModel(SegmentModel sm)
private SegmentModel.Segment getSegmentAtPosition(int mouseX)
private boolean hasSegmentBoundaryAtPosition(int mouseX)
private SegmentModel.SegmentBoundPitchMark getPitchMarkAtPosition(java.awt.Point p1)
private boolean hasPitchMarkAtPosition(java.awt.Point p1)
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
private java.util.List<HotSpot<SegmentModel.SegmentBoundPitchMark>> getPitchPoints()
private void paintPitchBackground(java.awt.Graphics g)
private void paintPitchMarks(java.awt.Graphics g)
private void paintSegments(java.awt.Graphics g)
public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
private int getLeftBoundary(SegmentModel.Segment l)
private int getRightBoundary(SegmentModel.Segment l)
private int getCenter(SegmentModel.Segment l)
private int timeAtPosition(int mouseX)
private int positionAtTime(int time)
private int positionForPitch(int pitch)
private int pitchForPosition(int mouseY)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |