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