com.miginfocom.beans
Class ActivityAShapeBean

java.lang.Object
  extended by com.miginfocom.beans.AbstractBean
      extended by com.miginfocom.beans.ActivityAShapeBean
All Implemented Interfaces:
java.io.Serializable

public class ActivityAShapeBean
extends AbstractBean

Encapsulates the default RootAShape that is a round rectangle with a title and a summary.

Uses the RootAShape gotten from calling AShapeUtil.createDefault(int) and configuring the properties of it.

See Also:
Serialized Form

Constructor Summary
ActivityAShapeBean()
           
 
Method Summary
 void addMouseInteractionListener(MouseInteractionListener l)
          Adds a listener that listens to all mouse events on this shape and all sub shapes that has a hit area report set to true.
 void addMouseInteractionListener(MouseInteractionListener l, boolean asWeakRef)
          Adds a listener that listens to all mouse events on this shape and all sub shapes that has a hit area report set to true.
 void addSubShape(AShape shape)
          Adds a generic sub shape to the root shape.
 int getAntiAlias()
          Property: The anti aliasing hint used when drawing the graphics for the shape.
 java.awt.Paint getBackground()
          Property: The background paint for the shape.
 PlaceRect getBackgroundPlaceRect()
          Property: How this shape's background will relate to the reference rectangle (bounds) given by the activity layout system.
 double getCornerRadius()
          Property: The corner radius for the outline RoundRectangle.
 boolean getDraggable()
          Property: If the activity should AShape should be draggable and thus send out DefaultDateArea.AE_DRAG_PRESSED when pressed.
 PlaceRect getEndResizePlaceRect()
          If set will change the bounds of the end resize handle relative to the main shape.
 java.awt.Cursor getMouseOverCursor()
          Property: The Cursor showed when the mouse is over the shape or null if none.
 int getMouseOverSummaryUnderline()
          Property: How thick the underline should be for mouse overs of on the summary text.
 java.awt.Paint getOutlinePaint()
          Property: The Paint used to draw the outline.
 float getOutlineStrokeWidth()
          Property: The width of the outline around the shape.
 java.lang.String getPaintContext()
          Property: The context that the AShape that this bean represent will adhere to.
 PlaceRect getPlaceRect()
          Property: How this shape will relate to the reference rectangle (bounds) given by the activity layout system.
 int getPrimaryDimension()
          Deprecated. Shunted to getResizeHandles()
 java.awt.Insets getRepaintPadding()
          Property: Increases (or reduces) the area around the activity that will be repainted if the activity is moved or changed.
 int getResizeHandles()
          Property: The size the resize boxes should be placed.
 float getShadowBlurRadius()
          Property: The blur radius for the blur filter.
 double getShadowCornerRadius()
          Property: The corner radius for the shadow RoundRectangle.
 java.awt.Paint getShadowPaint()
          Property: The Paint used to draw the shadow.
 boolean[] getShadowPaintOptimization()
          Property: The shadow is divided into a 3x3 grid.
 PlaceRect getShadowPlaceRect()
          Property: How the shadow will be placed relative to the main shape.
 int getShadowSliceSize()
          Property: How big (thick) the outer (border) slices for the shadow will be.
 java.lang.String getShapeNamePrefix()
           
 PlaceRect getStartResizePlaceRect()
          If set will change the bounds of the start resize handle relative to the main shape.
 AtRefRangeNumber getTextAlignX()
          Property: Where within the place rect for the text to draw the text string.
 AtRefRangeNumber getTextAlignY()
          Property: Where within the place rect for the text to draw the text string.
 int getTextAntiAlias()
          Property: The anti aliasing hint used when drawing the text for the shape.
 java.awt.Insets getTextCrop()
          Property: If not null then this will crop the text with these insets.
 java.awt.Font getTextFont()
          Property: The font used to draw the main text in the shape.
 java.awt.Paint getTextForeground()
          Property: The Paint used to draw the main text.
 java.lang.Boolean getTextKeepVisible()
          Property: If the main text should be moved to always stay within the visible bounds of the date area.
 PlaceRect getTextPlaceRect()
          Property: How this shape's main text will relate to the reference rectangle (bounds) given by the activity layout system.
 java.lang.String getTextTemplate()
          Property: The template text for the main text.
 AtRefRangeNumber getTitleAlignX()
          Property: Where within the place rect for the title to draw the title text.
 AtRefRangeNumber getTitleAlignY()
          Property: Where within the place rect for the title to draw the title text.
 java.awt.Insets getTitleCrop()
          Property: If not null then this will crop the text with these insets.
 java.awt.Font getTitleFont()
          Property: The font used to draw the title in the shape.
 java.awt.Paint getTitleForeground()
          Property: The Paint used to draw the title.
 java.lang.Boolean getTitleKeepVisible()
          Property: If the title text should be moved to always stay within the visible bounds of the date area.
 PlaceRect getTitlePlaceRect()
          Property: How this shape's title will relate to the reference rectangle (bounds) given by the activity layout system.
 java.lang.String getTitleTemplate()
          Property: The template text that will show in the title of the shape.
 void removeMouseInteractionListener(MouseInteractionListener l)
          Removes the listener if it exists locally.
 void removeSubShape(AShape shape)
          Removes the sub shape.
 void setAntiAlias(int hint)
          Property: The anti aliasing hint used when drawing the graphics for the shape.
 void setBackground(java.awt.Paint paint)
          Property: The background paint for the shape.
 void setBackgroundPlaceRect(PlaceRect placeRect)
          Property: How this shape's background will relate to the reference rectangle (bounds) given by the activity layout system.
 void setCornerRadius(double radius)
          Property: The corner radius for the outline RoundRectangle.
 void setDraggable(boolean b)
          Property: If the activity should AShape should be draggable and thus send out DefaultDateArea.AE_DRAG_PRESSED when pressed.
 void setEndResizePlaceRect(PlaceRect r)
          If set will change the bounds of the end resize handle relative to the main shape.
 void setMouseOverCursor(java.awt.Cursor c)
          Property: The Cursor showed when the mouse is over the shape or null if none.
 void setMouseOverSummaryUnderline(int width)
          Property: How thick the underline should be for mouse overs of on the summary text.
 void setOutlinePaint(java.awt.Paint paint)
          Property: The Paint used to draw the outline.
 void setOutlineStrokeWidth(float width)
          Property: The width of the outline around the shape.
 void setPaintContext(java.lang.String paintContext)
          Property: The context that the AShape that this bean represent will adhere to.
 void setPlaceRect(PlaceRect placeRect)
          Property: How this shape will relate to the reference rectangle (bounds) given by the activity layout system.
 void setPrimaryDimension(int dim)
          Deprecated. Shunted to (int)
 void setRepaintPadding(java.awt.Insets i)
          Property: Increases (or reduces) the area around the activity that will be repainted if the activity is moved or changed.
 void setResizeHandles(int dim)
          Property: The size the resize boxes should be placed.
 void setShadowBlurRadius(float r)
          Property: The blur radius for the blur filter.
 void setShadowCornerRadius(double radius)
          Property: The corner radius for the shadow RoundRectangle.
 void setShadowPaint(java.awt.Paint p)
          Property: The Paint used to draw the shadow.
 void setShadowPaintOptimization(boolean[] opt)
          Property: The shadow is divided into a 3x3 grid.
 void setShadowPlaceRect(PlaceRect pr)
          Property: How the shadow will be placed relative to the main shape.
 void setShadowSliceSize(int s)
          Property: How big the outer slices for the shadow will be.
 void setShapeNamePrefix(java.lang.String prefix)
           
 void setStartResizePlaceRect(PlaceRect r)
          If set will change the bounds of the start resize handle relative to the main shape.
 void setTextAlignX(AtRefRangeNumber x)
          Property: Where within the place rect for the text to draw the text string.
 void setTextAlignY(AtRefRangeNumber y)
          Property: Where within the place rect for the text to draw the text string.
 void setTextAntiAlias(int hint)
          Property: The anti aliasing hint used when drawing the text for the shape.
 void setTextCrop(java.awt.Insets insets)
          Property: If not null then this will crop the text with these insets.
 void setTextFont(java.awt.Font font)
          Property: The font used to draw the main text in the shape.
 void setTextForeground(java.awt.Paint paint)
          Property: The Paint used to draw the main text.
 void setTextKeepVisible(java.lang.Boolean b)
          Property: If the main text should be moved to always stay within the visible bounds of the date area.
 void setTextPlaceRect(PlaceRect placeRect)
          Property: How this shape's main text will relate to the reference rectangle (bounds) given by the activity layout system.
 void setTextTemplate(java.lang.String s)
          Property: The template text for the main text.
 void setTitleAlignX(AtRefRangeNumber x)
          Property: Where within the place rect for the title to draw the title text.
 void setTitleAlignY(AtRefRangeNumber y)
          Property: Where within the place rect for the title to draw the title text.
 void setTitleCrop(java.awt.Insets insets)
          Property: If not null then this will crop the text with these insets.
 void setTitleFont(java.awt.Font font)
          Property: The font used to draw the title in the shape.
 void setTitleForeground(java.awt.Paint paint)
          Property: The Paint used to draw the title.
 void setTitleKeepVisible(java.lang.Boolean b)
          Property: If the title text should be moved to always stay within the visible bounds of the date area.
 void setTitlePlaceRect(PlaceRect placeRect)
          Property: How this shape's title will relate to the reference rectangle (bounds) given by the activity layout system.
 void setTitleTemplate(java.lang.String s)
          Property: The template text that will show in the title of the shape.
 
