Package org.eclipse.gef.zest.fx.parts

# Class AbstractLabelPart

java.lang.Object
org.eclipse.gef.mvc.fx.parts.AbstractVisualPart<V>
org.eclipse.gef.mvc.fx.parts.AbstractContentPart<javafx.scene.Group>
org.eclipse.gef.zest.fx.parts.AbstractLabelPart

All Implemented Interfaces:
  `IActivatable`, `IAdaptable`, `IAdaptable.Bound<IViewer>`, `IDisposable`, `IContentPart<javafx.scene.Group>`, `ITransformableContentPart<javafx.scene.Group>`, `IVisualPart<javafx.scene.Group>`

Direct Known Subclasses:
  `EdgeLabelPart`, `NodeLabelPart`

public abstract class AbstractLabelPart extends AbstractContentPart<javafx.scene.Group> implements ITransformableContentPart<javafx.scene.Group>
Abstract base class for external labels, i.e. labels that are not part of the visualization of another controller. The standard node label is part of the node part's visualization. However, edge labels are implemented as external labels, for example.

## Property Summary

### Properties inherited from class org.eclipse.gef.mvc.fx.parts.AbstractContentPart

`contentAnchoragesUnmodifiable, contentChildrenUnmodifiable, content`

### Properties inherited from class org.eclipse.gef.mvc.fx.parts.AbstractVisualPart

`active, adaptable, adapters, anchoragesUnmodifiable, anchoredsUnmodifiable, childrenUnmodifiable, parent, refreshVisual`

### Properties inherited from interface org.eclipse.gef.common.activate.IActivatable

`active`

### Properties inherited from interface org.eclipse.gef.common.adapt.IAdaptable

`adapters`

### Properties inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound

`adaptable`

### Properties inherited from interface org.eclipse.gef.mvc.fx.parts.IContentPart

`contentAnchoragesUnmodifiable, contentChildrenUnmodifiable, content`

### Properties inherited from interface org.eclipse.gef.mvc.fx.parts.IVisualPart

`anchoragesUnmodifiable, anchoredsUnmodifiable, childrenUnmodifiable, parent, refreshVisual`

## Nested Class Summary

## Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable

`IAdaptable.Bound<A extends IAdaptable>`

## Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound

`IAdaptable.Bound.Impl<T extends IAdaptable>`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`CSS_CLASS_LABEL`
The CSS class that is assigned to the visualization of the `EdgeLabelPart` of this `EdgePart`.

### Fields inherited from interface org.eclipse.gef.common.activate.IActivatable

`ACTIVE_PROPERTY`

### Fields inherited from interface org.eclipse.gef.common.adapt.IAdaptable

`ADAPTERS_PROPERTY`

### Fields inherited from interface org.eclipse.gef.mvc.fx.parts.IContentPart

`CONTENT_ANCHORAGES_PROPERTY, CONTENT_CHILDREN_PROPERTY, CONTENT_PROPERTY`

### Fields inherited from interface org.eclipse.gef.mvc.fx.parts.ITransformableContentPart

`TRANSFORM_PROVIDER_KEY, TRANSFORM_PROVIDER_ROLE`

### Fields inherited from interface org.eclipse.gef.mvc.fx.parts.IVisualPart

`ANCHORAGES_PROPERTY, ANCHOREDS_PROPERTY, CHILDREN_PROPERTY, PARENT_PROPERTY, REFRESH_VISUAL_PROPERTY`

## Constructor Summary

Constructors
Constructor
Description
`AbstractLabelPart()`

## Method Summary

