Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "GEF/New and Noteworthy/3.7"
Line 1: | Line 1: | ||
+ | = New and Noteworthy for Previous Versions = | ||
+ | * [http://www.eclipse.org/gef/highlights30.html New and Noteworthy for 3.0] | ||
+ | * [http://www.eclipse.org/gef/newandnoteworthy/gef-news-35m4.html New and Noteworthy for 3.5 (M4)] | ||
+ | * [[GEF/New and Noteworthy/3.6| New and Noteworthy for 3.6]] | ||
+ | |||
+ | = New and Noteworthy in GEF 3.7 = | ||
+ | |||
+ | New and noteworthy items are subsumed under the respective components of the GEF project. No distinction between end-user and developer-relevant changes has been made. Instead, everything that was regarded to be of interest is mentioned here. | ||
+ | |||
== Draw2d== | == Draw2d== | ||
Revision as of 18:23, 8 November 2010
New and Noteworthy for Previous Versions
New and Noteworthy in GEF 3.7
New and noteworthy items are subsumed under the respective components of the GEF project. No distinction between end-user and developer-relevant changes has been made. Instead, everything that was regarded to be of interest is mentioned here.
Draw2d
Refactoring of Geometry API
Geometry API was refactored to guarantee consistency between integer-precision and double-precision version of Point
/PrecisionPoint
, Dimension
/PrecisionDimension
, and Rectangle
/PrecisionRectangle
. Synchronization between the still exposed integer-precision fields (x, y, width, height) and the no-longer exposed double-precision fields (preciseX, preciseY, preciseWidth, preciseHeight) is performed automatically by precision classes now, so clients may use the precision versions transparently, being no longer forced to perform a manual update of the respective fields. See 124904, 142628, and 271235 for details.
GEF
Refactoring of Layout Edit Policies
Layout edit policies have been refactored to remove duplicate code and allow better extensibility.
LayoutEditPolicy
was enhanced by adding methods relevant for translations, used in all layout edit policies (removed duplicate code from subclasses):- Added
getLayoutOrigin()
(pulled up fromConstrainedLayoutEditPolicy
) - Added
translateFromAbsoluteToLayoutRelative(Translatable t)
(synthesized from duplicated code spread throughout different layout edit policies) - Added
translateFromLayoutRelativeToAbsolute(Translatable t)
(synthesized from duplicated code spread throughout different layout edit policies)
- Added
ConstrainedLayoutEditPolicy
was changed as follows:- Added
createAddCommand(ChangeBoundsRequest request, EditPart child, Object constraint)
as a replacement forcreateAddCommand(EditPart child, Object constraint)
, which was in turn deprecated (this is now handled similar as in case of change constraint commands). - Made
createChangeConstraintCommand(EditPart child, Object constraint)
concrete (empty body) and deprecated it to indicate that clients should insteadcreateChangeConstraintCommand(ChangeBoundsRequest request, EditPart child, Object constraint)
- Added
getConstraintFor(Request request, GraphicalEditPart child, Rectangle rectangle)
, which subsumes the duplicate code fragments located ingetConstraintFor(ChangeBoundsRequest request, GraphicalEditPart child)
andgetConstraintFor(CreateRequest request)
before (both of these methods now delegate to the new method).
- Added
XYLayoutEditPolicy
was changed to overwrite the- Replaced overwritten version of
getConstraintFor(ChangeBoundsRequest request, GraphicalEditPart child)
with an overwritten version of the newly introducedgetConstraintFor(Request request, GraphicalEditPart child, Rectangle rect)
.
- Replaced overwritten version of
See 320852 for details.
Refactoring of Primary Drag Edit Policies
Primary drag edit policies were refactored to allow clients to easier provide custom handles and related select/drag/resize trackers.
NonResizableEditPolicy
was changed by introducing hook methods to allow clients to customize the creation of handles and drag/select trackers used by them:- Added
createDragHandle(List handles, int direction)
- Added
createMoveHandle(List handles, int direction)
- Added
createDragTracker()
, which is used bycreateDragHandle(List handles, int direction)
to construct the drag tracker for the created drag handle. - Added
createSelectTracker()
, which is used bycreateMoveHandle(List handles, int direction)
to construct the select tracker for the created move handle.
- Added
ResizableEditPolicy
was similarly changed by introducing the following methods:- Added
createResizeHandle(List handles, int direction)
- Added
createResizeTracker(int)
, which is used bycreateResizeHandle(List handles, int direction)
to create the resize tracker for the constructed resize handle.
- Added
The refactoring was performed in combination with the enhancement of ResizeTracker
and CreationTool
with support for constraints on resize and size-on-drop. See 67541 for details.
Enhancement of ResizeTracker and CreationTool
Extended ResizeTracker
and CreationTool
so that they now offer means to enforce certain constraints (by default, minimum and maximum size constraints) during resize as well as size-on-drop (dragging during creation). This was realized by adding methods to enforce size constraints:
-
ResizeTracker#enforceConstraintsForResize(ChangeBoundsRequest)
-
CreationTool#enforceConstraintsForSizeOnDropCreate(CreateRequest)
which are called whenever the source respectively target request is updated. By default, both ensure that minimum and maximum size constraints, which are inferred via respective hook methods:
-
ResizeTracker#getMaximumSizeFor(ChangeBoundsRequest)
-
ResizeTracker#getMinimumSizeFor(ChangeBoundsRequest)
-
CreationTool#getMaximumSizeFor(CreateRequest)
-
CreationTool#getMinimumSizeFor(CreateRequest)
Clients may overwrite the respective hook methods to infer maximum and minimum sizes for certain requests, or overwrite and adjust the enforcement of constraints as a whole (in case additional constraints have to be ensured). While the CreationTool
could already be easily exchanged with a customized subclass by specifying a tool class upon construction of a CreationToolEntry
, the ResizableEditPolicy
was now enhanced to allow clients to specify a custom ResizeTracker
as well, which will be used for all resize handles.
The logic example was enhanced to demonstrate how the new features can be used. See 67541 for details.
MarqueeSelectionTool
MarqueeSelectionTool
was enhanced to now offer the following default marquee behaviors:
- BEHAVIOR_CONNECTIONS_TOUCHED (supported since 3.1)
- BEHAVIOR_CONNECTIONS_CONTAINED
- BEHAVIOR_NODES_TOUCHED
- BEHAVIOR_NODES_CONTAINED (supported since 3.1, default behavior)
- BEHAVIOR_NODES_TOUCHED_AND_RELATED_CONNECTIONS
- BEHAVIOR_NODES_CONTAINED_AND_RELATED_CONNECTIONS (supported since 3.1, formerly known as BEHAVIOR_NODES_AND_CONNECTIONS, which was in turn deprecated).
It was furthermore refactored to allow clients to customize marquee selection behavior via subclassing and overwriting one or more of the following methods:
-
performMarqueeSelect()
-
calculateMarqueeSelectedEditParts()
-
isMarqueeSelectable(EditPart)
The following methods are now also exposed (protected visibility) so clients can use access the current tool mode and the selection rectangle in their customization code:
-
getCurrentMarqueeSelectionRectangle()
-
getCurrentSelectionMode()
The logic example was enhanced to demonstrate all new marquee behaviors. See 67991 for details.
MarqueeToolEntry
MarqueeToolEntry
has been enhanced to use different icons dependent on the marquee behavior of the tool.
- BEHAVIOR_NODE_TOUCHED and BEHAVIOR_NODES_CONTAINED
- BEHAVIOR_CONNECTIONS_TOUCHED and BEHAVIOR_CONNECTIONS_CONTAINED
- BEHAVIOR_NODES_TOUCHED_AND_RELATED_CONNECTIONS and BEHAVIOR_NODES_CONTAINED_AND_RELATED_CONNECTIONS
See 185960 for details.
MatchSizeAction
Similar to MatchWidthAction
and MatchHeightAction
, a concrete MatchSizeAction
was now made available.
The logic example was enhanced to demonstrate use of the new action. See 107916 for details.