JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.higrid
Class RowFormat

java.lang.Object
  |
  +--com.klg.jclass.higrid.RowFormat
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
RecordFormat, ShowableRowFormat

public abstract class RowFormat
extends Object
implements Serializable

The RowFormat class contains the design-time and run-time information associated with a given RowNode.

See Also:
Serialized Form

Field Summary
protected static int COLUMN_SIZING_TOLERANCE
           
static int MIXED_BORDER_STYLES
          indicates not all the cell formats' border styles are the same
static int MIXED_SIZE
          indicates not all the font sizes are the same
static int MIXED_STYLE
          indicates not all the font styles are the same
protected static int ROW_SIZING_TOLERANCE
           
 
Constructor Summary
RowFormat()
          Constructor
 
Method Summary
protected  int calculatePreferredHeight()
          Calculate the preferred height of this row format.
protected  void checkForRowResizing(com.klg.jclass.higrid.NullGraphics nullgc, com.klg.jclass.higrid.RowNode rowNode)
           
protected  void computeSize(Vector cells)
           
protected  void computeWidth()
           
protected  com.klg.jclass.higrid.CellFormat createEditStatus(com.klg.jclass.higrid.HiGrid grid)
          Creates the edit status indicator column.
 void createIndicatorFormats(com.klg.jclass.higrid.HiGrid grid)
          Setup the indicator formats.
protected  com.klg.jclass.higrid.CellFormat createNodeFormat(com.klg.jclass.higrid.HiGrid grid)
          Creates the node column.
 boolean draw(Graphics gc, com.klg.jclass.higrid.HiGrid grid, com.klg.jclass.higrid.RowNode rowNode)
          Draw an entire RowNode.
 void drawCells(Graphics gc, com.klg.jclass.higrid.HiGrid grid, com.klg.jclass.higrid.RowNode rowNode, Vector cells, Rectangle rect, Rectangle intersectRect)
          Draw a vector of cells within the given row.
protected  boolean findFromFormat(com.klg.jclass.higrid.NullGraphics nullgc, Enumeration e, int x)
           
 int getActualColumnIndex(int visibleColumnIndex)
          Compute the actual column index from the visible column index.
 boolean getAllowHeightSizing()
          Retrieves whether height sizing is allowed for this object.
 Color getBackground()
          Retrieves the background color for this object.
 Insets getBorderInsets()
          Retrieves the border insets for this object.
 int getBorderStyle()
          Retrieves the border style for this object.
 Vector getDataFormats()
          Retrieves the data formats for this level.
protected  int getDataWidth()
          Get the total width of all of the visible data cells.
protected  int getFirstVisibleCell()
          Returns the first available editable position
 String getFontName()
          Retrieves the font name for this object.
 int getFontSize()
          Retrieves the font size for this object.
 int getFontStyle()
          Retrieves the font style for this object.
 Color getForeground()
          Retrieves the foreground color for this object.
 Object getHeaderLabel(com.klg.jclass.higrid.HiGrid grid, com.klg.jclass.higrid.RowNode rowNode, com.klg.jclass.higrid.CellFormat cellFormat)
          Setup the header label for the indicated cell.
 int getHeight()
          Retrieves the height of this object.
 Vector getIndicatorFormats()
          Retrieves the indicator formats for this level.
 int getIndicatorIndent(com.klg.jclass.higrid.HiGrid grid, com.klg.jclass.higrid.FormatNode node)
          Get the initial pixel indent for the given format level's indicator formats.
 int getInitialLevelIndent(com.klg.jclass.higrid.HiGrid grid, com.klg.jclass.higrid.FormatNode node)
          Get the initial pixel indent for the given format level.
protected  int getLastVisibleCell()
          Returns the last available editable position
 com.klg.jclass.datasource.MetaDataModel getMetaData()
          Retrieves the metadata for this row format.
protected  int getNodeIndent(com.klg.jclass.higrid.HiGrid grid, Vector indicatorFormats)
           
protected  com.klg.jclass.higrid.FormatNode getParent()
          Retrieves the parent of this object.
 int getPreferredHeight()
          Get the preferred height of this row format.