Modifier and Type
Method
Description
`abstract Point`
`computeLabelPosition()`
Computes a position for this label.
`protected javafx.scene.text.Text`
`createText()`
Creates the text visual.
`protected void`
`doActivate()`
`protected void`
`doAttachToAnchorageVisual(IVisualPart<? extends javafx.scene.Node> anchorage, String role)`
`protected void`
`doDeactivate()`
`protected void`
`doDetachFromAnchorageVisual(IVisualPart<? extends javafx.scene.Node> anchorage, String role)`
`protected List<? extends Object>`
`doGetContentChildren()`
`javafx.util.Pair<? extends org.eclipse.gef.common.attributes.IAttributeStore,String>`
`getContent()`
`javafx.scene.transform.Affine`
`getContentTransform()`
`Point`
`getLabelPosition()`
Retrieves the stored position for the label.
`protected String`
`getLabelPositionAttributeKey()`
Retrieves the position attribute key for the given label role.
`protected javafx.scene.text.Text`
`getText()`
Returns the text visual.
`void`
`recomputeLabelPosition()`
Recomputes the label position.
`protected void`
`refreshPosition(javafx.scene.Node visual, Point position)`
Adjusts the label's position to fit the given `Point`.
`void`
`setContentTransform(javafx.scene.transform.Affine transform)`
`void`
`setLabelPosition(Point computedPosition)`
Sets the stored label position to the given value.

### Methods inherited from class org.eclipse.gef.mvc.fx.parts.AbstractContentPart

`addContentChild, attachToContentAnchorage, contentAnchoragesUnmodifiableProperty, contentChildrenUnmodifiableProperty, contentProperty, detachFromContentAnchorage, doAddContentChild, doAttachToContentAnchorage, doDetachFromContentAnchorage, doGetContentAnchorages, doRemoveContentChild, doReorderContentChild, getContentAnchoragesUnmodifiable, getContentChildrenUnmodifiable, isFocusable, isSelectable, refreshContentAnchorages, refreshContentChildren, register, registerAtContentPartMap, removeContentChild, reorderContentChild, setContent, unregister, unregisterFromContentPartMap`

### Methods inherited from class org.eclipse.gef.mvc.fx.parts.AbstractVisualPart

`activate, activateAdapters, activateChildren, activeProperty, adaptableProperty, adaptersProperty, addChild, addChild, addChildren, addChildren, anchoragesUnmodifiableProperty, anchoredsUnmodifiableProperty, attachAnchored, attachToAnchorage, attachToAnchorage, childrenUnmodifiableProperty, deactivate, deactivateAdapters, deactivateChildren, detachAnchored, detachFromAnchorage, detachFromAnchorage, determineViewer, dispose, doAddChildVisual, doCreateVisual, doRefreshVisual, doRemoveChildVisual, getAdaptable, getAdapter, getAdapter, getAdapter, getAdapterKey, getAdapters, getAdapters, getAdapters, getAnchoragesUnmodifiable, getAnchoredsUnmodifiable, getBehaviors, getChildrenUnmodifiable, getHandlers, getParent, getPolicies, getRoot, getVisual, isActive, isRefreshVisual, parentProperty, refreshVisual, refreshVisualProperty, registerAtVisualPartMap, removeChild, removeChildren, reorderChild, setAdaptable, setAdapter, setAdapter, setAdapter, setAdapter, setParent, setRefreshVisual, unregisterFromVisualPartMap, unsetAdapter`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.eclipse.gef.common.activate.IActivatable

`activate, activeProperty, deactivate, isActive`

### Methods inherited from interface org.eclipse.gef.common.adapt.IAdaptable

`adaptersProperty, getAdapter, getAdapter, getAdapter, getAdapterKey, getAdapters, getAdapters, getAdapters, setAdapter, setAdapter, setAdapter, setAdapter, unsetAdapter`

### Methods inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound

`adaptableProperty, getAdaptable, setAdaptable`

### Methods inherited from interface org.eclipse.gef.mvc.fx.parts.IContentPart

`addContentChild, attachToContentAnchorage, contentAnchoragesUnmodifiableProperty, contentChildrenUnmodifiableProperty, contentProperty, detachFromContentAnchorage, getContentAnchoragesUnmodifiable, getContentChildrenUnmodifiable, isFocusable, isSelectable, refreshContentAnchorages, refreshContentChildren, removeContentChild, reorderContentChild, setContent`

### Methods inherited from interface org.eclipse.gef.common.dispose.IDisposable

`dispose`

### Methods inherited from interface org.eclipse.gef.mvc.fx.parts.ITransformableContentPart

