TV-Browser 3.3.3 API

tvbrowser.ui.programtable
Class ProgramTable

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by tvbrowser.ui.programtable.ProgramTable
All Implemented Interfaces:
java.awt.dnd.DragGestureListener, java.awt.dnd.DragSourceListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.Scrollable, PluginStateListener, ProgramTableModelListener, ProgramContextMenuListener, ProgramMouseActionListener, ProgramMouseAndContextMenuListener

public class ProgramTable
extends javax.swing.JPanel
implements ProgramTableModelListener, java.awt.dnd.DragGestureListener, java.awt.dnd.DragSourceListener, PluginStateListener, javax.swing.Scrollable, ProgramMouseAndContextMenuListener

Author:
Til Schneider, www.murfman.de
See Also:
Serialized Form

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
 
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
ProgramTable(ProgramTableModel model, java.awt.event.KeyListener keyListener)
          Creates a new instance of ProgramTable.
 
Method Summary
 void addNotify()
           
 void clearTimeMarkings()
           
 void closePopupMenuIfVisible()
          Closes the PopupMenu menu if it is visible.
 void deSelectItem()
          Deselect the selected program.
 Program deSelectItem(boolean getProgram)
          Deselect the selected program.
 void down()
          Go to the program under the current program.
 void dragDropEnd(java.awt.dnd.DragSourceDropEvent dsde)
           
 void dragEnter(java.awt.dnd.DragSourceDragEvent dsde)
           
 void dragExit(java.awt.dnd.DragSourceEvent dse)
           
 void dragGestureRecognized(java.awt.dnd.DragGestureEvent evt)
           
 void dragOver(java.awt.dnd.DragSourceDragEvent dsde)
           
 void dropActionChanged(java.awt.dnd.DragSourceDragEvent dsde)
           
 void forceRepaintAll()
           
 BackgroundPainter getBackgroundPainter()
           
 int getColumnWidth()
           
 ProgramTableModel getModel()
           
 java.awt.Dimension getPreferredScrollableViewportSize()
           
 java.awt.Dimension getPreferredSize()
           
 Program getProgramAt(int x, int y)
           
 Program getProgramForMouseEvent(java.awt.event.MouseEvent e)
          Gets the program to use for a mouse action.
 ProgramTableLayout getProgramTableLayout()
           
 int getScrollableBlockIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
           
 boolean getScrollableTracksViewportHeight()
           
 boolean getScrollableTracksViewportWidth()
           
 int getScrollableUnitIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
           
protected  int getTimeY(int minutesAfterMidnight)
          get the average Y coordinate of the center of the program panels of all columns where the program is running at the given time
 java.lang.String getToolTipText(java.awt.event.MouseEvent event)
           
 void handleKeyboardAction(ContextMenuIf action)
           
 boolean isSelected()
           
 void left()
          Go to the left program of the current program.
 void markTime(int time)
           
 void mouseEventActionFinished()
          Called when MouseEventAction was finished.
 void paintComponent(java.awt.Graphics grp)
           
 void pluginActivated(PluginProxy plugin)
           
 void pluginDeactivated(PluginProxy plugin)
           
 void pluginLoaded(PluginProxy plugin)
           
 void pluginUnloaded(PluginProxy plugin)
           
 void removeNotify()
           
 void right()
          Go to the right program of the current program.
 void runCallback()
          runs the Runnable callback that scrolls to the wanted place in the ProgramTable
 void scrollBy(int deltaX, int deltaY)
           
 void selectItemAt(int pointX, int pointY)
          Selects the program at the point(x,y)
 void selectProgram(Program program)
          Select (highlight) a program in the program table.
 void setColumnWidth(int columnWidth)
           
protected  void setModel(ProgramTableModel model)
           
 void setProgramTableLayout(ProgramTableLayout layout)
           
 void showContextMenu(java.awt.event.MouseEvent e)
          Show a context menu on the triggered event.
 boolean stopAutoScroll()
           
 void tableCellUpdated(int col, int row)
           
 void tableDataChanged(java.lang.Runnable callback)
           
 void togglePopupFromKeyboard()
          Toggles visibility of the PopupMenu for the selected program.
 void up()
          Go to the program on top of the current program.
 void updateBackground()
           
 void updateLayout()
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, 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, 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, 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
 

Constructor Detail

ProgramTable

public ProgramTable(ProgramTableModel model,
                    java.awt.event.KeyListener keyListener)
Creates a new instance of ProgramTable.

Parameters:
model - program table model to use in the program table
keyListener - The key listener for FAYT.
Method Detail

setModel

protected void setModel(ProgramTableModel model)

getModel

public ProgramTableModel getModel()

getProgramTableLayout

public ProgramTableLayout getProgramTableLayout()

setProgramTableLayout

public void setProgramTableLayout(ProgramTableLayout layout)

setColumnWidth

public void setColumnWidth(int columnWidth)

getColumnWidth

public int getColumnWidth()

updateBackground

public void updateBackground()

getBackgroundPainter

public BackgroundPainter getBackgroundPainter()

paintComponent

public void paintComponent(java.awt.Graphics grp)
Overrides:
paintComponent in class javax.swing.JComponent

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class javax.swing.JComponent

markTime

public void markTime(int time)

clearTimeMarkings

public void clearTimeMarkings()

getProgramAt

public Program getProgramAt(int x,
                            int y)

forceRepaintAll

public void forceRepaintAll()

updateLayout

public void updateLayout()

scrollBy

public void scrollBy(int deltaX,
                     int deltaY)

stopAutoScroll

public boolean stopAutoScroll()

getTimeY

protected int getTimeY(int minutesAfterMidnight)
get the average Y coordinate of the center of the program panels of all columns where the program is running at the given time