protected  int getTotalPrintWidth(com.klg.jclass.higrid.HiGrid grid, com.klg.jclass.higrid.FormatNode node, int printableWidth)
           
protected  int getTotalWidth(com.klg.jclass.higrid.HiGrid grid, com.klg.jclass.higrid.FormatNode node)
           
 int getVisibleColumnCount()
          Compute the number of visible dataFormat columns for this rowFormat.
 int getVisibleColumnIndex(int actualColumnIndex)
          Compute the visible column index from the actual column index.
 int getWidth()
          Retrieves the width of this object.
protected  void getXPosition(com.klg.jclass.higrid.NullGraphics nullgc, com.klg.jclass.higrid.HiGrid grid, com.klg.jclass.higrid.RowNode rowNode, int operation)
           
protected  void heightChanged()
           
protected  void hitTest(com.klg.jclass.higrid.NullGraphics nullgc, com.klg.jclass.higrid.HiGrid grid, com.klg.jclass.higrid.RowNode rowNode)
           
protected  int hitTestWithinRow(com.klg.jclass.higrid.NullGraphics nullgc, com.klg.jclass.higrid.HiGrid grid, com.klg.jclass.higrid.RowNode rowNode, Vector cells, int x)
           
 boolean isShowing()
          Retrieves whether this object is showing.
protected  void nextRow(Graphics gc, com.klg.jclass.higrid.HiGrid grid, com.klg.jclass.higrid.RowNode rowNode)
          Move down to prepare to draw the next row.
protected  boolean nullDraw(com.klg.jclass.higrid.NullGraphics nullgc, com.klg.jclass.higrid.HiGrid grid, com.klg.jclass.higrid.RowNode rowNode)
          "Pretend" to draw an entire RowNode.
static void prepareDrawingArea(Graphics gc, com.klg.jclass.higrid.CellFormat cellFormat, Rectangle totalArea, boolean selected)
          Paints the background and the border for the given cell.
 void setAllowHeightSizing(boolean allow)
          Sets whether height sizing is allowed for this object.
 void setBackground(Color color)
          Sets the background color for this object (all its data formats).
 void setBorderInsets(Insets insets)
          Sets the border insets for this object (all its cell formats).
 void setBorderStyle(int style)
          Sets the border style for this object (all its cell formats).
 void setCellStyle(com.klg.jclass.higrid.CellStyleModel style)
          Sets the CellStyle style for this object (all its CellFormats).
protected  void setCellStyle(com.klg.jclass.higrid.CellStyleModel style, Vector v)
          Sets the CellStyle style for this object's CellFormats).
protected  void setCellWidths(int newWidth)
           
 void setDataCellStyle(com.klg.jclass.higrid.CellStyleModel style)
          Sets the CellStyle style for this object's DataFormats).
 void setDataFormats(Vector formats)
          Sets the data formats for this level.
 void setFont(String name, int style, int size, FontMetrics fm)
          Sets the font for this object (all its data formats).
 void setForeground(Color color)
          Sets the foreground color for this object (all its data formats).
 void setHeight(int height)
          Sets the height of this object.
 void setIndicatorCellStyle(com.klg.jclass.higrid.CellStyleModel style)
          Sets the CellStyle style for this object's IndicatorFormats).
 void setIndicatorFormats(Vector formats)
          Sets the indicator formats for this level.
 void setMetaData(com.klg.jclass.datasource.MetaDataModel metaData)
          Sets the metadata for this row format.
protected  void setParent(com.klg.jclass.higrid.FormatNode parent)
          Sets the parent of this object.
 void setShowing(boolean showing)
          Sets whether this object is showing.
protected  void setWidth(int width)
          Sets the width of this object.
protected  boolean shouldConnect(com.klg.jclass.higrid.RowNode rowNode)
          Determine whether this row can be visually connected to another row.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIXED_BORDER_STYLES

public static final int MIXED_BORDER_STYLES
indicates not all the cell formats' border styles are the same

See Also:
Constant Field Values

ROW_SIZING_TOLERANCE

protected static final int ROW_SIZING_TOLERANCE
See Also:
Constant Field Values

COLUMN_SIZING_TOLERANCE

protected static final int COLUMN_SIZING_TOLERANCE
See Also:
Constant Field Values

