T
- the type of the dateline modelpublic abstract class AbstractDatelineRenderer<T extends IDatelineModel> extends JLabel implements IDatelineRenderer<T>
Dateline.setDatelineRenderer(Class, IDatelineRenderer)
,
Serialized FormJLabel.AccessibleJLabel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Modifier | Constructor and Description |
---|---|
protected |
AbstractDatelineRenderer()
Constructs a new dateline renderer and initializes the forground and
background colors for calendar entries that are of type or subclasses of
WeekendCalendarEntry and HolidayCalendarEntry . |
Modifier and Type | Method and Description |
---|---|
void |
firePropertyChange(String propertyName,
boolean oldValue,
boolean newValue)
Overriden for performance reasons.
|
void |
firePropertyChange(String propertyName,
byte oldValue,
byte newValue)
Overriden for performance reasons.
|
void |
firePropertyChange(String propertyName,
char oldValue,
char newValue)
Overriden for performance reasons.
|
void |
firePropertyChange(String propertyName,
double oldValue,
double newValue)
Overriden for performance reasons.
|
void |
firePropertyChange(String propertyName,
float oldValue,
float newValue)
Overriden for performance reasons.
|
void |
firePropertyChange(String propertyName,
long oldValue,
long newValue)
Overriden for performance reasons.
|
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
Overriden for performance reasons.
|
void |
firePropertyChange(String propertyName,
short oldValue,
short newValue)
Overriden for performance reasons.
|
protected Color |
getCalendarBackground(ICalendarModel calendarModel,
IDatelineModel datelineModel,
long time)
Returns a background color for the given time point, calendar model and
dateline model.
|
Color |
getCalendarEntryBackground(Class calendarEntryType)
Returns the background color that will be used for drawing time spans
that intersect with calendar entries of the given type.
|
Color |
getCalendarEntryForeground(Class calendarEntryType)
Returns the foreground color that will be used for drawing time spans
that intersect with calendar entries of the given type.
|
protected Color |
getCalendarForeground(ICalendarModel calendarModel,
IDatelineModel datelineModel,
long time)
Returns a foreground color for the given time point, calendar model and
dateline model.
|
Dateline |
getDateline()
Returns the dateline for which rendering currently takes place.
|
Component |
getDatelineRendererComponent(Dateline dateline,
T model,
ITimeSpan timeSpan,
boolean major,
boolean focus)
Returns the renderer component that will be used by the dateline to
render a time span that can be located on the major or the minor part of
the dateline.
|
Color |
getFocusBackground()
Returns the background color that will be used for drawing a time span
when the time span has the focus (the mouse cursor hovers on top of the
time span).
|
Color |
getFocusForeground()
Returns the foreground color that will be used for drawing a time span
when the time span has the focus (the mouse cursor hovers on top of the
time span).
|
Icon |
getIcon()
Returns the icon used by the renderer.
|
protected Color |
getMajorBackground(Dateline dateline,
long date)
Returns the background color for the given time point that is placed on
the upper (the major) part of the dateline.
|
protected Color |
getMajorForeground(Dateline dateline,
long date)
Returns the foreground color for the given time point that is placed on
the upper (the major) part of the dateline.
|
protected Color |
getMinorBackground(Dateline dateline,
long date)
Returns the background color for the given time point that is placed on
the lower (the minor) part of the dateline.
|
protected Color |
getMinorForeground(Dateline dateline,
long date)
Returns the foreground color for the given time point that is placed on
the lower (the minor) part of the dateline.
|
T |
getModel()
Returns the dateline model that returned the time span that is currently
being rendered.
|
String |
getText()
Returns the text that will be shown by the renderer in the currently
drawn time span cell.
|
ITimeSpan |
getTimeSpan()
Returns the time span that is currently being rendered.
|
boolean |
hasFocus()
Determines whether the currently rendered time span (cell) is the focus
owner.
|
void |
invalidate()
Overriden for performance reasons.
|
boolean |
isFocusedTimeVisible()
Determines whether the renderer will visualize which time span currently
has the focus.
|
boolean |
isMajor()
Returns TRUE if the currently rendered time span (cell) is located in the
upper (major) section of the dateline.
|
boolean |
isVisible()
Overriden in order to fix a bug in AWT, which causes the cursor to
flicker during drag and drop operations.
|
void |
repaint()
Overriden for performance reasons.
|
void |
repaint(int x,
int y,
int width,
int height)
Overriden for performance reasons.
|
void |
repaint(long tm)
Overriden for performance reasons.
|
void |
revalidate()
Overriden for performance reasons.
|
void |
setCalendarEntryBackground(Class calendarEntryType,
Color color)
Sets the background color that will be used for drawing time spans that
intersect with calendar entries of the given type.
|
void |
setCalendarEntryForeground(Class calendarEntryType,
Color color)
Sets the foreground color that will be used for drawing time spans that
intersect with calendar entries of the given type.
|
void |
setFocusBackground(Color color)
Sets the background color that will be used for drawing a time span when
the time span has the focus (the mouse cursor hovers on top of the time
span).
|
void |
setFocusedTimeVisible(boolean visible)
Specifies whether the renderer will visualize which time span currently
has the focus.
|
void |
setFocusForeground(Color color)
Sets the foreground color that will be used for drawing a time span when
the time span has the focus (the mouse cursor hovers on top of the time
span).
|
void |
setIcon(Icon icon)
Sets the icon used by the renderer.
|
void |
setText(String text)
Sets the text that will be shown by the renderer in the currently drawn
time span cell.
|
void |
validate()
Overriden for performance reasons.
|
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIconTextGap, getLabelFor, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIconTextGap, setLabelFor, setUI, setVerticalAlignment, setVerticalTextPosition, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, 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, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, 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, 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
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, 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, 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, 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, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected AbstractDatelineRenderer()
WeekendCalendarEntry
and HolidayCalendarEntry
.setCalendarEntryForeground(Class, Color)
,
setCalendarEntryBackground(Class, Color)
public void setFocusedTimeVisible(boolean visible)
visible
- if true the cell with the focused time span will have a
different background color (default is TRUE)Dateline.getFocusBackground()
public boolean isFocusedTimeVisible()
Dateline.getFocusBackground()
public Component getDatelineRendererComponent(Dateline dateline, T model, ITimeSpan timeSpan, boolean major, boolean focus)
getDatelineRendererComponent
in interface IDatelineRenderer<T extends IDatelineModel>
dateline
- the dateline componentmodel
- the dateline model that returned / specified the given time
spantimeSpan
- the time span to rendermajor
- a flag that signals whether the time span is located on the
upper or the lower part of the datelinefocus
- a flag indicating whether the time span has the focusprotected Color getMajorForeground(Dateline dateline, long date)
dateline
- the component in which the time span will be renderereddate
- the start time of the time spangetMinorForeground(Dateline, long)
,
getMajorBackground(Dateline, long)
protected Color getMajorBackground(Dateline dateline, long date)
dateline
- the component in which the time span will be renderereddate
- the start time of the time spangetMinorBackground(Dateline, long)
,
getMajorForeground(Dateline, long)
protected Color getMinorForeground(Dateline dateline, long date)
dateline
- the component in which the time span will be renderereddate
- the start time of the time spangetFocusForeground()
,
getCalendarForeground(ICalendarModel, IDatelineModel, long)
,
getMinorBackground(Dateline, long)
,
getMajorForeground(Dateline, long)
,
getCalendarEntryForeground(Class)
protected Color getMinorBackground(Dateline dateline, long date)
dateline
- the component in which the time span will be renderereddate
- the start time of the time spangetFocusForeground()
,
getCalendarForeground(ICalendarModel, IDatelineModel, long)
,
getMinorBackground(Dateline, long)
,
getMajorForeground(Dateline, long)
,
getCalendarEntryForeground(Class)
protected Color getCalendarForeground(ICalendarModel calendarModel, IDatelineModel datelineModel, long time)
calendarModel
- the Gantt chart's calendar modeldatelineModel
- the model used by the datelinetime
- the time point for which to return a foreground colorgetCalendarEntryForeground(Class)
protected Color getCalendarBackground(ICalendarModel calendarModel, IDatelineModel datelineModel, long time)
calendarModel
- the Gantt chart's calendar modeldatelineModel
- the model used by the datelinetime
- the time point for which to return a background colorgetCalendarEntryBackground(Class)
public void setCalendarEntryForeground(Class calendarEntryType, Color color)
calendarEntryType
- the object type of the calendar entriescolor
- the color used for drawing the time span foregroundgetCalendarEntryForeground(Class)
,
setCalendarEntryBackground(Class, Color)
public Color getCalendarEntryForeground(Class calendarEntryType)
calendarEntryType
- the calendar entry typesetCalendarEntryForeground(Class, Color)
,
getCalendarEntryBackground(Class)
public void setCalendarEntryBackground(Class calendarEntryType, Color color)
calendarEntryType
- the object type of the calendar entriescolor
- the color used for drawing the time span backgroundgetCalendarEntryBackground(Class)
,
setCalendarEntryForeground(Class, Color)
public Color getCalendarEntryBackground(Class calendarEntryType)
calendarEntryType
- the calendar entry typesetCalendarEntryBackground(Class, Color)
,
getCalendarEntryForeground(Class)
public void setFocusBackground(Color color)
color
- the focus background colorgetFocusBackground()
public Color getFocusBackground()
public void setFocusForeground(Color color)
color
- the focus foreground colorgetFocusForeground()
public Color getFocusForeground()
public Dateline getDateline()
public boolean hasFocus()
public boolean isMajor()
public T getModel()
public ITimeSpan getTimeSpan()
public Icon getIcon()
public void setIcon(Icon icon)
public String getText()
public void setText(String text)
public void validate()
public void invalidate()
invalidate
in class Container
public void revalidate()
revalidate
in class JComponent
public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
firePropertyChange
in class JComponent
public void firePropertyChange(String propertyName, byte oldValue, byte newValue)
firePropertyChange
in class Component
public void firePropertyChange(String propertyName, char oldValue, char newValue)
firePropertyChange
in class JComponent
public void firePropertyChange(String propertyName, double oldValue, double newValue)
firePropertyChange
in class Component
public void firePropertyChange(String propertyName, float oldValue, float newValue)
firePropertyChange
in class Component
public void firePropertyChange(String propertyName, long oldValue, long newValue)
firePropertyChange
in class Component
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
firePropertyChange
in class Component
public void firePropertyChange(String propertyName, short oldValue, short newValue)
firePropertyChange
in class Component
public void repaint()
public void repaint(int x, int y, int width, int height)
public void repaint(long tm)
Copyright © 2006–2016 Dirk Lemmermann Software & Consulting. All rights reserved.