Methods inherited from class com.miginfocom.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChangeEvent, removePropertyChangeListener, setIgnorePropertyChangeEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActivityAShapeBean

public ActivityAShapeBean()
Method Detail

addSubShape

public void addSubShape(AShape shape)
Adds a generic sub shape to the root shape. It can for instance be used to add icons or other markers in some way that can not be expressed with the normalt properties. It is like adding a sub component to a Swing container.

Parameters:
shape - The shape to be added.

removeSubShape

public void removeSubShape(AShape shape)
Removes the sub shape.

Parameters:
shape - The shape to be removed.

getShapeNamePrefix

public java.lang.String getShapeNamePrefix()

setShapeNamePrefix

public void setShapeNamePrefix(java.lang.String prefix)

getResizeHandles

public int getResizeHandles()
Property: The size the resize boxes should be placed. -1 if no resize boxes and thus there will be no way to resize the shape.

Can be SwingConstants.VERTICAL or SwingConstants.HORIZONTAL or -1.

Returns:
The current value. Default is SwingConstants.VERTICAL.

setResizeHandles

public void setResizeHandles(int dim)
Property: The size the resize boxes should be placed. -1 if no resize boxes and thus there will be no way to resize the shape.

Parameters:
dim - The new value. One of SwingConstants.VERTICAL or SwingConstants.HORIZONTAL or -1.

