You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by ca...@apache.org on 2007/11/12 05:17:56 UTC
svn commit: r594018 - in /xmlgraphics/batik/trunk/sources/org/apache/batik:
bridge/ bridge/svg12/ dom/ dom/svg/ ext/awt/geom/
Author: cam
Date: Sun Nov 11 20:17:41 2007
New Revision: 594018
URL: http://svn.apache.org/viewvc?rev=594018&view=rev
Log:
Remove some unnecessary casts.
Modified:
xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/BridgeContext.java
xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGPathElementBridge.java
xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGPolygonElementBridge.java
xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGPolylineElementBridge.java
xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/svg12/SVGFlowRootElementBridge.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/AbstractElement.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/AbstractNode.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/AbstractParentNode.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/AbstractSVGNormPathSegList.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMAnimatedTransformList.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMElement.java
xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/ExtendedGeneralPath.java
xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/Polygon2D.java
xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/Polyline2D.java
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/BridgeContext.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/BridgeContext.java?rev=594018&r1=594017&r2=594018&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/BridgeContext.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/BridgeContext.java Sun Nov 11 20:17:41 2007
@@ -1686,8 +1686,7 @@
Element elem = evt.getElement();
SVGContext ctx = getSVGContext(elem);
if (ctx == null) {
- GraphicsNode pgn = getGraphicsNode
- ((Element)elem.getParentNode());
+ GraphicsNode pgn = getGraphicsNode(elem.getParentNode());
if ((pgn == null) || !(pgn instanceof CompositeGraphicsNode)) {
// Something changed in this element but we really don't
// care since its parent isn't displayed either.
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGPathElementBridge.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGPathElementBridge.java?rev=594018&r1=594017&r2=594018&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGPathElementBridge.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGPathElementBridge.java Sun Nov 11 20:17:41 2007
@@ -85,8 +85,7 @@
AWTPathProducer app = new AWTPathProducer();
try {
// 'd' attribute - required
- SVGOMAnimatedPathData _d =
- (SVGOMAnimatedPathData) pe.getAnimatedPathData();
+ SVGOMAnimatedPathData _d = pe.getAnimatedPathData();
_d.check();
SVGPathSegList p = _d.getAnimatedPathSegList();
app.setWindingRule(CSSUtilities.convertFillRule(e));
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGPolygonElementBridge.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGPolygonElementBridge.java?rev=594018&r1=594017&r2=594018&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGPolygonElementBridge.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGPolygonElementBridge.java Sun Nov 11 20:17:41 2007
@@ -79,8 +79,7 @@
SVGOMPolygonElement pe = (SVGOMPolygonElement) e;
try {
- SVGOMAnimatedPoints _points =
- (SVGOMAnimatedPoints) pe.getSVGOMAnimatedPoints();
+ SVGOMAnimatedPoints _points = pe.getSVGOMAnimatedPoints();
_points.check();
SVGPointList pl = _points.getAnimatedPoints();
int size = pl.getNumberOfItems();
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGPolylineElementBridge.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGPolylineElementBridge.java?rev=594018&r1=594017&r2=594018&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGPolylineElementBridge.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGPolylineElementBridge.java Sun Nov 11 20:17:41 2007
@@ -79,8 +79,7 @@
SVGOMPolylineElement pe = (SVGOMPolylineElement) e;
try {
- SVGOMAnimatedPoints _points =
- (SVGOMAnimatedPoints) pe.getSVGOMAnimatedPoints();
+ SVGOMAnimatedPoints _points = pe.getSVGOMAnimatedPoints();
_points.check();
SVGPointList pl = _points.getAnimatedPoints();
int size = pl.getNumberOfItems();
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/svg12/SVGFlowRootElementBridge.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/svg12/SVGFlowRootElementBridge.java?rev=594018&r1=594017&r2=594018&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/svg12/SVGFlowRootElementBridge.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/svg12/SVGFlowRootElementBridge.java Sun Nov 11 20:17:41 2007
@@ -604,7 +604,7 @@
}
GraphicsNode gn = isStatic ? (GraphicsNode) flowRegionNodes.get(n)
- : ctx.getGraphicsNode((Element) n);
+ : ctx.getGraphicsNode(n);
Shape s = gn.getOutline();
if (s == null) {
continue;
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/AbstractElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/AbstractElement.java?rev=594018&r1=594017&r2=594018&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/AbstractElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/AbstractElement.java Sun Nov 11 20:17:41 2007
@@ -30,7 +30,6 @@
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.TypeInfo;
-import org.w3c.dom.events.DocumentEvent;
import org.w3c.dom.events.MutationEvent;
/**
@@ -634,9 +633,8 @@
}
AbstractDocument doc = getCurrentDocument();
if (doc.getEventsEnabled() && !oldv.equals(newv)) {
- DocumentEvent de = (DocumentEvent)doc;
DOMMutationEvent ev
- = (DOMMutationEvent) de.createEvent("MutationEvents");
+ = (DOMMutationEvent) doc.createEvent("MutationEvents");
ev.initMutationEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
"DOMAttrModified",
true, // canBubbleArg
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/AbstractNode.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/AbstractNode.java?rev=594018&r1=594017&r2=594018&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/AbstractNode.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/AbstractNode.java Sun Nov 11 20:17:41 2007
@@ -43,7 +43,6 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.UserDataHandler;
-import org.w3c.dom.events.DocumentEvent;
import org.w3c.dom.events.Event;
import org.w3c.dom.events.EventException;
import org.w3c.dom.events.EventListener;
@@ -422,7 +421,7 @@
Node n = node.getParentNode();
while (n != null) {
if (n.getNodeType() == Node.ELEMENT_NODE) {
- base = getCascadedXMLBase((Element) n);
+ base = getCascadedXMLBase(n);
break;
}
n = n.getParentNode();
@@ -1067,8 +1066,8 @@
public void fireDOMNodeInsertedIntoDocumentEvent() {
AbstractDocument doc = getCurrentDocument();
if (doc.getEventsEnabled()) {
- DocumentEvent de = (DocumentEvent)doc;
- DOMMutationEvent ev = (DOMMutationEvent)de.createEvent("MutationEvents");
+ DOMMutationEvent ev =
+ (DOMMutationEvent)doc.createEvent("MutationEvents");
ev.initMutationEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
"DOMNodeInsertedIntoDocument",
true, // canBubbleArg
@@ -1088,9 +1087,8 @@
public void fireDOMNodeRemovedFromDocumentEvent() {
AbstractDocument doc = getCurrentDocument();
if (doc.getEventsEnabled()) {
- DocumentEvent de = (DocumentEvent)doc;
DOMMutationEvent ev
- = (DOMMutationEvent) de.createEvent("MutationEvents");
+ = (DOMMutationEvent) doc.createEvent("MutationEvents");
ev.initMutationEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
"DOMNodeRemovedFromDocument",
true, // canBubbleArg
@@ -1111,9 +1109,8 @@
String newv) {
AbstractDocument doc = getCurrentDocument();
if (doc.getEventsEnabled()) {
- DocumentEvent de = (DocumentEvent)doc;
DOMMutationEvent ev
- = (DOMMutationEvent) de.createEvent("MutationEvents");
+ = (DOMMutationEvent) doc.createEvent("MutationEvents");
ev.initMutationEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
"DOMCharacterDataModified",
true, // canBubbleArg
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/AbstractParentNode.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/AbstractParentNode.java?rev=594018&r1=594017&r2=594018&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/AbstractParentNode.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/AbstractParentNode.java Sun Nov 11 20:17:41 2007
@@ -26,7 +26,6 @@
import org.w3c.dom.DOMException;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-import org.w3c.dom.events.DocumentEvent;
import org.w3c.dom.events.MutationEvent;
/**
@@ -387,9 +386,8 @@
protected void fireDOMSubtreeModifiedEvent() {
AbstractDocument doc = getCurrentDocument();
if (doc.getEventsEnabled()) {
- DocumentEvent de = (DocumentEvent)doc;
DOMMutationEvent ev
- = (DOMMutationEvent) de.createEvent("MutationEvents");
+ = (DOMMutationEvent) doc.createEvent("MutationEvents");
ev.initMutationEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
"DOMSubtreeModified",
true, // canBubbleArg
@@ -409,9 +407,8 @@
protected void fireDOMNodeInsertedEvent(Node node) {
AbstractDocument doc = getCurrentDocument();
if (doc.getEventsEnabled()) {
- DocumentEvent de = (DocumentEvent)doc;
DOMMutationEvent ev
- = (DOMMutationEvent) de.createEvent("MutationEvents");
+ = (DOMMutationEvent) doc.createEvent("MutationEvents");
ev.initMutationEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
"DOMNodeInserted",
true, // canBubbleArg
@@ -433,9 +430,8 @@
protected void fireDOMNodeRemovedEvent(Node node) {
AbstractDocument doc = getCurrentDocument();
if (doc.getEventsEnabled()) {
- DocumentEvent de = (DocumentEvent)doc;
DOMMutationEvent ev
- = (DOMMutationEvent) de.createEvent("MutationEvents");
+ = (DOMMutationEvent) doc.createEvent("MutationEvents");
ev.initMutationEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
"DOMNodeRemoved",
true, // canBubbleArg
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/AbstractSVGNormPathSegList.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/AbstractSVGNormPathSegList.java?rev=594018&r1=594017&r2=594018&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/AbstractSVGNormPathSegList.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/AbstractSVGNormPathSegList.java Sun Nov 11 20:17:41 2007
@@ -281,7 +281,7 @@
// Ensure radii are valid
if (rx == 0 || ry == 0) {
- linetoAbs((float) x, (float) y);
+ linetoAbs(x, y);
return;
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMAnimatedTransformList.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMAnimatedTransformList.java?rev=594018&r1=594017&r2=594018&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMAnimatedTransformList.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMAnimatedTransformList.java Sun Nov 11 20:17:41 2007
@@ -131,7 +131,7 @@
int n = tl.getNumberOfItems();
List v = new ArrayList(n);
for (int i = 0; i < n; i++) {
- v.add((AbstractSVGTransform) tl.getItem(i));
+ v.add(tl.getItem(i));
}
return new AnimatableTransformListValue(target, v);
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMElement.java?rev=594018&r1=594017&r2=594018&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMElement.java Sun Nov 11 20:17:41 2007
@@ -259,7 +259,7 @@
Node n = node.getParentNode();
while (n != null) {
if (n.getNodeType() == Node.ELEMENT_NODE) {
- base = getCascadedXMLBase((Element) n);
+ base = getCascadedXMLBase(n);
break;
}
if (n instanceof CSSNavigableNode) {
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/ExtendedGeneralPath.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/ExtendedGeneralPath.java?rev=594018&r1=594017&r2=594018&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/ExtendedGeneralPath.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/ExtendedGeneralPath.java Sun Nov 11 20:17:41 2007
@@ -118,7 +118,7 @@
// Ensure radii are valid
if (rx == 0 || ry == 0) {
- lineTo((float) x, (float) y);
+ lineTo(x, y);
return;
}
@@ -443,16 +443,16 @@
switch(type) {
case PathIterator.SEG_CLOSE: closePath(); break;
case PathIterator.SEG_MOVETO:
- moveTo ((float)vals[0], (float)vals[1]); break;
+ moveTo (vals[0], vals[1]); break;
case PathIterator.SEG_LINETO:
- lineTo ((float)vals[0], (float)vals[1]); break;
+ lineTo (vals[0], vals[1]); break;
case PathIterator.SEG_QUADTO:
- quadTo ((float)vals[0], (float)vals[1],
- (float)vals[2], (float)vals[3]); break;
+ quadTo (vals[0], vals[1],
+ vals[2], vals[3]); break;
case PathIterator.SEG_CUBICTO:
- curveTo((float)vals[0], (float)vals[1],
- (float)vals[2], (float)vals[3],
- (float)vals[4], (float)vals[5]); break;
+ curveTo(vals[0], vals[1],
+ vals[2], vals[3],
+ vals[4], vals[5]); break;
case ExtendedPathIterator.SEG_ARCTO:
arcTo (vals[0], vals[1], vals[2],
(vals[3]!=0), (vals[4]!=0),
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/Polygon2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/Polygon2D.java?rev=594018&r1=594017&r2=594018&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/Polygon2D.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/Polygon2D.java Sun Nov 11 20:17:41 2007
@@ -113,8 +113,8 @@
this.xpoints = new float[pol.npoints];
this.ypoints = new float[pol.npoints];
for (int i = 0; i < pol.npoints; i++) {
- xpoints[i] = (float)pol.xpoints[i];
- ypoints[i] = (float)pol.ypoints[i];
+ xpoints[i] = pol.xpoints[i];
+ ypoints[i] = pol.ypoints[i];
}
calculatePath();
}
@@ -167,8 +167,8 @@
this.xpoints = new float[npoints];
this.ypoints = new float[npoints];
for (int i = 0; i < npoints; i++) {
- this.xpoints[i] = (float)xpoints[i];
- this.ypoints[i] = (float)ypoints[i];
+ this.xpoints[i] = xpoints[i];
+ this.ypoints[i] = ypoints[i];
}
calculatePath();
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/Polyline2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/Polyline2D.java?rev=594018&r1=594017&r2=594018&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/Polyline2D.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/Polyline2D.java Sun Nov 11 20:17:41 2007
@@ -127,8 +127,8 @@
this.xpoints = new float[npoints];
this.ypoints = new float[npoints];
for (int i = 0; i < npoints; i++) {
- this.xpoints[i] = (float)xpoints[i];
- this.ypoints[i] = (float)ypoints[i];
+ this.xpoints[i] = xpoints[i];
+ this.ypoints[i] = ypoints[i];
}
calculatePath();
}
@@ -390,7 +390,7 @@
public Polygon2D getPolygon2D() {
Polygon2D pol = new Polygon2D();
for (int i = 0; i < npoints - 1; i++) {
- pol.addPoint((float)xpoints[i], (float)ypoints[i]);
+ pol.addPoint(xpoints[i], ypoints[i]);
}
Point2D.Double p0 =
new Point2D.Double(xpoints[0], ypoints[0]);
@@ -398,7 +398,7 @@
new Point2D.Double(xpoints[npoints-1], ypoints[npoints-1]);
if (p0.distance(p1) > ASSUME_ZERO)
- pol.addPoint((float)xpoints[npoints-1], (float)ypoints[npoints-1]);
+ pol.addPoint(xpoints[npoints-1], ypoints[npoints-1]);
return pol;
}