📄 zbase.java
字号:
if (!hasProperty(PTY_Text) && source.hasProperty(PTY_Text)) {
text = new String(source.text);
setProperty(PTY_Text);
}
if (!hasProperty(PTY_ReadOnly) && source.hasProperty(PTY_ReadOnly)) {
readOnly = source.readOnly;
setProperty(PTY_ReadOnly);
}
if (!hasProperty(PTY_WordWrap) && source.hasProperty(PTY_WordWrap)) {
wordWrap = source.wordWrap;
setProperty(PTY_WordWrap);
}
if (hasProperty(PTY_Hide) && source.hasProperty(PTY_Hide)) {
hide = source.hide;
setProperty(PTY_Hide);
}
if (hasProperty(PTY_Format) && source.hasProperty(PTY_Format)) {
format = new String(source.format);
setProperty(PTY_Format);
}
if (hasProperty(PTY_Bookmark) && source.hasProperty(PTY_Bookmark)) {
bookmark = new String(source.bookmark);
setProperty(PTY_Bookmark);
}
//if (hasProperty(PTY_DefObject) && source.hasProperty(PTY_DefObject))
// oos.writeBoolean(defObject);
if (hasProperty(PTY_HorzAlign) && source.hasProperty(PTY_HorzAlign)) {
horzAlign = source.horzAlign;
setProperty(PTY_HorzAlign);
}
if (hasProperty(PTY_VertAlign) && source.hasProperty(PTY_VertAlign)) {
vertAlign = source.vertAlign;
setProperty(PTY_VertAlign);
}
if (hasProperty(PTY_Font) && source.hasProperty(PTY_Font)) {
font = (ZFont) source.font.clone();
setProperty(PTY_Font);
}
if (hasProperty(PTY_LeftBorder) && source.hasProperty(PTY_LeftBorder)) {
leftBorder = (ZPen) source.leftBorder.clone();
setProperty(PTY_LeftBorder);
}
if (hasProperty(PTY_TopBorder) && source.hasProperty(PTY_TopBorder)) {
topBorder = (ZPen) source.topBorder.clone();
setProperty(PTY_TopBorder);
}
if (hasProperty(PTY_RightBorder) && source.hasProperty(PTY_RightBorder)) {
rightBorder = (ZPen) source.rightBorder.clone();
setProperty(PTY_RightBorder);
}
if (hasProperty(PTY_BottomBorder) && source.hasProperty(PTY_BottomBorder)) {
bottomBorder = (ZPen) source.bottomBorder.clone();
setProperty(PTY_BottomBorder);
}
if (hasProperty(PTY_BackBrush) && source.hasProperty(PTY_BackBrush)) {
backBrush = (ZBrush) source.backBrush.clone();
setProperty(PTY_BackBrush);
}
if (hasProperty(PTY_TextBrush) && source.hasProperty(PTY_TextBrush)) {
textBrush = (ZBrush) source.textBrush.clone();
setProperty(PTY_TextBrush);
}
}
/**
* put your documentation comment here
* @param source
* @param prop
*/
public void copyFrom(ZBase source, int prop) {
int tmpProp = source.property;
int tmpNoProp = source.noPropUnder;
source.property &= prop;
source.noPropUnder &= prop;
copyFrom(source);
source.property = tmpProp;
source.noPropUnder = tmpNoProp;
}
/**
* put your documentation comment here
*/
public void fontChanged() {
/* if (font.equals(sheet.defaultBase.font)) {
setNoPropUnder(PTY_Font);
clearProperty(PTY_Font);
}
else*/
setProperty(PTY_Font);
}
/**
* put your documentation comment here
* @param prop
* @return
*/
public boolean hasNoPropUnder(int prop) {
return (noPropUnder & prop) != 0;
}
/**
* put your documentation comment here
* @param prop
* @return
*/
public boolean hasProperty(int prop) {
return (property & prop) != 0;
}
/**
* put your documentation comment here
* @param prop
* @return
*/
public boolean hasProperty2(int prop) {
return (prop & (property | noPropUnder)) != 0;
}
/**
* put your documentation comment here
* @return
*/
public int type() {
return 0;
}
/**
* put your documentation comment here
* @param row
* @param col
* @return
*/
public ZBase underLayer(int row, int col) {
return null;
}
/**
* put your documentation comment here
* @return
*/
protected ZBrush getBackBrush(int row, int col) {
if (!hasProperty(PTY_BackBrush) && !hasNoPropUnder(PTY_BackBrush)) {
return underLayer(row, col).getBackBrush(row, col);
} else {
return backBrush;
}
}
/**
* put your documentation comment here
* @return
*/
protected String getBookmark(int row, int col) {
return bookmark;
}
/**
* put your documentation comment here
* @return
*/
protected ZFont getFont(int row, int col) {
if (!hasProperty(PTY_Font) && !hasNoPropUnder(PTY_Font)) // if font exist
{
return underLayer(row, col).getFont(row, col);
}
return font;
}
/**
* put your documentation comment here
* @return
*/
protected String getFormat(int row, int col) {
if (!hasProperty(PTY_Format) && !hasNoPropUnder(PTY_Format)) {
return underLayer(row, col).getFormat(row, col);
} else {
return format;
}
}
/**
* put your documentation comment here
* @return
*/
protected boolean isHide(int row, int col) {
return hide;
}
/**
* put your documentation comment here
* @return
*/
protected int getHorzAlign(int row, int col) {
if (!hasProperty(PTY_HorzAlign) && !hasNoPropUnder(PTY_HorzAlign)) {
return underLayer(row, col).getHorzAlign(row, col);
} else {
return horzAlign;
}
}
/**
* put your documentation comment here
* @return
*/
protected ZPen getLeftBorder0(int row, int col) {
return leftBorder;
}
/**
* put your documentation comment here
* @return
*/
protected boolean isReadOnly(int row, int col) {
return readOnly;
}
protected boolean isWordWrap(int row,int col)
{
if (!hasProperty(PTY_WordWrap) && !hasNoPropUnder(PTY_WordWrap)) // if font exist
{
return underLayer(row, col).isWordWrap(row, col);
}
return wordWrap;
}
/**
* put your documentation comment here
* @return
*/
protected ZBrush getTextBrush(int row, int col) {
if (!hasProperty(PTY_TextBrush) && !hasNoPropUnder(PTY_TextBrush)) {
return underLayer(row, col).getTextBrush(row, col);
} else {
return textBrush;
}
}
/**
* put your documentation comment here
* @return
*/
protected ZPen getTopBorder0(int row, int col) {
return topBorder;
}
/**
* put your documentation comment here
* @return
*/
protected int getVertAlign(int row, int col) {
if (!hasProperty(PTY_VertAlign) && !hasNoPropUnder(PTY_VertAlign)) {
return underLayer(row, col).getVertAlign(row, col);
} else {
return vertAlign;
}
}
/**
* put your documentation comment here
* @return perform deep copy
*/
protected Object clone() {
ZBase obj = null;
try {
obj = (ZBase) super.clone();
obj.font = (ZFont) font.clone();
obj.backBrush = (ZBrush) backBrush.clone();
obj.textBrush = (ZBrush) textBrush.clone();
} catch (Exception e) {
}
return obj;
}
/**
* put your documentation comment here
* @param row
* @param col
* @return
*/
ZPen getBottomBorder0(int row, int col) {
return bottomBorder;
}
/**
* put your documentation comment here
* @param row
* @param col
* @return
*/
ZPen getRightBorder0(int row, int col) {
return rightBorder;
}
/**
* put your documentation comment here
* @param ois
* @exception ClassNotFoundException, IOException
*/
void _readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
row = ois.readInt();
col = ois.readInt();
//
try {
ObjectInputStream2 is = (ObjectInputStream2) ois;
is.sheet.add(this);
setSheet(is.sheet);
} catch (Exception ex) {
}
//
property = ois.readInt();
noPropUnder = ois.readInt();
if (hasProperty(PTY_Text)) {
text = (String) ois.readObject();
}
if (hasProperty(PTY_ReadOnly)) {
readOnly = ois.readBoolean();
}
if(hasProperty(PTY_WordWrap)){
wordWrap = ois.readBoolean();
}
if (hasProperty(PTY_Hide)) {
hide = ois.readBoolean();
}
if (hasProperty(PTY_Format)) {
format = (String) ois.readObject();
}
if (hasProperty(PTY_Bookmark)) {
bookmark = (String) ois.readObject();
}
if (hasProperty(PTY_DefObject)) {
defObject = ois.readBoolean();
}
if (hasProperty(PTY_HorzAlign)) {
horzAlign = ois.readInt();
}
if (hasProperty(PTY_VertAlign)) {
vertAlign = ois.readInt();
}
if (hasProperty(PTY_Font)) {
font = (ZFont) ois.readObject();
}
if (hasProperty(PTY_LeftBorder)) {
leftBorder = (ZPen) ois.readObject();
}
if (hasProperty(PTY_TopBorder)) {
topBorder = (ZPen) ois.readObject();
}
if (hasProperty(PTY_RightBorder)) {
rightBorder = (ZPen) ois.readObject();
}
if (hasProperty(PTY_BottomBorder)) {
bottomBorder = (ZPen) ois.readObject();
}
if (hasProperty(PTY_BackBrush)) {
backBrush = (ZBrush) ois.readObject();
}
if (hasProperty(PTY_TextBrush)) {
textBrush = (ZBrush) ois.readObject();
}
}
/**
* put your documentation comment here
* @param oos
* @exception IOException
*/
void _writeObject(ObjectOutputStream oos) throws IOException {
oos.writeInt(row);
oos.writeInt(col);
oos.writeInt(property);
oos.writeInt(noPropUnder);
if (hasProperty(PTY_Text)) {
oos.writeObject(text);
}
if (hasProperty(PTY_ReadOnly)) {
oos.writeBoolean(readOnly);
}
if(hasProperty(PTY_WordWrap)){
oos.writeBoolean(wordWrap);
}
if (hasProperty(PTY_Hide)) {
oos.writeBoolean(hide);
}
if (hasProperty(PTY_Format)) {
oos.writeObject(format);
}
if (hasProperty(PTY_Bookmark)) {
oos.writeObject(bookmark);
}
if (hasProperty(PTY_DefObject)) {
oos.writeBoolean(defObject);
}
if (hasProperty(PTY_HorzAlign)) {
oos.writeInt(horzAlign);
}
if (hasProperty(PTY_VertAlign)) {
oos.writeInt(vertAlign);
}
if (hasProperty(PTY_Font)) {
oos.writeObject(font);
}
if (hasProperty(PTY_LeftBorder)) {
oos.writeObject(leftBorder);
}
if (hasProperty(PTY_TopBorder)) {
oos.writeObject(topBorder);
}
if (hasProperty(PTY_RightBorder)) {
oos.writeObject(rightBorder);
}
if (hasProperty(PTY_BottomBorder)) {
oos.writeObject(bottomBorder);
}
if (hasProperty(PTY_BackBrush)) {
oos.writeObject(backBrush);
}
if (hasProperty(PTY_TextBrush)) {
oos.writeObject(textBrush);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -