Class AnnotationBubble

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
info.monitorenter.gui.chart.annotations.bubble.AnnotationBubble
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class AnnotationBubble extends JPanel
A movable container for annotations.

See Also:
  • Field Details

    • PADDING

      public static final int PADDING
      Internal padding for content box.
      See Also:
    • m_chartPanel

      protected ChartPanel m_chartPanel
      The chart listening on.
    • m_content

      protected AAnnotationContentComponent m_content
      Content area ref.
    • m_titleBar

      protected JComponent m_titleBar
      Title bar ref or null, if no title bar is used.
  • Constructor Details

    • AnnotationBubble

      public AnnotationBubble(ChartPanel chartPanel, AAnnotationContentComponent annotationContent, boolean useDragListenerOnAnnotationContent, boolean useTitleBar)
      Creates an instance for the given chart.

      Parameters:
      chartPanel - the chart panel this instance is added to as an annotation.
      annotationContent - the content area (information container) of the visible annotation information.
      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.
  • Method Details

    • isDragged

      public boolean isDragged()
      Check whether this annotation is currently draggged.

      Returns:
      true if this annotation is currently dragged.
    • isOutlineDragMode

      public final boolean isOutlineDragMode()
      Returns the outlineDragMode.

      Returns:
      the outlineDragMode
    • paint

      public final void paint(Graphics g)
      Overrides:
      paint in class JComponent
      See Also:
    • paintComponent

      protected void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
      See Also:
    • setOutlineDragMode

      public final void setOutlineDragMode(boolean outlineDragMode)
      Sets the outlineDragMode.

      Parameters:
      outlineDragMode - the outlineDragMode to set
    • setTransparency

      public void setTransparency(double zeroToOneAlpha)
      Sets the transparency of the annotation.

      Caution: When using a value greater 0 dragging the annotation may cost a multiple cpu load and dragging speed! In this case consider setting the paintOnDragging property to false;

      Parameters:
      zeroToOneAlpha - a transparency value between 0.0 and 1.0.