|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.dlsc.flexgantt.swing.layer.AbstractLayer com.dlsc.flexgantt.swing.layer.system.AbstractSystemLayer com.dlsc.flexgantt.swing.layer.system.PopupLayer
public class PopupLayer
A bar underneath a timeline is a nice representation for an activity but it can only carry a limited number of information due to space restrictions. Popups / annotations that show up when the mouse cursor hovers over such a bar is a nice feature that can display a wealth of additional information that the planner might need to make a scheduling decision. The popup layer uses renderers that perform the actual rendering of the popup windows. The layer can display a standard popup and an extended popup depending on whether the user holds down the SHIFT key while hovering over a timeline object.
Field Summary |
---|
Fields inherited from class com.dlsc.flexgantt.swing.layer.AbstractLayer |
---|
alpha, changeSupport, ganttChart, layerContainer, PROPERTY_ALPHA, PROPERTY_VISIBLE |
Constructor Summary | |
---|---|
PopupLayer(LayerContainer lc)
Constructs a new popup layer. |
Method Summary | |
---|---|
void |
addPinnedPopup(TimelineObjectPath path)
Adds a path to the layer that reference a timeline object with a pinned popup. |
void |
clearPinnedPopups()
Removes all pinned popups. |
boolean |
dispatchKeyEvent(java.awt.event.KeyEvent e)
Intercepts key events from the KeyboardFocusManager for two
reasons:
to toggle between the standard and the extended popup when the user
presses the SHIFT key
to pin the currently showing popup when the user hits the RETURN key
|
java.awt.Point |
getOffset()
Returns the offset used to move the popup away from or closer to (if negative) the timeline object that was the source of the popup input. |
java.awt.Point |
getPinnedOffset()
Returns the offset used to move the pinned popup away from or closer to (if negative) the timeline object that was the source of the popup input. |
java.util.List<TimelineObjectPath> |
getPinnedPopups()
Returns a list with all currently pinned popups. |
IPopupRenderer |
getPopupRenderer(java.lang.Class cl)
Returns a popup renderer for a given popup value type. |
boolean |
isAnimating()
Determines whether the popup layer will use a fade-in effect when showing the popup. |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
protected void |
paintLayer(java.awt.Graphics g)
|
protected void |
paintPopup(java.awt.Graphics g,
TimelineObjectPath path,
boolean pinned)
Renders the popup for the given object bounds. |
void |
removePinnedPopup(TimelineObjectPath path)
Removes a timeline object path from the list of pinned popups. |
void |
setAnimating(boolean animating)
Specifies whether the popup layer will use a fade-in effect when showing the popup. |
void |
setOffset(java.awt.Point offset)
Sets an offset that gets used to move the popup away from or closer to (if negative) the timeline object that it is describing. |
void |
setPinnedOffset(java.awt.Point offset)
Sets an offset that gets used to move the pinned popup away from or closer to (if negative) the timeline object that it is describing. |
void |
setPinnedPopups(java.util.List<TimelineObjectPath> paths)
Sets a list with all currently pinned popups. |
void |
setPopupRenderer(java.lang.Class objectType,
IPopupRenderer renderer)
Maps the implementation of a popup renderer to a popup object definition. |
void |
setVisible(boolean b)
Specifies whether the layer is visible or not. |
Methods inherited from class com.dlsc.flexgantt.swing.layer.AbstractLayer |
---|
addPropertyChangeListener, getAlpha, getDateline, getEventline, getGanttChart, getLayerContainer, getLayerPolicyProvider, getModel, getName, getStartRow, getTimeAt, getTimeline, getTimeLocation, getTimeSpanUsed, getToolTipText, getTreeTable, getTreeTablePolicyProvider, isVisible, removePropertyChangeListener, repaint, repaint, repaint, setAlpha, tearDown |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PopupLayer(LayerContainer lc)
lc
- the layer container that contains the popup layer.Method Detail |
---|
public java.awt.Point getOffset()
public void setOffset(java.awt.Point offset)
offset
- a distance in pixels between the popup and the timeline objectpublic java.awt.Point getPinnedOffset()
public void setPinnedOffset(java.awt.Point offset)
offset
- a distance in pixels between the popup and the timeline objectpublic void addPinnedPopup(TimelineObjectPath path)
path
- the path of a timeline objectpublic void removePinnedPopup(TimelineObjectPath path)
path
- the path of a timeline objectpublic void clearPinnedPopups()
public java.util.List<TimelineObjectPath> getPinnedPopups()
public void setPinnedPopups(java.util.List<TimelineObjectPath> paths)
paths
- all pinned popupsprotected void paintLayer(java.awt.Graphics g)
paintLayer
in class AbstractLayer
protected void paintPopup(java.awt.Graphics g, TimelineObjectPath path, boolean pinned)
IPopupRenderer
implementation based on the object
type of the timeline object.
g
- the graphics contextpath
- timeline object pathpinned
- if TRUE the popup is a pinned popuppublic void setVisible(boolean b)
AbstractLayer
setVisible
in class AbstractLayer
b
- if TRUE the layer will be visibleAbstractLayer.isVisible()
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void setPopupRenderer(java.lang.Class objectType, IPopupRenderer renderer)
objectType
- the type of the popup objects where the popup will be rendered
with the given rendererrenderer
- an implementation that will be used to renderer instances of
the given popup object typeDefaultPopupRenderer
,
IPopupPolicy.getPopupValue(Object, Object, IGanttChartModel,
boolean)
public IPopupRenderer getPopupRenderer(java.lang.Class cl)
cl
- the popup object type in need of rendering
setPopupRenderer(Class, IPopupRenderer)
,
DefaultPopupRenderer
,
IPopupPolicy
public boolean dispatchKeyEvent(java.awt.event.KeyEvent e)
KeyboardFocusManager
for two
reasons:
dispatchKeyEvent
in interface java.awt.KeyEventDispatcher
public boolean isAnimating()
public void setAnimating(boolean animating)
animating
- if TRUE if the layer animates the popup
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |