Tue, 12 Jan 2010 18:04:41 +0000
Renamed E4Graphics to E5Graphics.
--- a/APIs/Python3/eric5.api Tue Jan 12 17:55:24 2010 +0000 +++ b/APIs/Python3/eric5.api Tue Jan 12 18:04:41 2010 +0000 @@ -953,28 +953,6 @@ eric5.DocumentationTools.TemplatesListsStyleCSS.signalsListTemplate?7 eric5.DocumentationTools.TemplatesListsStyleCSS.sinceInfoTemplate?7 eric5.DocumentationTools.supportedExtensionsDictForApis?7 -eric5.E4Graphics.E4ArrowItem.ArrowheadAngleFactor?7 -eric5.E4Graphics.E4ArrowItem.E4ArrowItem.boundingRect?4() -eric5.E4Graphics.E4ArrowItem.E4ArrowItem.paint?4(painter, option, widget = None) -eric5.E4Graphics.E4ArrowItem.E4ArrowItem.setEndPoint?4(x, y) -eric5.E4Graphics.E4ArrowItem.E4ArrowItem.setPoints?4(xa, ya, xb, yb) -eric5.E4Graphics.E4ArrowItem.E4ArrowItem.setStartPoint?4(x, y) -eric5.E4Graphics.E4ArrowItem.E4ArrowItem?1(origin = QPointF(), end = QPointF(), filled = False, type = NormalArrow, parent = None) -eric5.E4Graphics.E4ArrowItem.NormalArrow?7 -eric5.E4Graphics.E4ArrowItem.WideArrow?7 -eric5.E4Graphics.E4GraphicsView.E4GraphicsView._getDiagramRect?5(border = 0) -eric5.E4Graphics.E4GraphicsView.E4GraphicsView._getDiagramSize?5(border = 0) -eric5.E4Graphics.E4GraphicsView.E4GraphicsView.filteredItems?4(items) -eric5.E4Graphics.E4GraphicsView.E4GraphicsView.printDiagram?4(printer, diagramName = "") -eric5.E4Graphics.E4GraphicsView.E4GraphicsView.resizeScene?4(amount, isWidth = True) -eric5.E4Graphics.E4GraphicsView.E4GraphicsView.saveImage?4(filename, format = "PNG") -eric5.E4Graphics.E4GraphicsView.E4GraphicsView.setSceneSize?4(width, height) -eric5.E4Graphics.E4GraphicsView.E4GraphicsView.setZoom?4(zoomFactor) -eric5.E4Graphics.E4GraphicsView.E4GraphicsView.zoom?4() -eric5.E4Graphics.E4GraphicsView.E4GraphicsView.zoomIn?4() -eric5.E4Graphics.E4GraphicsView.E4GraphicsView.zoomOut?4() -eric5.E4Graphics.E4GraphicsView.E4GraphicsView.zoomReset?4() -eric5.E4Graphics.E4GraphicsView.E4GraphicsView?1(scene, parent = None) eric5.E4Gui.E4Action.ArgumentsError?1(error) eric5.E4Gui.E4Action.E4Action.alternateShortcut?4() eric5.E4Gui.E4Action.E4Action.setAlternateShortcut?4(shortcut) @@ -1213,6 +1191,28 @@ eric5.E4Network.E4NetworkMonitor.E4RequestModel.removeRows?4(row, count, parent) eric5.E4Network.E4NetworkMonitor.E4RequestModel.rowCount?4(parent) eric5.E4Network.E4NetworkMonitor.E4RequestModel?1(networkAccessManager, parent = None) +eric5.E5Graphics.E5ArrowItem.ArrowheadAngleFactor?7 +eric5.E5Graphics.E5ArrowItem.E5ArrowItem.boundingRect?4() +eric5.E5Graphics.E5ArrowItem.E5ArrowItem.paint?4(painter, option, widget = None) +eric5.E5Graphics.E5ArrowItem.E5ArrowItem.setEndPoint?4(x, y) +eric5.E5Graphics.E5ArrowItem.E5ArrowItem.setPoints?4(xa, ya, xb, yb) +eric5.E5Graphics.E5ArrowItem.E5ArrowItem.setStartPoint?4(x, y) +eric5.E5Graphics.E5ArrowItem.E5ArrowItem?1(origin = QPointF(), end = QPointF(), filled = False, type = NormalArrow, parent = None) +eric5.E5Graphics.E5ArrowItem.NormalArrow?7 +eric5.E5Graphics.E5ArrowItem.WideArrow?7 +eric5.E5Graphics.E5GraphicsView.E5GraphicsView._getDiagramRect?5(border = 0) +eric5.E5Graphics.E5GraphicsView.E5GraphicsView._getDiagramSize?5(border = 0) +eric5.E5Graphics.E5GraphicsView.E5GraphicsView.filteredItems?4(items) +eric5.E5Graphics.E5GraphicsView.E5GraphicsView.printDiagram?4(printer, diagramName = "") +eric5.E5Graphics.E5GraphicsView.E5GraphicsView.resizeScene?4(amount, isWidth = True) +eric5.E5Graphics.E5GraphicsView.E5GraphicsView.saveImage?4(filename, format = "PNG") +eric5.E5Graphics.E5GraphicsView.E5GraphicsView.setSceneSize?4(width, height) +eric5.E5Graphics.E5GraphicsView.E5GraphicsView.setZoom?4(zoomFactor) +eric5.E5Graphics.E5GraphicsView.E5GraphicsView.zoom?4() +eric5.E5Graphics.E5GraphicsView.E5GraphicsView.zoomIn?4() +eric5.E5Graphics.E5GraphicsView.E5GraphicsView.zoomOut?4() +eric5.E5Graphics.E5GraphicsView.E5GraphicsView.zoomReset?4() +eric5.E5Graphics.E5GraphicsView.E5GraphicsView?1(scene, parent = None) eric5.E5XML.Config.debuggerPropertiesFileFormatVersion?7 eric5.E5XML.Config.highlightingStylesFileFormatVersion?7 eric5.E5XML.Config.multiProjectFileFormatVersion?7
--- a/Documentation/Help/source.qhp Tue Jan 12 17:55:24 2010 +0000 +++ b/Documentation/Help/source.qhp Tue Jan 12 18:04:41 2010 +0000 @@ -101,10 +101,6 @@ <section title="eric5.DocumentationTools.TemplatesListsStyle" ref="eric5.DocumentationTools.TemplatesListsStyle.html" /> <section title="eric5.DocumentationTools.TemplatesListsStyleCSS" ref="eric5.DocumentationTools.TemplatesListsStyleCSS.html" /> </section> - <section title="eric5.E4Graphics" ref="index-eric5.E4Graphics.html"> - <section title="eric5.E4Graphics.E4ArrowItem" ref="eric5.E4Graphics.E4ArrowItem.html" /> - <section title="eric5.E4Graphics.E4GraphicsView" ref="eric5.E4Graphics.E4GraphicsView.html" /> - </section> <section title="eric5.E4Gui" ref="index-eric5.E4Gui.html"> <section title="eric5.E4Gui.E4Action" ref="eric5.E4Gui.E4Action.html" /> <section title="eric5.E4Gui.E4Application" ref="eric5.E4Gui.E4Application.html" /> @@ -129,6 +125,10 @@ <section title="eric5.E4Network.E4NetworkHeaderDetailsDialog" ref="eric5.E4Network.E4NetworkHeaderDetailsDialog.html" /> <section title="eric5.E4Network.E4NetworkMonitor" ref="eric5.E4Network.E4NetworkMonitor.html" /> </section> + <section title="eric5.E5Graphics" ref="index-eric5.E5Graphics.html"> + <section title="eric5.E5Graphics.E5ArrowItem" ref="eric5.E5Graphics.E5ArrowItem.html" /> + <section title="eric5.E5Graphics.E5GraphicsView" ref="eric5.E5Graphics.E5GraphicsView.html" /> + </section> <section title="eric5.E5XML" ref="index-eric5.E5XML.html"> <section title="eric5.E5XML.Config" ref="eric5.E5XML.Config.html" /> <section title="eric5.E5XML.DebuggerPropertiesHandler" ref="eric5.E5XML.DebuggerPropertiesHandler.html" /> @@ -1235,6 +1235,31 @@ <keyword name="XMLWriterBase.encodedNewLines" id="XMLWriterBase.encodedNewLines" ref="eric5.E5XML.XMLWriterBase.html#XMLWriterBase.encodedNewLines" /> <keyword name="XMLWriterBase.escape" id="XMLWriterBase.escape" ref="eric5.E5XML.XMLWriterBase.html#XMLWriterBase.escape" /> <keyword name="XMLWriterBase.writeXML" id="XMLWriterBase.writeXML" ref="eric5.E5XML.XMLWriterBase.html#XMLWriterBase.writeXML" /> + <keyword name="E5Graphics (Package)" id="E5Graphics (Package)" ref="index-eric5.E5Graphics.html" /> + <keyword name="E5GraphicsView (Module)" id="E5GraphicsView (Module)" ref="eric5.E5Graphics.E5GraphicsView.html" /> + <keyword name="E5GraphicsView" id="E5GraphicsView" ref="eric5.E5Graphics.E5GraphicsView.html#E5GraphicsView" /> + <keyword name="E5GraphicsView (Constructor)" id="E5GraphicsView (Constructor)" ref="eric5.E5Graphics.E5GraphicsView.html#E5GraphicsView.__init__" /> + <keyword name="E5GraphicsView.__getDiagram" id="E5GraphicsView.__getDiagram" ref="eric5.E5Graphics.E5GraphicsView.html#E5GraphicsView.__getDiagram" /> + <keyword name="E5GraphicsView._getDiagramRect" id="E5GraphicsView._getDiagramRect" ref="eric5.E5Graphics.E5GraphicsView.html#E5GraphicsView._getDiagramRect" /> + <keyword name="E5GraphicsView._getDiagramSize" id="E5GraphicsView._getDiagramSize" ref="eric5.E5Graphics.E5GraphicsView.html#E5GraphicsView._getDiagramSize" /> + <keyword name="E5GraphicsView.filteredItems" id="E5GraphicsView.filteredItems" ref="eric5.E5Graphics.E5GraphicsView.html#E5GraphicsView.filteredItems" /> + <keyword name="E5GraphicsView.printDiagram" id="E5GraphicsView.printDiagram" ref="eric5.E5Graphics.E5GraphicsView.html#E5GraphicsView.printDiagram" /> + <keyword name="E5GraphicsView.resizeScene" id="E5GraphicsView.resizeScene" ref="eric5.E5Graphics.E5GraphicsView.html#E5GraphicsView.resizeScene" /> + <keyword name="E5GraphicsView.saveImage" id="E5GraphicsView.saveImage" ref="eric5.E5Graphics.E5GraphicsView.html#E5GraphicsView.saveImage" /> + <keyword name="E5GraphicsView.setSceneSize" id="E5GraphicsView.setSceneSize" ref="eric5.E5Graphics.E5GraphicsView.html#E5GraphicsView.setSceneSize" /> + <keyword name="E5GraphicsView.setZoom" id="E5GraphicsView.setZoom" ref="eric5.E5Graphics.E5GraphicsView.html#E5GraphicsView.setZoom" /> + <keyword name="E5GraphicsView.zoom" id="E5GraphicsView.zoom" ref="eric5.E5Graphics.E5GraphicsView.html#E5GraphicsView.zoom" /> + <keyword name="E5GraphicsView.zoomIn" id="E5GraphicsView.zoomIn" ref="eric5.E5Graphics.E5GraphicsView.html#E5GraphicsView.zoomIn" /> + <keyword name="E5GraphicsView.zoomOut" id="E5GraphicsView.zoomOut" ref="eric5.E5Graphics.E5GraphicsView.html#E5GraphicsView.zoomOut" /> + <keyword name="E5GraphicsView.zoomReset" id="E5GraphicsView.zoomReset" ref="eric5.E5Graphics.E5GraphicsView.html#E5GraphicsView.zoomReset" /> + <keyword name="E5ArrowItem (Module)" id="E5ArrowItem (Module)" ref="eric5.E5Graphics.E5ArrowItem.html" /> + <keyword name="E5ArrowItem" id="E5ArrowItem" ref="eric5.E5Graphics.E5ArrowItem.html#E5ArrowItem" /> + <keyword name="E5ArrowItem (Constructor)" id="E5ArrowItem (Constructor)" ref="eric5.E5Graphics.E5ArrowItem.html#E5ArrowItem.__init__" /> + <keyword name="E5ArrowItem.boundingRect" id="E5ArrowItem.boundingRect" ref="eric5.E5Graphics.E5ArrowItem.html#E5ArrowItem.boundingRect" /> + <keyword name="E5ArrowItem.paint" id="E5ArrowItem.paint" ref="eric5.E5Graphics.E5ArrowItem.html#E5ArrowItem.paint" /> + <keyword name="E5ArrowItem.setEndPoint" id="E5ArrowItem.setEndPoint" ref="eric5.E5Graphics.E5ArrowItem.html#E5ArrowItem.setEndPoint" /> + <keyword name="E5ArrowItem.setPoints" id="E5ArrowItem.setPoints" ref="eric5.E5Graphics.E5ArrowItem.html#E5ArrowItem.setPoints" /> + <keyword name="E5ArrowItem.setStartPoint" id="E5ArrowItem.setStartPoint" ref="eric5.E5Graphics.E5ArrowItem.html#E5ArrowItem.setStartPoint" /> <keyword name="PyUnit (Package)" id="PyUnit (Package)" ref="index-eric5.PyUnit.html" /> <keyword name="UnittestDialog (Module)" id="UnittestDialog (Module)" ref="eric5.PyUnit.UnittestDialog.html" /> <keyword name="QtTestResult" id="QtTestResult" ref="eric5.PyUnit.UnittestDialog.html#QtTestResult" /> @@ -3937,31 +3962,6 @@ <keyword name="BrowserSortFilterProxyModel.lessThan" id="BrowserSortFilterProxyModel.lessThan" ref="eric5.UI.BrowserSortFilterProxyModel.html#BrowserSortFilterProxyModel.lessThan" /> <keyword name="BrowserSortFilterProxyModel.preferencesChanged" id="BrowserSortFilterProxyModel.preferencesChanged" ref="eric5.UI.BrowserSortFilterProxyModel.html#BrowserSortFilterProxyModel.preferencesChanged" /> <keyword name="BrowserSortFilterProxyModel.sort" id="BrowserSortFilterProxyModel.sort" ref="eric5.UI.BrowserSortFilterProxyModel.html#BrowserSortFilterProxyModel.sort" /> - <keyword name="E4Graphics (Package)" id="E4Graphics (Package)" ref="index-eric5.E4Graphics.html" /> - <keyword name="E4ArrowItem (Module)" id="E4ArrowItem (Module)" ref="eric5.E4Graphics.E4ArrowItem.html" /> - <keyword name="E4ArrowItem" id="E4ArrowItem" ref="eric5.E4Graphics.E4ArrowItem.html#E4ArrowItem" /> - <keyword name="E4ArrowItem (Constructor)" id="E4ArrowItem (Constructor)" ref="eric5.E4Graphics.E4ArrowItem.html#E4ArrowItem.__init__" /> - <keyword name="E4ArrowItem.boundingRect" id="E4ArrowItem.boundingRect" ref="eric5.E4Graphics.E4ArrowItem.html#E4ArrowItem.boundingRect" /> - <keyword name="E4ArrowItem.paint" id="E4ArrowItem.paint" ref="eric5.E4Graphics.E4ArrowItem.html#E4ArrowItem.paint" /> - <keyword name="E4ArrowItem.setEndPoint" id="E4ArrowItem.setEndPoint" ref="eric5.E4Graphics.E4ArrowItem.html#E4ArrowItem.setEndPoint" /> - <keyword name="E4ArrowItem.setPoints" id="E4ArrowItem.setPoints" ref="eric5.E4Graphics.E4ArrowItem.html#E4ArrowItem.setPoints" /> - <keyword name="E4ArrowItem.setStartPoint" id="E4ArrowItem.setStartPoint" ref="eric5.E4Graphics.E4ArrowItem.html#E4ArrowItem.setStartPoint" /> - <keyword name="E4GraphicsView (Module)" id="E4GraphicsView (Module)" ref="eric5.E4Graphics.E4GraphicsView.html" /> - <keyword name="E4GraphicsView" id="E4GraphicsView" ref="eric5.E4Graphics.E4GraphicsView.html#E4GraphicsView" /> - <keyword name="E4GraphicsView (Constructor)" id="E4GraphicsView (Constructor)" ref="eric5.E4Graphics.E4GraphicsView.html#E4GraphicsView.__init__" /> - <keyword name="E4GraphicsView.__getDiagram" id="E4GraphicsView.__getDiagram" ref="eric5.E4Graphics.E4GraphicsView.html#E4GraphicsView.__getDiagram" /> - <keyword name="E4GraphicsView._getDiagramRect" id="E4GraphicsView._getDiagramRect" ref="eric5.E4Graphics.E4GraphicsView.html#E4GraphicsView._getDiagramRect" /> - <keyword name="E4GraphicsView._getDiagramSize" id="E4GraphicsView._getDiagramSize" ref="eric5.E4Graphics.E4GraphicsView.html#E4GraphicsView._getDiagramSize" /> - <keyword name="E4GraphicsView.filteredItems" id="E4GraphicsView.filteredItems" ref="eric5.E4Graphics.E4GraphicsView.html#E4GraphicsView.filteredItems" /> - <keyword name="E4GraphicsView.printDiagram" id="E4GraphicsView.printDiagram" ref="eric5.E4Graphics.E4GraphicsView.html#E4GraphicsView.printDiagram" /> - <keyword name="E4GraphicsView.resizeScene" id="E4GraphicsView.resizeScene" ref="eric5.E4Graphics.E4GraphicsView.html#E4GraphicsView.resizeScene" /> - <keyword name="E4GraphicsView.saveImage" id="E4GraphicsView.saveImage" ref="eric5.E4Graphics.E4GraphicsView.html#E4GraphicsView.saveImage" /> - <keyword name="E4GraphicsView.setSceneSize" id="E4GraphicsView.setSceneSize" ref="eric5.E4Graphics.E4GraphicsView.html#E4GraphicsView.setSceneSize" /> - <keyword name="E4GraphicsView.setZoom" id="E4GraphicsView.setZoom" ref="eric5.E4Graphics.E4GraphicsView.html#E4GraphicsView.setZoom" /> - <keyword name="E4GraphicsView.zoom" id="E4GraphicsView.zoom" ref="eric5.E4Graphics.E4GraphicsView.html#E4GraphicsView.zoom" /> - <keyword name="E4GraphicsView.zoomIn" id="E4GraphicsView.zoomIn" ref="eric5.E4Graphics.E4GraphicsView.html#E4GraphicsView.zoomIn" /> - <keyword name="E4GraphicsView.zoomOut" id="E4GraphicsView.zoomOut" ref="eric5.E4Graphics.E4GraphicsView.html#E4GraphicsView.zoomOut" /> - <keyword name="E4GraphicsView.zoomReset" id="E4GraphicsView.zoomReset" ref="eric5.E4Graphics.E4GraphicsView.html#E4GraphicsView.zoomReset" /> <keyword name="E4Gui (Package)" id="E4Gui (Package)" ref="index-eric5.E4Gui.html" /> <keyword name="E4TabWidget (Module)" id="E4TabWidget (Module)" ref="eric5.E4Gui.E4TabWidget.html" /> <keyword name="E4DnDTabBar" id="E4DnDTabBar" ref="eric5.E4Gui.E4TabWidget.html#E4DnDTabBar" /> @@ -8916,8 +8916,6 @@ <file>eric5.DocumentationTools.QtHelpGenerator.html</file> <file>eric5.DocumentationTools.TemplatesListsStyle.html</file> <file>eric5.DocumentationTools.TemplatesListsStyleCSS.html</file> - <file>eric5.E4Graphics.E4ArrowItem.html</file> - <file>eric5.E4Graphics.E4GraphicsView.html</file> <file>eric5.E4Gui.E4Action.html</file> <file>eric5.E4Gui.E4Application.html</file> <file>eric5.E4Gui.E4Completers.html</file> @@ -8938,6 +8936,8 @@ <file>eric5.E4Gui.E4TreeView.html</file> <file>eric5.E4Network.E4NetworkHeaderDetailsDialog.html</file> <file>eric5.E4Network.E4NetworkMonitor.html</file> + <file>eric5.E5Graphics.E5ArrowItem.html</file> + <file>eric5.E5Graphics.E5GraphicsView.html</file> <file>eric5.E5XML.Config.html</file> <file>eric5.E5XML.DebuggerPropertiesHandler.html</file> <file>eric5.E5XML.DebuggerPropertiesWriter.html</file> @@ -9392,9 +9392,9 @@ <file>index-eric5.DebugClients.html</file> <file>index-eric5.Debugger.html</file> <file>index-eric5.DocumentationTools.html</file> - <file>index-eric5.E4Graphics.html</file> <file>index-eric5.E4Gui.html</file> <file>index-eric5.E4Network.html</file> + <file>index-eric5.E5Graphics.html</file> <file>index-eric5.E5XML.html</file> <file>index-eric5.Globals.html</file> <file>index-eric5.Graphics.html</file>
--- a/Documentation/Source/eric5.E4Graphics.E4ArrowItem.html Tue Jan 12 17:55:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,178 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' -'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> -<html><head> -<title>eric5.E4Graphics.E4ArrowItem</title> -<style> -body { - background:white; - margin: 0em 1em 10em 1em; - color: black; -} - -h1 { color: white; background: #4FA4FF; } -h2 { color: white; background: #4FA4FF; } -h3 { color: white; background: #00557F; } -h4 { color: white; background: #00557F; } - -a { color: #AA5500; } - -</style> -</head> -<body><a NAME="top" ID="top"></a> -<h1>eric5.E4Graphics.E4ArrowItem</h1> -<p> -Module implementing a graphics item subclass for an arrow. -</p> -<h3>Global Attributes</h3> -<table> -<tr><td>ArrowheadAngleFactor</td></tr><tr><td>NormalArrow</td></tr><tr><td>WideArrow</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr> -<td><a href="#E4ArrowItem">E4ArrowItem</a></td> -<td>Class implementing an arrow graphics item subclass.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr><td>None</td></tr> -</table> -<hr /><hr /> -<a NAME="E4ArrowItem" ID="E4ArrowItem"></a> -<h2>E4ArrowItem</h2> -<p> - Class implementing an arrow graphics item subclass. -</p> -<h3>Derived from</h3> -QAbstractGraphicsShapeItem -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#E4ArrowItem.__init__">E4ArrowItem</a></td> -<td>Constructor</td> -</tr><tr> -<td><a href="#E4ArrowItem.boundingRect">boundingRect</a></td> -<td>Public method to return the bounding rectangle.</td> -</tr><tr> -<td><a href="#E4ArrowItem.paint">paint</a></td> -<td>Public method to paint the item in local coordinates.</td> -</tr><tr> -<td><a href="#E4ArrowItem.setEndPoint">setEndPoint</a></td> -<td>Public method to set the end point.</td> -</tr><tr> -<td><a href="#E4ArrowItem.setPoints">setPoints</a></td> -<td>Public method to set the start and end points of the line.</td> -</tr><tr> -<td><a href="#E4ArrowItem.setStartPoint">setStartPoint</a></td> -<td>Public method to set the start point.</td> -</tr> -</table> -<a NAME="E4ArrowItem.__init__" ID="E4ArrowItem.__init__"></a> -<h4>E4ArrowItem (Constructor)</h4> -<b>E4ArrowItem</b>(<i>origin = QPointF(), end = QPointF(), filled = False, type = NormalArrow, parent = None</i>) -<p> - Constructor -</p><dl> -<dt><i>origin</i></dt> -<dd> -origin of the arrow (QPointF) -</dd><dt><i>end</i></dt> -<dd> -end point of the arrow (QPointF) -</dd><dt><i>filled</i></dt> -<dd> -flag indicating a filled arrow head (boolean) -</dd><dt><i>type</i></dt> -<dd> -arrow type (NormalArrow, WideArrow) -</dd><dt><i>parent=</i></dt> -<dd> -reference to the parent object (QGraphicsItem) -</dd> -</dl><a NAME="E4ArrowItem.boundingRect" ID="E4ArrowItem.boundingRect"></a> -<h4>E4ArrowItem.boundingRect</h4> -<b>boundingRect</b>(<i></i>) -<p> - Public method to return the bounding rectangle. -</p><dl> -<dt>Returns:</dt> -<dd> -bounding rectangle (QRectF) -</dd> -</dl><a NAME="E4ArrowItem.paint" ID="E4ArrowItem.paint"></a> -<h4>E4ArrowItem.paint</h4> -<b>paint</b>(<i>painter, option, widget = None</i>) -<p> - Public method to paint the item in local coordinates. -</p><dl> -<dt><i>painter</i></dt> -<dd> -reference to the painter object (QPainter) -</dd><dt><i>option</i></dt> -<dd> -style options (QStyleOptionGraphicsItem) -</dd><dt><i>widget</i></dt> -<dd> -optional reference to the widget painted on (QWidget) -</dd> -</dl><a NAME="E4ArrowItem.setEndPoint" ID="E4ArrowItem.setEndPoint"></a> -<h4>E4ArrowItem.setEndPoint</h4> -<b>setEndPoint</b>(<i>x, y</i>) -<p> - Public method to set the end point. -</p><p> - <b>Note:</b> This method does not redraw the item. -</p><dl> -<dt><i>x</i></dt> -<dd> -x-coordinate of the end point (float) -</dd><dt><i>y</i></dt> -<dd> -y-coordinate of the end point (float) -</dd> -</dl><a NAME="E4ArrowItem.setPoints" ID="E4ArrowItem.setPoints"></a> -<h4>E4ArrowItem.setPoints</h4> -<b>setPoints</b>(<i>xa, ya, xb, yb</i>) -<p> - Public method to set the start and end points of the line. -</p><p> - <b>Note:</b> This method does not redraw the item. -</p><dl> -<dt><i>xa</i></dt> -<dd> -x-coordinate of the start point (float) -</dd><dt><i>ya</i></dt> -<dd> -y-coordinate of the start point (float) -</dd><dt><i>xb</i></dt> -<dd> -x-coordinate of the end point (float) -</dd><dt><i>yb</i></dt> -<dd> -y-coordinate of the end point (float) -</dd> -</dl><a NAME="E4ArrowItem.setStartPoint" ID="E4ArrowItem.setStartPoint"></a> -<h4>E4ArrowItem.setStartPoint</h4> -<b>setStartPoint</b>(<i>x, y</i>) -<p> - Public method to set the start point. -</p><p> - <b>Note:</b> This method does not redraw the item. -</p><dl> -<dt><i>x</i></dt> -<dd> -x-coordinate of the start point (float) -</dd><dt><i>y</i></dt> -<dd> -y-coordinate of the start point (float) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /> -</body></html> \ No newline at end of file
--- a/Documentation/Source/eric5.E4Graphics.E4GraphicsView.html Tue Jan 12 17:55:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,276 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' -'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> -<html><head> -<title>eric5.E4Graphics.E4GraphicsView</title> -<style> -body { - background:white; - margin: 0em 1em 10em 1em; - color: black; -} - -h1 { color: white; background: #4FA4FF; } -h2 { color: white; background: #4FA4FF; } -h3 { color: white; background: #00557F; } -h4 { color: white; background: #00557F; } - -a { color: #AA5500; } - -</style> -</head> -<body><a NAME="top" ID="top"></a> -<h1>eric5.E4Graphics.E4GraphicsView</h1> -<p> -Module implementing a canvas view class. -</p> -<h3>Global Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr> -<td><a href="#E4GraphicsView">E4GraphicsView</a></td> -<td>Class implementing a graphics view.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr><td>None</td></tr> -</table> -<hr /><hr /> -<a NAME="E4GraphicsView" ID="E4GraphicsView"></a> -<h2>E4GraphicsView</h2> -<p> - Class implementing a graphics view. -</p> -<h3>Derived from</h3> -QGraphicsView -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#E4GraphicsView.__init__">E4GraphicsView</a></td> -<td>Constructor</td> -</tr><tr> -<td><a href="#E4GraphicsView.__getDiagram">__getDiagram</a></td> -<td>Private method to retrieve the diagram from the scene fitting it in the minimum rectangle.</td> -</tr><tr> -<td><a href="#E4GraphicsView._getDiagramRect">_getDiagramRect</a></td> -<td>Protected method to calculate the minimum rectangle fitting the diagram.</td> -</tr><tr> -<td><a href="#E4GraphicsView._getDiagramSize">_getDiagramSize</a></td> -<td>Protected method to calculate the minimum size fitting the diagram.</td> -</tr><tr> -<td><a href="#E4GraphicsView.filteredItems">filteredItems</a></td> -<td>Public method to filter a list of items.</td> -</tr><tr> -<td><a href="#E4GraphicsView.printDiagram">printDiagram</a></td> -<td>Public method to print the diagram.</td> -</tr><tr> -<td><a href="#E4GraphicsView.resizeScene">resizeScene</a></td> -<td>Public method to resize the scene.</td> -</tr><tr> -<td><a href="#E4GraphicsView.saveImage">saveImage</a></td> -<td>Public method to save the scene to a file.</td> -</tr><tr> -<td><a href="#E4GraphicsView.setSceneSize">setSceneSize</a></td> -<td>Public method to set the scene size.</td> -</tr><tr> -<td><a href="#E4GraphicsView.setZoom">setZoom</a></td> -<td>Public method to set the zoom factor.</td> -</tr><tr> -<td><a href="#E4GraphicsView.zoom">zoom</a></td> -<td>Public method to get the current zoom factor.</td> -</tr><tr> -<td><a href="#E4GraphicsView.zoomIn">zoomIn</a></td> -<td>Public method to zoom in.</td> -</tr><tr> -<td><a href="#E4GraphicsView.zoomOut">zoomOut</a></td> -<td>Public method to zoom out.</td> -</tr><tr> -<td><a href="#E4GraphicsView.zoomReset">zoomReset</a></td> -<td>Public method to handle the reset zoom context menu entry.</td> -</tr> -</table> -<a NAME="E4GraphicsView.__init__" ID="E4GraphicsView.__init__"></a> -<h4>E4GraphicsView (Constructor)</h4> -<b>E4GraphicsView</b>(<i>scene, parent = None</i>) -<p> - Constructor -</p><dl> -<dt><i>scene</i></dt> -<dd> -reference to the scene object (QGraphicsScene) -</dd><dt><i>parent</i></dt> -<dd> -parent widget (QWidget) -</dd> -</dl><a NAME="E4GraphicsView.__getDiagram" ID="E4GraphicsView.__getDiagram"></a> -<h4>E4GraphicsView.__getDiagram</h4> -<b>__getDiagram</b>(<i>rect, format = "PNG", filename = None</i>) -<p> - Private method to retrieve the diagram from the scene fitting it - in the minimum rectangle. -</p><dl> -<dt><i>rect</i></dt> -<dd> -minimum rectangle fitting the diagram (QRectF) -</dd><dt><i>format</i></dt> -<dd> -format for the image file (string) -</dd><dt><i>filename</i></dt> -<dd> -name of the file for non pixmaps (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -diagram pixmap to receive the diagram (QPixmap) -</dd> -</dl><a NAME="E4GraphicsView._getDiagramRect" ID="E4GraphicsView._getDiagramRect"></a> -<h4>E4GraphicsView._getDiagramRect</h4> -<b>_getDiagramRect</b>(<i>border = 0</i>) -<p> - Protected method to calculate the minimum rectangle fitting the diagram. -</p><dl> -<dt><i>border</i></dt> -<dd> -border width to include in the calculation (integer) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -the minimum rectangle (QRectF) -</dd> -</dl><a NAME="E4GraphicsView._getDiagramSize" ID="E4GraphicsView._getDiagramSize"></a> -<h4>E4GraphicsView._getDiagramSize</h4> -<b>_getDiagramSize</b>(<i>border = 0</i>) -<p> - Protected method to calculate the minimum size fitting the diagram. -</p><dl> -<dt><i>border</i></dt> -<dd> -border width to include in the calculation (integer) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -the minimum size (QSizeF) -</dd> -</dl><a NAME="E4GraphicsView.filteredItems" ID="E4GraphicsView.filteredItems"></a> -<h4>E4GraphicsView.filteredItems</h4> -<b>filteredItems</b>(<i>items</i>) -<p> - Public method to filter a list of items. -</p><dl> -<dt><i>items</i></dt> -<dd> -list of items as returned by the scene object - (QGraphicsItem) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -list of interesting collision items (QGraphicsItem) -</dd> -</dl><a NAME="E4GraphicsView.printDiagram" ID="E4GraphicsView.printDiagram"></a> -<h4>E4GraphicsView.printDiagram</h4> -<b>printDiagram</b>(<i>printer, diagramName = ""</i>) -<p> - Public method to print the diagram. -</p><dl> -<dt><i>printer</i></dt> -<dd> -reference to a ready configured printer object (QPrinter) -</dd><dt><i>diagramName</i></dt> -<dd> -name of the diagram (string) -</dd> -</dl><a NAME="E4GraphicsView.resizeScene" ID="E4GraphicsView.resizeScene"></a> -<h4>E4GraphicsView.resizeScene</h4> -<b>resizeScene</b>(<i>amount, isWidth = True</i>) -<p> - Public method to resize the scene. -</p><dl> -<dt><i>isWidth</i></dt> -<dd> -flag indicating width is to be resized (boolean) -</dd><dt><i>amount</i></dt> -<dd> -size increment (integer) -</dd> -</dl><a NAME="E4GraphicsView.saveImage" ID="E4GraphicsView.saveImage"></a> -<h4>E4GraphicsView.saveImage</h4> -<b>saveImage</b>(<i>filename, format = "PNG"</i>) -<p> - Public method to save the scene to a file. -</p><dl> -<dt><i>filename</i></dt> -<dd> -name of the file to write the image to (string) -</dd><dt><i>format</i></dt> -<dd> -format for the image file (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -flag indicating success (boolean) -</dd> -</dl><a NAME="E4GraphicsView.setSceneSize" ID="E4GraphicsView.setSceneSize"></a> -<h4>E4GraphicsView.setSceneSize</h4> -<b>setSceneSize</b>(<i>width, height</i>) -<p> - Public method to set the scene size. -</p><dl> -<dt><i>width</i></dt> -<dd> -width for the scene (integer) -</dd><dt><i>height</i></dt> -<dd> -height for the scene (integer) -</dd> -</dl><a NAME="E4GraphicsView.setZoom" ID="E4GraphicsView.setZoom"></a> -<h4>E4GraphicsView.setZoom</h4> -<b>setZoom</b>(<i>zoomFactor</i>) -<p> - Public method to set the zoom factor. -</p><dl> -<dt><i>zoomFactor</i></dt> -<dd> -new zoom factor (float) -</dd> -</dl><a NAME="E4GraphicsView.zoom" ID="E4GraphicsView.zoom"></a> -<h4>E4GraphicsView.zoom</h4> -<b>zoom</b>(<i></i>) -<p> - Public method to get the current zoom factor. -</p><dl> -<dt>Returns:</dt> -<dd> -current zoom factor (float) -</dd> -</dl><a NAME="E4GraphicsView.zoomIn" ID="E4GraphicsView.zoomIn"></a> -<h4>E4GraphicsView.zoomIn</h4> -<b>zoomIn</b>(<i></i>) -<p> - Public method to zoom in. -</p><a NAME="E4GraphicsView.zoomOut" ID="E4GraphicsView.zoomOut"></a> -<h4>E4GraphicsView.zoomOut</h4> -<b>zoomOut</b>(<i></i>) -<p> - Public method to zoom out. -</p><a NAME="E4GraphicsView.zoomReset" ID="E4GraphicsView.zoomReset"></a> -<h4>E4GraphicsView.zoomReset</h4> -<b>zoomReset</b>(<i></i>) -<p> - Public method to handle the reset zoom context menu entry. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /> -</body></html> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Documentation/Source/eric5.E5Graphics.E5ArrowItem.html Tue Jan 12 18:04:41 2010 +0000 @@ -0,0 +1,178 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' +'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> +<html><head> +<title>eric5.E5Graphics.E5ArrowItem</title> +<style> +body { + background:white; + margin: 0em 1em 10em 1em; + color: black; +} + +h1 { color: white; background: #4FA4FF; } +h2 { color: white; background: #4FA4FF; } +h3 { color: white; background: #00557F; } +h4 { color: white; background: #00557F; } + +a { color: #AA5500; } + +</style> +</head> +<body><a NAME="top" ID="top"></a> +<h1>eric5.E5Graphics.E5ArrowItem</h1> +<p> +Module implementing a graphics item subclass for an arrow. +</p> +<h3>Global Attributes</h3> +<table> +<tr><td>ArrowheadAngleFactor</td></tr><tr><td>NormalArrow</td></tr><tr><td>WideArrow</td></tr> +</table> +<h3>Classes</h3> +<table> +<tr> +<td><a href="#E5ArrowItem">E5ArrowItem</a></td> +<td>Class implementing an arrow graphics item subclass.</td> +</tr> +</table> +<h3>Functions</h3> +<table> +<tr><td>None</td></tr> +</table> +<hr /><hr /> +<a NAME="E5ArrowItem" ID="E5ArrowItem"></a> +<h2>E5ArrowItem</h2> +<p> + Class implementing an arrow graphics item subclass. +</p> +<h3>Derived from</h3> +QAbstractGraphicsShapeItem +<h3>Class Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr> +<td><a href="#E5ArrowItem.__init__">E5ArrowItem</a></td> +<td>Constructor</td> +</tr><tr> +<td><a href="#E5ArrowItem.boundingRect">boundingRect</a></td> +<td>Public method to return the bounding rectangle.</td> +</tr><tr> +<td><a href="#E5ArrowItem.paint">paint</a></td> +<td>Public method to paint the item in local coordinates.</td> +</tr><tr> +<td><a href="#E5ArrowItem.setEndPoint">setEndPoint</a></td> +<td>Public method to set the end point.</td> +</tr><tr> +<td><a href="#E5ArrowItem.setPoints">setPoints</a></td> +<td>Public method to set the start and end points of the line.</td> +</tr><tr> +<td><a href="#E5ArrowItem.setStartPoint">setStartPoint</a></td> +<td>Public method to set the start point.</td> +</tr> +</table> +<a NAME="E5ArrowItem.__init__" ID="E5ArrowItem.__init__"></a> +<h4>E5ArrowItem (Constructor)</h4> +<b>E5ArrowItem</b>(<i>origin = QPointF(), end = QPointF(), filled = False, type = NormalArrow, parent = None</i>) +<p> + Constructor +</p><dl> +<dt><i>origin</i></dt> +<dd> +origin of the arrow (QPointF) +</dd><dt><i>end</i></dt> +<dd> +end point of the arrow (QPointF) +</dd><dt><i>filled</i></dt> +<dd> +flag indicating a filled arrow head (boolean) +</dd><dt><i>type</i></dt> +<dd> +arrow type (NormalArrow, WideArrow) +</dd><dt><i>parent=</i></dt> +<dd> +reference to the parent object (QGraphicsItem) +</dd> +</dl><a NAME="E5ArrowItem.boundingRect" ID="E5ArrowItem.boundingRect"></a> +<h4>E5ArrowItem.boundingRect</h4> +<b>boundingRect</b>(<i></i>) +<p> + Public method to return the bounding rectangle. +</p><dl> +<dt>Returns:</dt> +<dd> +bounding rectangle (QRectF) +</dd> +</dl><a NAME="E5ArrowItem.paint" ID="E5ArrowItem.paint"></a> +<h4>E5ArrowItem.paint</h4> +<b>paint</b>(<i>painter, option, widget = None</i>) +<p> + Public method to paint the item in local coordinates. +</p><dl> +<dt><i>painter</i></dt> +<dd> +reference to the painter object (QPainter) +</dd><dt><i>option</i></dt> +<dd> +style options (QStyleOptionGraphicsItem) +</dd><dt><i>widget</i></dt> +<dd> +optional reference to the widget painted on (QWidget) +</dd> +</dl><a NAME="E5ArrowItem.setEndPoint" ID="E5ArrowItem.setEndPoint"></a> +<h4>E5ArrowItem.setEndPoint</h4> +<b>setEndPoint</b>(<i>x, y</i>) +<p> + Public method to set the end point. +</p><p> + <b>Note:</b> This method does not redraw the item. +</p><dl> +<dt><i>x</i></dt> +<dd> +x-coordinate of the end point (float) +</dd><dt><i>y</i></dt> +<dd> +y-coordinate of the end point (float) +</dd> +</dl><a NAME="E5ArrowItem.setPoints" ID="E5ArrowItem.setPoints"></a> +<h4>E5ArrowItem.setPoints</h4> +<b>setPoints</b>(<i>xa, ya, xb, yb</i>) +<p> + Public method to set the start and end points of the line. +</p><p> + <b>Note:</b> This method does not redraw the item. +</p><dl> +<dt><i>xa</i></dt> +<dd> +x-coordinate of the start point (float) +</dd><dt><i>ya</i></dt> +<dd> +y-coordinate of the start point (float) +</dd><dt><i>xb</i></dt> +<dd> +x-coordinate of the end point (float) +</dd><dt><i>yb</i></dt> +<dd> +y-coordinate of the end point (float) +</dd> +</dl><a NAME="E5ArrowItem.setStartPoint" ID="E5ArrowItem.setStartPoint"></a> +<h4>E5ArrowItem.setStartPoint</h4> +<b>setStartPoint</b>(<i>x, y</i>) +<p> + Public method to set the start point. +</p><p> + <b>Note:</b> This method does not redraw the item. +</p><dl> +<dt><i>x</i></dt> +<dd> +x-coordinate of the start point (float) +</dd><dt><i>y</i></dt> +<dd> +y-coordinate of the start point (float) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +</body></html> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Documentation/Source/eric5.E5Graphics.E5GraphicsView.html Tue Jan 12 18:04:41 2010 +0000 @@ -0,0 +1,276 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' +'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> +<html><head> +<title>eric5.E5Graphics.E5GraphicsView</title> +<style> +body { + background:white; + margin: 0em 1em 10em 1em; + color: black; +} + +h1 { color: white; background: #4FA4FF; } +h2 { color: white; background: #4FA4FF; } +h3 { color: white; background: #00557F; } +h4 { color: white; background: #00557F; } + +a { color: #AA5500; } + +</style> +</head> +<body><a NAME="top" ID="top"></a> +<h1>eric5.E5Graphics.E5GraphicsView</h1> +<p> +Module implementing a canvas view class. +</p> +<h3>Global Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Classes</h3> +<table> +<tr> +<td><a href="#E5GraphicsView">E5GraphicsView</a></td> +<td>Class implementing a graphics view.</td> +</tr> +</table> +<h3>Functions</h3> +<table> +<tr><td>None</td></tr> +</table> +<hr /><hr /> +<a NAME="E5GraphicsView" ID="E5GraphicsView"></a> +<h2>E5GraphicsView</h2> +<p> + Class implementing a graphics view. +</p> +<h3>Derived from</h3> +QGraphicsView +<h3>Class Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr> +<td><a href="#E5GraphicsView.__init__">E5GraphicsView</a></td> +<td>Constructor</td> +</tr><tr> +<td><a href="#E5GraphicsView.__getDiagram">__getDiagram</a></td> +<td>Private method to retrieve the diagram from the scene fitting it in the minimum rectangle.</td> +</tr><tr> +<td><a href="#E5GraphicsView._getDiagramRect">_getDiagramRect</a></td> +<td>Protected method to calculate the minimum rectangle fitting the diagram.</td> +</tr><tr> +<td><a href="#E5GraphicsView._getDiagramSize">_getDiagramSize</a></td> +<td>Protected method to calculate the minimum size fitting the diagram.</td> +</tr><tr> +<td><a href="#E5GraphicsView.filteredItems">filteredItems</a></td> +<td>Public method to filter a list of items.</td> +</tr><tr> +<td><a href="#E5GraphicsView.printDiagram">printDiagram</a></td> +<td>Public method to print the diagram.</td> +</tr><tr> +<td><a href="#E5GraphicsView.resizeScene">resizeScene</a></td> +<td>Public method to resize the scene.</td> +</tr><tr> +<td><a href="#E5GraphicsView.saveImage">saveImage</a></td> +<td>Public method to save the scene to a file.</td> +</tr><tr> +<td><a href="#E5GraphicsView.setSceneSize">setSceneSize</a></td> +<td>Public method to set the scene size.</td> +</tr><tr> +<td><a href="#E5GraphicsView.setZoom">setZoom</a></td> +<td>Public method to set the zoom factor.</td> +</tr><tr> +<td><a href="#E5GraphicsView.zoom">zoom</a></td> +<td>Public method to get the current zoom factor.</td> +</tr><tr> +<td><a href="#E5GraphicsView.zoomIn">zoomIn</a></td> +<td>Public method to zoom in.</td> +</tr><tr> +<td><a href="#E5GraphicsView.zoomOut">zoomOut</a></td> +<td>Public method to zoom out.</td> +</tr><tr> +<td><a href="#E5GraphicsView.zoomReset">zoomReset</a></td> +<td>Public method to handle the reset zoom context menu entry.</td> +</tr> +</table> +<a NAME="E5GraphicsView.__init__" ID="E5GraphicsView.__init__"></a> +<h4>E5GraphicsView (Constructor)</h4> +<b>E5GraphicsView</b>(<i>scene, parent = None</i>) +<p> + Constructor +</p><dl> +<dt><i>scene</i></dt> +<dd> +reference to the scene object (QGraphicsScene) +</dd><dt><i>parent</i></dt> +<dd> +parent widget (QWidget) +</dd> +</dl><a NAME="E5GraphicsView.__getDiagram" ID="E5GraphicsView.__getDiagram"></a> +<h4>E5GraphicsView.__getDiagram</h4> +<b>__getDiagram</b>(<i>rect, format = "PNG", filename = None</i>) +<p> + Private method to retrieve the diagram from the scene fitting it + in the minimum rectangle. +</p><dl> +<dt><i>rect</i></dt> +<dd> +minimum rectangle fitting the diagram (QRectF) +</dd><dt><i>format</i></dt> +<dd> +format for the image file (string) +</dd><dt><i>filename</i></dt> +<dd> +name of the file for non pixmaps (string) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +diagram pixmap to receive the diagram (QPixmap) +</dd> +</dl><a NAME="E5GraphicsView._getDiagramRect" ID="E5GraphicsView._getDiagramRect"></a> +<h4>E5GraphicsView._getDiagramRect</h4> +<b>_getDiagramRect</b>(<i>border = 0</i>) +<p> + Protected method to calculate the minimum rectangle fitting the diagram. +</p><dl> +<dt><i>border</i></dt> +<dd> +border width to include in the calculation (integer) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +the minimum rectangle (QRectF) +</dd> +</dl><a NAME="E5GraphicsView._getDiagramSize" ID="E5GraphicsView._getDiagramSize"></a> +<h4>E5GraphicsView._getDiagramSize</h4> +<b>_getDiagramSize</b>(<i>border = 0</i>) +<p> + Protected method to calculate the minimum size fitting the diagram. +</p><dl> +<dt><i>border</i></dt> +<dd> +border width to include in the calculation (integer) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +the minimum size (QSizeF) +</dd> +</dl><a NAME="E5GraphicsView.filteredItems" ID="E5GraphicsView.filteredItems"></a> +<h4>E5GraphicsView.filteredItems</h4> +<b>filteredItems</b>(<i>items</i>) +<p> + Public method to filter a list of items. +</p><dl> +<dt><i>items</i></dt> +<dd> +list of items as returned by the scene object + (QGraphicsItem) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +list of interesting collision items (QGraphicsItem) +</dd> +</dl><a NAME="E5GraphicsView.printDiagram" ID="E5GraphicsView.printDiagram"></a> +<h4>E5GraphicsView.printDiagram</h4> +<b>printDiagram</b>(<i>printer, diagramName = ""</i>) +<p> + Public method to print the diagram. +</p><dl> +<dt><i>printer</i></dt> +<dd> +reference to a ready configured printer object (QPrinter) +</dd><dt><i>diagramName</i></dt> +<dd> +name of the diagram (string) +</dd> +</dl><a NAME="E5GraphicsView.resizeScene" ID="E5GraphicsView.resizeScene"></a> +<h4>E5GraphicsView.resizeScene</h4> +<b>resizeScene</b>(<i>amount, isWidth = True</i>) +<p> + Public method to resize the scene. +</p><dl> +<dt><i>isWidth</i></dt> +<dd> +flag indicating width is to be resized (boolean) +</dd><dt><i>amount</i></dt> +<dd> +size increment (integer) +</dd> +</dl><a NAME="E5GraphicsView.saveImage" ID="E5GraphicsView.saveImage"></a> +<h4>E5GraphicsView.saveImage</h4> +<b>saveImage</b>(<i>filename, format = "PNG"</i>) +<p> + Public method to save the scene to a file. +</p><dl> +<dt><i>filename</i></dt> +<dd> +name of the file to write the image to (string) +</dd><dt><i>format</i></dt> +<dd> +format for the image file (string) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +flag indicating success (boolean) +</dd> +</dl><a NAME="E5GraphicsView.setSceneSize" ID="E5GraphicsView.setSceneSize"></a> +<h4>E5GraphicsView.setSceneSize</h4> +<b>setSceneSize</b>(<i>width, height</i>) +<p> + Public method to set the scene size. +</p><dl> +<dt><i>width</i></dt> +<dd> +width for the scene (integer) +</dd><dt><i>height</i></dt> +<dd> +height for the scene (integer) +</dd> +</dl><a NAME="E5GraphicsView.setZoom" ID="E5GraphicsView.setZoom"></a> +<h4>E5GraphicsView.setZoom</h4> +<b>setZoom</b>(<i>zoomFactor</i>) +<p> + Public method to set the zoom factor. +</p><dl> +<dt><i>zoomFactor</i></dt> +<dd> +new zoom factor (float) +</dd> +</dl><a NAME="E5GraphicsView.zoom" ID="E5GraphicsView.zoom"></a> +<h4>E5GraphicsView.zoom</h4> +<b>zoom</b>(<i></i>) +<p> + Public method to get the current zoom factor. +</p><dl> +<dt>Returns:</dt> +<dd> +current zoom factor (float) +</dd> +</dl><a NAME="E5GraphicsView.zoomIn" ID="E5GraphicsView.zoomIn"></a> +<h4>E5GraphicsView.zoomIn</h4> +<b>zoomIn</b>(<i></i>) +<p> + Public method to zoom in. +</p><a NAME="E5GraphicsView.zoomOut" ID="E5GraphicsView.zoomOut"></a> +<h4>E5GraphicsView.zoomOut</h4> +<b>zoomOut</b>(<i></i>) +<p> + Public method to zoom out. +</p><a NAME="E5GraphicsView.zoomReset" ID="E5GraphicsView.zoomReset"></a> +<h4>E5GraphicsView.zoomReset</h4> +<b>zoomReset</b>(<i></i>) +<p> + Public method to handle the reset zoom context menu entry. +</p> +<div align="right"><a href="#top">Up</a></div> +<hr /> +</body></html> \ No newline at end of file
--- a/Documentation/Source/eric5.Graphics.AssociationItem.html Tue Jan 12 17:55:24 2010 +0000 +++ b/Documentation/Source/eric5.Graphics.AssociationItem.html Tue Jan 12 18:04:41 2010 +0000 @@ -49,7 +49,7 @@ ending at the second. </p> <h3>Derived from</h3> -E4ArrowItem +E5ArrowItem <h3>Class Attributes</h3> <table> <tr><td>None</td></tr>
--- a/Documentation/Source/eric5.Graphics.UMLGraphicsView.html Tue Jan 12 17:55:24 2010 +0000 +++ b/Documentation/Source/eric5.Graphics.UMLGraphicsView.html Tue Jan 12 18:04:41 2010 +0000 @@ -22,7 +22,7 @@ <body><a NAME="top" ID="top"></a> <h1>eric5.Graphics.UMLGraphicsView</h1> <p> -Module implementing a subclass of E4GraphicsView for our diagrams. +Module implementing a subclass of E5GraphicsView for our diagrams. </p> <h3>Global Attributes</h3> <table> @@ -32,7 +32,7 @@ <table> <tr> <td><a href="#UMLGraphicsView">UMLGraphicsView</a></td> -<td>Class implementing a specialized E4GraphicsView for our diagrams.</td> +<td>Class implementing a specialized E5GraphicsView for our diagrams.</td> </tr> </table> <h3>Functions</h3> @@ -43,7 +43,7 @@ <a NAME="UMLGraphicsView" ID="UMLGraphicsView"></a> <h2>UMLGraphicsView</h2> <p> - Class implementing a specialized E4GraphicsView for our diagrams. + Class implementing a specialized E5GraphicsView for our diagrams. </p><h4>Signals</h4> <dl> <dt>relayout()</dt> @@ -53,7 +53,7 @@ </dd> </dl> <h3>Derived from</h3> -E4GraphicsView +E5GraphicsView <h3>Class Attributes</h3> <table> <tr><td>None</td></tr>
--- a/Documentation/Source/index-eric5.E4Graphics.html Tue Jan 12 17:55:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' -'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> -<html><head> -<title>eric5.E4Graphics</title> -<style> -body { - background:white; - margin: 0em 1em 10em 1em; - color: black; -} - -h1 { color: white; background: #4FA4FF; } -h2 { color: white; background: #4FA4FF; } -h3 { color: white; background: #00557F; } -h4 { color: white; background: #00557F; } - -a { color: #AA5500; } - -</style> -</head> -<body> -<h1>eric5.E4Graphics</h1> -<p> -Package implementing some QGraphicsView related general purpoe classes. -</p> - - -<h3>Modules</h3> -<table> -<tr> -<td><a href="eric5.E4Graphics.E4ArrowItem.html">E4ArrowItem</a></td> -<td>Module implementing a graphics item subclass for an arrow.</td> -</tr><tr> -<td><a href="eric5.E4Graphics.E4GraphicsView.html">E4GraphicsView</a></td> -<td>Module implementing a canvas view class.</td> -</tr> -</table> -</body></html> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Documentation/Source/index-eric5.E5Graphics.html Tue Jan 12 18:04:41 2010 +0000 @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' +'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> +<html><head> +<title>eric5.E5Graphics</title> +<style> +body { + background:white; + margin: 0em 1em 10em 1em; + color: black; +} + +h1 { color: white; background: #4FA4FF; } +h2 { color: white; background: #4FA4FF; } +h3 { color: white; background: #00557F; } +h4 { color: white; background: #00557F; } + +a { color: #AA5500; } + +</style> +</head> +<body> +<h1>eric5.E5Graphics</h1> +<p> +Package implementing some QGraphicsView related general purpoe classes. +</p> + + +<h3>Modules</h3> +<table> +<tr> +<td><a href="eric5.E5Graphics.E5ArrowItem.html">E5ArrowItem</a></td> +<td>Module implementing a graphics item subclass for an arrow.</td> +</tr><tr> +<td><a href="eric5.E5Graphics.E5GraphicsView.html">E5GraphicsView</a></td> +<td>Module implementing a canvas view class.</td> +</tr> +</table> +</body></html> \ No newline at end of file
--- a/Documentation/Source/index-eric5.Graphics.html Tue Jan 12 17:55:24 2010 +0000 +++ b/Documentation/Source/index-eric5.Graphics.html Tue Jan 12 18:04:41 2010 +0000 @@ -68,7 +68,7 @@ <td>Module implementing a dialog showing UML like diagrams.</td> </tr><tr> <td><a href="eric5.Graphics.UMLGraphicsView.html">UMLGraphicsView</a></td> -<td>Module implementing a subclass of E4GraphicsView for our diagrams.</td> +<td>Module implementing a subclass of E5GraphicsView for our diagrams.</td> </tr><tr> <td><a href="eric5.Graphics.UMLItem.html">UMLItem</a></td> <td>Module implementing the UMLWidget base class.</td>
--- a/Documentation/Source/index-eric5.html Tue Jan 12 17:55:24 2010 +0000 +++ b/Documentation/Source/index-eric5.html Tue Jan 12 18:04:41 2010 +0000 @@ -43,15 +43,15 @@ <td><a href="index-eric5.DocumentationTools.html">DocumentationTools</a></td> <td>Package implementing the source code documentation tools.</td> </tr><tr> -<td><a href="index-eric5.E4Graphics.html">E4Graphics</a></td> -<td>Package implementing some QGraphicsView related general purpoe classes.</td> -</tr><tr> <td><a href="index-eric5.E4Gui.html">E4Gui</a></td> <td>Package implementing some special GUI elements.</td> </tr><tr> <td><a href="index-eric5.E4Network.html">E4Network</a></td> <td>Package implementing some special network related objects.</td> </tr><tr> +<td><a href="index-eric5.E5Graphics.html">E5Graphics</a></td> +<td>Package implementing some QGraphicsView related general purpoe classes.</td> +</tr><tr> <td><a href="index-eric5.E5XML.html">E5XML</a></td> <td>Package implementing the XML handling module of eric5.</td> </tr><tr>
--- a/E4Graphics/E4ArrowItem.py Tue Jan 12 17:55:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,135 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2007 - 2010 Detlev Offenbach <detlev@die-offenbachs.de> -# - -""" -Module implementing a graphics item subclass for an arrow. -""" - -from math import * - -from PyQt4.QtCore import * -from PyQt4.QtGui import * - -NormalArrow = 1 -WideArrow = 2 - -ArrowheadAngleFactor = 0.26179938779914941 # 0.5 * atan(sqrt(3.0) / 3.0) - -class E4ArrowItem(QAbstractGraphicsShapeItem): - """ - Class implementing an arrow graphics item subclass. - """ - def __init__(self, origin = QPointF(), end = QPointF(), - filled = False, type = NormalArrow, parent = None): - """ - Constructor - - @param origin origin of the arrow (QPointF) - @param end end point of the arrow (QPointF) - @param filled flag indicating a filled arrow head (boolean) - @param type arrow type (NormalArrow, WideArrow) - @keyparam parent reference to the parent object (QGraphicsItem) - """ - QAbstractGraphicsShapeItem.__init__(self, parent) - - self._origin = origin - self._end = end - self._filled = filled - self._type = type - - self._halfLength = 13.0 - - self.setFlag(QGraphicsItem.ItemIsMovable, True) - self.setFlag(QGraphicsItem.ItemIsSelectable, True) - - def setPoints(self, xa, ya, xb, yb): - """ - Public method to set the start and end points of the line. - - <b>Note:</b> This method does not redraw the item. - - @param xa x-coordinate of the start point (float) - @param ya y-coordinate of the start point (float) - @param xb x-coordinate of the end point (float) - @param yb y-coordinate of the end point (float) - """ - self._origin = QPointF(xa, ya) - self._end = QPointF(xb, yb) - - def setStartPoint(self, x, y): - """ - Public method to set the start point. - - <b>Note:</b> This method does not redraw the item. - - @param x x-coordinate of the start point (float) - @param y y-coordinate of the start point (float) - """ - self._origin = QPointF(x, y) - - def setEndPoint(self, x, y): - """ - Public method to set the end point. - - <b>Note:</b> This method does not redraw the item. - - @param x x-coordinate of the end point (float) - @param y y-coordinate of the end point (float) - """ - self._end = QPointF(x, y) - - def boundingRect(self): - """ - Public method to return the bounding rectangle. - - @return bounding rectangle (QRectF) - """ - extra = self._halfLength / 2.0 - return QRectF(self._origin, QSizeF(self._end.x() - self._origin.x(), - self._end.y() - self._origin.y()))\ - .normalized()\ - .adjusted(-extra, -extra, extra, extra) - - def paint(self, painter, option, widget = None): - """ - Public method to paint the item in local coordinates. - - @param painter reference to the painter object (QPainter) - @param option style options (QStyleOptionGraphicsItem) - @param widget optional reference to the widget painted on (QWidget) - """ - if (option.state & QStyle.State_Selected) == QStyle.State(QStyle.State_Selected): - width = 2 - else: - width = 1 - - # draw the line first - line = QLineF(self._origin, self._end) - painter.setPen(QPen(Qt.black, width, Qt.SolidLine, Qt.FlatCap, Qt.MiterJoin)) - painter.drawLine(line) - - # draw the arrow head - arrowAngle = self._type * ArrowheadAngleFactor - slope = atan2(line.dy(), line.dx()) - - # Calculate left arrow point - arrowSlope = slope + arrowAngle - a1 = QPointF(self._end.x() - self._halfLength * cos(arrowSlope), - self._end.y() - self._halfLength * sin(arrowSlope)) - - # Calculate right arrow point - arrowSlope = slope - arrowAngle - a2 = QPointF(self._end.x() - self._halfLength * cos(arrowSlope), - self._end.y() - self._halfLength * sin(arrowSlope)) - - if self._filled: - painter.setBrush(Qt.black) - else: - painter.setBrush(Qt.white) - polygon = QPolygonF() - polygon.append(line.p2()) - polygon.append(a1) - polygon.append(a2) - painter.drawPolygon(polygon)
--- a/E4Graphics/E4GraphicsView.py Tue Jan 12 17:55:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,342 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2007 - 2010 Detlev Offenbach <detlev@die-offenbachs.de> -# - -""" -Module implementing a canvas view class. -""" - -import sys - -from PyQt4.QtCore import * -from PyQt4.QtGui import * - -import Preferences - -class E4GraphicsView(QGraphicsView): - """ - Class implementing a graphics view. - """ - def __init__(self, scene, parent = None): - """ - Constructor - - @param scene reference to the scene object (QGraphicsScene) - @param parent parent widget (QWidget) - """ - QGraphicsView.__init__(self, scene, parent) - self.setObjectName("E4GraphicsView") - - self.setBackgroundBrush(QBrush(Qt.white)) - self.setRenderHint(QPainter.Antialiasing, True) - self.setDragMode(QGraphicsView.RubberBandDrag) - self.setAlignment(Qt.Alignment(Qt.AlignLeft | Qt.AlignTop)) - self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOn) - self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn) - - # available as of Qt 4.3 - try: - self.setViewportUpdateMode(QGraphicsView.SmartViewportUpdate) - except AttributeError: - pass - - self.setWhatsThis(self.trUtf8("<b>Graphics View</b>\n" - "<p>This graphics view is used to show a diagram. \n" - "There are various actions available to manipulate the \n" - "shown items.</p>\n" - "<ul>\n" - "<li>Clicking on an item selects it.</li>\n" - "<li>Ctrl-clicking adds an item to the selection.</li>\n" - "<li>Ctrl-clicking a selected item deselects it.</li>\n" - "<li>Clicking on an empty spot of the canvas resets the selection.</li>\n" - "<li>Dragging the mouse over the canvas spans a rubberband to \n" - "select multiple items.</li>\n" - "<li>Dragging the mouse over a selected item moves the \n" - "whole selection.</li>\n" - "</ul>\n" - )) - - def zoomIn(self): - """ - Public method to zoom in. - """ - self.scale(1.25, 1.25) - - def zoomOut(self): - """ - Public method to zoom out. - """ - self.scale(0.8, 0.8) - - def zoomReset(self): - """ - Public method to handle the reset zoom context menu entry. - """ - self.resetMatrix() - - def setZoom(self, zoomFactor): - """ - Public method to set the zoom factor. - - @param zoomFactor new zoom factor (float) - """ - self.zoomReset() - self.scale(zoomFactor, zoomFactor) - - def zoom(self): - """ - Public method to get the current zoom factor. - - @return current zoom factor (float) - """ - return self.matrix().m11() - - def resizeScene(self, amount, isWidth = True): - """ - Public method to resize the scene. - - @param isWidth flag indicating width is to be resized (boolean) - @param amount size increment (integer) - """ - sceneRect = self.scene().sceneRect() - width = sceneRect.width() - height = sceneRect.height() - if isWidth: - width += amount - else: - height += amount - rect = self._getDiagramRect(10) - if width < rect.width(): - width = rect.width() - if height < rect.height(): - height = rect.height() - - self.setSceneSize(width, height) - - def setSceneSize(self, width, height): - """ - Public method to set the scene size. - - @param width width for the scene (integer) - @param height height for the scene (integer) - """ - rect = self.scene().sceneRect() - rect.setHeight(height) - rect.setWidth(width) - self.setSceneRect(rect) - - def _getDiagramRect(self, border = 0): - """ - Protected method to calculate the minimum rectangle fitting the diagram. - - @param border border width to include in the calculation (integer) - @return the minimum rectangle (QRectF) - """ - startx = sys.maxsize - starty = sys.maxsize - endx = 0 - endy = 0 - items = self.filteredItems(list(self.scene().items())) - for itm in items: - rect = itm.sceneBoundingRect() - itmEndX = rect.x() + rect.width() - itmEndY = rect.y()+ rect.height() - itmStartX = rect.x() - itmStartY = rect.y() - if startx >= itmStartX: - startx = itmStartX - if starty >= itmStartY: - starty = itmStartY - if endx <= itmEndX: - endx = itmEndX - if endy <= itmEndY: - endy = itmEndY - if border: - startx -= border - starty -= border - endx += border - endy += border - - return QRectF(startx, starty, endx - startx + 1, endy - starty + 1) - - def _getDiagramSize(self, border = 0): - """ - Protected method to calculate the minimum size fitting the diagram. - - @param border border width to include in the calculation (integer) - @return the minimum size (QSizeF) - """ - endx = 0 - endy = 0 - items = self.filteredItems(list(self.scene().items())) - for itm in items: - rect = itm.sceneBoundingRect() - itmEndX = rect.x() + rect.width() - itmEndY = rect.y()+ rect.height() - if endx <= itmEndX: - endx = itmEndX - if endy <= itmEndY: - endy = itmEndY - if border: - endx += border - endy += border - - return QSizeF(endx + 1, endy + 1) - - def __getDiagram(self, rect, format = "PNG", filename = None): - """ - Private method to retrieve the diagram from the scene fitting it - in the minimum rectangle. - - @param rect minimum rectangle fitting the diagram (QRectF) - @param format format for the image file (string) - @param filename name of the file for non pixmaps (string) - @return diagram pixmap to receive the diagram (QPixmap) - """ - selectedItems = self.scene().selectedItems() - - # step 1: deselect all widgets - if selectedItems: - for item in selectedItems: - item.setSelected(False) - - # step 2: grab the diagram - if format == "PNG": - paintDevice = QPixmap(int(rect.width()), int(rect.height())) - paintDevice.fill(self.backgroundBrush().color()) - else: - from PyQt4.QtSvg import QSvgGenerator - paintDevice = QSvgGenerator() - paintDevice.setResolution(100) # 100 dpi - paintDevice.setSize(QSize(int(rect.width()), int(rect.height()))) - paintDevice.setFileName(filename) - painter = QPainter(paintDevice) - painter.setRenderHint(QPainter.Antialiasing, True) - self.scene().render(painter, QRectF(), rect) - - # step 3: reselect the widgets - if selectedItems: - for item in selectedItems: - item.setSelected(True) - - return paintDevice - - def saveImage(self, filename, format = "PNG"): - """ - Public method to save the scene to a file. - - @param filename name of the file to write the image to (string) - @param format format for the image file (string) - @return flag indicating success (boolean) - """ - rect = self._getDiagramRect(self.border) - if format == "SVG": - svg = self.__getDiagram(rect, format = format, filename = filename) - return True - else: - pixmap = self.__getDiagram(rect) - return pixmap.save(filename, format) - - def printDiagram(self, printer, diagramName = ""): - """ - Public method to print the diagram. - - @param printer reference to a ready configured printer object (QPrinter) - @param diagramName name of the diagram (string) - """ - painter = QPainter() - painter.begin(printer) - offsetX = 0 - offsetY = 0 - widthX = 0 - heightY = 0 - font = QFont("times", 10) - painter.setFont(font) - fm = painter.fontMetrics() - fontHeight = fm.lineSpacing() - marginX = printer.pageRect().x() - printer.paperRect().x() - marginX = \ - Preferences.getPrinter("LeftMargin") * int(printer.resolution() / 2.54) \ - - marginX - marginY = printer.pageRect().y() - printer.paperRect().y() - marginY = \ - Preferences.getPrinter("TopMargin") * int(printer.resolution() / 2.54) \ - - marginY - - width = printer.width() - marginX \ - - Preferences.getPrinter("RightMargin") * int(printer.resolution() / 2.54) - height = printer.height() - fontHeight - 4 - marginY \ - - Preferences.getPrinter("BottomMargin") * int(printer.resolution() / 2.54) - - border = self.border == 0 and 5 or self.border - rect = self._getDiagramRect(border) - diagram = self.__getDiagram(rect) - - finishX = False - finishY = False - page = 0 - pageX = 0 - pageY = 1 - while not finishX or not finishY: - if not finishX: - offsetX = pageX * width - pageX += 1 - elif not finishY: - offsetY = pageY * height - offsetX = 0 - pageY += 1 - finishX = False - pageX = 1 - if (width + offsetX) > diagram.width(): - finishX = True - widthX = diagram.width() - offsetX - else: - widthX = width - if diagram.width() < width: - widthX = diagram.width() - finishX = True - offsetX = 0 - if (height + offsetY) > diagram.height(): - finishY = True - heightY = diagram.height() - offsetY - else: - heightY = height - if diagram.height() < height: - finishY = True - heightY = diagram.height() - offsetY = 0 - - painter.drawPixmap(marginX, marginY, diagram, - offsetX, offsetY, widthX, heightY) - # write a foot note - s = self.trUtf8("Diagram: {0}, Page {1}").format(diagramName, page + 1) - tc = QColor(50, 50, 50) - painter.setPen(tc) - painter.drawRect(marginX, marginY, width, height) - painter.drawLine(marginX, marginY + height + 2, - marginX + width, marginY + height + 2) - painter.setFont(font) - painter.drawText(marginX, marginY + height + 4, width, - fontHeight, Qt.AlignRight, s) - if not finishX or not finishY: - printer.newPage() - page += 1 - - painter.end() - - ############################################################################ - ## The methods below should be overridden by subclasses to get special - ## behavior. - ############################################################################ - - def filteredItems(self, items): - """ - Public method to filter a list of items. - - @param items list of items as returned by the scene object - (QGraphicsItem) - @return list of interesting collision items (QGraphicsItem) - """ - # just return the list unchanged - return items
--- a/E4Graphics/__init__.py Tue Jan 12 17:55:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2007 - 2010 Detlev Offenbach <detlev@die-offenbachs.de> -# - -""" -Package implementing some QGraphicsView related general purpoe classes. -"""
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/E5Graphics/E5ArrowItem.py Tue Jan 12 18:04:41 2010 +0000 @@ -0,0 +1,135 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2007 - 2010 Detlev Offenbach <detlev@die-offenbachs.de> +# + +""" +Module implementing a graphics item subclass for an arrow. +""" + +from math import * + +from PyQt4.QtCore import * +from PyQt4.QtGui import * + +NormalArrow = 1 +WideArrow = 2 + +ArrowheadAngleFactor = 0.26179938779914941 # 0.5 * atan(sqrt(3.0) / 3.0) + +class E5ArrowItem(QAbstractGraphicsShapeItem): + """ + Class implementing an arrow graphics item subclass. + """ + def __init__(self, origin = QPointF(), end = QPointF(), + filled = False, type = NormalArrow, parent = None): + """ + Constructor + + @param origin origin of the arrow (QPointF) + @param end end point of the arrow (QPointF) + @param filled flag indicating a filled arrow head (boolean) + @param type arrow type (NormalArrow, WideArrow) + @keyparam parent reference to the parent object (QGraphicsItem) + """ + QAbstractGraphicsShapeItem.__init__(self, parent) + + self._origin = origin + self._end = end + self._filled = filled + self._type = type + + self._halfLength = 13.0 + + self.setFlag(QGraphicsItem.ItemIsMovable, True) + self.setFlag(QGraphicsItem.ItemIsSelectable, True) + + def setPoints(self, xa, ya, xb, yb): + """ + Public method to set the start and end points of the line. + + <b>Note:</b> This method does not redraw the item. + + @param xa x-coordinate of the start point (float) + @param ya y-coordinate of the start point (float) + @param xb x-coordinate of the end point (float) + @param yb y-coordinate of the end point (float) + """ + self._origin = QPointF(xa, ya) + self._end = QPointF(xb, yb) + + def setStartPoint(self, x, y): + """ + Public method to set the start point. + + <b>Note:</b> This method does not redraw the item. + + @param x x-coordinate of the start point (float) + @param y y-coordinate of the start point (float) + """ + self._origin = QPointF(x, y) + + def setEndPoint(self, x, y): + """ + Public method to set the end point. + + <b>Note:</b> This method does not redraw the item. + + @param x x-coordinate of the end point (float) + @param y y-coordinate of the end point (float) + """ + self._end = QPointF(x, y) + + def boundingRect(self): + """ + Public method to return the bounding rectangle. + + @return bounding rectangle (QRectF) + """ + extra = self._halfLength / 2.0 + return QRectF(self._origin, QSizeF(self._end.x() - self._origin.x(), + self._end.y() - self._origin.y()))\ + .normalized()\ + .adjusted(-extra, -extra, extra, extra) + + def paint(self, painter, option, widget = None): + """ + Public method to paint the item in local coordinates. + + @param painter reference to the painter object (QPainter) + @param option style options (QStyleOptionGraphicsItem) + @param widget optional reference to the widget painted on (QWidget) + """ + if (option.state & QStyle.State_Selected) == QStyle.State(QStyle.State_Selected): + width = 2 + else: + width = 1 + + # draw the line first + line = QLineF(self._origin, self._end) + painter.setPen(QPen(Qt.black, width, Qt.SolidLine, Qt.FlatCap, Qt.MiterJoin)) + painter.drawLine(line) + + # draw the arrow head + arrowAngle = self._type * ArrowheadAngleFactor + slope = atan2(line.dy(), line.dx()) + + # Calculate left arrow point + arrowSlope = slope + arrowAngle + a1 = QPointF(self._end.x() - self._halfLength * cos(arrowSlope), + self._end.y() - self._halfLength * sin(arrowSlope)) + + # Calculate right arrow point + arrowSlope = slope - arrowAngle + a2 = QPointF(self._end.x() - self._halfLength * cos(arrowSlope), + self._end.y() - self._halfLength * sin(arrowSlope)) + + if self._filled: + painter.setBrush(Qt.black) + else: + painter.setBrush(Qt.white) + polygon = QPolygonF() + polygon.append(line.p2()) + polygon.append(a1) + polygon.append(a2) + painter.drawPolygon(polygon) \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/E5Graphics/E5GraphicsView.py Tue Jan 12 18:04:41 2010 +0000 @@ -0,0 +1,342 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2007 - 2010 Detlev Offenbach <detlev@die-offenbachs.de> +# + +""" +Module implementing a canvas view class. +""" + +import sys + +from PyQt4.QtCore import * +from PyQt4.QtGui import * + +import Preferences + +class E5GraphicsView(QGraphicsView): + """ + Class implementing a graphics view. + """ + def __init__(self, scene, parent = None): + """ + Constructor + + @param scene reference to the scene object (QGraphicsScene) + @param parent parent widget (QWidget) + """ + QGraphicsView.__init__(self, scene, parent) + self.setObjectName("E5GraphicsView") + + self.setBackgroundBrush(QBrush(Qt.white)) + self.setRenderHint(QPainter.Antialiasing, True) + self.setDragMode(QGraphicsView.RubberBandDrag) + self.setAlignment(Qt.Alignment(Qt.AlignLeft | Qt.AlignTop)) + self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOn) + self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn) + + # available as of Qt 4.3 + try: + self.setViewportUpdateMode(QGraphicsView.SmartViewportUpdate) + except AttributeError: + pass + + self.setWhatsThis(self.trUtf8("<b>Graphics View</b>\n" + "<p>This graphics view is used to show a diagram. \n" + "There are various actions available to manipulate the \n" + "shown items.</p>\n" + "<ul>\n" + "<li>Clicking on an item selects it.</li>\n" + "<li>Ctrl-clicking adds an item to the selection.</li>\n" + "<li>Ctrl-clicking a selected item deselects it.</li>\n" + "<li>Clicking on an empty spot of the canvas resets the selection.</li>\n" + "<li>Dragging the mouse over the canvas spans a rubberband to \n" + "select multiple items.</li>\n" + "<li>Dragging the mouse over a selected item moves the \n" + "whole selection.</li>\n" + "</ul>\n" + )) + + def zoomIn(self): + """ + Public method to zoom in. + """ + self.scale(1.25, 1.25) + + def zoomOut(self): + """ + Public method to zoom out. + """ + self.scale(0.8, 0.8) + + def zoomReset(self): + """ + Public method to handle the reset zoom context menu entry. + """ + self.resetMatrix() + + def setZoom(self, zoomFactor): + """ + Public method to set the zoom factor. + + @param zoomFactor new zoom factor (float) + """ + self.zoomReset() + self.scale(zoomFactor, zoomFactor) + + def zoom(self): + """ + Public method to get the current zoom factor. + + @return current zoom factor (float) + """ + return self.matrix().m11() + + def resizeScene(self, amount, isWidth = True): + """ + Public method to resize the scene. + + @param isWidth flag indicating width is to be resized (boolean) + @param amount size increment (integer) + """ + sceneRect = self.scene().sceneRect() + width = sceneRect.width() + height = sceneRect.height() + if isWidth: + width += amount + else: + height += amount + rect = self._getDiagramRect(10) + if width < rect.width(): + width = rect.width() + if height < rect.height(): + height = rect.height() + + self.setSceneSize(width, height) + + def setSceneSize(self, width, height): + """ + Public method to set the scene size. + + @param width width for the scene (integer) + @param height height for the scene (integer) + """ + rect = self.scene().sceneRect() + rect.setHeight(height) + rect.setWidth(width) + self.setSceneRect(rect) + + def _getDiagramRect(self, border = 0): + """ + Protected method to calculate the minimum rectangle fitting the diagram. + + @param border border width to include in the calculation (integer) + @return the minimum rectangle (QRectF) + """ + startx = sys.maxsize + starty = sys.maxsize + endx = 0 + endy = 0 + items = self.filteredItems(list(self.scene().items())) + for itm in items: + rect = itm.sceneBoundingRect() + itmEndX = rect.x() + rect.width() + itmEndY = rect.y()+ rect.height() + itmStartX = rect.x() + itmStartY = rect.y() + if startx >= itmStartX: + startx = itmStartX + if starty >= itmStartY: + starty = itmStartY + if endx <= itmEndX: + endx = itmEndX + if endy <= itmEndY: + endy = itmEndY + if border: + startx -= border + starty -= border + endx += border + endy += border + + return QRectF(startx, starty, endx - startx + 1, endy - starty + 1) + + def _getDiagramSize(self, border = 0): + """ + Protected method to calculate the minimum size fitting the diagram. + + @param border border width to include in the calculation (integer) + @return the minimum size (QSizeF) + """ + endx = 0 + endy = 0 + items = self.filteredItems(list(self.scene().items())) + for itm in items: + rect = itm.sceneBoundingRect() + itmEndX = rect.x() + rect.width() + itmEndY = rect.y()+ rect.height() + if endx <= itmEndX: + endx = itmEndX + if endy <= itmEndY: + endy = itmEndY + if border: + endx += border + endy += border + + return QSizeF(endx + 1, endy + 1) + + def __getDiagram(self, rect, format = "PNG", filename = None): + """ + Private method to retrieve the diagram from the scene fitting it + in the minimum rectangle. + + @param rect minimum rectangle fitting the diagram (QRectF) + @param format format for the image file (string) + @param filename name of the file for non pixmaps (string) + @return diagram pixmap to receive the diagram (QPixmap) + """ + selectedItems = self.scene().selectedItems() + + # step 1: deselect all widgets + if selectedItems: + for item in selectedItems: + item.setSelected(False) + + # step 2: grab the diagram + if format == "PNG": + paintDevice = QPixmap(int(rect.width()), int(rect.height())) + paintDevice.fill(self.backgroundBrush().color()) + else: + from PyQt4.QtSvg import QSvgGenerator + paintDevice = QSvgGenerator() + paintDevice.setResolution(100) # 100 dpi + paintDevice.setSize(QSize(int(rect.width()), int(rect.height()))) + paintDevice.setFileName(filename) + painter = QPainter(paintDevice) + painter.setRenderHint(QPainter.Antialiasing, True) + self.scene().render(painter, QRectF(), rect) + + # step 3: reselect the widgets + if selectedItems: + for item in selectedItems: + item.setSelected(True) + + return paintDevice + + def saveImage(self, filename, format = "PNG"): + """ + Public method to save the scene to a file. + + @param filename name of the file to write the image to (string) + @param format format for the image file (string) + @return flag indicating success (boolean) + """ + rect = self._getDiagramRect(self.border) + if format == "SVG": + svg = self.__getDiagram(rect, format = format, filename = filename) + return True + else: + pixmap = self.__getDiagram(rect) + return pixmap.save(filename, format) + + def printDiagram(self, printer, diagramName = ""): + """ + Public method to print the diagram. + + @param printer reference to a ready configured printer object (QPrinter) + @param diagramName name of the diagram (string) + """ + painter = QPainter() + painter.begin(printer) + offsetX = 0 + offsetY = 0 + widthX = 0 + heightY = 0 + font = QFont("times", 10) + painter.setFont(font) + fm = painter.fontMetrics() + fontHeight = fm.lineSpacing() + marginX = printer.pageRect().x() - printer.paperRect().x() + marginX = \ + Preferences.getPrinter("LeftMargin") * int(printer.resolution() / 2.54) \ + - marginX + marginY = printer.pageRect().y() - printer.paperRect().y() + marginY = \ + Preferences.getPrinter("TopMargin") * int(printer.resolution() / 2.54) \ + - marginY + + width = printer.width() - marginX \ + - Preferences.getPrinter("RightMargin") * int(printer.resolution() / 2.54) + height = printer.height() - fontHeight - 4 - marginY \ + - Preferences.getPrinter("BottomMargin") * int(printer.resolution() / 2.54) + + border = self.border == 0 and 5 or self.border + rect = self._getDiagramRect(border) + diagram = self.__getDiagram(rect) + + finishX = False + finishY = False + page = 0 + pageX = 0 + pageY = 1 + while not finishX or not finishY: + if not finishX: + offsetX = pageX * width + pageX += 1 + elif not finishY: + offsetY = pageY * height + offsetX = 0 + pageY += 1 + finishX = False + pageX = 1 + if (width + offsetX) > diagram.width(): + finishX = True + widthX = diagram.width() - offsetX + else: + widthX = width + if diagram.width() < width: + widthX = diagram.width() + finishX = True + offsetX = 0 + if (height + offsetY) > diagram.height(): + finishY = True + heightY = diagram.height() - offsetY + else: + heightY = height + if diagram.height() < height: + finishY = True + heightY = diagram.height() + offsetY = 0 + + painter.drawPixmap(marginX, marginY, diagram, + offsetX, offsetY, widthX, heightY) + # write a foot note + s = self.trUtf8("Diagram: {0}, Page {1}").format(diagramName, page + 1) + tc = QColor(50, 50, 50) + painter.setPen(tc) + painter.drawRect(marginX, marginY, width, height) + painter.drawLine(marginX, marginY + height + 2, + marginX + width, marginY + height + 2) + painter.setFont(font) + painter.drawText(marginX, marginY + height + 4, width, + fontHeight, Qt.AlignRight, s) + if not finishX or not finishY: + printer.newPage() + page += 1 + + painter.end() + + ############################################################################ + ## The methods below should be overridden by subclasses to get special + ## behavior. + ############################################################################ + + def filteredItems(self, items): + """ + Public method to filter a list of items. + + @param items list of items as returned by the scene object + (QGraphicsItem) + @return list of interesting collision items (QGraphicsItem) + """ + # just return the list unchanged + return items \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/E5Graphics/__init__.py Tue Jan 12 18:04:41 2010 +0000 @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2007 - 2010 Detlev Offenbach <detlev@die-offenbachs.de> +# + +""" +Package implementing some QGraphicsView related general purpoe classes. +"""
--- a/Graphics/AssociationItem.py Tue Jan 12 17:55:24 2010 +0000 +++ b/Graphics/AssociationItem.py Tue Jan 12 18:04:41 2010 +0000 @@ -10,7 +10,7 @@ from PyQt4.QtCore import * from PyQt4.QtGui import * -from E4Graphics.E4ArrowItem import E4ArrowItem, NormalArrow, WideArrow +from E5Graphics.E5ArrowItem import E5ArrowItem, NormalArrow, WideArrow Normal = 0 Generalisation = 1 @@ -27,7 +27,7 @@ SouthWest = 8 Center = 9 -class AssociationItem(E4ArrowItem): +class AssociationItem(E5ArrowItem): """ Class implementing a graphics item for an association between two items. @@ -58,7 +58,7 @@ arrowType = WideArrow arrowFilled = False - E4ArrowItem.__init__(self, QPointF(0, 0), QPointF(100, 100), + E5ArrowItem.__init__(self, QPointF(0, 0), QPointF(100, 100), arrowFilled, arrowType, parent) self.setFlag(QGraphicsItem.ItemIsMovable, False) @@ -470,4 +470,4 @@ Public method to unassociate from the widgets. """ self.itemA.removeAssociation(self) - self.itemB.removeAssociation(self) + self.itemB.removeAssociation(self) \ No newline at end of file
--- a/Graphics/UMLGraphicsView.py Tue Jan 12 17:55:24 2010 +0000 +++ b/Graphics/UMLGraphicsView.py Tue Jan 12 18:04:41 2010 +0000 @@ -4,7 +4,7 @@ # """ -Module implementing a subclass of E4GraphicsView for our diagrams. +Module implementing a subclass of E5GraphicsView for our diagrams. """ import sys @@ -12,7 +12,7 @@ from PyQt4.QtCore import * from PyQt4.QtGui import * -from E4Graphics.E4GraphicsView import E4GraphicsView +from E5Graphics.E5GraphicsView import E5GraphicsView from .UMLItem import UMLItem from .UMLSceneSizeDialog import UMLSceneSizeDialog @@ -23,9 +23,9 @@ import Preferences -class UMLGraphicsView(E4GraphicsView): +class UMLGraphicsView(E5GraphicsView): """ - Class implementing a specialized E4GraphicsView for our diagrams. + Class implementing a specialized E5GraphicsView for our diagrams. @signal relayout() emitted to indicate a relayout of the diagram is requested @@ -39,7 +39,7 @@ @param parent parent widget of the view (QWidget) @param name name of the view widget (string) """ - E4GraphicsView.__init__(self, scene, parent) + E5GraphicsView.__init__(self, scene, parent) if name: self.setObjectName(name) @@ -485,4 +485,4 @@ (itemrect.y() + itemrect.height() // 2) item.moveBy(xOffset, yOffset) - self.scene().update() + self.scene().update() \ No newline at end of file
--- a/eric5.e4p Tue Jan 12 17:55:24 2010 +0000 +++ b/eric5.e4p Tue Jan 12 18:04:41 2010 +0000 @@ -210,15 +210,12 @@ <Source>Project/UserPropertiesDialog.py</Source> <Source>Preferences/ConfigurationPages/GraphicsPage.py</Source> <Source>QScintilla/APIsManager.py</Source> - <Source>E4Graphics/E4ArrowItem.py</Source> - <Source>E4Graphics/E4GraphicsView.py</Source> <Source>Graphics/AssociationItem.py</Source> <Source>Graphics/ClassItem.py</Source> <Source>Graphics/UMLGraphicsView.py</Source> <Source>Graphics/UMLItem.py</Source> <Source>Graphics/UMLSceneSizeDialog.py</Source> <Source>Graphics/UMLDialog.py</Source> - <Source>E4Graphics/__init__.py</Source> <Source>Graphics/PackageItem.py</Source> <Source>Graphics/ModuleItem.py</Source> <Source>patch_pyxml.py</Source> @@ -758,6 +755,9 @@ <Source>E5XML/XMLMessageDialog.py</Source> <Source>E5XML/XMLEntityResolver.py</Source> <Source>E5XML/XMLErrorHandler.py</Source> + <Source>E5Graphics/__init__.py</Source> + <Source>E5Graphics/E5ArrowItem.py</Source> + <Source>E5Graphics/E5GraphicsView.py</Source> </Sources> <Forms> <Form>PyUnit/UnittestDialog.ui</Form>