public class GefService extends java.lang.Object implements IGefService
Constructor and Description |
---|
GefService() |
Modifier and Type | Method and Description |
---|---|
IDimension |
calculateTextSize(java.lang.String text,
Font font)
Calculates and returns the size of the text ignoring any new line
characters in the string.
|
IDimension |
calculateTextSize(java.lang.String text,
Font font,
boolean handleMultiline)
Calculates and returns the size of the text.
|
org.eclipse.draw2d.geometry.Point |
calculateTranslation(org.eclipse.gef.EditPart source,
org.eclipse.gef.EditPart target)
Returns the translation between the coordinate-systems of EditParts.
|
org.eclipse.gef.EditPart |
findEditPartAt(org.eclipse.gef.EditPartViewer viewer,
org.eclipse.draw2d.geometry.Point location,
boolean includeConnections) |
org.eclipse.draw2d.geometry.Point |
getAbsolutePointOnConnection(Connection c,
double distance) |
org.eclipse.draw2d.geometry.Point |
getChopboxLocationOnBox(org.eclipse.draw2d.geometry.Point reference,
org.eclipse.draw2d.geometry.Rectangle box)
This method has to be kept in sync with
ChopboxAnchorFixed.getLocation(Point) . |
org.eclipse.draw2d.geometry.Point |
getConnectionPointAt(Connection c,
double d) |
java.util.List<org.eclipse.gef.EditPart> |
getConnectionsContainedInEditPart(org.eclipse.gef.EditPart ep)
Computes EditParts of the connections and related ConnectionDecorators
which live inside the containment hierarchy of the given edit part.
|
double |
getDistance(org.eclipse.draw2d.geometry.Point[] points) |
org.eclipse.draw2d.geometry.Point |
getDistantPoint(int startX,
int startY,
int endX,
int endY,
double distance) |
org.eclipse.draw2d.geometry.Point |
getDistantPoint(org.eclipse.draw2d.geometry.Point start,
org.eclipse.draw2d.geometry.Point end,
double distance) |
java.util.List<org.eclipse.gef.EditPart> |
getEditPartChildren(org.eclipse.gef.EditPart editPart)
Provides the direct children of the edit part.
|
java.lang.Object |
getLayoutConstraint(org.eclipse.gef.EditPart editPart)
Returns the layout constraint for the given EditPart.
|
org.eclipse.draw2d.geometry.Point |
getPointAt(int startX,
int startY,
int endX,
int endY,
double d) |
org.eclipse.draw2d.geometry.Point |
getPointAt(org.eclipse.draw2d.geometry.Point start,
org.eclipse.draw2d.geometry.Point end,
double d) |
java.util.List<org.eclipse.gef.EditPart> |
getSelectedEditParts(org.eclipse.gef.EditPartViewer editPartViewer)
Provides the selected edit parts of the viewer.
|
java.util.List<org.eclipse.gef.GraphicalEditPart> |
getSourceConnections(org.eclipse.gef.GraphicalEditPart graphicalEditPart)
Provides the source connections of the graphical edit part.
|
java.util.List<org.eclipse.gef.GraphicalEditPart> |
getTargetConnections(org.eclipse.gef.GraphicalEditPart graphicalEditPart)
Provides the target connections of the graphical edit part.
|
void |
mirrorArray(org.eclipse.draw2d.geometry.Point[] draw2dPoints) |
void |
selectEditPart(org.eclipse.gef.EditPartViewer viewer,
java.lang.Object modelObject)
Selects the EditPart for the given model Object.
|
public void selectEditPart(org.eclipse.gef.EditPartViewer viewer, java.lang.Object modelObject)
IGefService
selectEditPart
in interface IGefService
viewer
- The viewer, which contains the EditParts.modelObject
- The model Object, which EditPart to select.public org.eclipse.draw2d.geometry.Point calculateTranslation(org.eclipse.gef.EditPart source, org.eclipse.gef.EditPart target)
IGefService
calculateTranslation
in interface IGefService
source
- The EditPart with the source coordinate-system.target
- The EditPart with the target coordinate-system.public java.lang.Object getLayoutConstraint(org.eclipse.gef.EditPart editPart)
IGefService
getLayoutConstraint
in interface IGefService
editPart
- The EditPart for which to return the layout constraint.public org.eclipse.gef.EditPart findEditPartAt(org.eclipse.gef.EditPartViewer viewer, org.eclipse.draw2d.geometry.Point location, boolean includeConnections)
findEditPartAt
in interface IGefService
location
- : the absolute location for the whole RootEditpart (if any,
the scroll should be considered)public java.util.List<org.eclipse.gef.EditPart> getConnectionsContainedInEditPart(org.eclipse.gef.EditPart ep)
IGefService
getConnectionsContainedInEditPart
in interface IGefService
ep
- the EditPart whose inner connection and ConnectionDecorators
should be computedpublic org.eclipse.draw2d.geometry.Point getConnectionPointAt(Connection c, double d)
getConnectionPointAt
in interface IGefService
public org.eclipse.draw2d.geometry.Point getChopboxLocationOnBox(org.eclipse.draw2d.geometry.Point reference, org.eclipse.draw2d.geometry.Rectangle box)
IGefService
ChopboxAnchorFixed.getLocation(Point)
.getChopboxLocationOnBox
in interface IGefService
public org.eclipse.draw2d.geometry.Point getAbsolutePointOnConnection(Connection c, double distance)
getAbsolutePointOnConnection
in interface IGefService
public org.eclipse.draw2d.geometry.Point getDistantPoint(org.eclipse.draw2d.geometry.Point start, org.eclipse.draw2d.geometry.Point end, double distance)
getDistantPoint
in interface IGefService
public org.eclipse.draw2d.geometry.Point getDistantPoint(int startX, int startY, int endX, int endY, double distance)
getDistantPoint
in interface IGefService
public org.eclipse.draw2d.geometry.Point getPointAt(int startX, int startY, int endX, int endY, double d)
getPointAt
in interface IGefService
public org.eclipse.draw2d.geometry.Point getPointAt(org.eclipse.draw2d.geometry.Point start, org.eclipse.draw2d.geometry.Point end, double d)
getPointAt
in interface IGefService
public double getDistance(org.eclipse.draw2d.geometry.Point[] points)
getDistance
in interface IGefService
public IDimension calculateTextSize(java.lang.String text, Font font)
IGefService
calculateTextSize
in interface IGefService
IGefService.calculateTextSize(String, Font, boolean)
public IDimension calculateTextSize(java.lang.String text, Font font, boolean handleMultiline)
IGefService
calculateTextSize
in interface IGefService
handleMultiline
- Defines if line breaks in the string should be used in the
calculation of the size or not. In case true
, a
new line character in the string will increase the size of the
returned dimensions by one line, in case false
a
new line character will be ignored.public void mirrorArray(org.eclipse.draw2d.geometry.Point[] draw2dPoints)
mirrorArray
in interface IGefService
public java.util.List<org.eclipse.gef.EditPart> getEditPartChildren(org.eclipse.gef.EditPart editPart)
IGefService
getEditPartChildren
in interface IGefService
public java.util.List<org.eclipse.gef.GraphicalEditPart> getSourceConnections(org.eclipse.gef.GraphicalEditPart graphicalEditPart)
IGefService
getSourceConnections
in interface IGefService
public java.util.List<org.eclipse.gef.GraphicalEditPart> getTargetConnections(org.eclipse.gef.GraphicalEditPart graphicalEditPart)
IGefService
getTargetConnections
in interface IGefService
public java.util.List<org.eclipse.gef.EditPart> getSelectedEditParts(org.eclipse.gef.EditPartViewer editPartViewer)
IGefService
getSelectedEditParts
in interface IGefService