info.monitorenter.gui.chart.annotations.bubble
Class AnnotationCreatorBubble

java.lang.Object
  extended by info.monitorenter.gui.chart.annotations.bubble.AnnotationCreatorBubble
All Implemented Interfaces:
IAnnotationCreator, java.io.Serializable

public final class AnnotationCreatorBubble
extends java.lang.Object
implements IAnnotationCreator

Factory implementation for annotation view creation in tool tip bubble style.

Author:
Achim Westermann
See Also:
Serialized Form

Method Summary
 javax.swing.JComponent createAnnotationView(ChartPanel chart, ITracePoint2D point, AAnnotationContentComponent annotationPainter, boolean useDragListenerOnAnnotationContent, boolean useTitleBar)
          Factory method to create a JComponent that annotates the given ITracePoint.
static IAnnotationCreator getInstance()
          Singleton retrieval method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static IAnnotationCreator getInstance()
Singleton retrieval method.

Returns:
the sole instance in this VM.

createAnnotationView

public javax.swing.JComponent createAnnotationView(ChartPanel chart,
                                                   ITracePoint2D point,
                                                   AAnnotationContentComponent annotationPainter,
                                                   boolean useDragListenerOnAnnotationContent,
                                                   boolean useTitleBar)
Description copied from interface: IAnnotationCreator
Factory method to create a JComponent that annotates the given ITracePoint.

The returned component will be the "content area" of the visible annotation. It's method Component.getPreferredSize() will be used to define the overall size of the visible annotation.

The returned component may have it's own mouse listeners because dragging of the annotation will be supported by a separate title bar part. However it may also use the given dragListener via Component.addMouseListener(java.awt.event.MouseListener) and Component.addMouseMotionListener(java.awt.event.MouseMotionListener) if the "content area" of the visible annotation should only support dragging the annotation and a right - click menu for basic operations.

The implementation should build a complete annotation view with all required event listeners that contains at least the annotation content component that given here.

Specified by:
createAnnotationView in interface IAnnotationCreator
Parameters:
chart - the chart panel to add the annotation to, potentially needed for the removal of the annotation view when it's optional title bar close icon is pressed.
point - the point that is annotated.
annotationPainter - the content component of the annotation that will display the information of the annotation.
useDragListenerOnAnnotationContent - if true the content area that contains the information of the annotation will support drag and drop as well as a basic right click popup menu.
useTitleBar - if true, a title bar with close button for the annotation will be shown.
Returns:
the component that will be displayed as an annotation of the given point.
See Also:
IAnnotationCreator.createAnnotationView(info.monitorenter.gui.chart.views.ChartPanel, info.monitorenter.gui.chart.ITracePoint2D, info.monitorenter.gui.chart.annotations.AAnnotationContentComponent, boolean, boolean)


Copyright © 2001 - 2010 LGPL, All Rights Footloose.