|
|
@ -345,29 +345,31 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> { |
|
|
|
public void setScale(int resolution) { |
|
|
|
public void setScale(int resolution) { |
|
|
|
//更新resolution
|
|
|
|
//更新resolution
|
|
|
|
this.resolution = resolution; |
|
|
|
this.resolution = resolution; |
|
|
|
if (reportComposite.centerCardPane.editingComponet.elementCasePane != null){ |
|
|
|
ElementCasePane elementCasePane = reportComposite.centerCardPane.editingComponet.elementCasePane; |
|
|
|
reportComposite.centerCardPane.editingComponet.elementCasePane.setResolution(resolution); |
|
|
|
PolyDesigner polyDezi = reportComposite.centerCardPane.getPolyDezi(); |
|
|
|
reportComposite.centerCardPane.editingComponet.elementCasePane.getGrid().getGridMouseAdapter().setResolution(resolution); |
|
|
|
if (elementCasePane != null){ |
|
|
|
reportComposite.centerCardPane.editingComponet.elementCasePane.getGrid().setResolution(resolution); |
|
|
|
elementCasePane.setResolution(resolution); |
|
|
|
|
|
|
|
elementCasePane.getGrid().getGridMouseAdapter().setResolution(resolution); |
|
|
|
|
|
|
|
elementCasePane.getGrid().setResolution(resolution); |
|
|
|
//更新Grid
|
|
|
|
//更新Grid
|
|
|
|
Grid grid = reportComposite.centerCardPane.editingComponet.elementCasePane.getGrid(); |
|
|
|
Grid grid = elementCasePane.getGrid(); |
|
|
|
DynamicUnitList rowHeightList = ReportHelper.getRowHeightList(reportComposite.centerCardPane.editingComponet.elementCasePane.getEditingElementCase()); |
|
|
|
DynamicUnitList rowHeightList = ReportHelper.getRowHeightList(elementCasePane.getEditingElementCase()); |
|
|
|
DynamicUnitList columnWidthList = ReportHelper.getColumnWidthList(reportComposite.centerCardPane.editingComponet.elementCasePane.getEditingElementCase()); |
|
|
|
DynamicUnitList columnWidthList = ReportHelper.getColumnWidthList(elementCasePane.getEditingElementCase()); |
|
|
|
grid.setVerticalExtent(GridUtils.getExtentValue(0, rowHeightList, grid.getHeight(), resolution)); |
|
|
|
grid.setVerticalExtent(GridUtils.getExtentValue(0, rowHeightList, grid.getHeight(), resolution)); |
|
|
|
grid.setHorizontalExtent(GridUtils.getExtentValue(0, columnWidthList, grid.getWidth(), resolution)); |
|
|
|
grid.setHorizontalExtent(GridUtils.getExtentValue(0, columnWidthList, grid.getWidth(), resolution)); |
|
|
|
reportComposite.centerCardPane.editingComponet.elementCasePane.getGrid().updateUI(); |
|
|
|
elementCasePane.getGrid().updateUI(); |
|
|
|
//更新Column和Row
|
|
|
|
//更新Column和Row
|
|
|
|
((DynamicScrollBar)reportComposite.centerCardPane.editingComponet.elementCasePane.getVerticalScrollBar()).setDpi(resolution); |
|
|
|
((DynamicScrollBar)elementCasePane.getVerticalScrollBar()).setDpi(resolution); |
|
|
|
((DynamicScrollBar)reportComposite.centerCardPane.editingComponet.elementCasePane.getHorizontalScrollBar()).setDpi(resolution); |
|
|
|
((DynamicScrollBar)elementCasePane.getHorizontalScrollBar()).setDpi(resolution); |
|
|
|
reportComposite.centerCardPane.editingComponet.elementCasePane.getGridColumn().setResolution(resolution); |
|
|
|
elementCasePane.getGridColumn().setResolution(resolution); |
|
|
|
reportComposite.centerCardPane.editingComponet.elementCasePane.getGridColumn().updateUI(); |
|
|
|
elementCasePane.getGridColumn().updateUI(); |
|
|
|
reportComposite.centerCardPane.editingComponet.elementCasePane.getGridRow().setResolution(resolution); |
|
|
|
elementCasePane.getGridRow().setResolution(resolution); |
|
|
|
reportComposite.centerCardPane.editingComponet.elementCasePane.getGridRow().updateUI(); |
|
|
|
elementCasePane.getGridRow().updateUI(); |
|
|
|
} |
|
|
|
} |
|
|
|
if (reportComposite.centerCardPane.polyDezi != null){ |
|
|
|
if (polyDezi != null){ |
|
|
|
reportComposite.centerCardPane.polyDezi.setResolution(resolution); |
|
|
|
polyDezi.setResolution(resolution); |
|
|
|
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setJTemplateResolution(resolution); |
|
|
|
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setJTemplateResolution(resolution); |
|
|
|
reportComposite.centerCardPane.polyDezi.updateUI(); |
|
|
|
polyDezi.updateUI(); |
|
|
|
} |
|
|
|
} |
|
|
|
// reportComposite.centerCardPane.editingComponet.elementCasePane.getGrid().setVerticalValue(10);
|
|
|
|
// reportComposite.centerCardPane.editingComponet.elementCasePane.getGrid().setVerticalValue(10);
|
|
|
|
|
|
|
|
|
|
|
@ -375,27 +377,29 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> { |
|
|
|
} |
|
|
|
} |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public int selfAdaptUpdate(){ |
|
|
|
public int selfAdaptUpdate(){ |
|
|
|
|
|
|
|
PolyDesigner polyDezi = reportComposite.centerCardPane.getPolyDezi(); |
|
|
|
|
|
|
|
ElementCasePane elementCasePane = reportComposite.centerCardPane.editingComponet.elementCasePane; |
|
|
|
if (resolution == 0){ |
|
|
|
if (resolution == 0){ |
|
|
|
resolution = ScreenResolution.getScreenResolution(); |
|
|
|
resolution = ScreenResolution.getScreenResolution(); |
|
|
|
} |
|
|
|
} |
|
|
|
if (reportComposite.centerCardPane.polyDezi.getSelection() !=null){ |
|
|
|
if (polyDezi.getSelection() !=null){ |
|
|
|
BlockCreator blockCreator =reportComposite.centerCardPane.polyDezi.getSelection(); |
|
|
|
BlockCreator blockCreator =polyDezi.getSelection(); |
|
|
|
double x = blockCreator.getEditorBounds().getX(); |
|
|
|
double x = blockCreator.getEditorBounds().getX(); |
|
|
|
double y = blockCreator.getEditorBounds().getY(); |
|
|
|
double y = blockCreator.getEditorBounds().getY(); |
|
|
|
reportComposite.centerCardPane.polyDezi.setHorizontalValue((int) x); |
|
|
|
polyDezi.setHorizontalValue((int) x); |
|
|
|
reportComposite.centerCardPane.polyDezi.setVerticalValue((int) y); |
|
|
|
polyDezi.setVerticalValue((int) y); |
|
|
|
double creatorHeight = blockCreator.getEditorBounds().height; |
|
|
|
double creatorHeight = blockCreator.getEditorBounds().height; |
|
|
|
double creatorWidth = blockCreator.getEditorBounds().width; |
|
|
|
double creatorWidth = blockCreator.getEditorBounds().width; |
|
|
|
double areaHeight = reportComposite.centerCardPane.polyDezi.polyArea.getHeight(); |
|
|
|
double areaHeight = polyDezi.polyArea.getHeight(); |
|
|
|
double areaWidth = reportComposite.centerCardPane.polyDezi.polyArea.getWidth(); |
|
|
|
double areaWidth = polyDezi.polyArea.getWidth(); |
|
|
|
if (creatorWidth == 0||creatorHeight == 0){ |
|
|
|
if (creatorWidth == 0||creatorHeight == 0){ |
|
|
|
return resolution; |
|
|
|
return resolution; |
|
|
|
} |
|
|
|
} |
|
|
|
double time =(areaHeight/creatorHeight)<(areaWidth/creatorWidth) ? (areaHeight/creatorHeight) : (areaWidth/creatorWidth); |
|
|
|
double time =(areaHeight/creatorHeight)<(areaWidth/creatorWidth) ? (areaHeight/creatorHeight) : (areaWidth/creatorWidth); |
|
|
|
return (int) (time * reportComposite.centerCardPane.polyDezi.getResolution()); |
|
|
|
return (int) (time * polyDezi.getResolution()); |
|
|
|
|
|
|
|
|
|
|
|
}else if (reportComposite.centerCardPane.editingComponet.elementCasePane != null) { |
|
|
|
}else if (elementCasePane != null) { |
|
|
|
ElementCasePane reportPane = reportComposite.centerCardPane.editingComponet.elementCasePane.getGrid().getElementCasePane(); |
|
|
|
ElementCasePane reportPane = elementCasePane.getGrid().getElementCasePane(); |
|
|
|
int column = reportPane.getSelection().getSelectedColumns()[0]; |
|
|
|
int column = reportPane.getSelection().getSelectedColumns()[0]; |
|
|
|
double columnLength = reportPane.getSelection().getSelectedColumns().length; |
|
|
|
double columnLength = reportPane.getSelection().getSelectedColumns().length; |
|
|
|
double columnExtent = reportPane.getGrid().getHorizontalExtent(); |
|
|
|
double columnExtent = reportPane.getGrid().getHorizontalExtent(); |
|
|
@ -405,12 +409,12 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> { |
|
|
|
if (columnLength == 0||rowLength == 0){ |
|
|
|
if (columnLength == 0||rowLength == 0){ |
|
|
|
return resolution; |
|
|
|
return resolution; |
|
|
|
} |
|
|
|
} |
|
|
|
double time =(columnExtent/columnLength)<(rowExtent/rowLength) ? (columnExtent/columnLength) : (rowExtent/rowLength); |
|
|
|
double time = (columnExtent/columnLength) < (rowExtent/rowLength) ? (columnExtent/columnLength) : (rowExtent/rowLength); |
|
|
|
if (reportPane.isHorizontalScrollBarVisible()) { |
|
|
|
if (reportPane.isHorizontalScrollBarVisible()) { |
|
|
|
reportPane.getVerticalScrollBar().setValue(row); |
|
|
|
reportPane.getVerticalScrollBar().setValue(row); |
|
|
|
reportPane.getHorizontalScrollBar().setValue(column); |
|
|
|
reportPane.getHorizontalScrollBar().setValue(column); |
|
|
|
} |
|
|
|
} |
|
|
|
return (int) (time * reportComposite.centerCardPane.editingComponet.elementCasePane.getGrid().getResolution()); |
|
|
|
return (int) (time * elementCasePane.getGrid().getResolution()); |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
return resolution; |
|
|
|
return resolution; |
|
|
|
} |
|
|
|
} |
|
|
|