getStartResizePlaceRect

public PlaceRect getStartResizePlaceRect()
If set will change the bounds of the start resize handle relative to the main shape.

Returns:
The current place rect. May be null.

setStartResizePlaceRect

public void setStartResizePlaceRect(PlaceRect r)
If set will change the bounds of the start resize handle relative to the main shape.

Parameters:
r - The new place rect. May be null, which is default.

getEndResizePlaceRect

public PlaceRect getEndResizePlaceRect()
If set will change the bounds of the end resize handle relative to the main shape.

Returns:
The current place rect. May be null.

setEndResizePlaceRect

public void setEndResizePlaceRect(PlaceRect r)
If set will change the bounds of the end resize handle relative to the main shape.

Parameters:
r - The new place rect. May be null, which is default.

getPrimaryDimension

public int getPrimaryDimension()
Deprecated. Shunted to getResizeHandles()

Shunted to getResizeHandles()


setPrimaryDimension

public void setPrimaryDimension(int dim)
Deprecated. Shunted to (int)

Shunted to setResizeHandles(int)


getDraggable

public boolean getDraggable()
Property: If the activity should AShape should be draggable and thus send out DefaultDateArea.AE_DRAG_PRESSED when pressed.

Returns:
The current state.

setDraggable

public void setDraggable(boolean b)
Property: If the activity should AShape should be draggable and thus send out DefaultDateArea.AE_DRAG_PRESSED when pressed.

Parameters:
b - true means draggable. If same as set nothing will be done.

