|
|
@ -183,42 +183,40 @@ public class IntelliElements { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void doIntelliAction() { |
|
|
|
public abstract void doIntelliAction(); |
|
|
|
for (int colIndex = getStartColumnIndex(), colEnd = getEndColumnIndex(); colIndex < colEnd; colIndex++) { |
|
|
|
|
|
|
|
for (int rowIndex = getStartRowIndex(), rowEnd = getEndRowIndex(); rowIndex < rowEnd; rowIndex++) { |
|
|
|
|
|
|
|
TemplateCellElement sourceCellElement = getSourceCellElementByColumnRow(colIndex, rowIndex); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (sourceCellElement == null) { |
|
|
|
public void expandCellValue(int colIndex, int rowIndex) { |
|
|
|
sourceCellElement = new DefaultTemplateCellElement(); |
|
|
|
TemplateCellElement sourceCellElement = getSourceCellElementByColumnRow(colIndex, rowIndex); |
|
|
|
} |
|
|
|
|
|
|
|
TemplateCellElement newCellElement = new DefaultTemplateCellElement(colIndex, rowIndex); |
|
|
|
|
|
|
|
applyStyle(newCellElement, sourceCellElement);//style
|
|
|
|
|
|
|
|
if (sourceCellElement.getValue() instanceof DSColumn) { |
|
|
|
|
|
|
|
try{ |
|
|
|
|
|
|
|
DSColumn dsColumn = (DSColumn)((DSColumn) sourceCellElement.getValue()).clone(); |
|
|
|
|
|
|
|
newCellElement.setValue(dsColumn); |
|
|
|
|
|
|
|
}catch (CloneNotSupportedException e){ |
|
|
|
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
newCellElement.setCellExpandAttr(sourceCellElement.getCellExpandAttr()); |
|
|
|
|
|
|
|
} else if (sourceCellElement.getValue() instanceof Number) { |
|
|
|
|
|
|
|
newCellElement.setValue(processNumber((Number) sourceCellElement.getValue())); |
|
|
|
|
|
|
|
} else if (sourceCellElement.getValue() instanceof BaseFormula) { |
|
|
|
|
|
|
|
BaseFormula formula = (BaseFormula) sourceCellElement.getValue(); |
|
|
|
|
|
|
|
formula = this.generateSimpleFormula(formula, 1); |
|
|
|
|
|
|
|
newCellElement.setValue(formula); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
//richer:不改变原单元格
|
|
|
|
|
|
|
|
newCellElement.setValue(BaseUtils.cloneObject(sourceCellElement.getValue())); |
|
|
|
|
|
|
|
} catch (CloneNotSupportedException e) { |
|
|
|
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
report.addCellElement(newCellElement); |
|
|
|
if (sourceCellElement == null) { |
|
|
|
|
|
|
|
sourceCellElement = new DefaultTemplateCellElement(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
TemplateCellElement newCellElement = new DefaultTemplateCellElement(colIndex, rowIndex); |
|
|
|
|
|
|
|
applyStyle(newCellElement, sourceCellElement);//style
|
|
|
|
|
|
|
|
if (sourceCellElement.getValue() instanceof DSColumn) { |
|
|
|
|
|
|
|
try{ |
|
|
|
|
|
|
|
DSColumn dsColumn = (DSColumn)((DSColumn) sourceCellElement.getValue()).clone(); |
|
|
|
|
|
|
|
newCellElement.setValue(dsColumn); |
|
|
|
|
|
|
|
}catch (CloneNotSupportedException e){ |
|
|
|
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
newCellElement.setCellExpandAttr(sourceCellElement.getCellExpandAttr()); |
|
|
|
|
|
|
|
} else if (sourceCellElement.getValue() instanceof Number) { |
|
|
|
|
|
|
|
newCellElement.setValue(processNumber((Number) sourceCellElement.getValue())); |
|
|
|
|
|
|
|
} else if (sourceCellElement.getValue() instanceof BaseFormula) { |
|
|
|
|
|
|
|
BaseFormula formula = (BaseFormula) sourceCellElement.getValue(); |
|
|
|
|
|
|
|
formula = this.generateSimpleFormula(formula, 1); |
|
|
|
|
|
|
|
newCellElement.setValue(formula); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
//richer:不改变原单元格
|
|
|
|
|
|
|
|
newCellElement.setValue(BaseUtils.cloneObject(sourceCellElement.getValue())); |
|
|
|
|
|
|
|
} catch (CloneNotSupportedException e) { |
|
|
|
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
report.addCellElement(newCellElement); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected abstract int getStartColumnIndex(); |
|
|
|
protected abstract int getStartColumnIndex(); |
|
|
@ -328,6 +326,15 @@ public class IntelliElements { |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void doIntelliAction() { |
|
|
|
|
|
|
|
for (int colIndex = getStartColumnIndex(), colEnd = getEndColumnIndex(); colIndex < colEnd; colIndex ++) { |
|
|
|
|
|
|
|
for (int rowIndex = getStartRowIndex(), rowEnd = getEndRowIndex(); rowIndex < rowEnd; rowIndex ++) { |
|
|
|
|
|
|
|
expandCellValue(colIndex, rowIndex); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean havetoModify() { |
|
|
|
public boolean havetoModify() { |
|
|
|
return IntelliElements.this.dragCellRectangle.width > IntelliElements.this.oldCellRectangle.width; |
|
|
|
return IntelliElements.this.dragCellRectangle.width > IntelliElements.this.oldCellRectangle.width; |
|
|
@ -397,39 +404,48 @@ public class IntelliElements { |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void doIntelliAction() { |
|
|
|
|
|
|
|
for (int colIndex = getStartColumnIndex(), colEnd = getEndColumnIndex(); colIndex > colEnd; colIndex --) { |
|
|
|
|
|
|
|
for (int rowIndex = getStartRowIndex(), rowEnd = getEndRowIndex(); rowIndex < rowEnd; rowIndex ++) { |
|
|
|
|
|
|
|
expandCellValue(colIndex, rowIndex); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean havetoModify() { |
|
|
|
public boolean havetoModify() { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public int getStartRowIndex() { |
|
|
|
public int getStartRowIndex() { |
|
|
|
return IntelliElements.this.oldCellRectangle.y; |
|
|
|
return IntelliElements.this.oldCellRectangle.y; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public int getEndRowIndex() { |
|
|
|
public int getEndRowIndex() { |
|
|
|
return IntelliElements.this.oldCellRectangle.y + IntelliElements.this.oldCellRectangle.height; |
|
|
|
return IntelliElements.this.oldCellRectangle.y + IntelliElements.this.oldCellRectangle.height; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public int getStartColumnIndex() { |
|
|
|
public int getStartColumnIndex() { |
|
|
|
return IntelliElements.this.dragCellRectangle.x; |
|
|
|
return IntelliElements.this.oldCellRectangle.x - 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public int getEndColumnIndex() { |
|
|
|
public int getEndColumnIndex() { |
|
|
|
return IntelliElements.this.oldCellRectangle.x; |
|
|
|
return IntelliElements.this.dragCellRectangle.x - 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public TemplateCellElement getSourceCellElementByColumnRow(int columnIndex, int rowIndex) { |
|
|
|
public TemplateCellElement getSourceCellElementByColumnRow(int columnIndex, int rowIndex) { |
|
|
|
return report.getTemplateCellElement(IntelliElements.this.oldCellRectangle.x + (columnIndex - IntelliElements.this.dragCellRectangle.x) % (IntelliElements.this.oldCellRectangle.width), rowIndex); |
|
|
|
return report.getTemplateCellElement(columnIndex + IntelliElements.this.oldCellRectangle.width, rowIndex); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected Number processNumber(Number i) { |
|
|
|
protected Number processNumber(Number i) { |
|
|
|
return i; |
|
|
|
return FunctionHelper.asNumber(i.doubleValue() - 1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -465,6 +481,15 @@ public class IntelliElements { |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void doIntelliAction() { |
|
|
|
|
|
|
|
for (int colIndex = getStartColumnIndex(), colEnd = getEndColumnIndex(); colIndex < colEnd; colIndex ++) { |
|
|
|
|
|
|
|
for (int rowIndex = getStartRowIndex(), rowEnd = getEndRowIndex(); rowIndex < rowEnd; rowIndex ++) { |
|
|
|
|
|
|
|
expandCellValue(colIndex, rowIndex); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean havetoModify() { |
|
|
|
public boolean havetoModify() { |
|
|
|
return IntelliElements.this.dragCellRectangle.height > IntelliElements.this.oldCellRectangle.height; |
|
|
|
return IntelliElements.this.dragCellRectangle.height > IntelliElements.this.oldCellRectangle.height; |
|
|
@ -534,38 +559,47 @@ public class IntelliElements { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean havetoModify() { |
|
|
|
public void doIntelliAction() { |
|
|
|
|
|
|
|
for (int colIndex = getStartColumnIndex(), colEnd = getEndColumnIndex(); colIndex < colEnd; colIndex++) { |
|
|
|
|
|
|
|
for (int rowIndex = getStartRowIndex(), rowEnd = getEndRowIndex(); rowIndex > rowEnd; rowIndex--) { |
|
|
|
|
|
|
|
expandCellValue(colIndex, rowIndex); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean havetoModify() { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public int getStartRowIndex() { |
|
|
|
public int getStartRowIndex() { |
|
|
|
return IntelliElements.this.dragCellRectangle.y; |
|
|
|
return IntelliElements.this.oldCellRectangle.y - 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public int getEndRowIndex() { |
|
|
|
public int getEndRowIndex() { |
|
|
|
return IntelliElements.this.oldCellRectangle.y; |
|
|
|
return IntelliElements.this.dragCellRectangle.y - 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public int getStartColumnIndex() { |
|
|
|
public int getStartColumnIndex() { |
|
|
|
return IntelliElements.this.oldCellRectangle.x; |
|
|
|
return IntelliElements.this.oldCellRectangle.x; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public int getEndColumnIndex() { |
|
|
|
public int getEndColumnIndex() { |
|
|
|
return IntelliElements.this.oldCellRectangle.x + IntelliElements.this.oldCellRectangle.width; |
|
|
|
return IntelliElements.this.oldCellRectangle.x + IntelliElements.this.oldCellRectangle.width; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public TemplateCellElement getSourceCellElementByColumnRow(int columnIndex, int rowIndex) { |
|
|
|
public TemplateCellElement getSourceCellElementByColumnRow(int columnIndex, int rowIndex) { |
|
|
|
return report.getTemplateCellElement(columnIndex, IntelliElements.this.oldCellRectangle.y + (rowIndex - IntelliElements.this.dragCellRectangle.y) % (IntelliElements.this.oldCellRectangle.height)); |
|
|
|
return report.getTemplateCellElement(columnIndex, rowIndex + IntelliElements.this.oldCellRectangle.height); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected Number processNumber(Number i) { |
|
|
|
protected Number processNumber(Number i) { |
|
|
|
return i; |
|
|
|
return FunctionHelper.asNumber(i.doubleValue() - 1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|