MIXED_STYLE

public static final int MIXED_STYLE
indicates not all the font styles are the same

See Also:
Constant Field Values

MIXED_SIZE

public static final int MIXED_SIZE
indicates not all the font sizes are the same

See Also:
Constant Field Values
Constructor Detail

RowFormat

public RowFormat()
Constructor

Method Detail

getParent

protected com.klg.jclass.higrid.FormatNode getParent()
Retrieves the parent of this object.

Returns:
The current parent.

setParent

protected void setParent(com.klg.jclass.higrid.FormatNode parent)
Sets the parent of this object.

Parameters:
parent - The new parent.

getHeight

public int getHeight()
Retrieves the height of this object.

Returns:
The current height.

setHeight

public void setHeight(int height)
Sets the height of this object.

Parameters:
height - The new height.

getWidth

public int getWidth()
Retrieves the width of this object.

Returns:
The current width.

setWidth

protected void setWidth(int width)
Sets the width of this object.

Parameters:
width - The new width.

getMetaData

public com.klg.jclass.datasource.MetaDataModel getMetaData()
Retrieves the metadata for this row format.

Returns:
The current metadata.

setMetaData

public void setMetaData(com.klg.jclass.datasource.MetaDataModel metaData)
Sets the metadata for this row format.

Parameters:
metaData - The new metadata.

isShowing

public boolean isShowing()
Retrieves whether this object is showing. Should be overridden by its subclass.

Returns:
Whether object is currently showing.

setShowing

public void setShowing(boolean showing)
Sets whether this object is showing. Should be overridden by its subclass.

Parameters:
showing - Whether object is to be shown.

getFirstVisibleCell

protected int getFirstVisibleCell()
Returns the first available editable position


getLastVisibleCell

protected int getLastVisibleCell()
Returns the last available editable position


getAllowHeightSizing

public boolean getAllowHeightSizing()
Retrieves whether height sizing is allowed for this object.

Returns:
Whether height sizing is currently allowed.

setAllowHeightSizing

public void setAllowHeightSizing(boolean allow)
Sets whether height sizing is allowed for this object.

Parameters:
allow - Whether to allow height sizing.

setCellStyle

public void setCellStyle(com.klg.jclass.higrid.CellStyleModel style)
Sets the CellStyle style for this object (all its CellFormats).

Parameters:
style - The new CellStyle.

setIndicatorCellStyle

public void setIndicatorCellStyle(com.klg.jclass.higrid.CellStyleModel style)
Sets the CellStyle style for this object's IndicatorFormats).

Parameters:
style - The new CellStyle.

setDataCellStyle

public void setDataCellStyle(com.klg.jclass.higrid.CellStyleModel style)
Sets the CellStyle style for this object's DataFormats).

Parameters:
style - The new CellStyle.

setCellStyle

protected void setCellStyle(com.klg.jclass.higrid.CellStyleModel style,
                            Vector v)
Sets the CellStyle style for this object's CellFormats).

Parameters:
style - The new CellStyle.

getBorderStyle

public int getBorderStyle()
Retrieves the border style for this object. All cell formats must have the same style else the current border style returned is MIXED_BORDER_STYLES.

Returns:
The current border style.

setBorderStyle

public void setBorderStyle(int style)
Sets the border style for this object (all its cell formats).

Parameters:
style - The new border style.

getBorderInsets

public Insets getBorderInsets()
Retrieves the border insets for this object.

Returns:
The current border insets.

setBorderInsets

public void setBorderInsets(Insets insets)
Sets the border insets for this object (all its cell formats).


getForeground

public Color getForeground()
Retrieves the foreground color for this object. All data formats must have the same color, else a null value is returned.

Returns:
The current foreground color.

setForeground

public void setForeground(Color color)
Sets the foreground color for this object (all its data formats).

Parameters:
color - The new foreground color.

getBackground

public Color getBackground()
Retrieves the background color for this object. All data formats must have the same color, else a null value is returned.

Returns:
The current background color.

setBackground

public void setBackground(Color color)
Sets the background color for this object (all its data formats).

Parameters:
color - The new background color.

getFontName

public String getFontName()
Retrieves the font name for this object. All data formats must have the same font name, else a special value is returned.