`getVisualTransform, setVisualTransform`

### Methods inherited from interface org.eclipse.gef.mvc.fx.parts.IVisualPart

`addChild, addChild, addChildren, addChildren, anchoragesUnmodifiableProperty, anchoredsUnmodifiableProperty, attachAnchored, attachToAnchorage, attachToAnchorage, childrenUnmodifiableProperty, detachAnchored, detachFromAnchorage, detachFromAnchorage, getAnchoragesUnmodifiable, getAnchoredsUnmodifiable, getBehaviors, getChildrenUnmodifiable, getHandlers, getParent, getPolicies, getRoot, getViewer, getVisual, isRefreshVisual, parentProperty, refreshVisual, refreshVisualProperty, removeChild, removeChildren, reorderChild, setParent, setRefreshVisual`

## Field Details

### CSS_CLASS_LABEL

public static final String CSS_CLASS_LABEL
The CSS class that is assigned to the visualization of the `EdgeLabelPart` of this `EdgePart`.

See Also:
  - Constant Field Values

## Constructor Details

### AbstractLabelPart

public AbstractLabelPart()

## Method Details

### computeLabelPosition

public abstract Point computeLabelPosition()
Computes a position for this label.

Returns:
  The computed position for this label in the coordinate system of the `GraphPart` that contains this label.

### createText

protected javafx.scene.text.Text createText()
Creates the text visual.

Returns:
  The created `Text`.

### doActivate

protected void doActivate()

Overrides:
  `doActivate` in class `AbstractVisualPart<javafx.scene.Group>`

### doAttachToAnchorageVisual

protected void doAttachToAnchorageVisual(IVisualPart<? extends javafx.scene.Node> anchorage, String role)

Overrides:
  `doAttachToAnchorageVisual` in class `AbstractVisualPart<javafx.scene.Group>`

### doDeactivate

protected void doDeactivate()

Overrides:
  `doDeactivate` in class `AbstractVisualPart<javafx.scene.Group>`

### doDetachFromAnchorageVisual

protected void doDetachFromAnchorageVisual(IVisualPart<? extends javafx.scene.Node> anchorage, String role)

Overrides:
  `doDetachFromAnchorageVisual` in class `AbstractVisualPart<javafx.scene.Group>`

### doGetContentChildren

protected List<? extends Object> doGetContentChildren()

Specified by:
  `doGetContentChildren` in class `AbstractContentPart<javafx.scene.Group>`

### getContent

public javafx.util.Pair<? extends org.eclipse.gef.common.attributes.IAttributeStore,String> getContent()

Specified by:
  `getContent` in interface `IContentPart<javafx.scene.Group>`
Overrides:
  `getContent` in class `AbstractContentPart<javafx.scene.Group>`

### getContentTransform

public javafx.scene.transform.Affine getContentTransform()

Specified by:
  `getContentTransform` in interface `ITransformableContentPart<javafx.scene.Group>`

### getLabelPosition

public Point getLabelPosition()
Retrieves the stored position for the label.

Returns:
  The label position stored in the attributes.

### getLabelPositionAttributeKey

protected String getLabelPositionAttributeKey()
Retrieves the position attribute key for the given label role.

Returns:
  The key via which to retrieve the position attribute for the label.

### getText

protected javafx.scene.text.Text getText()
Returns the text visual.

Returns:
  The `Text` used as visual.

### recomputeLabelPosition

public void recomputeLabelPosition()
Recomputes the label position.

### refreshPosition

protected void refreshPosition(javafx.scene.Node visual, Point position)
Adjusts the label's position to fit the given `Point`.

Parameters:
  `visual` - This node's visual.
  `position` - This node's position.

### setContentTransform

public void setContentTransform(javafx.scene.transform.Affine transform)

Specified by:
  `setContentTransform` in interface `ITransformableContentPart<javafx.scene.Group>`

### setLabelPosition

public void setLabelPosition(Point computedPosition)
Sets the stored label position to the given value.

Parameters:
  `computedPosition` - The new label position.