getMouseOverSummaryUnderline

public int getMouseOverSummaryUnderline()
Property: How thick the underline should be for mouse overs of on the summary text. 0 will disable it.

Returns:
The current width.
See Also:
setMouseOverSummaryUnderline(int)

setMouseOverSummaryUnderline

public void setMouseOverSummaryUnderline(int width)
Property: How thick the underline should be for mouse overs of on the summary text. 0 will disable it.

Parameters:
width - The width in pixels.
See Also:
setMouseOverSummaryUnderline(int)

getPaintContext

public java.lang.String getPaintContext()
Property: The context that the AShape that this bean represent will adhere to. Activity objects may have a paintContext set and contexts must match if the shape should be used to paint the activity.

For example there might be two types of activities, one with "bigShape" and one with "smallShape" as context. It is then possible to create two beans of this class, configure them differently, and set their respective paint context to either. This will paint some activities with one bean's and the others with the other bean's AShape.

Returns:
The current context. Default to null.

setPaintContext

public void setPaintContext(java.lang.String paintContext)
Property: The context that the AShape that this bean represent will adhere to. Activity objects may have a paintContext set and contexts must match if the shape should be used to paint the activity.

For example there might be two types of activities, one with "bigShape" and one with "smallShape" as context. It is then possible to create two beans of this class, configure them differently, and set their respective paint context to either. This will paint some activities with one bean's and the others with the other bean's AShape.

Parameters:
paintContext - The new context. May be null.

getTextKeepVisible

public java.lang.Boolean getTextKeepVisible()
Property: If the main text should be moved to always stay within the visible bounds of the date area.

Returns:
true for keep visible. null or false for not (null default).
Since:
6.5

setTextKeepVisible

public void setTextKeepVisible(java.lang.Boolean b)
Property: If the main text should be moved to always stay within the visible bounds of the date area.

Parameters:
b - true for keep visible. null or false for not (null default)
Since:
6.5

getTitleKeepVisible

public java.lang.Boolean getTitleKeepVisible()
Property: If the title text should be moved to always stay within the visible bounds of the date area.

Returns:
true for keep visible. null or false for not (null default).
Since:
6.5

setTitleKeepVisible

public void setTitleKeepVisible(java.lang.Boolean b)
Property: If the title text should be moved to always stay within the visible bounds of the date area.

Parameters:
b - true for keep visible. null or false for not (null default)
Since:
6.5

getRepaintPadding

public java.awt.Insets getRepaintPadding()
Property: Increases (or reduces) the area around the activity that will be repainted if the activity is moved or changed.

Returns:
The current padding. May be null. Default is Insets(4, 4, 4, 4).
Since:
6.0

setRepaintPadding

public void setRepaintPadding(java.awt.Insets i)
Property: Increases (or reduces) the area around the activity that will be repainted if the activity is moved or changed.

Parameters:
i - The new padding. May be null. Default is Insets(4, 4, 4, 4).
Since:
6.0

getMouseOverCursor

public java.awt.Cursor getMouseOverCursor()
Property: The Cursor showed when the mouse is over the shape or null if none.

Returns:
The current Cursor. May be null.
Since:
6.0

setMouseOverCursor

public void setMouseOverCursor(java.awt.Cursor c)
Property: The Cursor showed when the mouse is over the shape or null if none.

Parameters:
c - The new Cursor. May be null in which case the Cursor is not changed.
Since:
6.0

getShadowPaintOptimization

public boolean[] getShadowPaintOptimization()
Property: The shadow is divided into a 3x3 grid. Normally only the lower and right slices need to be drawn since the other slices will be fully covered (obscured) by the main shape. This greatly improves the performance. This must be turned of for certain shapes (and shadow offsets) and for instance if the main shape is translucent.

There are a few static arrays that can be used:

Returns:
A nine element array with which slices are to be painted. The first element is upper left, the second upper middle and so on. null will paint all slices.
See Also:
getShadowSliceSize()

setShadowPaintOptimization

public void setShadowPaintOptimization(boolean[] opt)
Property: The shadow is divided into a 3x3 grid. Normally only the lower and right slices need to be drawn since the other slices will be fully covered (obscured) by the main shape. This greatly improves the performance. This must be turned of for certain shapes (and shadow offsets) and for instance if the main shape is translucent.