Returns:
The current font name.

getFontStyle

public int getFontStyle()
Retrieves the font style for this object. All data formats must have the same font style, else a special value is returned.

Returns:
The current font style.

getFontSize

public int getFontSize()
Retrieves the font size for this object. All data formats must have the same font size, else a special value is returned.

Returns:
The current font size.

setFont

public void setFont(String name,
                    int style,
                    int size,
                    FontMetrics fm)
Sets the font for this object (all its data formats).

Parameters:
name - The new font name.
style - The new font style.
size - The new font size.

getIndicatorFormats

public Vector getIndicatorFormats()
Retrieves the indicator formats for this level.

Returns:
Indicator formats for this level.

setIndicatorFormats

public void setIndicatorFormats(Vector formats)
Sets the indicator formats for this level.

Parameters:
formats - Indicator formats for this level.

getDataFormats

public Vector getDataFormats()
Retrieves the data formats for this level.

Returns:
Data formats for this level.

setDataFormats

public void setDataFormats(Vector formats)
Sets the data formats for this level.

Parameters:
formats - Data formats for this level.

setCellWidths

protected void setCellWidths(int newWidth)

heightChanged

protected void heightChanged()

getPreferredHeight

public int getPreferredHeight()
Get the preferred height of this row format. It is based on the highest of the cells.

Returns:
The preferred height value.

calculatePreferredHeight

protected int calculatePreferredHeight()
Calculate the preferred height of this row format. It is based on the highest of the cells.

Returns:
The preferred height value.

getDataWidth

protected int getDataWidth()
Get the total width of all of the visible data cells.

Returns:
The total width of all of the visible data cells.

computeWidth

protected void computeWidth()

computeSize

protected void computeSize(Vector cells)

getTotalWidth

protected int getTotalWidth(com.klg.jclass.higrid.HiGrid grid,
                            com.klg.jclass.higrid.FormatNode node)

getTotalPrintWidth

protected int getTotalPrintWidth(com.klg.jclass.higrid.HiGrid grid,
                                 com.klg.jclass.higrid.FormatNode node,
                                 int printableWidth)

getNodeIndent

protected int getNodeIndent(com.klg.jclass.higrid.HiGrid grid,
                            Vector indicatorFormats)

getInitialLevelIndent

public int getInitialLevelIndent(com.klg.jclass.higrid.HiGrid grid,
                                 com.klg.jclass.higrid.FormatNode node)
Get the initial pixel indent for the given format level.

Parameters:
grid - the current instance of HiGrid.
node - the FormatNode to examine.
Returns:
The number of pixels to indent before drawing a node.

getIndicatorIndent

public int getIndicatorIndent(com.klg.jclass.higrid.HiGrid grid,
                              com.klg.jclass.higrid.FormatNode node)
Get the initial pixel indent for the given format level's indicator formats.

Parameters:
grid - the current instance of HiGrid.
node - the FormatNode to examine.
Returns:
The number of pixels to indent before drawing the indicator formats.

nextRow

protected void nextRow(Graphics gc,
                       com.klg.jclass.higrid.HiGrid grid,
                       com.klg.jclass.higrid.RowNode rowNode)
Move down to prepare to draw the next row.

Parameters:
gc - the Graphics Context.
grid - the current instance of HiGrid.
rowNode - the current RowNode to move beyond.

shouldConnect

protected boolean shouldConnect(com.klg.jclass.higrid.RowNode rowNode)
Determine whether this row can be visually connected to another row.

Parameters:
rowNode - the RowNode to examine.
Returns:
true if the row can be visually connected to another row.

drawCells

public void drawCells(Graphics gc,
                      com.klg.jclass.higrid.HiGrid grid,
                      com.klg.jclass.higrid.RowNode rowNode,
                      Vector cells,
                      Rectangle rect,
                      Rectangle intersectRect)
Draw a vector of cells within the given row. This is a lower level routine that can optionally draw either indicatorFormats or dataFormats.

Parameters:
gc - the Graphics Context.
grid - the current instance of HiGrid.
rowNode - the current RowNode to draw.
cells - the cells to draw.
rect - rectangle used for clipping.
intersectRect - rectangle used for clipping.

