Package jpicedt.graphic.toolkit
Class EditPointMouseTransformFactory
- java.lang.Object
-
- jpicedt.graphic.toolkit.AbstractMouseTransformFactory
-
- jpicedt.graphic.toolkit.EditPointMouseTransformFactory
-
- All Implemented Interfaces:
MouseTransformFactory
public class EditPointMouseTransformFactory extends AbstractMouseTransformFactory
A factory that produces MouseTransform's that may be plugged into the SelectionTool mouse-tool. MouseTransform's created by this factory are dedicated to editing points of Elements which either support a variable number of points (e.g. AbstractCurve and subclasses), and/or whose point possess specific geometric feature (e.g. smoothness/symmetry for PicMultiCurve, smoothness coefficient for PicSmoothPolygon,...). So far, only AbstractCurve's are supported by the current implementation.- Since:
- jPicEdt 1.4
- Version:
- $Id: EditPointMouseTransformFactory.java,v 1.17.2.1 2007/09/02 11:56:28 reynal Exp $
- Author:
- Sylvain Reynal
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classEditPointMouseTransformFactory.EditSmoothCoeffTransforma mouse-transform that edit smooth-coefficients for a PicSmoothPolygon (edit ALL selected points at once)protected classEditPointMouseTransformFactory.RemovePointTransforma mouse-transform that removes selected points to/from extensible curves or parallelogram/ellipses after conversion to a multicurve.protected classEditPointMouseTransformFactory.SelectedPointsHandlerHelper class for SelectPointsInAreaTransform.protected classEditPointMouseTransformFactory.SelectElementTransformprotected classEditPointMouseTransformFactory.SelectPointsInAreaTransforma mouse-transform that selects all elements inside a rectangle dragged by the userprotected classEditPointMouseTransformFactory.SplitSegmentTransforma mouse-transform that add points to extensible curvesprotected classEditPointMouseTransformFactory.UnSelectPointTransforma mouse-transform that unselects points-
Nested classes/interfaces inherited from class jpicedt.graphic.toolkit.AbstractMouseTransformFactory
AbstractMouseTransformFactory.HelpMessageMouseTransform, AbstractMouseTransformFactory.InvalidMouseTransform, AbstractMouseTransformFactory.SelectAreaTransform
-
-
Constructor Summary
Constructors Constructor Description EditPointMouseTransformFactory(EditorKit kit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MouseTransformcreateMouseTransform(PEMouseEvent e)Return a MouseTransform whose type is adequate with the given mouse-event.voidflush()called when the associated SelectionTool is being deactivated in the hosting EditorKit.EditPointMouseTransformFactory.SelectedPointsHandlergetSelectedPointsHandler()Returns a reference to the current SelectedPointsHandlervoidinit()called when the associated SelectionTool is being activated in the hosting EditorKit.protected booleanisValidTarget(Element e)Return true is the given element is a valid target for this factory.voidpaint(java.awt.Graphics2D g, java.awt.geom.Rectangle2D allocation, double scale)Allows this EditPointMouseTransformFactory to do specific graphic rendering when it's installed in a hosting SelectionTool.-
Methods inherited from class jpicedt.graphic.toolkit.AbstractMouseTransformFactory
getEditorKit
-
-
-
-
Constructor Detail
-
EditPointMouseTransformFactory
public EditPointMouseTransformFactory(EditorKit kit)
- Parameters:
kit- the hosting editor-kit
-
-
Method Detail
-
getSelectedPointsHandler
public EditPointMouseTransformFactory.SelectedPointsHandler getSelectedPointsHandler()
Returns a reference to the current SelectedPointsHandler
-
isValidTarget
protected boolean isValidTarget(Element e)
Return true is the given element is a valid target for this factory.
-
paint
public void paint(java.awt.Graphics2D g, java.awt.geom.Rectangle2D allocation, double scale)Allows this EditPointMouseTransformFactory to do specific graphic rendering when it's installed in a hosting SelectionTool. This implementation renders selected points using a specific highlighter (which superimposes to the standard highlighter).- Specified by:
paintin interfaceMouseTransformFactory- Overrides:
paintin classAbstractMouseTransformFactory- Since:
- jpicedt 1.4
-
init
public void init()
called when the associated SelectionTool is being activated in the hosting EditorKit. This cleans up the state of the underlying SelectionPointsHandler, and checks for the state of the current selection (ie EditorKit's selection handler) to be adequate with the mouse-transform's created by this factory. This means in particular that only one Element may be selected, and that (so far) it MUST be an instance of AbstractCurve. Besides, highlightingMode is forced to LOCAL_MODE, so that curve's control-points are visible ("green squares").- Specified by:
initin interfaceMouseTransformFactory- Overrides:
initin classAbstractMouseTransformFactory
-
flush
public void flush()
called when the associated SelectionTool is being deactivated in the hosting EditorKit. this simply cleans up the state of the underlying SelectionPointsHandler.- Specified by:
flushin interfaceMouseTransformFactory- Overrides:
flushin classAbstractMouseTransformFactory
-
createMouseTransform
public MouseTransform createMouseTransform(PEMouseEvent e)
Return a MouseTransform whose type is adequate with the given mouse-event. This can be null if no MouseTransform matches the given event.Basically, we work with the following modifiers : Shift, Control, Alt. Other modifiers must be excluded, given their poor support on MacOS platforms, and their odd behaviours on some Unices. Similarly, double-click events should be avoided since these are rather hard to deal with seeing that a single-click event is ALWAYS posted beforehands.
-
-