|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel com.dlsc.flexgantt.swing.timeline.AbstractDatelineRenderer<T>
T
- the type of the dateline modelpublic abstract class AbstractDatelineRenderer<T extends IDatelineModel>
An abstract dateline renderer that provides common functionality for its subclasses. This common functionality primarily consists of several methods to lookup colors used for the foreground and background of major and minor time spans.
Dateline.setDatelineRenderer(Class, IDatelineRenderer)
,
Serialized FormNested 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.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 | |
---|---|
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 . |
Method Summary | |
---|---|
void |
firePropertyChange(java.lang.String propertyName,
boolean oldValue,
boolean newValue)
Overriden for performance reasons. |
void |
firePropertyChange(java.lang.String propertyName,
byte oldValue,
byte newValue)
Overriden for performance reasons. |
void |
firePropertyChange(java.lang.String propertyName,
char oldValue,
char newValue)
Overriden for performance reasons. |
void |
firePropertyChange(java.lang.String propertyName,
double oldValue,
double newValue)
Overriden for performance reasons. |
void |
firePropertyChange(java.lang.String propertyName,
float oldValue,
float newValue)
Overriden for performance reasons. |
void |
firePropertyChange(java.lang.String propertyName,
long oldValue,
long newValue)
Overriden for performance reasons. |
protected void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
Overriden for performance reasons. |
void |
firePropertyChange(java.lang.String propertyName,
short oldValue,
short newValue)
Overriden for performance reasons. |
protected java.awt.Color |
getCalendarBackground(ICalendarModel calendarModel,
IDatelineModel datelineModel,
long time)
Returns a background color for the given time point, calendar model and dateline model. |
java.awt.Color |
getCalendarEntryBackground(java.lang.Class calendarEntryType)
Returns the background color that will be used for drawing time spans that intersect with calendar entries of the given type. |
java.awt.Color |
getCalendarEntryForeground(java.lang.Class calendarEntryType)
Returns the foreground color that will be used for drawing time spans that intersect with calendar entries of the given type. |
protected java.awt.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. |
java.awt.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. |
java.awt.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). |
java.awt.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). |
javax.swing.Icon |
getIcon()
Returns the icon used by the renderer. |
protected java.awt.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 java.awt.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 java.awt.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 java.awt.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. |
java.lang.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 |
isMajor()
Returns TRUE if the currently rendered time span (cell) is located in the upper (major) section of the dateline. |
protected void |
paintComponent(java.awt.Graphics g)
|
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(java.lang.Class calendarEntryType,
java.awt.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(java.lang.Class calendarEntryType,
java.awt.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(java.awt.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 |
setFocusForeground(java.awt.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(javax.swing.Icon icon)
Sets the icon used by the renderer. |
void |
setText(java.lang.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. |
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, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, 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, 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, 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, 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, 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, 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, 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 |
---|
protected AbstractDatelineRenderer()
WeekendCalendarEntry
and HolidayCalendarEntry
.
setCalendarEntryForeground(Class, Color)
,
setCalendarEntryBackground(Class, Color)
Method Detail |
---|
public java.awt.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 focus
protected java.awt.Color getMajorForeground(Dateline dateline, long date)
dateline
- the component in which the time span will be renderereddate
- the start time of the time span
getMinorForeground(Dateline, long)
,
getMajorBackground(Dateline, long)
protected java.awt.Color getMajorBackground(Dateline dateline, long date)
dateline
- the component in which the time span will be renderereddate
- the start time of the time span
getMinorBackground(Dateline, long)
,
getMajorForeground(Dateline, long)
protected java.awt.Color getMinorForeground(Dateline dateline, long date)
dateline
- the component in which the time span will be renderereddate
- the start time of the time span
getFocusForeground()
,
getCalendarForeground(ICalendarModel, IDatelineModel, long)
,
getMinorBackground(Dateline, long)
,
getMajorForeground(Dateline, long)
,
getCalendarEntryForeground(Class)
protected java.awt.Color getMinorBackground(Dateline dateline, long date)
dateline
- the component in which the time span will be renderereddate
- the start time of the time span
getFocusForeground()
,
getCalendarForeground(ICalendarModel, IDatelineModel, long)
,
getMinorBackground(Dateline, long)
,
getMajorForeground(Dateline, long)
,
getCalendarEntryForeground(Class)
protected java.awt.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 color
getCalendarEntryForeground(Class)
protected java.awt.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 color
getCalendarEntryBackground(Class)
public void setCalendarEntryForeground(java.lang.Class calendarEntryType, java.awt.Color color)
calendarEntryType
- the object type of the calendar entriescolor
- the color used for drawing the time span foregroundgetCalendarEntryForeground(Class)
,
setCalendarEntryBackground(Class, Color)
public java.awt.Color getCalendarEntryForeground(java.lang.Class calendarEntryType)
calendarEntryType
- the calendar entry type
setCalendarEntryForeground(Class, Color)
,
getCalendarEntryBackground(Class)
public void setCalendarEntryBackground(java.lang.Class calendarEntryType, java.awt.Color color)
calendarEntryType
- the object type of the calendar entriescolor
- the color used for drawing the time span backgroundgetCalendarEntryBackground(Class)
,
setCalendarEntryForeground(Class, Color)
public java.awt.Color getCalendarEntryBackground(java.lang.Class calendarEntryType)
calendarEntryType
- the calendar entry type
setCalendarEntryBackground(Class, Color)
,
getCalendarEntryForeground(Class)
public void setFocusBackground(java.awt.Color color)
color
- the focus background colorgetFocusBackground()
public java.awt.Color getFocusBackground()
public void setFocusForeground(java.awt.Color color)
color
- the focus foreground colorgetFocusForeground()
public java.awt.Color getFocusForeground()
public Dateline getDateline()
public boolean hasFocus()
hasFocus
in class java.awt.Component
public boolean isMajor()
public T getModel()
public ITimeSpan getTimeSpan()
public javax.swing.Icon getIcon()
public void setIcon(javax.swing.Icon icon)
icon
- the icon shown in the time span cellpublic java.lang.String getText()
public void setText(java.lang.String text)
text
- the renderer's textprotected void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public void validate()
validate
in class java.awt.Container
public void invalidate()
invalidate
in class java.awt.Container
public void revalidate()
revalidate
in class javax.swing.JComponent
public void firePropertyChange(java.lang.String propertyName, boolean oldValue, boolean newValue)
firePropertyChange
in class javax.swing.JComponent
public void firePropertyChange(java.lang.String propertyName, byte oldValue, byte newValue)
firePropertyChange
in class java.awt.Component
public void firePropertyChange(java.lang.String propertyName, char oldValue, char newValue)
firePropertyChange
in class javax.swing.JComponent
public void firePropertyChange(java.lang.String propertyName, double oldValue, double newValue)
firePropertyChange
in class java.awt.Component
public void firePropertyChange(java.lang.String propertyName, float oldValue, float newValue)
firePropertyChange
in class java.awt.Component
public void firePropertyChange(java.lang.String propertyName, long oldValue, long newValue)
firePropertyChange
in class java.awt.Component
protected void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
firePropertyChange
in class java.awt.Component
public void firePropertyChange(java.lang.String propertyName, short oldValue, short newValue)
firePropertyChange
in class java.awt.Component
public void repaint()
repaint
in class java.awt.Component
public void repaint(int x, int y, int width, int height)
repaint
in class java.awt.Component
public void repaint(long tm)
repaint
in class java.awt.Component
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |