Class ALcdGXYContextWrapper
- All Implemented Interfaces:
ILcdGXYContext,Serializable
Convenience class to wrap an ILcdGXYContext: one only has to overwrite those
methods that are required. This is also known as the decorator design pattern.
This wrapper is provided because methods might be added to the interface in a newer version of
the API. The advantage of extending from this ALcdGXYContextWrapper is that if methods
are ever added to ILcdGXYContext, they will also be added here. So when writing a
wrapper for a ILcdGXYContext, always extend this class.
- Since:
- 10.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionALcdGXYContextWrapper(ILcdGXYContext aGXYContext) Creates a wrapper for the specifiedILcdGXYContext. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the delta x for the first input point.intgetDeltaX(int aIndex) Returns the delta x for the input point at indexaIndex.intReturns the delta y for the first input point.intgetDeltaY(int aIndex) Returns the delta y for the input point at indexaIndex.Returns the wrappedILcdGXYContext.intReturns the number of input points.Returns a modifiable map to store and retrieve implementation specific context information.intReturns the sensitivity that should be used for painting and editing purposes.Short forgetSnapTarget( 0 )getSnapTarget(int aIndex) The snap target at indexaIndexif the painting or editing action requires one.Short forgetSnapTargetLayer( 0 )getSnapTargetLayer(int aIndex) intgetX()Returns the current x coordinate of the first input point.intgetX(int aIndex) Returns the current x coordinate of the input point at the given index.intgetY()Returns the current y coordinate of the first input point.intgetY(int aIndex) Returns the current y coordinate of the input point at the given index.
-
Constructor Details
-
ALcdGXYContextWrapper
Creates a wrapper for the specified
ILcdGXYContext.- Parameters:
aGXYContext- TheILcdGXYContextto wrap. Must not benull.
-
-
Method Details
-
getGXYContext
Returns the wrapped
ILcdGXYContext.- Returns:
- The wrapped
ILcdGXYContext. Nevernull.
-
getGXYView
- Specified by:
getGXYViewin interfaceILcdGXYContext- Returns:
- the
ILcdGXYViewwhere the drawing or editing occurs. - See Also:
-
getGXYLayer
- Specified by:
getGXYLayerin interfaceILcdGXYContext- Returns:
- the
ILcdGXYLayer(and therefor theILcdModel) theObjectto paint or edit belongs to. - See Also:
-
getGXYViewXYWorldTransformation
- Specified by:
getGXYViewXYWorldTransformationin interfaceILcdGXYContext- Returns:
- a valid
ILcdGXYViewXYWorldTransformationthat can be used as support for painting or editing. - See Also:
-
getModelXYWorldTransformation
- Specified by:
getModelXYWorldTransformationin interfaceILcdGXYContext- Returns:
- a valid
ILcdModelXYWorldTransformationthat can be used as support for painting or editing. - See Also:
-
getGXYPen
- Specified by:
getGXYPenin interfaceILcdGXYContext- Returns:
- a valid
ILcdGXYPenthat can be used as support for painting or editing. - See Also:
-
getInputPointCount
public int getInputPointCount()Description copied from interface:ILcdGXYContextReturns the number of input points. For mouse-based interaction, this will usually be 1, for touch-based interaction it can be more.- Specified by:
getInputPointCountin interfaceILcdGXYContext- Returns:
- the number of input points
-
getX
public int getX()Description copied from interface:ILcdGXYContextReturns the current x coordinate of the first input point.- Specified by:
getXin interfaceILcdGXYContext- Returns:
- the x coordinate of the current location of the input point at index
0 expressed in view coordinates. If
ILcdGXYContext.getInputPointCount()== 0, 0 will be returned. - See Also:
-
getX
Description copied from interface:ILcdGXYContextReturns the current x coordinate of the input point at the given index.- Specified by:
getXin interfaceILcdGXYContext- Parameters:
aIndex- the index of the input point- Returns:
- the x coordinate of the current location of the input point at index
aIndex, expressed in view coordinates - Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= getInputPointCount())- See Also:
-
getY
public int getY()Description copied from interface:ILcdGXYContextReturns the current y coordinate of the first input point.- Specified by:
getYin interfaceILcdGXYContext- Returns:
- the y coordinate of the current location of the input point at index
0, expressed in view coordinates. If
ILcdGXYContext.getInputPointCount()== 0, 0 will be returned. - See Also:
-
getY
Description copied from interface:ILcdGXYContextReturns the current y coordinate of the input point at the given index.- Specified by:
getYin interfaceILcdGXYContext- Parameters:
aIndex- the index of the input point- Returns:
- the y coordinate of the current location of the input point at index
aIndex, expressed in view coordinates - Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= getInputPointCount())- See Also:
-
getDeltaX
public int getDeltaX()Description copied from interface:ILcdGXYContextReturns the delta x for the first input point. This is typically the difference between the current x value and the original x value triggering an interaction.
- Specified by:
getDeltaXin interfaceILcdGXYContext- Returns:
- the delta x value of the first input point, or 0 when
ILcdGXYContext.getInputPointCount()== 0. - See Also:
-
getDeltaX
Description copied from interface:ILcdGXYContextReturns the delta x for the input point at index
aIndex. This is typically the difference between the current x value and the original x value triggering an interaction.- Specified by:
getDeltaXin interfaceILcdGXYContext- Parameters:
aIndex- the index- Returns:
- the delta x for the input point at index
aIndex, expressed in view coordinates - Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= getInputPointCount())- See Also:
-
getDeltaY
public int getDeltaY()Description copied from interface:ILcdGXYContextReturns the delta y for the first input point. This is typically the difference between the current y value and the original y value triggering the interaction.
- Specified by:
getDeltaYin interfaceILcdGXYContext- Returns:
- the delta y value of the first input point, or 0 when
ILcdGXYContext.getInputPointCount()== 0. - See Also:
-
getDeltaY
Description copied from interface:ILcdGXYContextReturns the delta y for the input point at index
aIndex. This is typically the difference between the current x value and the original y value triggering an interaction.- Specified by:
getDeltaYin interfaceILcdGXYContext- Parameters:
aIndex- the index- Returns:
- the delta y for the input point at index
aIndex, expressed in view coordinates - Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= getInputPointCount())- See Also:
-
getSnapTarget
Description copied from interface:ILcdGXYContextShort for
getSnapTarget( 0 )When
ILcdGXYContext.getInputPointCount()()} == 0, this method will returnnull, whilegetSnapTarget( 0 )will throw anIndexOutOfBoundsException.- Specified by:
getSnapTargetin interfaceILcdGXYContext- Returns:
- the first snap target, or
nullwhen no snap target is available - See Also:
-
getSnapTarget
Description copied from interface:ILcdGXYContextThe snap target at indexaIndexif the painting or editing action requires one. This snap target should correspond to the input point at indexaIndex.- Specified by:
getSnapTargetin interfaceILcdGXYContext- Parameters:
aIndex- the index- Returns:
- the snap target at index
aIndex - Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= getInputPointCount())
-
getSnapTargetLayer
Description copied from interface:ILcdGXYContextShort for
getSnapTargetLayer( 0 )When
ILcdGXYContext.getInputPointCount()()} == 0, this method will returnnull, whilegetSnapTarget( 0 )will throw anIndexOutOfBoundsException.- Specified by:
getSnapTargetLayerin interfaceILcdGXYContext- Returns:
- the layer of the first snap target, or
nullwhen no snap target is available
-
getSnapTargetLayer
Description copied from interface:ILcdGXYContextReturns the
ILcdGXYLayerof the snap target at indexaIndex.- Specified by:
getSnapTargetLayerin interfaceILcdGXYContext- Parameters:
aIndex- the index- Returns:
- the
ILcdGXYLayerof the snap target at indexaIndex - Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= getInputPointCount())
-
getSensitivity
public int getSensitivity()Description copied from interface:ILcdGXYContextReturns the sensitivity that should be used for painting and editing purposes. This is for instance the distance between an input point and a handle that still allows the input to interact with the handle. Returning a value smaller than zero indicates that the painter/editor can choose the sensitivity to use.- Specified by:
getSensitivityin interfaceILcdGXYContext- Returns:
- the sensitivity for painting/editing purposes or a value smaller than zero if the sensitivity should be chosen by the painter/editor.
-
getProperties
Description copied from interface:ILcdGXYContextReturns a modifiable map to store and retrieve implementation specific context information. For example, an editor can use it to store information on an ongoing creation or editing process across multiple invocations, e.g. the handle that is currently being edited.- Specified by:
getPropertiesin interfaceILcdGXYContext- Returns:
- a modifiable map to store and retrieve implementation specific context information
-