public abstract class ALcdGXYPainter extends Object implements ILcdGXYPainter, ILcdGXYPainterProvider
ALcdGXYPainter
is an abstract class that can be used
for implementing the ILcdGXYPainter
interface.Modifier and Type | Field and Description |
---|---|
static ILcdGXYPainterStyle |
defaultCreationFillStyle
Deprecated.
do not use this field
|
static ILcdGXYPainterStyle |
defaultCreationLineStyle
Deprecated.
do not use this field
|
static ILcdGXYPainterStyle |
defaultFillStyle
Deprecated.
do not use this field
|
static ILcdGXYPainterStyle |
defaultLineStyle
Deprecated.
do not use this field
|
protected TLcdXYBounds |
fWorkBounds |
BODY, CREATING, DEFAULT, HANDLES, RESHAPING, SELECTED, SNAPS, TRANSLATING
Constructor and Description |
---|
ALcdGXYPainter() |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
Adds a
PropertyChangeListener to this ILcdGXYPainter . |
void |
anchorPointSFCT(Graphics aGraphics,
int aMode,
ILcdGXYContext aGXYContext,
Point aPointSFCT)
Implements
ILcdGXYPainter.anchorPointSFCT . |
Object |
clone()
Makes
Object.clone() public. |
protected void |
firePropertyChangeEvent(PropertyChangeEvent aEvent)
Fires a
PropertyChangeEvent to all PropertyChangeListeners that have been
registered to this ILcdGXYPainter . |
protected void |
firePropertyChangeEvent(String aPropertyName,
Object aOldValue,
Object aNewValue)
Fires a
PropertyChangeEvent to all PropertyChangeListeners that have been
registered to this ILcdGXYPainter . |
Cursor |
getCursor(Graphics aGraphics,
int aMode,
ILcdGXYContext aGXYContext)
Override this method to return a cursor.
|
String |
getDisplayName()
Returns the display name of this
ILcdGXYPainter . |
ILcdGXYPainter |
getGXYPainter(Object aObject)
Finds an
ILcdGXYPainter that can be used to paint or locate the object passed. |
boolean |
isTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
removePropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
Removes a
PropertyChangeListener from this ILcdGXYPainter . |
static void |
setClassTraceOn(boolean aClassTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
setDisplayName(String aDisplayName)
Sets a displayName for this
ILcdGXYPainter . |
void |
setTraceOn(boolean aTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
Object |
snapTarget(Graphics aGraphics,
ILcdGXYContext aGXYContext)
Override this method to support snapping.
|
boolean |
supportSnap(Graphics aGraphics,
ILcdGXYContext aGXYContext)
Override this method to support snapping.
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
boundsSFCT, getObject, isTouched, paint, setObject
public static ILcdGXYPainterStyle defaultLineStyle
public static ILcdGXYPainterStyle defaultFillStyle
public static ILcdGXYPainterStyle defaultCreationLineStyle
public static ILcdGXYPainterStyle defaultCreationFillStyle
protected transient TLcdXYBounds fWorkBounds
public static void setClassTraceOn(boolean aClassTraceOn)
true
then all log messages are recorded, otherwise only
the informative, warning and error messages are recorded.aClassTraceOn
- if true then all log messages are recorded,
otherwise only the informative, warning and error messages are recorded.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.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.public String getDisplayName()
ILcdGXYPainter
.getDisplayName
in interface ILcdGXYPainter
setDisplayName()
, or
this.toString()
if no name has been set.public void setDisplayName(String aDisplayName)
ILcdGXYPainter
.public void addPropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
PropertyChangeListener
to this ILcdGXYPainter
.addPropertyChangeListener
in interface ILcdPropertyChangeSource
aPropertyChangeListener
- The listener to be notifiedALcdWeakPropertyChangeListener
,
ILcdPropertyChangeSource.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
PropertyChangeListener
from this ILcdGXYPainter
.removePropertyChangeListener
in interface ILcdPropertyChangeSource
aPropertyChangeListener
- the listener that should no longer be notified of changes of
this object's propertiesILcdPropertyChangeSource.addPropertyChangeListener(java.beans.PropertyChangeListener)
protected void firePropertyChangeEvent(String aPropertyName, Object aOldValue, Object aNewValue)
PropertyChangeEvent
to all PropertyChangeListeners that have been
registered to this ILcdGXYPainter
.
This is merely a convenience wrapper around the more general
firePropertyChange method that takes PropertyChangeEvent
value.
aPropertyName
- The programmatic name of the property
that was changed.aOldValue
- The old value of the property.aNewValue
- The new value of the property.protected void firePropertyChangeEvent(PropertyChangeEvent aEvent)
PropertyChangeEvent
to all PropertyChangeListeners that have been
registered to this ILcdGXYPainter
.aEvent
- The PropertyChangeEvent object.public void anchorPointSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Point aPointSFCT) throws TLcdNoBoundsException
ILcdGXYPainter.anchorPointSFCT
.
aPointSFCT
will be set to the center of the
bounds calculated by boundsSFCT.anchorPointSFCT
in interface ILcdGXYPainter
aGraphics
- the Graphics on which the representation of the object is paintedaMode
- the mode the object is painted in (see class documentation)aGXYContext
- the context for which the representation of the object is painted. It contains amongst others
the transformations from model to world and world to view.aPointSFCT
- the point that has to be moved to the location of the anchor point of the representation of
the object. This point must not be taken into account when the method has thrown a TLcdNoBoundsException.TLcdNoBoundsException
- if no anchor point can be determined for the representation of the object.
This can be when the object does not have a representation in the given context, for example when it is located in
a part of the world which is not visible in the projection as set in the views world reference.paint
public boolean supportSnap(Graphics aGraphics, ILcdGXYContext aGXYContext)
supportSnap
in interface ILcdGXYPainter
aGraphics
- the Graphics on which the representation of the object is paintedaGXYContext
- the context in which this object is represented and in which the editing of an object occurs.false
.public Object snapTarget(Graphics aGraphics, ILcdGXYContext aGXYContext)
snapTarget
in interface ILcdGXYPainter
aGraphics
- the Graphics on which the representation of the object is paintedaGXYContext
- the context in which this object is represented and in which the editing of an object occurs.null
.supportSnap
public Cursor getCursor(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext)
getCursor
in interface ILcdGXYPainter
aGraphics
- the Graphics on which the representation of the object is paintedaMode
- the rendering mode to return the cursor for.aGXYContext
- the context in which the rendering occurs.null
.public ILcdGXYPainter getGXYPainter(Object aObject)
ILcdGXYPainterProvider
ILcdGXYPainter
that can be used to paint or locate the object passed.
The painter provider is responsible for setting the object to the painter before returning the painter. An implementation should therefore have the following structure:
public ILcdGXYPainter getGXYPainter(Object aObject) {
ILcdGXYPainter painter = ... // find the painter for the object
if (painter != null) {
painter.setObject(aObject);
}
return painter;
}
getGXYPainter
in interface ILcdGXYPainterProvider
aObject
- the object to find a painter forpublic 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 ILcdGXYPainterProvider
clone
in class Object
Object.clone()