📄 grid.java
字号:
* Get the vertical scrollbar live scrolling
*/
public boolean getVerticalScrollLiveScrolling()
{
return m_bLiveScrollingVertical;
}
/**
* Set the vertical scrollbar live scrolling
*/
public void setVerticalScrollLiveScrolling(boolean bLiveScrolling)
{
m_bLiveScrollingVertical = bLiveScrolling;
m_VertScroll.setLiveScrolling(m_bLiveScrollingVertical);
_repaintGridIfNeeded();
}
/**
* Get the current horizontal scroll height
*/
public int getHorizontalScrollHeight()
{
return m_iHorizontalScrollHeight;
}
/**
* Set the current horizontal scroll height
*/
public void setHorizontalScrollHeight(int iHorizontalScrollHeight)
{
m_iHorizontalScrollHeight = iHorizontalScrollHeight;
_repositionScrollBars();
}
/**
* Get the current vertical scroll width
*/
public int getVerticalScrollWidth()
{
return m_iVerticalScrollWidth;
}
/**
* Set the current vertical scroll width
*/
public void setVerticalScrollWidth(int iVerticalScrollWidth)
{
m_iVerticalScrollWidth = iVerticalScrollWidth;
_repositionScrollBars();
}
/**
* Get if the grid will update the screen after operations
*/
public boolean getUpdating()
{
return m_bUpdating;
}
/**
* Set if the grid will update the screen after operations
*/
public void setUpdating(boolean bUpdating)
{
if (isVisible() && !m_bUpdating && bUpdating)
{
m_bUpdating = bUpdating;
_repaintGridIfNeeded();
}
}
/**
* Get if the grid will highlight entire row of the selected cell
*/
public boolean getFullRowSelectionDisplay()
{
return m_bFullRowSelectionDisplay;
}
/**
* Set if the grid will highlight entire row of the selected cell
*/
public void setFullRowSelectionDisplay(boolean bFullRowSelectionDisplay)
{
m_bFullRowSelectionDisplay = bFullRowSelectionDisplay;
_repaintGridIfNeeded();
}
/**
* Get if the grid will highlight the selected cell in full-row selection mode
*/
public boolean getHighlightSelectedCell()
{
return m_bHighlightSelectedCell;
}
/**
* Set if the grid will highlight the selected cell in full-row selection mode
*/
public void setHighlightSelectedCell(boolean bHighlightSelectedCell)
{
m_bHighlightSelectedCell = bHighlightSelectedCell;
_repaintGridIfNeeded();
}
/**
* Get the grid border color
*/
public Color getGridBorderColor()
{
return m_clrGridBorderColor;
}
/**
* Set the grid border color
*/
public void setGridBorderColor(Color clrGridBorderColor)
{
m_clrGridBorderColor = clrGridBorderColor;
_repaintGridIfNeeded();
}
/**
* Get the grid background color
*/
public Color getGridBackColor()
{
return m_clrGridBackColor;
}
/**
* Set the grid background color
*/
public void setGridBackColor(Color clrGridBackColor)
{
m_clrGridBackColor = clrGridBackColor;
_repaintGridIfNeeded();
}
/**
* Get the grid line separator color
*/
public Color getGridCellSeparatorColor()
{
return m_clrGridCellSeparatorColor;
}
/**
* Set the grid line separator color
*/
public void setGridCellSeparatorColor(Color clrGridCellSeparatorColor)
{
m_clrGridCellSeparatorColor = clrGridCellSeparatorColor;
_repaintGridIfNeeded();
}
/**
* Get if the Grid will draw cell磗 row separators
*/
public boolean getDrawRowSeparators()
{
return m_bDrawRowSeparators;
}
/**
* Set if the Grid will draw cell's row separators
*/
public void setDrawRowSeparators(boolean bDrawRowSeparators)
{
m_bDrawRowSeparators = bDrawRowSeparators;
_repaintGridIfNeeded();
}
/**
* Get if the Grid will draw cell磗 column separators
*/
public boolean getDrawColSeparators()
{
return m_bDrawColSeparators;
}
/**
* Set if the Grid will draw cell's column separators
*/
public void setDrawColSeparators(boolean bDrawColSeparators)
{
m_bDrawColSeparators = bDrawColSeparators;
_repaintGridIfNeeded();
}
/**
* Get the cell's row separator size
*/
public int getRowSeparatorHeight()
{
return m_iRowSeparatorHeight;
}
/**
* Set the cell's row separator size
*/
public void setRowSeparatorHeight(int iRowSeparatorHeight)
{
if (iRowSeparatorHeight < 1)
{
return;
}
m_iRowSeparatorHeight = iRowSeparatorHeight;
_repaintGridIfNeeded();
}
/**
* Get the cell's column separator size
*/
public int getColSeparatorWidth()
{
return m_iColSeparatorWidth;
}
/**
* Set the cell's column separator size
*/
public void setColSeparatorWidth(int iColSeparatorWidth)
{
if (iColSeparatorWidth < 1)
{
return;
}
m_iColSeparatorWidth = iColSeparatorWidth;
_repaintGridIfNeeded();
}
/**
* Get the column width default for drawing the grid
*/
public int getColWidthDefault()
{
return m_iColWidthDefault;
}
/**
* Set the column width default for drawing the grid (must be >= 2)
*/
public void setColWidthDefault(int iColWidthDefault)
{
if (iColWidthDefault < 2)
{
return;
}
m_iColWidthDefault = iColWidthDefault;
_repaintGridIfNeeded();
}
/**
* Get the row height default for drawing the grid
*/
public int getRowHeightDefault()
{
return m_iRowHeightDefault;
}
/**
* Set the row height default for drawing the grid (must be >= 2)
*/
public void setRowHeightDefault(int iRowHeightDefault)
{
if (iRowHeightDefault < 2)
{
return;
}
m_iRowHeightDefault = iRowHeightDefault;
_repaintGridIfNeeded();
}
/**
* Get the column display width
*/
public int getColWidth(int iCol)
{
int iRes = m_mapColWidths.get(iCol);
if (iRes == IntHashtable.INVALID)
{
iRes = m_iColWidthDefault;
}
return iRes;
}
/**
* Set the column display width
*/
public void setColWidth(int iCol, int iWidth)
{
if (iWidth < 0)
{
return;
}
m_mapColWidths.put(iCol, iWidth);
_repaintGridIfNeeded();
}
/**
* Clear the column display width
*/
public void clearColWidth(int iCol)
{
if (m_mapColWidths.remove(iCol) != IntHashtable.INVALID)
{
_repaintGridIfNeeded();
}
}
/**
* Get the row display height
*/
public int getRowHeight(int iRow)
{
int iRes = m_mapRowHeights.get(iRow);
if (iRes == IntHashtable.INVALID)
{
iRes = m_iRowHeightDefault;
}
return iRes;
}
/**
* Set the row display height
*/
public void setRowHeight(int iRow, int iHeight)
{
if (iHeight < 0)
{
return;
}
m_mapRowHeights.put(iRow, iHeight);
_repaintGridIfNeeded();
}
/**
* Clear the row display height
*/
public void clearRowHeight(int iRow)
{
if (m_mapRowHeights.remove(iRow) != IntHashtable.INVALID)
{
_repaintGridIfNeeded();
}
}
/**
* Get the row alignment
*/
public int getRowAlignment(int iRow)
{
try
{
return m_mapRowAttributes.get(iRow).m_iCellAlignment;
}
catch (Exception e)
{
return GridCellAttributes.ALIGN_DEFAULT;
}
}
/**
* Set the row alignment
*/
public void setRowAlignment(int iRow, int rowAlignment)
{
GridCellAttributes rowAttr = m_mapRowAttributes.get(iRow);
if (rowAttr == null)
{
rowAttr = new GridCellAttributes();
m_mapRowAttributes.put(iRow, rowAttr);
}
rowAttr.m_iCellAlignment = rowAlignment;
_repaintGridIfNeeded();
}
/**
* Set the row alignment
*/
public void clearRowAlignment(int iRow)
{
try
{
m_mapRowAttributes.get(iRow).m_iCellAlignment = GridCellAttributes.ALIGN_DEFAULT;
_repaintGridIfNeeded();
}
catch (Exception e)
{
}
}
/**
* Get the row background color
*/
public Color getRowBackColor(int iRow)
{
try
{
return m_mapRowAttributes.get(iRow).m_clrCellBackColor;
}
catch (Exception e)
{
return null;
}
}
/**
* Set the row background color
*/
public void setRowBackColor(int iRow, Color rowBackColor)
{
GridCellAttributes rowAttr = m_mapRowAttributes.get(iRow);
if (rowAttr == null)
{
rowAttr = new GridCellAttributes();
m_mapRowAttributes.put(iRow, rowAttr);
}
rowAttr.m_clrCellBackColor = rowBackColor;
_repaintGridIfNeeded();
}
/**
* Set the row background color
*/
public void clearRowBackColor(int iRow)
{
try
{
m_mapRowAttributes.get(iRow).m_clrCellBackColor = null;
_repaintGridIfNeeded();
}
catch (Exception e)
{
}
}
/**
* Get the row foreground color
*/
public Color getRowForeColor(int iRow)
{
try
{
return m_mapRowAttributes.get(iRow).m_clrCellForeColor;
}
catch (Exception e)
{
return null;
}
}
/**
* Set the row foreground color
*/
public void setRowForeColor(int iRow, Color rowForeColor)
{
GridCellAttributes rowAttr = m_mapRowAttributes.get(iRow);
if (rowAttr == null)
{
rowAttr = new GridCellAttributes();
m_mapRowAttributes.put(iRow, rowAttr);
}
rowAttr.m_clrCellForeColor = rowForeColor;
_repaintGridIfNeeded();
}
/**
* Set the row foreground color
*/
public void clearRowForeColor(int iRow)
{
try
{
m_mapRowAttributes.get(iRow).m_clrCellForeColor = null;
_repaintGridIfNeeded();
}
catch (Exception e)
{
}
}
/**
* Get the row font
*/
public Font getRowFont(int iRow)
{
try
{
return m_mapRowAttributes.get(iRow).m_CellFont;
}
catch (Exception e)
{
return null;
}
}
/**
* Set the row font
*/
public void setRowFont(int iRow, Font rowFont)
{
GridCellAttributes rowAttr = m_mapRowAttributes.get(iRow);
if (rowAttr == null)
{
rowAttr = new GridCellAttributes();
m_mapRowAttributes.put(iRow, rowAttr);
}
rowAttr.m_CellFont = rowFont;
_repaintGridIfNeeded();
}
/**
* Set the row font
*/
public void clearRowFont(int iRow)
{
try
{
m_mapRowAttributes.get(iRow).m_CellFont = null;
_repaintGridIfNeeded();
}
catch (Exception e)
{
}
}
/**
* Get the column alignment
*/
public int getColAlignment(int iCol)
{
try
{
return m_mapColAttributes.get(iCol).m_iCellAlignment;
}
catch (Exception e)
{
return GridCellAttributes.ALIGN_DEFAULT;
}
}
/**
* Set the column alignment
*/
public void setColAlignment(int iCol, int rowAlignment)
{
GridCellAttributes colAttr = m_mapColAttributes.get(iCol);
if (colAttr == null)
{
colAttr = new GridCellAttributes();
m_mapColAttributes.put(iCol, colAttr);
}
colAttr.m_iCellAlignment = rowAlignment;
_repaintGridIfNeeded();
}
/**
* Set the column alignment
*/
public void clearColAlignment(int iCol)
{
try
{
m_mapColAttributes.get(iCol).m_iCellAlignment = GridCellAttributes.ALIGN_DEFAULT;
_repaintGridIfNeeded();
}
catch (Exception e)
{
}
}
/**
* Get the column background color
*/
public Color getColBackColor(int iCol)
{
try
{
return m_mapColAttributes.get(iCol).m_clrCellBackColor;
}
catch (Exception e)
{
return null;
}
}
/**
* Set the column background color
*/
public void setColBackColor(int iCol, Color rowBackColor)
{
GridCellAttributes colAttr = m_mapColAttributes.get(iCol);
if (colAttr == null)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -