public abstract class ALcdGXYContextWrapper extends Object implements ILcdGXYContext
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.
Constructor and Description |
---|
ALcdGXYContextWrapper(ILcdGXYContext aGXYContext)
Creates a wrapper for the specified
ILcdGXYContext . |
Modifier and Type | Method and Description |
---|---|
int |
getDeltaX()
Returns the delta x for the first input point.
|
int |
getDeltaX(int aIndex)
Returns the delta x for the input point at index
aIndex . |
int |
getDeltaY()
Returns the delta y for the first input point.
|
int |
getDeltaY(int aIndex)
Returns the delta y for the input point at index
aIndex . |
ILcdGXYContext |
getGXYContext()
Returns the wrapped
ILcdGXYContext . |
ILcdGXYLayer |
getGXYLayer() |
ILcdGXYPen |
getGXYPen() |
ILcdGXYView |
getGXYView() |
ILcdGXYViewXYWorldTransformation |
getGXYViewXYWorldTransformation() |
int |
getInputPointCount()
Returns the number of input points.
|
ILcdModelXYWorldTransformation |
getModelXYWorldTransformation() |
Map<Object,Object> |
getProperties()
Returns a modifiable map to store and retrieve implementation specific context information.
|
int |
getSensitivity()
Returns the sensitivity that should be used for painting and editing purposes.
|
Object |
getSnapTarget()
Short for
getSnapTarget( 0 ) |
Object |
getSnapTarget(int aIndex)
The snap target at index
aIndex if the painting or editing action requires one. |
ILcdGXYLayer |
getSnapTargetLayer()
Short for
getSnapTargetLayer( 0 ) |
ILcdGXYLayer |
getSnapTargetLayer(int aIndex)
|
int |
getX()
Returns the current x coordinate of the first input point.
|
int |
getX(int aIndex)
Returns the current x coordinate of the input point at the given index.
|
int |
getY()
Returns the current y coordinate of the first input point.
|
int |
getY(int aIndex)
Returns the current y coordinate of the input point at the given index.
|
public ALcdGXYContextWrapper(ILcdGXYContext aGXYContext)
Creates a wrapper for the specified ILcdGXYContext
.
aGXYContext
- The ILcdGXYContext
to wrap. Must not be null
.public ILcdGXYContext getGXYContext()
Returns the wrapped ILcdGXYContext
.
ILcdGXYContext
. Never null
.public ILcdGXYView getGXYView()
getGXYView
in interface ILcdGXYContext
ILcdGXYView
where the drawing or editing occurs.ILcdGXYView
public ILcdGXYLayer getGXYLayer()
getGXYLayer
in interface ILcdGXYContext
ILcdGXYLayer
(and therefor the
ILcdModel
) the Object
to paint or edit belongs to.ILcdLayer.getModel()
public ILcdGXYViewXYWorldTransformation getGXYViewXYWorldTransformation()
getGXYViewXYWorldTransformation
in interface ILcdGXYContext
ILcdGXYViewXYWorldTransformation
that can be used as support for
painting or editing.ILcdGXYPen
public ILcdModelXYWorldTransformation getModelXYWorldTransformation()
getModelXYWorldTransformation
in interface ILcdGXYContext
ILcdModelXYWorldTransformation
that can be used as support for
painting or editing.ILcdGXYPen
public ILcdGXYPen getGXYPen()
getGXYPen
in interface ILcdGXYContext
ILcdGXYPen
that can be used as support for
painting or editing.ILcdGXYPen
public int getInputPointCount()
ILcdGXYContext
getInputPointCount
in interface ILcdGXYContext
public int getX()
ILcdGXYContext
getX
in interface ILcdGXYContext
ILcdGXYContext.getInputPointCount()
== 0, 0 will be returned.ILcdGXYPainter.paint(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)
,
ILcdGXYEditor.edit(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)
,
ILcdGXYContext.getInputPointCount()
,
ILcdGXYContext.getX(int)
public int getX(int aIndex) throws IndexOutOfBoundsException
ILcdGXYContext
getX
in interface ILcdGXYContext
aIndex
- the index of the input pointaIndex
, expressed in view coordinatesIndexOutOfBoundsException
- if the index is out of range (index < 0 || index >=
getInputPointCount())ILcdGXYPainter.paint(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)
,
ILcdGXYEditor.edit(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)
,
ILcdGXYContext.getInputPointCount()
public int getY()
ILcdGXYContext
getY
in interface ILcdGXYContext
ILcdGXYContext.getInputPointCount()
== 0, 0 will be returned.ILcdGXYPainter.paint(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)
,
ILcdGXYEditor.edit(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)
,
ILcdGXYContext.getInputPointCount()
,
ILcdGXYContext.getY(int)
public int getY(int aIndex) throws IndexOutOfBoundsException
ILcdGXYContext
getY
in interface ILcdGXYContext
aIndex
- the index of the input pointaIndex
, expressed in view coordinatesIndexOutOfBoundsException
- if the index is out of range (index < 0 || index >=
getInputPointCount())ILcdGXYPainter.paint(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)
,
ILcdGXYEditor.edit(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)
,
ILcdGXYContext.getInputPointCount()
public int getDeltaX()
ILcdGXYContext
Returns 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.
getDeltaX
in interface ILcdGXYContext
ILcdGXYContext.getInputPointCount()
== 0.ILcdGXYContext.getInputPointCount()
,
ILcdGXYContext.getDeltaX(int)
public int getDeltaX(int aIndex) throws IndexOutOfBoundsException
ILcdGXYContext
Returns 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.
getDeltaX
in interface ILcdGXYContext
aIndex
- the indexaIndex
, expressed in view coordinatesIndexOutOfBoundsException
- if the index is out of range (index < 0 || index >=
getInputPointCount())ILcdGXYContext.getInputPointCount()
public int getDeltaY()
ILcdGXYContext
Returns 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.
getDeltaY
in interface ILcdGXYContext
ILcdGXYContext.getInputPointCount()
== 0.ILcdGXYContext.getInputPointCount()
,
ILcdGXYContext.getDeltaY(int)
public int getDeltaY(int aIndex) throws IndexOutOfBoundsException
ILcdGXYContext
Returns 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.
getDeltaY
in interface ILcdGXYContext
aIndex
- the indexaIndex
, expressed in view coordinatesIndexOutOfBoundsException
- if the index is out of range (index < 0 || index >=
getInputPointCount())ILcdGXYContext.getInputPointCount()
public Object getSnapTarget()
ILcdGXYContext
Short for getSnapTarget( 0 )
When ILcdGXYContext.getInputPointCount()
()} == 0, this method will return null
, while
getSnapTarget( 0 )
will throw an IndexOutOfBoundsException
.
getSnapTarget
in interface ILcdGXYContext
null
when no snap target is availableILcdGXYContext.getSnapTarget(int)
public Object getSnapTarget(int aIndex) throws IndexOutOfBoundsException
ILcdGXYContext
aIndex
if the painting or editing action requires one. This
snap target should correspond to the input point at index aIndex
.getSnapTarget
in interface ILcdGXYContext
aIndex
- the indexaIndex
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >=
getInputPointCount())public ILcdGXYLayer getSnapTargetLayer()
ILcdGXYContext
Short for getSnapTargetLayer( 0 )
When ILcdGXYContext.getInputPointCount()
()} == 0, this method will return null
, while
getSnapTarget( 0 )
will throw an IndexOutOfBoundsException
.
getSnapTargetLayer
in interface ILcdGXYContext
null
when no snap target is
availablepublic ILcdGXYLayer getSnapTargetLayer(int aIndex) throws IndexOutOfBoundsException
ILcdGXYContext
Returns the ILcdGXYLayer
of the snap target at
index aIndex
.
getSnapTargetLayer
in interface ILcdGXYContext
aIndex
- the indexILcdGXYLayer
of the snap target at
index aIndex
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >=
getInputPointCount())public int getSensitivity()
ILcdGXYContext
getSensitivity
in interface ILcdGXYContext
public Map<Object,Object> getProperties()
ILcdGXYContext
getProperties
in interface ILcdGXYContext