public class ProgramPanel extends JComponent implements ChangeListener, PluginStateListener
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
static int |
X_AXIS
Deprecated.
since 2.7 Use
ProgramPanelSettings.X_AXIS instead |
static int |
Y_AXIS
Deprecated.
since 2.7 Use
ProgramPanelSettings.Y_AXIS instead |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS
Constructor and Description |
---|
ProgramPanel()
Creates a new instance of ProgramPanel.
|
ProgramPanel(boolean showOnlyDateAndTitle)
Deprecated.
Since 2.2.2 Use
ProgramPanel(ProgramPanelSettings) instead. |
ProgramPanel(Program prog)
Creates a new instance of ProgramPanel.
|
ProgramPanel(Program prog,
boolean showOnlyDateAndTitle)
Deprecated.
Since 2.2.2 Use
ProgramPanel(Program, ProgramPanelSettings) instead. |
ProgramPanel(Program prog,
int axis)
Deprecated.
Since 2.7 Use
ProgramPanel(Program, ProgramPanelSettings) instead. |
ProgramPanel(Program prog,
int axis,
boolean showOnlyDateAndTitle)
Deprecated.
Since 2.2.2 Use
ProgramPanel(Program, int, ProgramPanelSettings) instead. |
ProgramPanel(Program prog,
int axis,
ProgramPanelSettings settings)
Creates a new instance of ProgramPanel.
|
ProgramPanel(ProgramPanelSettings settings)
Creates a new instance of ProgramPanel.
|
ProgramPanel(ProgramPanelSettings settings,
int axis)
Deprecated.
Since 2.7 Use
ProgramPanel(ProgramPanelSettings) instead. |
ProgramPanel(Program prog,
ProgramPanelSettings settings)
Creates a new instance of ProgramPanel.
|
Modifier and Type | Method and Description |
---|---|
void |
addNotify()
Called when the panel is added to a container.
|
void |
addPluginContextMenuMouseListener(ContextMenuIf caller)
Adds a MouseListener that shows the plugin context menu when the user does
a right click on the program panel.
|
void |
forceRepaint()
Repaints the complete panel.
|
int |
getHeight()
Gets the height.
|
int |
getMinimumHeight() |
int |
getPreferredHeight()
Gets the preferred height.
|
Program |
getProgram()
Gets the program object of this ProgramPanel.
|
Color |
getTextColor()
Returns the Color of the Text
|
void |
paint(boolean mouse,
boolean isSelected,
Graphics g)
Paints the ProgramPanel
|
void |
paintComponent(Graphics g)
Paints the component.
|
void |
pluginActivated(PluginProxy plugin) |
void |
pluginDeactivated(PluginProxy plugin) |
void |
pluginLoaded(PluginProxy plugin) |
void |
pluginUnloaded(PluginProxy plugin) |
void |
programHasChanged()
Should be called, when the program has changed.
|
void |
removeNotify()
Called when the panel is added to a container.
|
void |
setHeight(int height)
Sets the height of this panel
|
void |
setMaximumHeight() |
void |
setPaintExpiredProgramsPale(boolean value)
Sets if expired programs should be painted pale.
|
void |
setProgram(Program program)
Sets the program this panel shows.
|
void |
setProgram(Program program,
int maxHeight)
Sets the program this panel shows.
|
void |
setProgramPanelSettings(ProgramPanelSettings settings)
Change the settings of this panel.
|
void |
setTextColor(Color col)
Sets the Color of the Text
|
void |
stateChanged(ChangeEvent evt)
Called when the state of the program has changed.
|
static void |
updateColumnWidth()
(Re)Loads the column width settings.
|
static int |
updateColumnWidth(int newOffset) |
static void |
updateFonts()
Reloads the font settings and sets the dynamic font size
to standard font size again
|
static boolean |
updateFonts(int newOffset)
Reloads the font settings and sets a dynamic font size
|
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, 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, updateUI
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, transferFocusDownCycle, validate, validateTree
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, transferFocusBackward, transferFocusUpCycle
public static final int X_AXIS
ProgramPanelSettings.X_AXIS
insteadpublic static final int Y_AXIS
ProgramPanelSettings.Y_AXIS
insteadpublic ProgramPanel()
public ProgramPanel(ProgramPanelSettings settings)
settings
- The settings for this program panel.public ProgramPanel(Program prog)
prog
- The program to show in this panel.public ProgramPanel(Program prog, ProgramPanelSettings settings)
prog
- The program to show in this panel.settings
- The settings for this program panel.public ProgramPanel(Program prog, int axis, ProgramPanelSettings settings)
prog
- The program to show in this panel.axis
- Orientation of ProgressBar (X_AXIS/Y_AXIS)settings
- The settings for this program panel.public ProgramPanel(boolean showOnlyDateAndTitle)
ProgramPanel(ProgramPanelSettings)
instead.showOnlyDateAndTitle
- If this panel should only show date time and title.public ProgramPanel(Program prog, int axis)
ProgramPanel(Program, ProgramPanelSettings)
instead.prog
- The program to show in this panel.axis
- Orientation of ProgressBar (X_AXIS/Y_AXIS)public ProgramPanel(Program prog, boolean showOnlyDateAndTitle)
ProgramPanel(Program, ProgramPanelSettings)
instead.prog
- The program to show in this panel.showOnlyDateAndTitle
- If this panel should only show date time and title.public ProgramPanel(Program prog, int axis, boolean showOnlyDateAndTitle)
ProgramPanel(Program, int, ProgramPanelSettings)
instead.prog
- The program to show in this panel.axis
- Orientation of ProgressBar (X_AXIS/Y_AXIS)showOnlyDateAndTitle
- If this panel should only show date time and title.public ProgramPanel(ProgramPanelSettings settings, int axis)
ProgramPanel(ProgramPanelSettings)
instead.settings
- The settings for this program panel.axis
- The axis of the progress bar.public static boolean updateFonts(int newOffset)
newOffset
- increase or decrease compared to standard font sizepublic static void updateFonts()
public void setProgramPanelSettings(ProgramPanelSettings settings)
settings
- The settings of this panel.public void forceRepaint()
public static void updateColumnWidth()
public static int updateColumnWidth(int newOffset)
public int getPreferredHeight()
It's the height the panel has with a maximum of 3 information rows.
public void setHeight(int height)
height
- public void setMaximumHeight()
public int getHeight()
getHeight
in class JComponent
public void setProgram(Program program)
program
- The program to show in this panel.public void setProgram(Program program, int maxHeight)
program
- The program to show in this panel.maxHeight
- The maximum height the program should have (in pixels).public void paintComponent(Graphics g)
paintComponent
in class JComponent
g
- The graphics context to paint to.public void addNotify()
registers the panel as ChangeListener at the program.
addNotify
in class JComponent
public void removeNotify()
removes the panel as ChangeListener from the program.
removeNotify
in class JComponent
public Program getProgram()
public void addPluginContextMenuMouseListener(ContextMenuIf caller)
caller
- The ContextMenuIf to exclude from the context menu. When
null
no ContextMenuIf is excluded.public void programHasChanged()
If you use this program panel directly (this is the case, when you have added it into a JPanel), you don't have to call this method. This is done automatically.
But if you use this panel just as renderer (e.g. for a list) you have to
register at the programs as ChangeListener and call this method when
ChangeListener.stateChanged(javax.swing.event.ChangeEvent)
was
called.
public void stateChanged(ChangeEvent evt)
repaints the panel.
stateChanged
in interface ChangeListener
evt
- The event describing the change.public void setTextColor(Color col)
col
- Color of the Textpublic Color getTextColor()
public void paint(boolean mouse, boolean isSelected, Graphics g)
mouse
- under a Mouse and needs highlight?isSelected
- IsSelected program?g
- Graphics-Objectpublic int getMinimumHeight()
public void setPaintExpiredProgramsPale(boolean value)
value
- True
if expired programs should be painted pale,
false
otherwise.public void pluginActivated(PluginProxy plugin)
pluginActivated
in interface PluginStateListener
public void pluginDeactivated(PluginProxy plugin)
pluginDeactivated
in interface PluginStateListener
public void pluginLoaded(PluginProxy plugin)
pluginLoaded
in interface PluginStateListener
public void pluginUnloaded(PluginProxy plugin)
pluginUnloaded
in interface PluginStateListener
TV-Browser 2.7.6, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)