JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.higrid
Class GridArea

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--com.klg.jclass.higrid.GridArea
All Implemented Interfaces:
EventListener, FocusListener, ImageObserver, MenuContainer, Serializable

public class GridArea
extends JComponent
implements FocusListener

The GridArea is the component onto which the HiGrid nodes are rendered. The GridArea, along with the vertical and horizontal scrollbars exist within the HiGrid container.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
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  com.klg.jclass.higrid.FocusModel focusManager
           
protected  boolean isDoubleBuffer
           
protected static int MINIMUM_HEIGHT
           
protected static int MINIMUM_WIDTH
           
protected  com.klg.jclass.higrid.HiGridTip toolTip
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
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
GridArea(com.klg.jclass.higrid.HiGrid grid)
          Default Constructor
 
Method Summary
 JToolTip createToolTip()
          Retrieves the HiGridTip.
 void dispose()
          Disposes of any native resources.
protected  boolean doubleBufferSizeChanged()
          Checks whether the double-buffer needs to be reset/recreated, based on HiGrid's RowTree.
 void focusGained(FocusEvent event)
           
 void focusLost(FocusEvent event)
           
protected  Object getAWTLock()
          Returns the object used to lock layout and repaint.
protected  Graphics getDoubleBufferGraphics()
          Creates a double-buffer graphics for drawing into the doubleBufferImage
protected  Image getDoubleBufferImage()
          Returns the double-buffer image previously created in a call to getDoubleBufferGraphics.
 com.klg.jclass.higrid.FocusModel getFocusManager()
          Returns the current FocusManager.
 Dimension getPreferredSize()
          Gets the preferred size of this component.
 Point getToolTipLocation(MouseEvent event)
          Computes the point at which the HiGridTip must be placed for correct alignment.
 void paintComponent(Graphics gc)
          Override for Swing painting model.
protected  void paintGrid(Graphics gc)
          Call back to HiGrid to render the grid.
protected  void recreateToolTip()
          Allows lazy creation of tooltips and permits cut and paste serialization.
protected  void refresh()
          Repaints the entire grid
protected  void refresh(int pixels)
          Repaints the grid based on the passed number of pixels.
protected  void refresh(int x, int y, int width, int height)
          Repaints the grid based on the passed rectangle coordinates
 void setBounds(int x, int y, int width, int height)
          Moves and resizes this component.
protected  Image setDoubleBufferImage(Image image)
          Sets the image to be used as the double-buffer image.
 void setFocusManager(com.klg.jclass.higrid.FocusModel focusManager)
          Sets a new FocusManager
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, 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, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MINIMUM_WIDTH

protected static final int MINIMUM_WIDTH
See Also:
Constant Field Values

MINIMUM_HEIGHT

protected static final int MINIMUM_HEIGHT
See Also:
Constant Field Values

toolTip

protected transient com.klg.jclass.higrid.HiGridTip toolTip

isDoubleBuffer

protected boolean isDoubleBuffer

focusManager

protected com.klg.jclass.higrid.FocusModel focusManager
Constructor Detail

GridArea

public GridArea(com.klg.jclass.higrid.HiGrid grid)
Default Constructor

Method Detail

getToolTipLocation

public Point getToolTipLocation(MouseEvent event)
Computes the point at which the HiGridTip must be placed for correct alignment.

Overrides:
getToolTipLocation in class JComponent
Parameters:
event - MouseEvent that stores current mouse position
Returns:
the point at which the HiGridTip must be placed for correct alignment.

createToolTip

public JToolTip createToolTip()
Retrieves the HiGridTip.

Overrides:
createToolTip in class JComponent
Returns:
the HiGridTip.

recreateToolTip

protected void recreateToolTip()
Allows lazy creation of tooltips and permits cut and paste serialization.


getAWTLock

protected Object getAWTLock()
Returns the object used to lock layout and repaint.


getDoubleBufferImage

protected Image getDoubleBufferImage()
Returns the double-buffer image previously created in a call to getDoubleBufferGraphics.

See Also:
getDoubleBufferGraphics()

setDoubleBufferImage

protected Image setDoubleBufferImage(Image image)
Sets the image to be used as the double-buffer image.

Parameters:
image - new double-buffer to use

doubleBufferSizeChanged

protected boolean doubleBufferSizeChanged()
Checks whether the double-buffer needs to be reset/recreated, based on HiGrid's RowTree.

Returns:
true if image has been recreated

getDoubleBufferGraphics

protected Graphics getDoubleBufferGraphics()
Creates a double-buffer graphics for drawing into the doubleBufferImage

Returns:
the Graphics instance for the image
See Also:
getDoubleBufferImage()

paintGrid

protected void paintGrid(Graphics gc)
Call back to HiGrid to render the grid.

Parameters:
gc - Graphics Context to use for rendering.

refresh

protected void refresh()
Repaints the entire grid


refresh

protected void refresh(int x,
                       int y,
                       int width,
                       int height)
Repaints the grid based on the passed rectangle coordinates


refresh

protected void refresh(int pixels)
Repaints the grid based on the passed number of pixels.

Parameters:
pixels - Based on its sign, will copy the given number of pixels up or down within the double-buffer and expose the remainder to be repainted as usual.

paintComponent

public void paintComponent(Graphics gc)
Override for Swing painting model.

Overrides:
paintComponent in class JComponent
Parameters:
gc - Graphics Context to paint into.

getPreferredSize

public Dimension getPreferredSize()
Gets the preferred size of this component.

Overrides:
getPreferredSize in class JComponent
Returns:
A dimension object indicating this component's preferred size.

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Moves and resizes this component. The new location of the top-left corner is specified by x and y, and the new size is specified by width and height.

Overrides:
setBounds in class Component
Parameters:
x - The new x-coordinate of this component.
y - The new y-coordinate of this component.
width - The new width of this component.
height - The new height of this component.

dispose

public void dispose()
Disposes of any native resources.


getFocusManager

public com.klg.jclass.higrid.FocusModel getFocusManager()
Returns the current FocusManager.

Returns:
The current FocusManager
See Also:
setFocusManager(com.klg.jclass.higrid.FocusModel)

setFocusManager

public void setFocusManager(com.klg.jclass.higrid.FocusModel focusManager)
Sets a new FocusManager

Parameters:
focusManager - The new focus manager. Null values are ignored.

focusGained

public void focusGained(FocusEvent event)
Specified by:
focusGained in interface FocusListener

focusLost

public void focusLost(FocusEvent event)
Specified by:
focusLost in interface FocusListener

Copyright © 2004 Quest Software Inc..
All rights reserved.