|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.view.ViewMode y.view.TooltipMode
public class TooltipMode
A ViewMode
which shows tooltips for every kind of graph element when moving the mouse over it. Graph
elements which tooltips can be shown for are Node
s, Edge
s, NodeLabel
s, EdgeLabel
s and
NodePort
s.
TooltipMode
is used the tooltip functionality of EditMode
must not be executed any
more to avoid interferences.
Field Summary |
---|
Fields inherited from class y.view.ViewMode |
---|
ACTIVE_PROPERTY, ACTIVE_VIEW_PROPERTY, CHILD_MODE_PROPERTY, EDITING_PROPERTY, GRAB_FOCUS_ENABLED_PROPERTY, lastClickEvent, lastDragEvent, lastMoveEvent, lastPressEvent, lastReleaseEvent, MODIFIER_MASK_PROPERTY, NAME_PROPERTY, originalX, originalY, PARENT_MODE_PROPERTY, view |
Constructor Summary | |
---|---|
TooltipMode()
Creates a new TooltipMode . |
Method Summary | |
---|---|
protected java.lang.String |
getEdgeLabelTip(EdgeLabel label)
Returns the text of the tooltip for a edge's label. |
protected java.lang.String |
getEdgeTip(Edge edge)
Returns the text of the tooltip for an edge. |
protected HitInfo |
getHitInfo(double x,
double y)
Overwrites ViewMode.getHitInfo(double, double) in order to get the hit information of only the first hit of
every kind of graph element at the coordinates (x,y). |
protected java.lang.String |
getNodeLabelTip(NodeLabel label)
Returns the text of the tooltip for a node's label. |
protected java.lang.String |
getNodePortTip(NodePort port)
Returns the text of the tooltip for a node port. |
protected java.lang.String |
getNodeTip(Node node)
Returns the text of the tooltip for a given node. |
boolean |
isEdgeLabelTipEnabled()
Determines whether tooltips for edge labels will be displayed. |
boolean |
isEdgeTipEnabled()
Determines whether tooltips for edges will be displayed. |
boolean |
isNodeLabelTipEnabled()
Determines whether tooltips for node labels will be displayed. |
boolean |
isNodeTipEnabled()
Determines whether tooltips for nodes will be displayed. |
boolean |
isPortTipEnabled()
Determines whether tooltips for node ports will be displayed. |
void |
mouseMoved(double x,
double y)
Sets a tooltip for the topmost graph element at the coordinates (x,y) which belongs to a kind of graph element where tooltips are enabled and a tooltip text is set. |
void |
setEdgeLabelTipEnabled(boolean edgeLabelTipEnabled)
Specifies whether tooltips for edge labels will be displayed. |
void |
setEdgeTipEnabled(boolean edgeTipEnabled)
Specifies whether tooltips for edges will be displayed. |
void |
setNodeLabelTipEnabled(boolean nodeLabelTipEnabled)
Specifies whether tooltips for node labels will be displayed. |
void |
setNodeTipEnabled(boolean nodeTipEnabled)
Specifies whether tooltips for nodes will be displayed. |
void |
setPortTipEnabled(boolean portTipEnabled)
Specifies whether tooltips for node ports will be displayed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TooltipMode()
TooltipMode
. Tooltips for every kind of graph element are activated.
Method Detail |
---|
protected HitInfo getHitInfo(double x, double y)
ViewMode.getHitInfo(double, double)
in order to get the hit information of only the first hit of
every kind of graph element at the coordinates (x,y). Only the graph elements for which tooltips are enabled will
be considered.
Note: As getHitInfo
stores the last hit information for further use, any overwriting method has to
make sure that ViewMode.setLastHitInfo(HitInfo)
is called, so the methods ViewMode.setLastHitInfo(HitInfo)
and ViewMode.getLastHitInfo()
will access the right HitInfo
object.
getHitInfo
in class ViewMode
x
- x world coordinatey
- y world coordinate
HitInfo
that contains the first hit of every kind of graph elements at (x,y)ViewMode.createHitInfo(double,double,boolean)
public void mouseMoved(double x, double y)
mouseMoved
in class ViewMode
x
- the x-coordinate of the mouse event in world coordinates.y
- the y-coordinate of the mouse event in world coordinates.setNodeTipEnabled(boolean)
,
setEdgeTipEnabled(boolean)
,
setNodeLabelTipEnabled(boolean)
,
setEdgeLabelTipEnabled(boolean)
,
setPortTipEnabled(boolean)
protected java.lang.String getNodeTip(Node node)
setNodeTipEnabled(boolean)
.
By default the label text of the node will be returned. Subclasses may want to overwrite this behavior.
node
- the node for which the tooltip is set
protected java.lang.String getEdgeTip(Edge edge)
setEdgeTipEnabled(boolean)
.
By default the first label text of the edge will be returned. Subclasses may want to overwrite this behavior.
edge
- the edge for which the tooltip is set
protected java.lang.String getNodeLabelTip(NodeLabel label)
setNodeLabelTipEnabled(boolean)
.
By default the label text will be returned. Subclasses may want to overwrite this behavior.
label
- the label for which the tooltip is set
protected java.lang.String getEdgeLabelTip(EdgeLabel label)
setEdgeLabelTipEnabled(boolean)
.
By default the label text will be returned. Subclasses may want to overwrite this behavior.
label
- the label for which the tooltip is set
protected java.lang.String getNodePortTip(NodePort port)
setPortTipEnabled(boolean)
.
By default the label text of the node port will be returned. Subclasses may want to overwrite this behavior.
port
- the node port for which the tooltip is set
public boolean isEdgeLabelTipEnabled()
true
if tooltips for edge labels will be displayed, false
otherwisesetEdgeLabelTipEnabled(boolean)
public void setEdgeLabelTipEnabled(boolean edgeLabelTipEnabled)
false
.
edgeLabelTipEnabled
- true
if tooltips for edge labels will be displayed, false
otherwiseisEdgeLabelTipEnabled()
public boolean isEdgeTipEnabled()
true
if tooltips for edges will be displayed, false
otherwisesetEdgeTipEnabled(boolean)
public void setEdgeTipEnabled(boolean edgeTipEnabled)
true
.
edgeTipEnabled
- true
if tooltips for edges will be displayed, false
otherwiseisEdgeTipEnabled()
public boolean isNodeLabelTipEnabled()
true
if tooltips for node labels will be displayed, false
otherwisesetNodeLabelTipEnabled(boolean)
public void setNodeLabelTipEnabled(boolean nodeLabelTipEnabled)
false
.
nodeLabelTipEnabled
- true
if tooltips for node labels will be displayed, false
otherwiseisNodeLabelTipEnabled()
public boolean isNodeTipEnabled()
true
if tooltips for nodes will be displayed, false
otherwisesetNodeTipEnabled(boolean)
public void setNodeTipEnabled(boolean nodeTipEnabled)
true
.
nodeTipEnabled
- true
if tooltips for nodes will be displayed, false
otherwiseisNodeTipEnabled()
public boolean isPortTipEnabled()
true
if tooltips for node ports will be displayed, false
otherwisesetPortTipEnabled(boolean)
public void setPortTipEnabled(boolean portTipEnabled)
false
.
portTipEnabled
- true
if tooltips for node ports will be displayed, false
otherwiseisPortTipEnabled()
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |