Summ:  Constr. Methods    Details:  Constr. Methods      Class:  Prev
com.artfulbits.aiCharts.Annotations
Class ChartTextAnnotation

java.lang.Object com.artfulbits.aiCharts.Annotations.ChartAnnotation com.artfulbits.aiCharts.Annotations.ChartTextAnnotation

Declaration: public class ChartTextAnnotation extends ChartAnnotation

 

Represents text annotation class. In order to display this annotations, instance should be added chart's annotations collection.

 

Since: 1.0

 

 

Constructors Summary
ChartTextAnnotation(android.graphics.drawable.Drawable backgroundDrawable, java.lang.String text)
    
Initializes a new instance of text centered annotation with no description.
ChartTextAnnotation(android.graphics.drawable.Drawable backgroundDrawable, java.lang.String text, java.lang.String description)
    
Initializes a new instance of text centered annotation.
ChartTextAnnotation(android.graphics.drawable.Drawable backgroundDrawable, java.lang.String text, java.lang.String description, Alignment horizontalAlignment, Alignment verticalAlignment)
    
Initializes a new instance of text annotation.
ChartTextAnnotation(java.lang.String text)
    
Initializes a new instance of text centered annotation with no description on transparent background.
ChartTextAnnotation(java.lang.String text, java.lang.String description)
    
Initializes a new instance of text centered annotation on transparent background.

 

 

Methods Summary
void draw(android.graphics.Canvas canvas, ChartEngine chart)
    
Draws annotation of specified canvas.
android.graphics.drawable.Drawable getBackground()
    
Gets the drawable used to draw annotation's background.
android.graphics.Paint getConnectorPaint()
    
Gets android.graphics.Paint object that is used to draw annotation's connecting line.
boolean getDrawConnector()
    
Gets value indicating whether connecting line should be drawn for this annotation.
Alignment getHorizontalAlignment()
    
Gets the horizontal alignment for this annotation.
boolean getSmartPositioning()
    
Sets value indicating whether smart positioning logic should be enabled for this annotation.
java.lang.String getText()
    
Gets the annotation text.
int getTextColor()
    
Gets color of text of this annotation.
android.text.TextPaint getTextPaint()
    
Gets android.text.TextPaint object that will be used to draw annotation's text.
Alignment getVerticalAlignment()
    
Gets the vertical alignment for this annotation.
void setAlignment(Alignment horizontalAlignment, Alignment verticalAlignment)
    
Sets both the vertical and horizontal alignment for this annotation.
void setBackground(android.graphics.drawable.Drawable background)
    
Sets android.graphics.drawable.Drawable object that is used to draw annotation's background.
void setDrawConnector(boolean value)
    
Sets value indicating whether connecting line should be drawn for this annotation.
void setHorizontalAlignment(Alignment alignment)
    
Sets the horizontal alignment for this annotation.
void setSmartPositioning(boolean value)
    
Gets value indicating whether smart positioning logic should be enabled for this annotation.
void setTextColor(int color)
    
Sets color of text of this annotation.
void setVerticalAlignment(Alignment alignment)
    
Sets the vertical alignment for this annotation.

 

Methods inherited from class: com.artfulbits.aiCharts.Annotations.ChartAnnotation
getDescription, getOffset, getPosition, setDescription, setOffset, setPosition

 

Methods inherited from class: java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

 

 

 

ChartTextAnnotation

 

public ChartTextAnnotation( android.graphics.drawable.Drawable backgroundDrawable,
java.lang.String text,
java.lang.String description,
Alignment horizontalAlignment,
Alignment verticalAlignment)

 

Initializes a new instance of text annotation.

 

Parameters:
backgroundDrawable-
drawable that is used to display annotation's background.
text-
text for this annotation.
description-
text description of annotation.
horizontalAlignment-
horizontal annotation alignment.
verticalAlignment-
vertical annotation alignment.

 

Since: 1.0

 

 

 

ChartTextAnnotation

 

public ChartTextAnnotation( android.graphics.drawable.Drawable backgroundDrawable,
java.lang.String text,
java.lang.String description)

 

Initializes a new instance of text centered annotation.

 

Parameters:
backgroundDrawable-
drawable that is used to display annotation's background.
text-
text for this annotation.
description-
text description of annotation.

 

Since: 1.0

 

 

 

ChartTextAnnotation

 

public ChartTextAnnotation( android.graphics.drawable.Drawable backgroundDrawable,
java.lang.String text)

 

Initializes a new instance of text centered annotation with no description.

 

Parameters:
backgroundDrawable-
drawable that is used to display annotation's background.
text-
text for this annotation.

 

Since: 1.0

 

 

 

ChartTextAnnotation

 

public ChartTextAnnotation( java.lang.String text,
java.lang.String description)

 

Initializes a new instance of text centered annotation on transparent background.

 

Parameters:
text-
text for this annotation.
description-
text description of annotation.

 

Since: 1.0

 

 

 