There are a few static arrays that can be used:

Parameters:
opt - A nine element array with which slices are to be painted. The first element is upper left, the second upper middle and so on. null will paint all slices.
See Also:
getShadowSliceSize()

getShadowSliceSize

public int getShadowSliceSize()
Property: How big (thick) the outer (border) slices for the shadow will be. This is like the line thickness for LineBorder. The center slice (there 3x3) will be the remaining size.

Returns:
The current size.
See Also:
setShadowPaintOptimization(boolean[])

setShadowSliceSize

public void setShadowSliceSize(int s)
Property: How big the outer slices for the shadow will be. This is like the line thickness for LineBorder. The center slice (there 3x3) will be the remaining size.

Parameters:
s - The new size.
See Also:
setShadowPaintOptimization(boolean[])

getShadowPaint

public java.awt.Paint getShadowPaint()
Property: The Paint used to draw the shadow.

Returns:
The current Paint. May be null.

setShadowPaint

public void setShadowPaint(java.awt.Paint p)
Property: The Paint used to draw the shadow.

Parameters:
p - The new Paint. May be null in which case no shadow will be painted.

getShadowBlurRadius

public float getShadowBlurRadius()
Property: The blur radius for the blur filter. Greater means more smeared shadow but it takes longer to compute.

Returns:
The current Paint. May be null.

setShadowBlurRadius

public void setShadowBlurRadius(float r)
Property: The blur radius for the blur filter. Greater means more smeared shadow but it takes longer to compute.

Parameters:
r - The new blur radius. 5 is default.

getShadowPlaceRect

public PlaceRect getShadowPlaceRect()
Property: How the shadow will be placed relative to the main shape. The PlaceRect is an interface that basically takes one Rectangle and return another one. This makes it very flexible.

Returns:
The current place rect.
See Also:
AbsRect, AlignRect, AspectRatioRect

setShadowPlaceRect

public void setShadowPlaceRect(PlaceRect pr)
Property: How the shadow will be placed relative to the main shape. The PlaceRect is an interface that basically takes one Rectangle and return another one. This makes it very flexible.

E.g:

 new AbsRect(new Insets(5, 5, 5, 5));
 

Parameters:
pr - The new place rect.
See Also:
AbsRect, AlignRect, AspectRatioRect

getShadowCornerRadius

public double getShadowCornerRadius()
Property: The corner radius for the shadow RoundRectangle.

Returns:
The current radius.
See Also:
RoundRectangle2D.Double.setRoundRect(double, double, double, double, double, double)

setShadowCornerRadius

public void setShadowCornerRadius(double radius)
Property: The corner radius for the shadow RoundRectangle.

Parameters:
radius - The new radius.
See Also:
RoundRectangle2D.Double.setRoundRect(double, double, double, double, double, double)

getTitleTemplate

public java.lang.String getTitleTemplate()
Property: The template text that will show in the title of the shape. Since the title, or at least parts thereof, is different for every activity but there is only one bean one has to use a template text that will be expanded for every painted activity.

Normally a template will look something like this:

"$startTime$-$endTimeExcl$ $description$"

however it is better to write it in code something like this:

ActivityInteractor.TEMPL_START_TIME.getName() + "-" + ActivityInteractor.TEMPL_END_TIME_INCL.getName() + " " + ActivityInteractor.TEMPL_DESCRIPTION.getName();

since ActivityInteractor is where the special templates is located.

If a special template isn't found the text between the Interactor.TEMPLATE_CHAR ($) chars will be converted to a property and fetched from the activity such that:

"$assignedTo$"

will be converted to:

activity.getProperty(PropertyKey.getKey("assignedTo"));

This means that any property of the activity can be expanded with this template system.

Default is: "$startTime$ - $endTimeExcl$ ($timeZoneShort$)".

Returns:
The current template string.
See Also:
ActivityInteractor, (for instance)

setTitleTemplate

public void setTitleTemplate(java.lang.String s)
Property: The template text that will show in the title of the shape. Since the title, or at least parts thereof, is different for every activity but there is only one bean one has to use a template text that will be expanded for every painted activity.

