📄 tablecellimpl.java
字号:
if (pt == null)
return -1;
else
return pt.y;
}
public boolean setGraphic(Image img)
{
checkCellForSetting();
if (!(bufferedTableItem instanceof BufferedGraphicTableItem))
return false;
graphic = null;
boolean b = ((BufferedGraphicTableItem)bufferedTableItem).setGraphic(img);
if (b)
{
setFlag(64);
bufferedTableItem.redraw();
}
return b;
}
public boolean setGraphic(Graphic img)
{
if (img != null)
checkCellForSetting();
if (!(bufferedTableItem instanceof BufferedGraphicTableItem))
return false;
if (img == graphic && numFastRefreshes >= MAX_REFRESHES)
pluginError("TableCellImpl::setGraphic to same Graphic object. Forcing refresh.");
graphic = img;
if (img == null)
{
boolean b = ((BufferedGraphicTableItem)bufferedTableItem).setGraphic(null);
if (b)
{
setFlag(64);
bufferedTableItem.redraw();
}
}
if (img instanceof GraphicSWT)
{
Image imgSWT = ((GraphicSWT)img).getImage();
boolean b = ((BufferedGraphicTableItem)bufferedTableItem).setGraphic(imgSWT);
if (b)
{
setFlag(64);
bufferedTableItem.redraw();
}
} else
if (img instanceof UISWTGraphic)
{
Image imgSWT = ((UISWTGraphic)img).getImage();
boolean b = ((BufferedGraphicTableItem)bufferedTableItem).setGraphic(imgSWT);
if (b)
{
setFlag(64);
bufferedTableItem.redraw();
}
}
return false;
}
public Graphic getGraphic()
{
if (graphic != null)
return graphic;
if (!(bufferedTableItem instanceof BufferedGraphicTableItem))
{
return null;
} else
{
Image img = ((BufferedGraphicTableItem)bufferedTableItem).getGraphic();
return new UISWTGraphicImpl(img);
}
}
public Image getGraphicSWT()
{
if (!(bufferedTableItem instanceof BufferedGraphicTableItem))
return null;
else
return ((BufferedGraphicTableItem)bufferedTableItem).getGraphic();
}
public void setFillCell(boolean bFillCell)
{
checkCellForSetting();
if (!(bufferedTableItem instanceof BufferedGraphicTableItem))
return;
if (bFillCell)
((BufferedGraphicTableItem)bufferedTableItem).setOrientation(4);
else
setOrientationViaColumn();
setFlag(64);
}
public void setMarginHeight(int height)
{
checkCellForSetting();
if (!(bufferedTableItem instanceof BufferedGraphicTableItem))
{
return;
} else
{
((BufferedGraphicTableItem)bufferedTableItem).setMargin(-1, height);
setFlag(64);
return;
}
}
public void setMarginWidth(int width)
{
checkCellForSetting();
if (!(bufferedTableItem instanceof BufferedGraphicTableItem))
{
return;
} else
{
((BufferedGraphicTableItem)bufferedTableItem).setMargin(width, -1);
setFlag(64);
return;
}
}
public int getMarginHeight()
{
if (!(bufferedTableItem instanceof BufferedGraphicTableItem))
return 0;
else
return ((BufferedGraphicTableItem)bufferedTableItem).getMarginHeight();
}
public int getMarginWidth()
{
if (!(bufferedTableItem instanceof BufferedGraphicTableItem))
return 0;
else
return ((BufferedGraphicTableItem)bufferedTableItem).getMarginWidth();
}
public void addRefreshListener(TableCellRefreshListener listener)
{
this_mon.enter();
if (refreshListeners == null)
refreshListeners = new ArrayList(1);
if (bDebug)
debug((new StringBuilder()).append("addRefreshListener; count=").append(refreshListeners.size()).toString());
refreshListeners.add(listener);
this_mon.exit();
break MISSING_BLOCK_LABEL_88;
Exception exception;
exception;
this_mon.exit();
throw exception;
}
public void removeRefreshListener(TableCellRefreshListener listener)
{
this_mon.enter();
if (refreshListeners == null)
{
this_mon.exit();
return;
}
refreshListeners.remove(listener);
this_mon.exit();
break MISSING_BLOCK_LABEL_47;
Exception exception;
exception;
this_mon.exit();
throw exception;
}
public void addDisposeListener(TableCellDisposeListener listener)
{
this_mon.enter();
if (disposeListeners == null)
disposeListeners = new ArrayList(1);
disposeListeners.add(listener);
this_mon.exit();
break MISSING_BLOCK_LABEL_52;
Exception exception;
exception;
this_mon.exit();
throw exception;
}
public void removeDisposeListener(TableCellDisposeListener listener)
{
this_mon.enter();
if (disposeListeners == null)
{
this_mon.exit();
return;
}
disposeListeners.remove(listener);
this_mon.exit();
break MISSING_BLOCK_LABEL_47;
Exception exception;
exception;
this_mon.exit();
throw exception;
}
public void addToolTipListener(TableCellToolTipListener listener)
{
this_mon.enter();
if (tooltipListeners == null)
tooltipListeners = new ArrayList(1);
tooltipListeners.add(listener);
this_mon.exit();
break MISSING_BLOCK_LABEL_52;
Exception exception;
exception;
this_mon.exit();
throw exception;
}
public void removeToolTipListener(TableCellToolTipListener listener)
{
this_mon.enter();
if (tooltipListeners == null)
{
this_mon.exit();
return;
}
tooltipListeners.remove(listener);
this_mon.exit();
break MISSING_BLOCK_LABEL_47;
Exception exception;
exception;
this_mon.exit();
throw exception;
}
public void addMouseListener(TableCellMouseListener listener)
{
this_mon.enter();
if (cellMouseListeners == null)
cellMouseListeners = new ArrayList(1);
cellMouseListeners.add(listener);
this_mon.exit();
break MISSING_BLOCK_LABEL_52;
Exception exception;
exception;
this_mon.exit();
throw exception;
}
public void removeMouseListener(TableCellMouseListener listener)
{
this_mon.enter();
if (cellMouseListeners == null)
{
this_mon.exit();
return;
}
cellMouseListeners.remove(listener);
this_mon.exit();
break MISSING_BLOCK_LABEL_47;
Exception exception;
exception;
this_mon.exit();
throw exception;
}
public void addMouseMoveListener(TableCellMouseMoveListener listener)
{
this_mon.enter();
if (cellMouseMoveListeners == null)
cellMouseMoveListeners = new ArrayList(1);
cellMouseMoveListeners.add(listener);
this_mon.exit();
break MISSING_BLOCK_LABEL_52;
Exception exception;
exception;
this_mon.exit();
throw exception;
}
public void removeMouseMoveListener(TableCellMouseMoveListener listener)
{
this_mon.enter();
if (cellMouseMoveListeners == null)
{
this_mon.exit();
return;
}
cellMouseMoveListeners.remove(listener);
this_mon.exit();
break MISSING_BLOCK_LABEL_47;
Exception exception;
exception;
this_mon.exit();
throw exception;
}
public void addVisibilityListener(TableCellVisibilityListener listener)
{
this_mon.enter();
if (cellVisibilityListeners == null)
cellVisibilityListeners = new ArrayList(1);
cellVisibilityListeners.add(listener);
this_mon.exit();
break MISSING_BLOCK_LABEL_52;
Exception exception;
exception;
this_mon.exit();
throw exception;
}
public void removeVisibilityListener(TableCellVisibilityListener listener)
{
this_mon.enter();
if (cellVisibilityListeners == null)
{
this_mon.exit();
return;
}
cellVisibilityListeners.remove(listener);
this_mon.exit();
break MISSING_BLOCK_LABEL_47;
Exception exception;
exception;
this_mon.exit();
throw exception;
}
private void addSWTPaintListener(TableCellSWTPaintListener listener)
{
this_mon.enter();
if (cellSWTPaintListeners == null)
cellSWTPaintListeners = new ArrayList(1);
cellSWTPaintListeners.add(listener);
this_mon.exit();
break MISSING_BLOCK_LABEL_52;
Exception exception;
exception;
this_mon.exit();
throw exception;
}
public void invokeSWTPaintListeners(GC gc)
{
if (tableColumn != null)
{
Object swtPaintListeners[] = tableColumn.getCellOtherListeners("SWTPaint");
if (swtPaintListeners != null)
{
for (int i = 0; i < swtPaintListeners.length; i++)
try
{
TableCellSWTPaintListener l = (TableCellSWTPaintListener)swtPaintListeners[i];
l.cellPaint(gc, this);
}
catch (Throwable e)
{
Debug.printStackTrace(e);
}
}
}
if (cellSWTPaintListeners == null)
return;
for (int i = 0; i < cellSWTPaintListeners.size(); i++)
try
{
TableCellSWTPaintListener l = (TableCellSWTPaintListener)(TableCellSWTPaintListener)cellSWTPaintListeners.get(i);
l.cellPaint(gc, this);
}
catch (Throwable e)
{
Debug.printStackTrace(e);
}
}
public void addListeners(Object listenerObject)
{
if (listenerObject instanceof TableCellDisposeListener)
addDisposeListener((TableCellDisposeListener)listenerObject);
if (listenerObject instanceof TableCellRefreshListener)
addRefreshListener((TableCellRefreshListener)listenerObject);
if (listenerObject instanceof TableCellToolTipListener)
addToolTipListener((TableCellToolTipListener)listenerObject);
if (listenerObject instanceof TableCellMouseMoveListener)
addMouseMoveListener((TableCellMouseMoveListener)listenerObject);
if (listenerObject instanceof TableCellMouseListener)
addMouseListener((TableCellMouseListener)listenerObject);
if (listenerObject instanceof TableCellVisibilityListener)
addVisibilityListener((TableCellVisibilityListener)listenerObject);
if (listenerObject instanceof TableCellSWTPaintListener)
addSWTPaintListener((TableCellSWTPaintListener)listenerObject);
}
public void invalidate()
{
checkCellForSetting();
invalidate(true);
}
public void redraw()
{
if (bufferedTableItem != null)
bufferedTableItem.redraw();
}
public void invalidate(boolean bMustRefresh)
{
if (!hasFlag(1))
if (bMustRefresh)
{
if (hasFlag(32))
return;
} else
{
return;
}
clearFlag(1);
setFlag(64);
if (bDebug)
debug((new StringBuilder()).append("Invalidate Cell;").append(bMustRefresh).toString());
if (bMustRefresh)
{
setFlag(32);
if (bufferedTableItem != null)
bufferedTableItem.invalidate();
}
}
public boolean refresh()
{
return refresh(true);
}
public void refreshAsync()
{
if (bInRefreshAsync)
{
if (restartRefresh < 127)
restartRefresh++;
return;
} else
{
bInRefreshAsync = true;
AERunnable runnable = new AERunnable() {
final TableCellImpl this$0;
public void runSupport()
{
restartRefresh = 0;
refresh(true);
bInRefreshAsync = false;
if (restartRefresh > 0)
refreshAsync();
}
{
this$0 = TableCellImpl.this;
super();
}
};
Utils.execSWTThreadLater(25, runnable);
return;
}
}
public boolean refresh(boolean bDoGraphics)
{
boolean isRowShown;
if (tableRow != null)
{
TableView view = tableRow.getView();
isRowShown = view.isRowVisible(tableRow);
} else
{
isRowShown = true;
}
boolean isCellShown = isRowShown && isShown();
return refresh(bDoGraphics, isRowShown, isCellShown);
}
public boolean refresh(boolean bDoGraphics, boolean bRowVisible)
{
boolean isCellShown = bRowVisible && isShown();
return refresh(bDoGraphics, bRowVisible, isCellShown);
}
public boolean refresh(boolean bDoGraphics, boolean bRowVisible, boolean bCellVisible)
{
boolean ret;
int iErrCount;
if (tableColumn == null)
return false;
ret = getVisuallyChangedSinceRefresh();
clearFlag(64);
iErrCount = 0;
if (refreshErrLoopCount > 2)
return ret;
iErrCount = tableColumn.getConsecutiveErrCount();
if (iErrCount > 10)
{
refreshErrLoopCount = 3;
return ret;
}
if (bInRefresh)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -