lt.monarch.chart.awt
Class ChartCanvas

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by lt.monarch.chart.awt.ChartCanvas
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, ViewContainer

public class ChartCanvas
extends java.awt.Panel
implements ViewContainer

AWT ViewContainer implementation

See Also:
Serialized Form

Nested Class Summary
Modifier and Type Class and Description
 
Nested classes/interfaces inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
Modifier and Type Field and Description
protected  java.awt.Image buffer
          image for double buffering
protected  View chart
          the chart
protected  ChartObjectsMap chartObjectsMap
           
protected  java.awt.Dimension currentChartSize
          current chart size
protected  HotSpotMap hotSpotMap
          hot spot map
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Constructor and Description
ChartCanvas(View chart)
          Constructs a new ChartCanvas with the specified chart.
 
Method Summary
Modifier and Type Method and Description
 void addGestureListener(GestureListener l)
          Does nothing.
 void addMultitouchListener(MultitouchListener l)
          Does nothing.
 void addNotify()
          Makes this Container visible by connecting it to a native screen resource.
 void doLayout()
          Causes this container to lay out its components.
 ChartObjectsMap getChartObjectsMap()
          Returns a chart objects map of this chart canvas.
 java.awt.Component getComponent()
          Returns the associated Component
 HotSpotMap getHotSpotMap()
          Returns a hot spot map of this chart canvas.
 java.awt.Insets getInsets()
          Determines the insets of this container, which indicate the size of the container's border.
 java.awt.Dimension getMinimumSize()
          Returns the minimum size of this container.
 java.awt.Dimension getPreferredSize()
          Returns the preferred size of this container.
 AbstractGraphics getUpdateGraphics()
          Returns the default graphics context, where any view can render itself
 View getView()
          Returns chart view.
 void paint(java.awt.Graphics g)
          Paints the container.
 void removeGestureListener(GestureListener l)
          Does nothing.
 void removeMultitouchListener(MultitouchListener l)
          Does nothing.
 void removeNotify()
          Makes this Container invisible by removing its connection to its native screen resource.
 void repaint(Rectangle2D r)
          Requests a container update
 void revalidate()
          Requests a container to be revalidated
 void setChartObjectsMap(ChartObjectsMap chartObjectsMap)
          Sets the specified chart objects map for this chart canvas.
 void setHotSpotMap(HotSpotMap map)
          Sets the specified hot spot map for this chart canvas.
 void update(java.awt.Graphics g)
          Updates the container.
 void validate()
          Validates this container and its chart.
 
Methods inherited from class java.awt.Panel
getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getListeners, getMaximumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, isValidateRoot, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface lt.monarch.chart.engine.ViewContainer
addMouseListener, addMouseMotionListener, addMouseWheelListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener
 

Field Detail

currentChartSize

protected java.awt.Dimension currentChartSize
current chart size


hotSpotMap

protected HotSpotMap hotSpotMap
hot spot map


chartObjectsMap

protected ChartObjectsMap chartObjectsMap

chart

protected View chart
the chart


buffer

protected transient java.awt.Image buffer
image for double buffering

Constructor Detail

ChartCanvas

public ChartCanvas(View chart)
Constructs a new ChartCanvas with the specified chart.

Parameters:
chart - the chart
Method Detail

getHotSpotMap

public HotSpotMap getHotSpotMap()
Returns a hot spot map of this chart canvas.

Specified by:
getHotSpotMap in interface ViewContainer
Returns:
hot spot map of this chart canvas

setHotSpotMap

public void setHotSpotMap(HotSpotMap map)
Sets the specified hot spot map for this chart canvas.

Parameters:
map - the hot spot map

getChartObjectsMap

public ChartObjectsMap getChartObjectsMap()
Returns a chart objects map of this chart canvas.

Specified by:
getChartObjectsMap in interface ViewContainer
Returns:
chart objects map of this chart canvas

setChartObjectsMap

public void setChartObjectsMap(ChartObjectsMap chartObjectsMap)
Sets the specified chart objects map for this chart canvas.

Parameters:
map - the chart objects map

getInsets

public java.awt.Insets getInsets()
Determines the insets of this container, which indicate the size of the container's border.

Overrides:
getInsets in class java.awt.Container
Returns:
new Insets (5,5,5,5)

getMinimumSize

public java.awt.Dimension getMinimumSize()
Returns the minimum size of this container.

Overrides:
getMinimumSize in class java.awt.Container
Returns:
the minimum size of this container

getPreferredSize

public java.awt.Dimension getPreferredSize()
Returns the preferred size of this container.

Overrides:
getPreferredSize in class java.awt.Container
Returns:
the preferred size of this container

repaint

public void repaint(Rectangle2D r)
Requests a container update

Specified by:
repaint in interface ViewContainer
Parameters:
r - the specified rectangle of this view container to repaint

revalidate

public void revalidate()
Requests a container to be revalidated

Specified by:
revalidate in interface ViewContainer

getComponent

public java.awt.Component getComponent()
Returns the associated Component

Specified by:
getComponent in interface ViewContainer
Returns:
reference to this container

getUpdateGraphics

public AbstractGraphics getUpdateGraphics()
Returns the default graphics context, where any view can render itself

Specified by:
getUpdateGraphics in interface ViewContainer
Returns:
graphics context

update

public void update(java.awt.Graphics g)
Updates the container. Calls paint method for the chart.

Overrides:
update in class java.awt.Container
Parameters:
g - the Graphics context in which to paint chart

validate

public void validate()
Validates this container and its chart.

Overrides:
validate in class java.awt.Container

paint

public void paint(java.awt.Graphics g)
Paints the container. This forwards the paint to the child chart.

Overrides:
paint in class java.awt.Container
Parameters:
g - the specified Graphics context

doLayout

public void doLayout()
Causes this container to lay out its components. Validates the child chart.

Overrides:
doLayout in class java.awt.Container

addNotify

public void addNotify()
Makes this Container visible by connecting it to a native screen resource. Sets chart container to this.

Overrides:
addNotify in class java.awt.Panel

removeNotify

public void removeNotify()
Makes this Container invisible by removing its connection to its native screen resource. Sets child chart container to null.

Overrides:
removeNotify in class java.awt.Container

getView

public View getView()
Returns chart view.

Specified by:
getView in interface ViewContainer
Returns:
Returns the chart view.

addGestureListener

public void addGestureListener(GestureListener l)
Does nothing.

Specified by:
addGestureListener in interface ViewContainer
Parameters:
l - the gesture listener

addMultitouchListener

public void addMultitouchListener(MultitouchListener l)
Does nothing.

Specified by:
addMultitouchListener in interface ViewContainer
Parameters:
l - the gesture listener

removeGestureListener

public void removeGestureListener(GestureListener l)
Does nothing.

Specified by:
removeGestureListener in interface ViewContainer
Parameters:
l - the gesture listener

removeMultitouchListener

public void removeMultitouchListener(MultitouchListener l)
Does nothing.

Specified by:
removeMultitouchListener in interface ViewContainer
Parameters:
l - the gesture listener