draw

public boolean draw(Graphics gc,
                    com.klg.jclass.higrid.HiGrid grid,
                    com.klg.jclass.higrid.RowNode rowNode)
Draw an entire RowNode.

Parameters:
gc - the Graphics Context.
grid - the current instance of HiGrid.
rowNode - the RowNode to draw.
Returns:
true if the row can be drawn within the current clip bounds.

nullDraw

protected boolean nullDraw(com.klg.jclass.higrid.NullGraphics nullgc,
                           com.klg.jclass.higrid.HiGrid grid,
                           com.klg.jclass.higrid.RowNode rowNode)
"Pretend" to draw an entire RowNode. This method is used to accomplish hit detection within the grid.

Parameters:
grid - the current instance of HiGrid.
rowNode - the RowNode to draw.
Returns:
true if hit detection succeeded.

findFromFormat

protected boolean findFromFormat(com.klg.jclass.higrid.NullGraphics nullgc,
                                 Enumeration e,
                                 int x)

getXPosition

protected void getXPosition(com.klg.jclass.higrid.NullGraphics nullgc,
                            com.klg.jclass.higrid.HiGrid grid,
                            com.klg.jclass.higrid.RowNode rowNode,
                            int operation)

hitTestWithinRow

protected int hitTestWithinRow(com.klg.jclass.higrid.NullGraphics nullgc,
                               com.klg.jclass.higrid.HiGrid grid,
                               com.klg.jclass.higrid.RowNode rowNode,
                               Vector cells,
                               int x)

checkForRowResizing

protected void checkForRowResizing(com.klg.jclass.higrid.NullGraphics nullgc,
                                   com.klg.jclass.higrid.RowNode rowNode)

getVisibleColumnCount

public int getVisibleColumnCount()
Compute the number of visible dataFormat columns for this rowFormat.

Returns:
the number of visible dataFormat columns for this rowFormat.

getVisibleColumnIndex

public int getVisibleColumnIndex(int actualColumnIndex)
Compute the visible column index from the actual column index. The maximum visible column index is always less than or equal to the maximum actual column index, since some columns can be marked as invisible at runtime.

Parameters:
actualColumnIndex - the actual index into the dataFormat vector
Returns:
the visible column index.

getActualColumnIndex

public int getActualColumnIndex(int visibleColumnIndex)
Compute the actual column index from the visible column index. The maximum visible column index is always less than or equal to the maximum actual column index, since some columns can be marked as invisible at runtime.

Parameters:
visibleColumnIndex - the visible index into the dataFormat vector
Returns:
the actual column index.

hitTest

protected void hitTest(com.klg.jclass.higrid.NullGraphics nullgc,
                       com.klg.jclass.higrid.HiGrid grid,
                       com.klg.jclass.higrid.RowNode rowNode)

prepareDrawingArea

public static void prepareDrawingArea(Graphics gc,
                                      com.klg.jclass.higrid.CellFormat cellFormat,
                                      Rectangle totalArea,
                                      boolean selected)
Paints the background and the border for the given cell.

Parameters:
gc - the Graphics Context.
cellFormat - The cell to paint.
totalArea - the rectangle to paint.
selected - true if the cell should be painted as selected.

getHeaderLabel

public Object getHeaderLabel(com.klg.jclass.higrid.HiGrid grid,
                             com.klg.jclass.higrid.RowNode rowNode,
                             com.klg.jclass.higrid.CellFormat cellFormat)
Setup the header label for the indicated cell.

Parameters:
grid - The higrid.
rowNode - The row node.
cellFormat - The cell format.
Returns:
The sort label object.

createIndicatorFormats

public void createIndicatorFormats(com.klg.jclass.higrid.HiGrid grid)
Setup the indicator formats.


createEditStatus

protected com.klg.jclass.higrid.CellFormat createEditStatus(com.klg.jclass.higrid.HiGrid grid)
Creates the edit status indicator column.

Returns:
The CellFormat for the edit status indicator column.

createNodeFormat

protected com.klg.jclass.higrid.CellFormat createNodeFormat(com.klg.jclass.higrid.HiGrid grid)
Creates the node column.

Returns:
The CellFormat for the nodes.

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