ChartTextAnnotation

 

public ChartTextAnnotation( java.lang.String text)

 

Initializes a new instance of text centered annotation with no description on transparent background.

 

Parameters:
text-
text for this annotation.

 

Since: 1.0

 

 

 

 

setAlignment

 

public void setAlignment( Alignment horizontalAlignment,
Alignment verticalAlignment)

 

Sets both the vertical and horizontal alignment for this annotation.

 

Parameters:
horizontalAlignment-
instance of Alignment enumeration containing desired alignment value.
verticalAlignment-
instance of Alignment enumeration containing desired alignment value.

 

Since: 1.0

 

 

 

setVerticalAlignment

 

public void setVerticalAlignment( Alignment alignment)

 

Sets the vertical alignment for this annotation.

 

Parameters:
alignment-
instance of Alignment enumeration containing desired alignment value.

 

Since: 1.0

 

 

 

getVerticalAlignment

 

public Alignment getVerticalAlignment( )

 

Gets the vertical alignment for this annotation.

 

Returns:
instance of Alignment enumeration containing current alignment value.

 

Since: 1.0

 

 

 

setHorizontalAlignment

 

public void setHorizontalAlignment( Alignment alignment)

 

Sets the horizontal alignment for this annotation.

 

Parameters:
alignment-
instance of Alignment enumeration containing desired alignment value.

 

Since: 1.0

 

 

 

getHorizontalAlignment

 

public Alignment getHorizontalAlignment( )

 

Gets the horizontal alignment for this annotation.

 

Returns:
instance of Alignment enumeration containing current alignment value.

 

Since: 1.0

 

 

 

getTextPaint

 

public android.text.TextPaint getTextPaint( )

 

Gets android.text.TextPaint object that will be used to draw annotation's text.

 

Returns:
instance of android.text.TextPaint object that will be used to draw annotation's text.

 

Since: 1.0
See also: setTextColor(int)

 

 

 

getTextColor

 

public int getTextColor( )

 

Gets color of text of this annotation.

 

Returns:
integer value of annotation's text color.

 

Since: 1.0

 

 

 

setTextColor

 

public void setTextColor( int color)

 

Sets color of text of this annotation.

 

Parameters:
color-
integer value of annotation's text color.

 

Since: 1.0

 

 

 

getConnectorPaint

 

public android.graphics.Paint getConnectorPaint( )

 

Gets android.graphics.Paint object that is used to draw annotation's connecting line.

 

Returns:
instance of android.graphics.Paint object that is used to draw annotation's connecting line.

 

Since: 1.0

 

 

 

setDrawConnector

 

public void setDrawConnector( boolean value)

 

Sets value indicating whether connecting line should be drawn for this annotation.

 

Parameters:
value-
true if connecting line should be drawn for this annotation, otherwise false.

 

Since: 1.0

 

 

 

getDrawConnector

 

public boolean getDrawConnector( )

 

Gets value indicating whether connecting line should be drawn for this annotation.

 

Returns:
true if connecting line should be drawn for this annotation, otherwise false.

 

Since: 1.0

 

 

 

getText

 

public java.lang.String getText( )

 

Gets the annotation text.

 

Returns:
value of annotation text.

 

Since: 1.0

 

 

 

getBackground

 

public android.graphics.drawable.Drawable getBackground( )

 

Gets the drawable used to draw annotation's background.

 

Returns:
instance of android.graphics.drawable.Drawable object used to draw annotation's background.

 

Since: 1.0

 

 

 

setSmartPositioning

 

public void setSmartPositioning( boolean value)

 

Gets value indicating whether smart positioning logic should be enabled for this annotation. If enabled, annotation will be forced to stay visible if it is about to be shown out of chart's borders.

 

Parameters:
value-
true if smart positioning should be enabled, otherwise false.

 

Since: 1.0

 

 

 

getSmartPositioning

 

public boolean getSmartPositioning( )

 

Sets value indicating whether smart positioning logic should be enabled for this annotation. If enabled, annotation will be forced to stay visible if it is about to be shown out of chart's borders.

 

Returns:
true if smart positioning should be enabled, otherwise false.

 

Since: 1.0

 

 

 

setBackground

 

public void setBackground( android.graphics.drawable.Drawable background)

 

Sets android.graphics.drawable.Drawable object that is used to draw annotation's background.

 

Parameters:
background-
android.graphics.drawable.Drawable object that is used to draw annotation's background.

 

Since: 1.0

 

 

 

draw

 

public void draw( android.graphics.Canvas canvas,
ChartEngine chart)

 

[ description from ChartAnnotation.draw(android.graphics.Canvas,ChartEngine) ]
 
Draws annotation of specified canvas.

 

Parameters:
canvas-
instance of canvas that is used to draw annotation.
chart-
instance of parent chart.

 

Implements: ChartAnnotation.draw(Canvas,ChartEngine)

 

 

© 2005 - 2010 ArtfulBits. All rights reserved.