Package com.actelion.research.chem
Class AbstractDrawingObject
- java.lang.Object
-
- com.actelion.research.chem.AbstractDrawingObject
-
- Direct Known Subclasses:
ReactionArrow
,TextDrawingObject
public abstract class AbstractDrawingObject extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
DESCRIPTOR_END
protected static java.lang.String
DESCRIPTOR_START
protected static java.lang.String
DESCRIPTOR_TYPE
protected boolean
mIsSelected
protected java.awt.geom.Point2D.Double[]
mPoint
protected boolean
mProtectedFromDeletion
protected double
mTransformationReferenceX
protected double
mTransformationReferenceY
protected double[]
mTransformationValue1
protected double[]
mTransformationValue2
protected static java.awt.Color
SELECTION_COLOR
-
Constructor Summary
Constructors Constructor Description AbstractDrawingObject()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
checkHiliting(double x, double y)
abstract void
clearHiliting()
abstract AbstractDrawingObject
clone()
abstract boolean
contains(double x, double y)
Checks, whether this drawing object contains the point at x,yabstract void
draw(GenericDrawContext context, DepictorTransformation t)
java.awt.geom.Rectangle2D.Double
getBoundingRect(GenericDrawContext context)
java.lang.String
getDescriptor()
abstract java.lang.String
getDescriptorDetail()
Creates a string encoding all properties specific to this drawing object.abstract java.lang.String
getTypeString()
abstract void
hilite(GenericDrawContext context)
static AbstractDrawingObject
instantiate(java.lang.String descriptor)
boolean
isDeletable()
boolean
isSelected()
boolean
isSurroundedBy(GenericShape shape)
void
move(double dx, double dy)
void
scale(double f)
void
setDeletable(boolean d)
void
setSelected(boolean s)
java.lang.String
toString()
void
translate(double x, double y)
void
translateInit(double x, double y)
void
zoomAndRotate(double zoom, double angle)
void
zoomAndRotateInit(double x, double y)
-
-
-
Field Detail
-
DESCRIPTOR_START
protected static final java.lang.String DESCRIPTOR_START
- See Also:
- Constant Field Values
-
DESCRIPTOR_END
protected static final java.lang.String DESCRIPTOR_END
- See Also:
- Constant Field Values
-
DESCRIPTOR_TYPE
protected static final java.lang.String DESCRIPTOR_TYPE
- See Also:
- Constant Field Values
-
SELECTION_COLOR
protected static final java.awt.Color SELECTION_COLOR
-
mPoint
protected java.awt.geom.Point2D.Double[] mPoint
-
mIsSelected
protected boolean mIsSelected
-
mProtectedFromDeletion
protected boolean mProtectedFromDeletion
-
mTransformationReferenceX
protected double mTransformationReferenceX
-
mTransformationReferenceY
protected double mTransformationReferenceY
-
mTransformationValue1
protected double[] mTransformationValue1
-
mTransformationValue2
protected double[] mTransformationValue2
-
-
Method Detail
-
draw
public abstract void draw(GenericDrawContext context, DepictorTransformation t)
-
hilite
public abstract void hilite(GenericDrawContext context)
-
clearHiliting
public abstract void clearHiliting()
-
contains
public abstract boolean contains(double x, double y)
Checks, whether this drawing object contains the point at x,y- Parameters:
x
-y
-- Returns:
-
checkHiliting
public abstract boolean checkHiliting(double x, double y)
-
clone
public abstract AbstractDrawingObject clone()
- Overrides:
clone
in classjava.lang.Object
-
getDescriptorDetail
public abstract java.lang.String getDescriptorDetail()
Creates a string encoding all properties specific to this drawing object. Its type is not part of the descriptor detail. The detail must start, but not end with a space. Example: ' size="12" x="50.0" y="80.0"'- Returns:
- concatenated property list, each property with a leading space
-
getTypeString
public abstract java.lang.String getTypeString()
-
instantiate
public static AbstractDrawingObject instantiate(java.lang.String descriptor)
-
move
public void move(double dx, double dy)
-
scale
public void scale(double f)
-
isDeletable
public boolean isDeletable()
-
setDeletable
public void setDeletable(boolean d)
-
isSelected
public boolean isSelected()
-
setSelected
public void setSelected(boolean s)
-
getBoundingRect
public java.awt.geom.Rectangle2D.Double getBoundingRect(GenericDrawContext context)
-
isSurroundedBy
public boolean isSurroundedBy(GenericShape shape)
-
translateInit
public void translateInit(double x, double y)
-
translate
public void translate(double x, double y)
-
zoomAndRotateInit
public void zoomAndRotateInit(double x, double y)
-
zoomAndRotate
public void zoomAndRotate(double zoom, double angle)
-
getDescriptor
public java.lang.String getDescriptor()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-