Normally a template will look something like this:

"$startTime$-$endTimeExcl$ $description$"

however it is better to write it in code something like this:

ActivityInteractor.TEMPL_START_TIME.getName() + "-" + ActivityInteractor.TEMPL_END_TIME_INCL.getName() + " " + ActivityInteractor.TEMPL_DESCRIPTION.getName();

since ActivityInteractor is where the special templates is located.

If a special template isn't found the text between the Interactor.TEMPLATE_CHAR ($) chars will be converted to a property and fetched from the activity such that:

"$assignedTo$"

will be converted to:

activity.getProperty(PropertyKey.getKey("assignedTo"));

This means that any property of the activity can be expanded with this template system.

Default is: "$startTime$ - $endTimeExcl$ ($timeZoneShort$)".

Parameters:
s - The new tempalte string.
See Also:
ActivityInteractor, (for instance)

getTextTemplate

public java.lang.String getTextTemplate()
Property: The template text for the main text. See getTitleTemplate() for and explanation of the template system

Default is: "$summary$".

Returns:
The current template.

setTextTemplate

public void setTextTemplate(java.lang.String s)
Property: The template text for the main text. See getTitleTemplate() for and explanation of the template system

Default is: "$summary$".

Parameters:
s - The new template.

getAntiAlias

public int getAntiAlias()
Property: The anti aliasing hint used when drawing the graphics for the shape. For instance GfxUtil.AA_HINT_ON.

Returns:
The current hint.
See Also:
GfxUtil.confAntiAliasingHint(java.awt.Graphics2D, boolean, int)

setAntiAlias

public void setAntiAlias(int hint)
Property: The anti aliasing hint used when drawing the graphics for the shape. For instance GfxUtil.AA_HINT_ON.

Parameters:
hint - The new hint.
See Also:
GfxUtil.confAntiAliasingHint(java.awt.Graphics2D, boolean, int)

getTextAntiAlias

public int getTextAntiAlias()
Property: The anti aliasing hint used when drawing the text for the shape. For instance GfxUtil.AA_HINT_ON.

Returns:
The current hint. May be null.
See Also:
GfxUtil.confAntiAliasingHint(java.awt.Graphics2D, boolean, int)

setTextAntiAlias

public void setTextAntiAlias(int hint)
Property: The anti aliasing hint used when drawing the text for the shape. For instance GfxUtil.AA_HINT_ON.

Parameters:
hint - The new hint.
See Also:
GfxUtil.confAntiAliasingHint(java.awt.Graphics2D, boolean, int)

getTitleForeground

public java.awt.Paint getTitleForeground()
Property: The Paint used to draw the title.

Returns:
The current paint. May be null.

setTitleForeground

public void setTitleForeground(java.awt.Paint paint)
Property: The Paint used to draw the title.

Parameters:
paint - The new paint. May be null in which case the title isn't drawn.

getTextForeground

public java.awt.Paint getTextForeground()
Property: The Paint used to draw the main text.

Returns:
The current paint. May be null.

setTextForeground

public void setTextForeground(java.awt.Paint paint)
Property: The Paint used to draw the main text.

Parameters:
paint - The new paint. May be null in which case the title isn't drawn.

getOutlinePaint

public java.awt.Paint getOutlinePaint()
Property: The Paint used to draw the outline.

Returns:
The current paint. May be null.

setOutlinePaint

public void setOutlinePaint(java.awt.Paint paint)
Property: The Paint used to draw the outline.

Parameters:
paint - The new paint. May be null in which case the outline isn't drawn.

getPlaceRect

public PlaceRect getPlaceRect()
Property: How this shape will relate to the reference rectangle (bounds) given by the activity layout system. It can for instance be used to offset it or something else. Norhally though there will just be a 1:1 mapping which can be done with AbsRect.FILL.

Returns:
The current place rect. May be null.

setPlaceRect

public void setPlaceRect(PlaceRect placeRect)
Property: How this shape will relate to the reference rectangle (bounds) given by the activity layout system. It can for instance be used to offset it or something else. Norhally though there will just be a 1:1 mapping which can be done with AbsRect.FILL.

Parameters:
placeRect - The new place rect. May be null, but the behaviour for that is undefined.

