org.globus.cog.gui.grapheditor.targets.swing.util
Class ScalingContainer

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byorg.globus.cog.gui.grapheditor.util.swing.EventTrappingContainer
              extended byorg.globus.cog.gui.grapheditor.targets.swing.util.ScalingContainer
All Implemented Interfaces:
ActionListener, EventListener, ImageObserver, MenuContainer, MouseListener, MouseMotionListener, PainterListener, RepaintListener, Serializable
Direct Known Subclasses:
OverviewContainer

public class ScalingContainer
extends EventTrappingContainer
implements ActionListener, RepaintListener, MouseListener, MouseMotionListener, PainterListener

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  ScalingPainter painter
           
protected static int SWING_SCALING_PAINTER
           
protected static int titleHeight
           
 
Fields inherited from class org.globus.cog.gui.grapheditor.util.swing.EventTrappingContainer
comp
 
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
ScalingContainer(Component comp)
           
 
Method Summary
 void actionPerformed(ActionEvent e)
           
 void addPainterListener(PainterListener l)
           
 void bufferUpdated(ScalingPainter p)
           
 void clear()
           
 Dimension computeSize()
           
 void computeSize(Component c, int tx, int ty)
           
protected  void destroyCurrentPainter()
           
 void dispose()
           
 void doPaintBuffer()
           
 void finalize()
           
 void fireBufferUpdated(ScalingPainter source)
           
 void firePaintCompleted(ScalingPainter source)
           
 boolean getAntiAliasing()
           
 Dimension getBufferSize()
           
 ImageIcon getIcon()
           
 boolean getKeepAspectRatio()
           
 int getMaxx()
           
 int getMaxy()
           
 int getMinx()
           
 int getMiny()
           
protected  ScalingPainter getPainter(int type)
           
 Object getPaintLock()
           
 Dimension getPreferredSize()
           
 String getTilte()
           
 void invalidate()
           
 boolean isImmediate()
           
 boolean isOutline()
           
 int maxX()
           
 int maxY()
           
 int minX()
           
 int minY()
           
 void mouseClicked(MouseEvent e)
           
 void mouseDragged(MouseEvent e)
           
 void mouseEntered(MouseEvent e)
           
 void mouseExited(MouseEvent e)
           
 void mouseMoved(MouseEvent e)
           
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
 void paint(Graphics g0)
           
 void paintBuffer()
           
 void paintCompleted(ScalingPainter p)
           
 void paintd(Component c, Graphics g, int ox, int oy, double sx, double sy)
           
 void paintNormal()
           
 void paintOutline()
           
protected  void processMouseEvent(MouseEvent e)
           
protected  void processMouseMotionEvent(MouseEvent e)
           
 Point realToScaled(int x, int y)
           
 Point realToScaled(Point p)
           
 void removePainterListener(PainterListener l)
           
 void removeTitle()
           
 void repaint(PaintEvent e)
           
 void repaintBuffer(Rectangle dirtyRect)
           
 void repaintImmediately()
           
 Point scaledToReal(int x, int y)
           
 Point scaledToReal(Point p)
           
 void setAntiAliasing(boolean aa)
           
 void setComponent(Component comp)
           
 void setEventsEnabled(boolean enabled)
           
 void setIcon(ImageIcon icon)
           
 void setImmediate(boolean immediate)
           
 void setKeepAspectRatio(boolean k)
           
 void setMaxx(int i)
           
 void setMaxy(int i)
           
 void setMinx(int i)
           
 void setMiny(int i)
           
 void setOutline(boolean b)
           
 void setPaintLock(Object paintLock)
          Since this is a multithreaded animal, provide a way to defer painting if some other thread is changing things on the scaled component
 void setTitle(String title)
           
 void translateAndDispatchMouseEvent(MouseEvent e)
           
 void validateTree(Component c)
           
protected  void wakeCurrentPainter()
           
 
Methods inherited from class org.globus.cog.gui.grapheditor.util.swing.EventTrappingContainer
contains, disableEventsP, disableMouseEvents, doLayout, enableEventsP, enableMouseEvents, getComponent
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, insets, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, 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, 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, isOpaque, 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, 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, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SWING_SCALING_PAINTER

protected static final int SWING_SCALING_PAINTER
See Also:
Constant Field Values

titleHeight

protected static int titleHeight

painter

protected ScalingPainter painter
Constructor Detail

ScalingContainer

