public class PopupLayer extends AbstractSystemLayer implements MouseListener, MouseMotionListener, KeyEventDispatcher
alpha, changeSupport, ganttChart, layerContainer, PROPERTY_ALPHA, PROPERTY_VISIBLE
Constructor and Description |
---|
PopupLayer(LayerContainer lc)
Constructs a new popup layer.
|
Modifier and Type | Method and Description |
---|---|
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.
|
protected org.jdesktop.animation.timing.Animator |
createAnimator(org.jdesktop.animation.timing.TimingTarget fadeIn)
Creates the animator, which performs the fading in of the popup.
|
boolean |
dispatchKeyEvent(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
|
int |
getAnimationDelay()
Returns the number of milliseconds to wait before popups will appear.
|
int |
getAnimationDuration()
Returns the duration it takes for the popups to become fully visible.
|
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.
|
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.
|
List<TimelineObjectPath> |
getPinnedPopups()
Returns a list with all currently pinned popups.
|
IPopupRenderer |
getPopupRenderer(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.
|
boolean |
isShowingRelationshipObjectPopups()
Determines whether the layer will show popups for relationships (lines
between timeline objets).
|
boolean |
isShowingTimlineObjectPopups()
Determines whether the layer will show popups for timeline objects.
|
boolean |
isShowingTreeNodePopups()
Determines whether the layer will show popups for tree nodes.
|
boolean |
isVisible()
Determines whether the layer is currently visible or not.
|
void |
mouseClicked(MouseEvent e) |
void |
mouseDragged(MouseEvent e) |
void |
mouseEntered(MouseEvent e) |
void |
mouseExited(MouseEvent e) |
void |
mouseMoved(MouseEvent e) |
void |
mousePressed(MouseEvent e) |
void |
mouseReleased(MouseEvent e) |
protected void |
paintLayer(Graphics g) |
protected void |
paintRelationshipPopup(Graphics g,
IRelationship relationship)
Renders the popup for the given timeline object path.
|
protected void |
paintTimelineObjectPathPopup(Graphics g,
TimelineObjectPath path,
boolean pinned)
Renders the popup for the given timeline object path.
|
protected void |
paintTreePathPopup(Graphics g,
TreePath path,
boolean pinned)
Renders the popup for the given tree path.
|
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 |
setAnimationDelay(int animationDelay)
Sets the number of milliseconds to wait before popups will appear.
|
void |
setAnimationDuration(int animationDuration)
Specifies the duration it takes for the popups to become fully visible.
|
void |
setOffset(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(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(List<TimelineObjectPath> paths)
Sets a list with all currently pinned popups.
|
void |
setPopupRenderer(Class objectType,
IPopupRenderer renderer)
Maps the implementation of a popup renderer to a popup object definition.
|
void |
setShowingRelationshipObjectPopups(boolean showing)
Controls whether the popup layer will show popups for relationships
(lines between timeline objects).
|
void |
setShowingTimlineObjectPopups(boolean showing)
Controls whether the popup layer will show popups for timeline objects.
|
void |
setShowingTreeNodePopups(boolean showing)
Controls whether the popup layer will show popups for tree nodes.
|
void |
setVisible(boolean b)
Specifies whether the layer is visible or not.
|
void |
tearDown()
Removes the layer from the keyboard focus manager.
|
addPropertyChangeListener, getAlpha, getDateline, getEventline, getGanttChart, getHeight, getLayerContainer, getLayerPolicyProvider, getModel, getName, getStartRow, getTimeAt, getTimeline, getTimeLocation, getTimeSpanUsed, getToolTipText, getTreeTable, getTreeTablePolicyProvider, getWidth, removePropertyChangeListener, repaint, repaint, repaint, setAlpha
public PopupLayer(LayerContainer lc)
lc
- the layer container that contains the popup layer.public void setShowingRelationshipObjectPopups(boolean showing)
showing
- if TRUE the layer will show popups for relationshipspublic boolean isShowingRelationshipObjectPopups()
public void setShowingTimlineObjectPopups(boolean showing)
showing
- if TRUE the layer will show popups for timeline objectspublic boolean isShowingTimlineObjectPopups()
public void setShowingTreeNodePopups(boolean showing)
showing
- if TRUE the layer will show popups for tree nodespublic boolean isShowingTreeNodePopups()
public boolean isVisible()
AbstractLayer
isVisible
in class AbstractLayer
AbstractLayer.setVisible(boolean)
public Point getOffset()
public void setOffset(Point offset)
offset
- a distance in pixels between the popup and the timeline objectpublic Point getPinnedOffset()
public void setPinnedOffset(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 List<TimelineObjectPath> getPinnedPopups()
public void setPinnedPopups(List<TimelineObjectPath> paths)
paths
- all pinned popupsprotected void paintLayer(Graphics g)
paintLayer
in class AbstractLayer
protected void paintTimelineObjectPathPopup(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 popupprotected void paintTreePathPopup(Graphics g, TreePath path, boolean pinned)
IPopupRenderer
implementation based on the object
type of the timeline object.g
- the graphics contextpath
- the tree pathpinned
- if TRUE the popup is a pinned popupprotected void paintRelationshipPopup(Graphics g, IRelationship relationship)
IPopupRenderer
implementation based on the
object type of the timeline object.g
- the graphics contextrelationship
- the relationship for which to draw a popuppublic void setVisible(boolean b)
AbstractLayer
setVisible
in class AbstractLayer
b
- if TRUE the layer will be visibleAbstractLayer.isVisible()
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
protected org.jdesktop.animation.timing.Animator createAnimator(org.jdesktop.animation.timing.TimingTarget fadeIn)
fadeIn
- the timing target that gets animatedpublic void setAnimationDuration(int animationDuration)
animationDuration
- the duration in millisecondspublic int getAnimationDuration()
public void setAnimationDelay(int animationDelay)
animationDelay
- the popup delay in milliseconds.createAnimator(TimingTarget)
public int getAnimationDelay()
createAnimator(TimingTarget)
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
public void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
public void setPopupRenderer(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(TimelineObjectPath, IGanttChartModel,
boolean)
public IPopupRenderer getPopupRenderer(Class cl)
cl
- the popup object type in need of renderingsetPopupRenderer(Class, IPopupRenderer)
,
DefaultPopupRenderer
,
IPopupPolicy
public boolean dispatchKeyEvent(KeyEvent e)
KeyboardFocusManager
for two
reasons:
dispatchKeyEvent
in interface KeyEventDispatcher
public boolean isAnimating()
public void setAnimating(boolean animating)
animating
- if TRUE if the layer animates the popuppublic void tearDown()
tearDown
in class AbstractLayer
Copyright © 2006–2016 Dirk Lemmermann Software & Consulting. All rights reserved.