ptolemy.vergil.basic
Class BasicGraphPane

java.lang.Object
  extended by diva.canvas.CanvasPane
      extended by diva.canvas.GraphicsPane
          extended by diva.graph.GraphPane
              extended by ptolemy.vergil.basic.BasicGraphPane
All Implemented Interfaces:
CanvasComponent, EventAcceptor

public class BasicGraphPane
extends GraphPane

A simple graph pane that has an associated Ptolemy model and handles getting the background color from the preferences.

Since:
Ptolemy II 8.0
Version:
$Id: BasicGraphPane.java 57046 2010-01-27 23:35:53Z cxh $
Author:
Edward A. Lee
Accepted Rating:
Red (eal)
Proposed Rating:
Yellow (eal)

Field Summary
private static int _backgroundWarningCount
          Counter to ensure that no more than one message is printed when we fail to find the default preferences in the configuration.
private  java.awt.Color _defaultColor
          The default color from the configuration.
private  NamedObj _entity
          The Ptolemy object being displayed.
 
Fields inherited from class diva.canvas.GraphicsPane
_backgroundEventLayer, _backgroundLayer, _foregroundEventLayer, _foregroundLayer, _layers, _overlayLayer
 
Constructor Summary
BasicGraphPane(GraphController controller, GraphModel model, NamedObj entity)
          Create a pane that updates the background color on each repaint if there is a preference attribute.
 
Method Summary
private  void _setBackground()
          If the model contains local preferences, use that to set the background color.
 void repaint()
          Override the base class to set the background.
 void repaint(DamageRegion damage)
          Override the base class to set the background.
 
Methods inherited from class diva.graph.GraphPane
getGraphController, getGraphModel
 
Methods inherited from class diva.canvas.GraphicsPane
_rebuildLayerArray, getBackgroundEventLayer, getBackgroundLayer, getForegroundEventLayer, getForegroundLayer, getOverlayLayer, layersFromBack, layersFromFront, setBackgroundEventLayer, setBackgroundLayer, setForegroundEventLayer, setForegroundLayer, setOverlayLayer
 
Methods inherited from class diva.canvas.CanvasPane
_initNewLayer, _nullifyLayer, dispatchEvent, getCanvas, getParent, getSize, getToolTipText, getTransformContext, isAntialiasing, isEnabled, layers, paint, paint, processLayerEvent, scale, setAntialiasing, setCanvas, setEnabled, setParent, setSize, setSize, setTransform, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_backgroundWarningCount

private static int _backgroundWarningCount
Counter to ensure that no more than one message is printed when we fail to find the default preferences in the configuration.


_defaultColor

private java.awt.Color _defaultColor
The default color from the configuration.


_entity

private NamedObj _entity
The Ptolemy object being displayed.

Constructor Detail

BasicGraphPane

public BasicGraphPane(GraphController controller,
                      GraphModel model,
                      NamedObj entity)
Create a pane that updates the background color on each repaint if there is a preference attribute.

Parameters:
controller - The controller.
model - The graph model.
entity - The Ptolemy II model being displayed.
Method Detail

repaint

public void repaint()
Override the base class to set the background.

Specified by:
repaint in interface CanvasComponent
Overrides:
repaint in class CanvasPane

repaint

public void repaint(DamageRegion damage)
Override the base class to set the background.

Specified by:
repaint in interface CanvasComponent
Overrides:
repaint in class CanvasPane

_setBackground

private void _setBackground()
If the model contains local preferences, use that to set the background color. Otherwise, use the global preferences from the configuration.