public ScalingContainer(Component comp)
Method Detail

addPainterListener

public void addPainterListener(PainterListener l)

removePainterListener

public void removePainterListener(PainterListener l)

fireBufferUpdated

public void fireBufferUpdated(ScalingPainter source)

firePaintCompleted

public void firePaintCompleted(ScalingPainter source)

actionPerformed

public void actionPerformed(ActionEvent e)
Specified by:
actionPerformed in interface ActionListener

computeSize

public Dimension computeSize()

computeSize

public void computeSize(Component c,
                        int tx,
                        int ty)

dispose

public void dispose()

doPaintBuffer

public void doPaintBuffer()

paintNormal

public void paintNormal()

paintOutline

public void paintOutline()

getPainter

protected ScalingPainter getPainter(int type)

destroyCurrentPainter

protected void destroyCurrentPainter()

wakeCurrentPainter

protected void wakeCurrentPainter()

paintCompleted

public void paintCompleted(ScalingPainter p)
Specified by:
paintCompleted in interface PainterListener

bufferUpdated

public void bufferUpdated(ScalingPainter p)
Specified by:
bufferUpdated in interface PainterListener

getBufferSize

public Dimension getBufferSize()

getAntiAliasing

public boolean getAntiAliasing()

getIcon

public ImageIcon getIcon()

getKeepAspectRatio

public boolean getKeepAspectRatio()

getMaxx

public int getMaxx()

getMaxy

public int getMaxy()

getMinx

public int getMinx()

getMiny

public int getMiny()

getPreferredSize

public Dimension getPreferredSize()

getTilte

public String getTilte()

invalidate

public void invalidate()

isOutline

public boolean isOutline()

maxX

public int maxX()

maxY

public int maxY()

minX

public int minX()

minY

public int minY()

mouseClicked

public void mouseClicked(MouseEvent e)
Specified by:
mouseClicked in interface MouseListener

mouseDragged

public void mouseDragged(MouseEvent e)
Specified by:
mouseDragged in interface MouseMotionListener

mouseEntered

public void mouseEntered(MouseEvent e)
Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
Specified by:
mouseExited in interface MouseListener

mouseMoved

public void mouseMoved(MouseEvent e)
Specified by:
mouseMoved in interface MouseMotionListener

mousePressed

public void mousePressed(MouseEvent e)
Specified by:
mousePressed in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent e)
Specified by:
mouseReleased in interface MouseListener

paint

public void paint(Graphics g0)

paintBuffer

public void paintBuffer()

paintd

public void paintd(Component c,
                   Graphics g,
                   int ox,
                   int oy,
                   double sx,
                   double sy)

realToScaled

public Point realToScaled(int x,
                          int y)

realToScaled

public Point realToScaled(Point p)

removeTitle

public void removeTitle()

repaint

public void repaint(PaintEvent e)
Specified by:
repaint in interface RepaintListener

repaintBuffer

public void repaintBuffer(Rectangle dirtyRect)

repaintImmediately

public void repaintImmediately()

scaledToReal

public Point scaledToReal(int x,
                          int y)

scaledToReal

public Point scaledToReal(Point p)

setAntiAliasing

public void setAntiAliasing(boolean aa)

setComponent

public void setComponent(Component comp)
Overrides:
setComponent in class EventTrappingContainer

setEventsEnabled

public void setEventsEnabled(boolean enabled)

translateAndDispatchMouseEvent

public void translateAndDispatchMouseEvent(MouseEvent e)

processMouseEvent

protected void processMouseEvent(MouseEvent e)

processMouseMotionEvent

protected void processMouseMotionEvent(MouseEvent e)

setIcon

public void setIcon(ImageIcon icon)

setKeepAspectRatio

public void setKeepAspectRatio(boolean k)

setMaxx

public void setMaxx(int i)

setMaxy

public void setMaxy(int i)

setMinx

public void setMinx(int i)

setMiny

public void setMiny(int i)

setOutline

public void setOutline(boolean b)

setTitle

public void setTitle(String title)

validateTree

public void validateTree(Component c)

finalize

public void finalize()

clear

public void clear()

getPaintLock

public Object getPaintLock()

setPaintLock

public void setPaintLock(Object paintLock)
Since this is a multithreaded animal, provide a way to defer painting if some other thread is changing things on the scaled component


isImmediate

public boolean isImmediate()

setImmediate

public void setImmediate(boolean immediate)