getTextPlaceRect

public PlaceRect getTextPlaceRect()
Property: How this shape's main text will relate to the reference rectangle (bounds) given by the activity layout system.

Default is: new AbsRect(new AtStart(2), new AtStart(1), new AtEnd(0), new AtStart(14), null, null, null).

Returns:
The current place rect. May be null.

setTextPlaceRect

public void setTextPlaceRect(PlaceRect placeRect)
Property: How this shape's main text will relate to the reference rectangle (bounds) given by the activity layout system.

Default is: new AbsRect(new AtStart(2), new AtStart(1), new AtEnd(0), new AtStart(14), null, null, null).

Parameters:
placeRect - The new place rect. May be null, but the behaviour for that is undefined.

getTextCrop

public java.awt.Insets getTextCrop()
Property: If not null then this will crop the text with these insets. 0, 0, 0, 0 will crop to the texxt PlaceRect.

Default is: null.

Returns:
The current crop insets. May be null.

setTextCrop

public void setTextCrop(java.awt.Insets insets)
Property: If not null then this will crop the text with these insets. 0, 0, 0, 0 will crop to the texxt PlaceRect.

Default is: null.

Parameters:
insets - The new crop insets. May be null in which case there is no cropping.

getTitleCrop

public java.awt.Insets getTitleCrop()
Property: If not null then this will crop the text with these insets. 0, 0, 0, 0 will crop to the texxt PlaceRect.

Default is: null.

Returns:
The current crop insets. May be null.

setTitleCrop

public void setTitleCrop(java.awt.Insets insets)
Property: If not null then this will crop the text with these insets. 0, 0, 0, 0 will crop to the texxt PlaceRect.

Default is: null.

Parameters:
insets - The new crop insets. May be null in which case there is no cropping.

getTextAlignX

public AtRefRangeNumber getTextAlignX()
Property: Where within the place rect for the text to draw the text string.

Returns:
The alignment for the text. Might be null.
See Also:
getTextPlaceRect()

setTextAlignX

public void setTextAlignX(AtRefRangeNumber x)
Property: Where within the place rect for the text to draw the text string.

Parameters:
x - The new alignment for the text. Might be null.
See Also:
getTextPlaceRect()

getTextAlignY

public AtRefRangeNumber getTextAlignY()
Property: Where within the place rect for the text to draw the text string.

Returns:
The alignment for the text. Might be null.
See Also:
getTextPlaceRect()

setTextAlignY

public void setTextAlignY(AtRefRangeNumber y)
Property: Where within the place rect for the text to draw the text string.

Parameters:
y - The new alignment for the text. Might be null.
See Also:
getTextPlaceRect()

getTitlePlaceRect

public PlaceRect getTitlePlaceRect()
Property: How this shape's title will relate to the reference rectangle (bounds) given by the activity layout system.

Default is: new AbsRect(new AtStart(2), new AtStart(16), new AtEnd(0), new AtEnd(0), null, null, null).

Returns:
The current place rect. May be null.

setTitlePlaceRect

public void setTitlePlaceRect(PlaceRect placeRect)
Property: How this shape's title will relate to the reference rectangle (bounds) given by the activity layout system.

Default is: new AbsRect(new AtStart(2), new AtStart(16), new AtEnd(0), new AtEnd(0), null, null, null).

Parameters:
placeRect - The new place rect. May be null, but the behaviour for that is undefined.

getTitleAlignX

public AtRefRangeNumber getTitleAlignX()
Property: Where within the place rect for the title to draw the title text.

Returns:
The alignment for the text. Might be null.
See Also:
getTitlePlaceRect()

setTitleAlignX

public void setTitleAlignX(AtRefRangeNumber x)
Property: Where within the place rect for the title to draw the title text.

Parameters:
x - The new alignment for the text. Might be null.
See Also:
setTitlePlaceRect(com.miginfocom.util.gfx.geometry.PlaceRect)

getTitleAlignY

public AtRefRangeNumber getTitleAlignY()
Property: Where within the place rect for the title to draw the title text.

Returns:
The alignment for the text. Might be null.
See Also:
getTitlePlaceRect()

setTitleAlignY

