|
||||||||||
| 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
net.luniks.jtvd.TitleMenuPanel
JPanel providing the UI for JTVD with that a simple title menu can be created. It consists of a scrollable drawing area with a popup menu and some buttons. It contains the logic that creates the images for the menu and executes the command to create audio and video streams
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
private javax.swing.JMenuItem |
addTextMenuItem
|
private javax.swing.JButton |
addTitlesButton
|
private javax.swing.ImageIcon |
addTitlesIcon
|
private javax.swing.JMenuItem |
arrangeMenuItem
|
private int |
aspect
|
static int |
ASPECT_16TO9
|
static int |
ASPECT_4TO3
|
private javax.swing.JButton |
audioButton
|
private TitleMenuAudioDialog |
audioDialog
|
private javax.swing.ImageIcon |
audioIcon
|
private javax.swing.JButton |
cancelButton
|
private javax.swing.ImageIcon |
cancelIcon
|
private javax.swing.JPanel |
controlPanel
|
private boolean |
createMenuCanceled
|
private boolean |
createMenuError
|
private boolean |
createStartedLocally
|
private javax.swing.JMenuItem |
deleteMenuItem
|
static java.lang.String |
FILE_AUDIO
|
static java.lang.String |
FILE_BACKGROUND
|
static java.lang.String |
FILE_HIGHLIGHT
|
static java.lang.String |
FILE_MENU
|
static java.lang.String |
FILE_MPEG2
|
static java.lang.String |
FILE_SELECT
|
static java.lang.String |
FILE_SPUCONF
|
static java.lang.String |
FILE_VIDEO
|
private int |
imageHeight
|
private ImagePanel |
imagePanel
|
private int |
imageWidth
|
private JTVDFrame |
mainFrame
|
static java.lang.String |
MENU
|
private java.awt.event.MouseListener |
mousePressedListener
|
private int |
norm
|
static int |
NORM_NTSC
|
static int |
NORM_PALSECAM
|
private java.awt.Dimension |
panelSize
|
private javax.swing.JPopupMenu |
popupMenu
|
private java.awt.Point |
popupMenuLocation
|
private javax.swing.JScrollPane |
scrollPane
|
static java.awt.Dimension |
SIZE_NTSC
|
static java.awt.Dimension |
SIZE_PAL
|
static java.awt.Dimension |
SIZE_SMALL
|
private javax.swing.JMenuItem |
sizeNTSCMenuItem
|
private javax.swing.JMenuItem |
sizePALMenuItem
|
private javax.swing.JMenuItem |
sizeSmallMenuItem
|
private javax.swing.JButton |
styleButton
|
private TitleMenuStyleDialog |
styleDialog
|
private javax.swing.ImageIcon |
styleIcon
|
private javax.swing.JMenuItem |
styleMenuItem
|
private javax.swing.JButton |
testButton
|
private javax.swing.ImageIcon |
testIcon
|
private javax.swing.JButton |
textButton
|
private javax.swing.ImageIcon |
textIcon
|
private javax.swing.JMenuItem |
textMenuItem
|
private javax.swing.JMenuItem |
titleMenuItem
|
private java.io.File |
workDir
|
| 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 | |
TitleMenuPanel(JTVDFrame frame)
Initializes the components, creates the layout, sets up action listeners and so on. |
|
| Method Summary | |
private void |
addTextItemAction()
Called when the user chooses "Add Text" from the popup menu and adds a (text) item at the location of the popup menu |
private void |
addTitlesAction()
Called when the user clicks on the button "Add Titles" and prompts for confirmation if any existing menu items should be replaced, and then calls setTitlesFromTitlePanel() |
private void |
arrangeItemAction()
Called when the user chooses "Arrange" from the popup menu and arranges the menu items |
private void |
audioAction()
Called when the user chooses "Audio..." from the popup menu or clicks on the "Audio..." button and brings up the audio dialog |
private void |
calcPanelSize()
Modifies the panelSize instance variable used for
holding the size of the drawing area to fit the current aspect
ratio by keeping the height and modifying the width accordingly |
void |
cancel()
Canceles the current process and sets the instance variable createMenuCanceled to true |
private void |
cancelAction()
Called when the user presses the "Cancel" button and cancels any menu-creating process immediately with exception for the creation of the images which cannot be cancelled. |
void |
create(boolean test)
Calls the relevant methods in order to create the menu. |
private void |
createAction()
Called when the users presses "Test" and starts the menu creation after checking if there is any other process running in which case it will pop up a message and return |
private void |
createImages()
Calls the relevant methods to create the background, highlight and select images for the menu |
private void |
createMenu(boolean test)
Creates and runs the processes for creating an audio and video stream, multiplexing audio and video and adding the subtitles. |
private void |
createSpuconf()
Creates the configuration file for spuconf |
private void |
deleteItemAction()
Called when the user chooses "Delete" while a "deleteable" item is selected and deletes that item |
ImagePanel |
getImagePanel()
Returns the reference to the ImagePanel used as drawing area |
private void |
popupAction(java.awt.event.MouseEvent me)
Called when when the user right-clicks on the drawing. |
void |
setAspect(int aspect)
Sets the aspect ratio of the panel used as drawing area to the ratio given as argument after calculating the dimensions according to the current size |
void |
setNorm(int norm)
Sets the size of the menu images according to the video norm given as argument. |
void |
setPanelSize(java.awt.Dimension size)
Sets the size of the panel used as drawing area to the size given as argument after calculating the dimensions according to the current aspect ratio |
void |
setTitlesFromTitlePanel()
Creates one menu item for each title the user has marked to be included in the DVD, adds them to the drawing area and arranges them. |
void |
setWorkDir(java.io.File dir)
Sets the directory in which the menu and all temporary files are created. |
private void |
styleAction()
Called when the user chooses "Style..." from the popup menu or clicks on the "Style..." button and brings up the style dialog |
private void |
textAction()
Called when the user chooses "Text..." from the popup menu or clicks on the "Text..." button while an item is selected and brings up the dialog prompting the user for the new text for the item. |
void |
updateUI()
Updates the current look and feel by calling SwingUtilities.updateComponentTreeUI() for all components
in this class that are not affected by the same call for this class
because they are not child components of this class |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI |
| 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 |
private JTVDFrame mainFrame
public static final java.lang.String MENU
public static final java.lang.String FILE_BACKGROUND
public static final java.lang.String FILE_HIGHLIGHT
public static final java.lang.String FILE_SELECT
public static final java.lang.String FILE_SPUCONF
public static final java.lang.String FILE_AUDIO
public static final java.lang.String FILE_VIDEO
public static final java.lang.String FILE_MPEG2
public static final java.lang.String FILE_MENU
public static final java.awt.Dimension SIZE_SMALL
public static final java.awt.Dimension SIZE_NTSC
public static final java.awt.Dimension SIZE_PAL
public static final int ASPECT_4TO3
public static final int ASPECT_16TO9
public static final int NORM_PALSECAM
public static final int NORM_NTSC
private ImagePanel imagePanel
private javax.swing.JPanel controlPanel
private javax.swing.JScrollPane scrollPane
private javax.swing.JPopupMenu popupMenu
private javax.swing.JMenuItem titleMenuItem
private javax.swing.JMenuItem addTextMenuItem
private javax.swing.JMenuItem textMenuItem
private javax.swing.JMenuItem styleMenuItem
private javax.swing.JMenuItem arrangeMenuItem
private javax.swing.JMenuItem sizeSmallMenuItem
private javax.swing.JMenuItem sizeNTSCMenuItem
private javax.swing.JMenuItem sizePALMenuItem
private javax.swing.JMenuItem deleteMenuItem
private java.awt.Point popupMenuLocation
private TitleMenuStyleDialog styleDialog
private TitleMenuAudioDialog audioDialog
private javax.swing.JButton addTitlesButton
private javax.swing.JButton textButton
private javax.swing.JButton styleButton
private javax.swing.JButton audioButton
private javax.swing.JButton testButton
private javax.swing.JButton cancelButton
private javax.swing.ImageIcon addTitlesIcon
private javax.swing.ImageIcon textIcon
private javax.swing.ImageIcon styleIcon
private javax.swing.ImageIcon audioIcon
private javax.swing.ImageIcon testIcon
private javax.swing.ImageIcon cancelIcon
private java.awt.event.MouseListener mousePressedListener
private int imageWidth
private int imageHeight
private java.awt.Dimension panelSize
private int aspect
private int norm
private java.io.File workDir
private boolean createMenuError
private boolean createMenuCanceled
private boolean createStartedLocally
| Constructor Detail |
public TitleMenuPanel(JTVDFrame frame)
frame - reference to the main application window| Method Detail |
public void setNorm(int norm)
norm - the norm of the menu to be createdpublic void setPanelSize(java.awt.Dimension size)
size - the new size of the drawing areapublic void setAspect(int aspect)
aspect - the new aspect ration of the drawing areapublic ImagePanel getImagePanel()
ImagePanel used as drawing area
ImagePanel instanceprivate void calcPanelSize()
panelSize instance variable used for
holding the size of the drawing area to fit the current aspect
ratio by keeping the height and modifying the width accordingly
public void setWorkDir(java.io.File dir)
dir - the working directory used for the menu creationpublic void setTitlesFromTitlePanel()
private void popupAction(java.awt.event.MouseEvent me)
private void addTitlesAction()
setTitlesFromTitlePanel()
private void addTextItemAction()
private void arrangeItemAction()
private void deleteItemAction()
private void styleAction()
private void audioAction()
private void textAction()
private void cancelAction()
private void createAction()
public void create(boolean test)
test - if this is a test or notpublic void cancel()
createMenuCanceled to true
private void createImages()
throws java.lang.Exception
java.lang.Exception
private void createSpuconf()
throws java.lang.Exception
spuconf
java.lang.Exception
private void createMenu(boolean test)
throws java.lang.Exception
TitleMenuCommands
The boolean argument is used to indicate if after menu creation has
completed, the user should be asked if he/she wants to view the created
video or not.
java.lang.Exceptionpublic void updateUI()
SwingUtilities.updateComponentTreeUI() for all components
in this class that are not affected by the same call for this class
because they are not child components of this class
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||