Parameters:
minutesAfterMidnight -
Returns:
y offset

runCallback

public void runCallback()
runs the Runnable callback that scrolls to the wanted place in the ProgramTable


tableDataChanged

public void tableDataChanged(java.lang.Runnable callback)
Specified by:
tableDataChanged in interface ProgramTableModelListener

tableCellUpdated

public void tableCellUpdated(int col,
                             int row)
Specified by:
tableCellUpdated in interface ProgramTableModelListener

closePopupMenuIfVisible

public void closePopupMenuIfVisible()
Closes the PopupMenu menu if it is visible.


togglePopupFromKeyboard

public void togglePopupFromKeyboard()
Toggles visibility of the PopupMenu for the selected program.


handleKeyboardAction

public void handleKeyboardAction(ContextMenuIf action)

right

public void right()
Go to the right program of the current program.


up

public void up()
Go to the program on top of the current program.


down

public void down()
Go to the program under the current program.


left

public void left()
Go to the left program of the current program.


deSelectItem

public void deSelectItem()
Deselect the selected program.


deSelectItem

public Program deSelectItem(boolean getProgram)
Deselect the selected program.

Parameters:
getProgram - If the current selected program should be returned.
Returns:
The formally selected program or null if there was no selected program.

selectItemAt

public void selectItemAt(int pointX,
                         int pointY)
Selects the program at the point(x,y)

Parameters:
pointX - X position of the point
pointY - Y position of the point

dragGestureRecognized

public void dragGestureRecognized(java.awt.dnd.DragGestureEvent evt)
Specified by:
dragGestureRecognized in interface java.awt.dnd.DragGestureListener

dragEnter

public void dragEnter(java.awt.dnd.DragSourceDragEvent dsde)
Specified by:
dragEnter in interface java.awt.dnd.DragSourceListener

dragOver

public void dragOver(java.awt.dnd.DragSourceDragEvent dsde)
Specified by:
dragOver in interface java.awt.dnd.DragSourceListener

dropActionChanged

public void dropActionChanged(java.awt.dnd.DragSourceDragEvent dsde)
Specified by:
dropActionChanged in interface java.awt.dnd.DragSourceListener

dragExit

public void dragExit(java.awt.dnd.DragSourceEvent dse)
Specified by:
dragExit in interface java.awt.dnd.DragSourceListener

dragDropEnd

public void dragDropEnd(java.awt.dnd.DragSourceDropEvent dsde)
Specified by:
dragDropEnd in interface java.awt.dnd.DragSourceListener

selectProgram

public void selectProgram(Program program)
Select (highlight) a program in the program table. This will deselect any other programs.

Parameters:
program - the program to select
Since:
2.6

addNotify

public void addNotify()
Overrides:
addNotify in class javax.swing.JComponent

removeNotify

public void removeNotify()
Overrides:
removeNotify in class javax.swing.JComponent

pluginActivated

public void pluginActivated(PluginProxy plugin)
Specified by:
pluginActivated in interface PluginStateListener

pluginDeactivated

public void pluginDeactivated(PluginProxy plugin)
Specified by:
pluginDeactivated in interface PluginStateListener

pluginLoaded

public void pluginLoaded(PluginProxy plugin)
Specified by:
pluginLoaded in interface PluginStateListener

pluginUnloaded

public void pluginUnloaded(PluginProxy plugin)
Specified by:
pluginUnloaded in interface PluginStateListener

getPreferredScrollableViewportSize

public java.awt.Dimension getPreferredScrollableViewportSize()
Specified by:
getPreferredScrollableViewportSize in interface javax.swing.Scrollable

getScrollableBlockIncrement

public int getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
                                       int orientation,
                                       int direction)
Specified by:
getScrollableBlockIncrement in interface javax.swing.Scrollable

getScrollableTracksViewportHeight

public boolean getScrollableTracksViewportHeight()
Specified by:
getScrollableTracksViewportHeight in interface javax.swing.Scrollable

getScrollableTracksViewportWidth

public boolean getScrollableTracksViewportWidth()
Specified by:
getScrollableTracksViewportWidth in interface javax.swing.Scrollable

getScrollableUnitIncrement

public int getScrollableUnitIncrement(java.awt.Rectangle visibleRect,
                                      int orientation,
                                      int direction)
Specified by:
getScrollableUnitIncrement in interface javax.swing.Scrollable

getToolTipText

public java.lang.String getToolTipText(java.awt.event.MouseEvent event)
Overrides:
getToolTipText in class javax.swing.JComponent

isSelected

public boolean isSelected()

getProgramForMouseEvent

public Program getProgramForMouseEvent(java.awt.event.MouseEvent e)
Description copied from interface: ProgramMouseActionListener
Gets the program to use for a mouse action.

Specified by:
getProgramForMouseEvent in interface ProgramMouseActionListener
Parameters:
e - The mouse event that was triggered for a user mouse interaction.
Returns:
The program that was affected by the user mouse interaction or null if no program was affected.

mouseEventActionFinished

public void mouseEventActionFinished()
Description copied from interface: ProgramMouseActionListener
Called when MouseEventAction was finished.

Specified by:
mouseEventActionFinished in interface ProgramMouseActionListener

showContextMenu

public void showContextMenu(java.awt.event.MouseEvent e)
Description copied from interface: ProgramContextMenuListener
Show a context menu on the triggered event.

Specified by:
showContextMenu in interface ProgramContextMenuListener
Parameters:
e - The MouseEvent that has triggered the popup event.

TV-Browser 3.3.3 API

TV-Browser 3.3.3, Copyright (C) 2004-2008 TV-Browser Team (dev@tvbrowser.org)