public void setTitleAlignY(AtRefRangeNumber y)
Property: Where within the place rect for the title to draw the title text.

Parameters:
y - The new alignment for the text. Might be null.
See Also:
setTitlePlaceRect(com.miginfocom.util.gfx.geometry.PlaceRect)

getTitleFont

public java.awt.Font getTitleFont()
Property: The font used to draw the title in the shape.

Returns:
The current font. May be null.

setTitleFont

public void setTitleFont(java.awt.Font font)
Property: The font used to draw the title in the shape.

Parameters:
font - The new font. May be null in which case the title will not be drawn.

getTextFont

public java.awt.Font getTextFont()
Property: The font used to draw the main text in the shape.

Returns:
The current font. May be null.

setTextFont

public void setTextFont(java.awt.Font font)
Property: The font used to draw the main text in the shape.

Parameters:
font - The new font. May be null in which case the title will not be drawn.

getBackground

public java.awt.Paint getBackground()
Property: The background paint for the shape.

Returns:
The current background paint. may be null.

setBackground

public void setBackground(java.awt.Paint paint)
Property: The background paint for the shape.

Parameters:
paint - The new background paint. May be null in which case it isn't painted.

getBackgroundPlaceRect

public PlaceRect getBackgroundPlaceRect()
Property: How this shape's background will relate to the reference rectangle (bounds) given by the activity layout system.

Default is: new AbsRect(new AtStart(1), new AtStart(1), new AtEnd(-1), new AtEnd(-1), null, null, null).

Returns:
The current place rect. May be null.
Since:
6.5

setBackgroundPlaceRect

public void setBackgroundPlaceRect(PlaceRect placeRect)
Property: How this shape's background will relate to the reference rectangle (bounds) given by the activity layout system.

Default is: new AbsRect(new AtStart(1), new AtStart(1), new AtEnd(-1), new AtEnd(-1), null, null, null).

Parameters:
placeRect - The new place rect. May be null, but the behaviour for that is undefined.
Since:
6.5

getOutlineStrokeWidth

public float getOutlineStrokeWidth()
Property: The width of the outline around the shape.

Returns:
The current width. Default is 1.

setOutlineStrokeWidth

public void setOutlineStrokeWidth(float width)
Property: The width of the outline around the shape.

Parameters:
width - The new width.

getCornerRadius

public double getCornerRadius()
Property: The corner radius for the outline RoundRectangle.

Returns:
The current radius.
See Also:
RoundRectangle2D.Double.setRoundRect(double, double, double, double, double, double)

setCornerRadius

public void setCornerRadius(double radius)
Property: The corner radius for the outline RoundRectangle.

Parameters:
radius - The new radius.
See Also:
RoundRectangle2D.Double.setRoundRect(double, double, double, double, double, double)

addMouseInteractionListener

public void addMouseInteractionListener(MouseInteractionListener l)
Adds a listener that listens to all mouse events on this shape and all sub shapes that has a hit area report set to true.

Note that the listener will be installed on the default AShape which can be used for many date areas. To only handle events originating from a single date area you can do this:

 if (event.getOriginalEvent().getComponent() == myDateAreaBean.getDateArea()) {
         // Put code to handle the event here...
 }

Parameters:
l - The listener
Since:
6.0
See Also:
AShape.A_REPORT_HIT_AREA, addMouseInteractionListener(MouseInteractionListener, boolean)

addMouseInteractionListener

public void addMouseInteractionListener(MouseInteractionListener l,
                                        boolean asWeakRef)
Adds a listener that listens to all mouse events on this shape and all sub shapes that has a hit area report set to true.

Parameters:
l - The listener
asWeakRef - If the listener should be added wrapped in a WeakReference. This defers memory leak problems since the garbage collector can collect the listener if it is only referenced from this list.

Note! This (weak reference) can not be used with listeners that doesn't have another real (a.k.a Strong) reference to it, as for instance an annonymous inner class. If one such listener is added it will be removed almost immediately by the garbage collector.

Since:
6.0
See Also:
AShape.A_REPORT_HIT_AREA

removeMouseInteractionListener

public void removeMouseInteractionListener(MouseInteractionListener l)
Removes the listener if it exists locally.

Parameters:
l - The listener.
Since:
6.0


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.