public class TLcdGXYLonLatHeightBufferPainter extends ALcdGXYAreaPainter implements ILcdGXYPainter, ILcdGXYEditor, ILcdGXYEditorProvider
TLcdLonLatHeightBuffer
objects in an ILcdGXYView
.Modifier and Type | Field and Description |
---|---|
static int |
AREA
Deprecated.
use
FILLED instead |
static int |
FILLED
Deprecated.
Draw the area defined by the buffer filled with the foreground color.
|
static int |
OUTLINED
Deprecated.
Draw only the outline of the buffer.
|
static int |
OUTLINED_FILLED
Deprecated.
Draw the buffer as an outlined and filled area.
|
static int |
OUTLINED_FILLED_OPEN
Deprecated.
Draw the buffer as an outlined and filled area where the outline is open
at both ends.
|
static int |
OUTLINED_OPEN
Deprecated.
Draw the outline of the buffer which is open at both ends.
|
static int |
POLYGON
Deprecated.
use
OUTLINED instead |
defaultCreationFillStyle, defaultCreationLineStyle, defaultFillStyle, defaultLineStyle, fWorkBounds
BODY, CREATING, DEFAULT, HANDLES, RESHAPING, SELECTED, SNAPS, TRANSLATING
CREATING, END_CREATION, RESHAPED, START_CREATION, TRANSLATED
Constructor and Description |
---|
TLcdGXYLonLatHeightBufferPainter()
Deprecated.
Creates a new TLcdGXYBufferPainter.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptSnapTarget(Graphics aGraphics,
ILcdGXYContext aGXYContext)
Deprecated.
Returns whether the object set to the editor can be edited so that (part of) the object snaps to the object passed
as snap target in the context.
|
void |
boundsSFCT(Graphics aGraphics,
int aMode,
ILcdGXYContext aGXYContext,
ILcd2DEditableBounds aBoundsSFCT)
Deprecated.
Sets the supplied bounds (in view coordinates, pixels) so that it encompasses the representation of the object
in the given mode taking into account the given context.
|
protected void |
calculateBoundsSFCT(int aMode,
ILcdGXYContext aGXYContext,
ILcd2DEditableBounds aBoundsSFCT)
Deprecated.
Computes the bounds of the current object of the paint as the bounds that holds all contour points which are
visible in the given context.
|
Object |
clone()
Deprecated.
Makes
Object.clone() public. |
boolean |
edit(Graphics aGraphics,
int aMode,
ILcdGXYContext aGXYContext)
Deprecated.
Defines how an object shall be edited by this editor, taking into account the mode and the
context passed.
|
double |
getCreationBufferWidth()
Deprecated.
Returns the buffer width set for creation of a new buffer.
|
int |
getCreationClickCount()
Deprecated.
Returns the number of points needed for creation of a new buffer.
|
Cursor |
getCursor(Graphics aGraphics,
int aMode,
ILcdGXYContext aGXYContext)
Deprecated.
Implements
ILcdGXYPainter.getCursor . |
boolean |
getDrawAxis()
Deprecated.
|
boolean |
getDrawIntersection()
Deprecated.
|
ILcdGXYEditor |
getGXYEditor(Object aObject)
Deprecated.
This implementation always returns this instance as an editor, with the object passed set as object.
|
int |
getMinimumEditDelta()
Deprecated.
Returns the minimum pixel distance the input device (a mouse, for example) must move before editing the shape.
|
Object |
getObject()
Deprecated.
Returns the object set to paint or edit.
|
boolean |
getPaintCache()
Deprecated.
Returns whether caching will be used when painting the buffer.
|
ILcdIcon |
getSnapIcon()
Deprecated.
Returns the icon to paint snap target points of the object set to this painter.
|
boolean |
isDrawAxis()
Deprecated.
Returns whether the axis should be painted.
|
boolean |
isDrawAxisPoints()
Deprecated.
Returns whether the axis points should be painted.
|
boolean |
isDrawAxisPointsWhenSelected()
Deprecated.
Returns whether the painter draws the axis points of the
TLcdLonLatHeightBuffer
when it is painted in selected mode. |
boolean |
isDrawAxisWhenSelected()
Deprecated.
Returns whether the painter draws the axis of the
TLcdLonLatHeightBuffer when
it is painted in selected mode. |
boolean |
isDrawIntersection()
Deprecated.
Returns whether to paint the point on the central axis
that is the closest to the point on the corridor at which the width of the
corridor is made to change.
|
boolean |
isSnapToInvisiblePoints()
Deprecated.
Returns whether the painter allows snapping to the invisible points of the shape.
|
boolean |
isTouched(Graphics aGraphics,
int aMode,
ILcdGXYContext aGXYContext)
Deprecated.
Depending on the painter mode, returns whether the current object of the painter is touched by
the mouse in the given context.
|
boolean |
isTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
paint(Graphics aGraphics,
int aMode,
ILcdGXYContext aGXYContext)
Deprecated.
Displays the representation of the object in the given mode on the Graphics passed, taking into account the
supplied context.
|
void |
setCreationBufferWidth(double aBufferWidth)
Deprecated.
Sets the width of the buffer to be set at creation time.
|
void |
setDrawAxis(boolean aDrawAxis)
Deprecated.
drawAxis determines whether to paint the central axis when the object is
not in
ILcdGXYPainter.SELECTED mode. |
void |
setDrawAxisPoints(boolean aDrawAxisPoints)
Deprecated.
DrawAxisPoints determines whether to paint the central axis point when the object is
not in
ILcdGXYPainter.SELECTED mode. |
void |
setDrawAxisPointsWhenSelected(boolean aDrawAxisPointsWhenSelected)
Deprecated.
Sets whether the axis points of the
TLcdLonLatHeightBuffer should be drawn when selected. |
void |
setDrawAxisWhenSelected(boolean aDrawAxisWhenSelected)
Deprecated.
Sets whether the axis of the
TLcdLonLatHeightBuffer should be drawn when selected. |
void |
setDrawIntersection(boolean aDrawIntersection)
Deprecated.
drawIntersection determines whether to paint the point on the central axis
that is the closest to the point on the corridor at which the width of the
corridor is made to change.
|
void |
setMinimumEditDelta(int aDelta)
Deprecated.
Sets the minimum pixel distance the input device (a mouse, for example) must move before editing the shape.
|
void |
setMode(int aMode)
Deprecated.
Sets the mode to decide how to paint an object:
the outline (
ALcdGXYAreaPainter.OUTLINED ), as a filled area (ALcdGXYAreaPainter.FILLED ), or
as a filled and outlined area (ALcdGXYAreaPainter.OUTLINED_FILLED ). |
void |
setModelModelTransformationClass(Class aModel2ModelTransformationClass)
Deprecated.
Sets the transformation class to use to transform points when snapping to points in models
with non equal model references.
|
void |
setObject(Object aObject)
Deprecated.
Sets the object to paint or edit with this painter/editor.
|
void |
setPaintCache(boolean aPaintCache)
Deprecated.
The property paintCache determines whether the painter will cache the
points it has drawn.
|
void |
setSelectionMode(int aSelectionMode)
Deprecated.
Sets the selection mode to decide how to paint a selected object:
the outline (
ALcdGXYAreaPainter.OUTLINED ), as a filled area (ALcdGXYAreaPainter.FILLED ), or
as a filled and outlined area (ALcdGXYAreaPainter.OUTLINED_FILLED ). |
void |
setSnapIcon(ILcdIcon aSnapIcon)
Deprecated.
Sets the icon to paint snap target points of the object set to this painter.
|
void |
setSnapToInvisiblePoints(boolean aSnapToInvisiblePoints)
Deprecated.
Sets whether the other shapes can snap to invisible points of this shape.
|
void |
setTraceOn(boolean aTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
protected void |
setupGraphicsForFill(Graphics aGraphics,
int aMode,
ILcdGXYContext aGXYContext)
Deprecated.
This method is called by this
ILcdGXYPainter just before
drawing Fills on aGraphics. |
protected void |
setupGraphicsForLine(Graphics aGraphics,
int aMode,
ILcdGXYContext aGXYContext)
Deprecated.
This method is called by this
ILcdGXYPainter just before
drawing lines on aGraphics. |
void |
setWidthFormat(Format aWidthFormat)
Deprecated.
Controls how the width will be displayed when editing the buffer.
|
Object |
snapTarget(Graphics aGraphics,
ILcdGXYContext aGXYContext)
Deprecated.
Returns one of the axis or contour points of the
TLcdLonLatHeightBuffer if it is
touched. |
boolean |
supportSnap(Graphics aGraphics,
ILcdGXYContext aGXYContext)
Deprecated.
This implementation supports snapping.
|
getEditMode, getFillStyle, getLineStyle, getMode, getSelectionMode, setEditMode, setFillStyle, setLineStyle
addPropertyChangeListener, anchorPointSFCT, firePropertyChangeEvent, firePropertyChangeEvent, getDisplayName, getGXYPainter, removePropertyChangeListener, setClassTraceOn, setDisplayName
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
anchorPointSFCT, getDisplayName
getDisplayName
addPropertyChangeListener, removePropertyChangeListener
public static final int OUTLINED
public static final int FILLED
public static final int OUTLINED_FILLED
public static final int OUTLINED_OPEN
public static final int OUTLINED_FILLED_OPEN
public static final int POLYGON
OUTLINED
insteadOUTLINED
,
Constant Field Valuespublic static final int AREA
FILLED
insteadFILLED
,
Constant Field Valuespublic TLcdGXYLonLatHeightBufferPainter()
public void setTraceOn(boolean aTraceOn)
true
or false
as argument automatically turns
off tracing for all other class instances for which
setTraceOn
has not been called.
If the argument is false
then only the informative, warning
and error log messages are recorded.setTraceOn
in class ALcdGXYPainter
aTraceOn
- if true then all log messages are recorded for this
instance. If false, then only the informative, warning and
error log messages are recorded.public boolean isTraceOn()
true
if tracing is enabled for this class.isTraceOn
in class ALcdGXYPainter
public void setObject(Object aObject)
setObject
in interface ILcdGXYEditor
setObject
in interface ILcdGXYPainter
aObject
- the object to paint or edit with this painter/editor.getObject()
public final Object getObject()
getObject
in interface ILcdGXYEditor
getObject
in interface ILcdGXYPainter
setObject(java.lang.Object)
public void setPaintCache(boolean aPaintCache)
aPaintCache
- the new PaintCache value.getPaintCache()
public boolean getPaintCache()
setPaintCache(boolean)
public void setCreationBufferWidth(double aBufferWidth)
aBufferWidth
- the new CreationBufferWidth value.getCreationBufferWidth()
public double getCreationBufferWidth()
setCreationBufferWidth(double)
public void setMode(int aMode)
ALcdGXYAreaPainter
ALcdGXYAreaPainter.OUTLINED
), as a filled area (ALcdGXYAreaPainter.FILLED
), or
as a filled and outlined area (ALcdGXYAreaPainter.OUTLINED_FILLED
).setMode
in class ALcdGXYAreaPainter
aMode
- The mode deciding how to paint an object.ALcdGXYAreaPainter.getSelectionMode()
public void setSelectionMode(int aSelectionMode)
ALcdGXYAreaPainter
ALcdGXYAreaPainter.OUTLINED
), as a filled area (ALcdGXYAreaPainter.FILLED
), or
as a filled and outlined area (ALcdGXYAreaPainter.OUTLINED_FILLED
).setSelectionMode
in class ALcdGXYAreaPainter
aSelectionMode
- The mode deciding how to paint a selected object.ALcdGXYAreaPainter.getSelectionMode()
public void setDrawIntersection(boolean aDrawIntersection)
aDrawIntersection
- true to paint the point on the central axis
that is the closest to the point on the corridor at which the width of the
corridor is made to change.isDrawIntersection()
public boolean isDrawIntersection()
setDrawIntersection(boolean)
public boolean getDrawIntersection()
public void setDrawAxis(boolean aDrawAxis)
ILcdGXYPainter.SELECTED
mode.aDrawAxis
- true to paint the axis when painting the buffer.isDrawAxis()
public boolean isDrawAxis()
setDrawAxis(boolean)
public boolean getDrawAxis()
public void setDrawAxisWhenSelected(boolean aDrawAxisWhenSelected)
TLcdLonLatHeightBuffer
should be drawn when selected.aDrawAxisWhenSelected
- the new drawAxisWhenSelected property value.isDrawAxisWhenSelected()
public boolean isDrawAxisWhenSelected()
TLcdLonLatHeightBuffer
when
it is painted in selected mode.TLcdLonLatHeightBuffer
when
it is painted in selected mode.setDrawAxisWhenSelected(boolean)
public void setDrawAxisPoints(boolean aDrawAxisPoints)
ILcdGXYPainter.SELECTED
mode.aDrawAxisPoints
- true to paint the axis points when painting the buffer.isDrawAxisPoints()
public boolean isDrawAxisPoints()
setDrawAxisPoints(boolean)
public void setDrawAxisPointsWhenSelected(boolean aDrawAxisPointsWhenSelected)
TLcdLonLatHeightBuffer
should be drawn when selected.aDrawAxisPointsWhenSelected
- the new drawAxisPointsWhenSelected property value.isDrawAxisPointsWhenSelected()
public boolean isDrawAxisPointsWhenSelected()
TLcdLonLatHeightBuffer
when it is painted in selected mode.TLcdLonLatHeightBuffer
when it is painted in selected mode.setDrawAxisPointsWhenSelected(boolean)
public void setSnapToInvisiblePoints(boolean aSnapToInvisiblePoints)
TLcdLonLatHeightBuffer
, all axis points are invisible points if
there are not drawn.aSnapToInvisiblePoints
- the new snapToInvisiblePoints property value.isSnapToInvisiblePoints()
public boolean isSnapToInvisiblePoints()
setSnapToInvisiblePoints(boolean)
public void setWidthFormat(Format aWidthFormat)
aWidthFormat
- formats a Double, the distance between the center axis and the contour, as
a String containing information on the width of the buffer.public void setMinimumEditDelta(int aDelta)
aDelta
- the minimum pixel distance the input device should move in either the X or Y directionpublic int getMinimumEditDelta()
public void setSnapIcon(ILcdIcon aSnapIcon)
aSnapIcon
- the icon to paint snap target points of the object set to this painter.getSnapIcon()
public ILcdIcon getSnapIcon()
setSnapIcon(com.luciad.gui.ILcdIcon)
public Cursor getCursor(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext)
ILcdGXYPainter.getCursor
. A non-null cursor is
returned only if aMode is equal to ILcdGXYPainter.RESHAPING
or
ILcdGXYPainter.TRANSLATING
. The kind of cursor that is
returned depends on location of the mouse: Cursor.CROSSHAIR_CURSOR, if the
mouse pointer is positioned on an axis point. Cursor.MOVE_CURSOR, if the
mouse pointer is positioned on an axis segment line. Either
Cursor.N_RESIZE_CURSOR, Cursor.W_RESIZE_CURSOR , Cursor.NE_RESIZE_CURSOR or
Cursor.NW_RESIZE_CURSOR, if the mouse pointer is positioned on a contour
segment line. Which one is actually returned depends on the orientation of
the contour segment line.getCursor
in interface ILcdGXYPainter
getCursor
in class ALcdGXYPainter
aGraphics
- the Graphics to get the cursor on.aMode
- the painting mode for which to get the cursor.aGXYContext
- the context in which to get the cursor.ILcdGXYPainter.RESHAPING
or
ILcdGXYPainter.TRANSLATING
and:
public ILcdGXYEditor getGXYEditor(Object aObject)
getGXYEditor
in interface ILcdGXYEditorProvider
aObject
- the object to retrieve an editor for.public boolean isTouched(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext)
isTouched
in interface ILcdGXYPainter
aGraphics
- the graphics to check on whether the object in this painter is touched.aMode
- the painting mode to check in whether this painters object is touched.aGXYContext
- the context to check in whether this painters object is touched.setMode(int)
)
if
boundsSFCT
public int getCreationClickCount()
getCreationClickCount
in interface ILcdGXYEditor
public void paint(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext)
ILcdGXYPainter
The visual representation of an object depends on the context. Depending on the context (e.g. is the location covered by the view), an object may or may not have a representation. The context contains:
The mode passed in this method indicates what part of the object must be painted, whether it should be painted as selected or not, and whether user interaction (via mouse movements) must be taken into account.
When the mode passed contains either TRANSLATING, RESHAPING or CREATING, this method is also responsible for
interpreting interaction on the representation of an object and modifying the representation of the object
accordingly. The painter is not responsible for modifying the object itself, this is done by
a corresponding ILcdGXYEditor
.
Implementations of ILcdGXYPainter
and ILcdGXYEditor
interfaces must be consistent for
an object: the painter must display the result of the user interaction on the object, while the editor is
responsible for modifying the object as a result of the user interaction.
A good practice to ensure a consistent implementation is to implement both the ILcdGXYPainter
and ILcdGXYEditor
interfaces in a single class.
When the mode passed includes SNAPS, the part of the representation which corresponds to the object returned as
snap target by the method snapTarget
must be painted in order to provide the user with a visual indication of the snap target.
The Graphics passed in this method can be different from the Graphics returned by a view due to techniques such as double buffering (as applied in Swing). Basic drawing operations must always be performed on the Graphics passed as an argument in this method.
paint
in interface ILcdGXYPainter
aGraphics
- the Graphics on which the representation of the object is paintedaMode
- the mode the object is represented in (see class documentation).aGXYContext
- the ILcdGXYContext
the drawing depends on.public boolean edit(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext)
ILcdGXYEditor
The mode passed indicates how the interaction should be interpreted. It can be one of the following:
TRANSLATED
RESHAPED
START_CREATION
CREATING
END_CREATION
The first two modes designate that the object should be modified, the last three modes are passed
when initializing an object. From an implementation point of view there is no difference between TRANSLATED and
RESHAPED. These constants only differ in semantics. For ILcdShape
objects TRANSLATED can be seen
as the mode that will be passed when the shape as a whole is moved. RESHAPED is used more often for moving part of
a shape.
The context contains information on the user interaction at hand. The methods
getX
and
getY
contain the location(s) of the user interaction. The methods
getDeltaX
and
getDeltaY
contain the distance(s) over which the user interaction is taking place. For example, getX
and
getY
may contain the current mouse location while getDeltaX
and getDeltaY
contain the distance over which the mouse has been dragged. The editing behavior can take into
account multiple locations, to respond to, for example, multi-touch input.
When a snap target is accepted, the implementation of this method should take that fact into account when editing or initializing an object.
edit
in interface ILcdGXYEditor
aGraphics
- the graphics on which the buffer is being edited. This might be of importance e.g. when a scale or
a clip is set on the graphics.aMode
- the editing mode, it will contain either ILcdGXYEditor.TRANSLATING or ILcdGXYEditor.RESHAPINGaGXYContext
- the context in which the buffer will be edited. This contains the graphics on which the buffer
is painted, the current and previous mouse position, model to world, world to view transformations and possible snap
targets.ILcdGXYContext
,
acceptSnapTarget
public void boundsSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, ILcd2DEditableBounds aBoundsSFCT) throws TLcdNoBoundsException
ILcdGXYPainter
If this method returns without exception the bounds argument must encompass the representation of the object. A point outside the bounds will not be contained within the painted object.
The bounds returned in this method can be seen as the equivalent in the view space of the bounds in the model
space for ILcdBounded
objects.
boundsSFCT
in interface ILcdGXYPainter
aGraphics
- aMode
- aGXYContext
- aBoundsSFCT
- TLcdNoBoundsException
isTouched
public boolean supportSnap(Graphics aGraphics, ILcdGXYContext aGXYContext)
supportSnap
in interface ILcdGXYPainter
supportSnap
in class ALcdGXYPainter
aGraphics
- the Graphics on which the painter supports snap.aGXYContext
- the context in which the painter supports snap.public Object snapTarget(Graphics aGraphics, ILcdGXYContext aGXYContext)
TLcdLonLatHeightBuffer
if it is
touched. An axis points is only returned if the axis point is drawn (see isDrawAxisPoints()
and isDrawAxis()
) or when snapping to invisible points is enabled (see
isSnapToInvisiblePoints()
).snapTarget
in interface ILcdGXYPainter
snapTarget
in class ALcdGXYPainter
aGraphics
- the Graphics on which the snap target is given.aGXYContext
- the context in which the snap target is given.ILcdPoint
that is touched, otherwise null.supportSnap
public void setModelModelTransformationClass(Class aModel2ModelTransformationClass)
Setting this property allows to snap to points defined in a different model reference.
aModel2ModelTransformationClass
- the transformation to use as described above. Instances of this
class should implement ILcdModelModelTransformation
public boolean acceptSnapTarget(Graphics aGraphics, ILcdGXYContext aGXYContext)
edit
method with this
context passed should edit the object so that (part of) the object snaps to the object passed
as snap target in the context.
The context contains information on the user interaction at hand: the current location of the
user interaction, given by its
X
and
Y
coordinates, and
the
distance in X direction
and
distance in Y direction
over which the user interaction is taking place.
For example, getX
and
getY
may contain the current mouse location while getDeltaX
and getDeltaY
contain the distance over which the mouse has been dragged.
The context also contains the candidate
snap target
and the
layer the snap target is contained in
.
ILcdPoint
whose coordinates are expressed in the same coordinate
system as the current object or the model to model transformation can transform the
point to a point in the objects coordinate system.
isDrawAxisPoints()
or isDrawAxisPointsWhenSelected()
)
or when the axis itself is drawn (see isDrawAxis()
or isDrawAxisWhenSelected()
)
acceptSnapTarget
in interface ILcdGXYEditor
aGraphics
- the Graphics on which the snap target should be checked.aGXYContext
- the context in which the snap target should be checked.setModelModelTransformationClass(java.lang.Class)
protected void setupGraphicsForLine(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext)
ILcdGXYPainter
just before
drawing lines on aGraphics. It can be redefined in order to set specific
Graphics properties like Color, etc ... It calls
getLineStyle().setupGraphics if such method returns a non null value.aGraphics
- the graphics to paint the object on.aMode
- the mode to paint the object in.aGXYContext
- the context to paint the object in.protected void setupGraphicsForFill(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext)
ILcdGXYPainter
just before
drawing Fills on aGraphics. It can be redefined in order to set specific
Graphics properties like Color, etc ... It calls
getFillStyle().setupGraphics if such method returns a non null value.aGraphics
- the graphics to paint the object on.aMode
- the mode to paint the object in.aGXYContext
- the context to paint the object in.protected void calculateBoundsSFCT(int aMode, ILcdGXYContext aGXYContext, ILcd2DEditableBounds aBoundsSFCT) throws TLcdNoBoundsException
aMode
- the painting mode to calculate the bounds in.aGXYContext
- the context in which to calculate the boundsaBoundsSFCT
- the bounds to adapt to the bounds of the object of this painter.TLcdNoBoundsException
- if the axis of the buffer contains less than 2 points or if no points
of the buffer are visible in the given context.public Object clone()
ILcdCloneable
Makes Object.clone()
public.
java.lang.Object
, it can be implemented like this:
public Object clone() {
try {
return super.clone();
} catch ( CloneNotSupportedException e ) {
// Cannot happen: extends from Object and implements Cloneable (see also Object.clone)
throw new RuntimeException( e );
}
}
clone
in interface ILcdCloneable
clone
in interface ILcdGXYEditorProvider
clone
in interface ILcdGXYPainterProvider
clone
in class ALcdGXYAreaPainter
Object.clone()