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 2008/11/13 01:28:23 UTC
svn commit: r713578 - in /xmlgraphics/batik/trunk/sources/org/apache/batik:
apps/svgbrowser/ ext/awt/geom/ gvt/filter/ gvt/font/ gvt/renderer/ util/
Author: cam
Date: Wed Nov 12 16:28:21 2008
New Revision: 713578
URL: http://svn.apache.org/viewvc?rev=713578&view=rev
Log:
1. Remove some Java 1.3 specific code.
2. Make all OS X detection use Platform.isOSX.
Modified:
xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java
xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/RectListManager.java
xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/filter/GraphicsNodeRed8Bit.java
xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/font/AWTGVTGlyphVector.java
xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/renderer/ConcreteImageRendererFactory.java
xmlgraphics/batik/trunk/sources/org/apache/batik/util/Platform.java
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java?rev=713578&r1=713577&r2=713578&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java Wed Nov 12 16:28:21 2008
@@ -567,9 +567,9 @@
public void setMySize(Dimension d) {
setPreferredSize(d);
invalidate();
- if (JSVGViewerFrame.this.autoAdjust) {
- Platform.unmaximize(JSVGViewerFrame.this);
- JSVGViewerFrame.this.pack();
+ if (autoAdjust) {
+ setExtendedState(getExtendedState() & ~MAXIMIZED_BOTH);
+ pack();
}
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/RectListManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/RectListManager.java?rev=713578&r1=713577&r2=713578&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/RectListManager.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/RectListManager.java Wed Nov 12 16:28:21 2008
@@ -170,6 +170,8 @@
/**
* Similar to clone only strongly typed
+ * TODO Java 5: The use of covariant return types on clone() can eliminate
+ * this method.
*/
public RectListManager copy() {
return new RectListManager(rects);
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/filter/GraphicsNodeRed8Bit.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/filter/GraphicsNodeRed8Bit.java?rev=713578&r1=713577&r2=713578&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/filter/GraphicsNodeRed8Bit.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/filter/GraphicsNodeRed8Bit.java Wed Nov 12 16:28:21 2008
@@ -34,6 +34,7 @@
import org.apache.batik.ext.awt.image.rendered.AbstractTiledRed;
import org.apache.batik.ext.awt.image.rendered.CachableRed;
import org.apache.batik.gvt.GraphicsNode;
+import org.apache.batik.util.Platform;
/**
* This implementation of RenderableImage will render its input
@@ -146,14 +147,8 @@
g.dispose();
}
- static final boolean onMacOSX;
- static {
- // This should be OK for applets.
- onMacOSX = ("Mac OS X".equals(System.getProperty("os.name")));
- }
-
public ColorModel createColorModel() {
- if (onMacOSX)
+ if (Platform.isOSX)
return GraphicsUtil.sRGB_Pre;
return GraphicsUtil.sRGB_Unpre;
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/font/AWTGVTGlyphVector.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/font/AWTGVTGlyphVector.java?rev=713578&r1=713577&r2=713578&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/font/AWTGVTGlyphVector.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/font/AWTGVTGlyphVector.java Wed Nov 12 16:28:21 2008
@@ -38,6 +38,7 @@
import org.apache.batik.gvt.text.ArabicTextHandler;
import org.apache.batik.gvt.text.GVTAttributedCharacterIterator;
import org.apache.batik.gvt.text.TextPaintInfo;
+import org.apache.batik.util.Platform;
/**
* This is a wrapper class for a java.awt.font.GlyphVector instance.
@@ -502,10 +503,11 @@
static {
String s = System.getProperty("java.specification.version");
if ("1.4".compareTo(s) <= 0) {
+ // TODO Java 5
outlinesPositioned = true;
drawGlyphVectorWorks = true;
glyphVectorTransformWorks = true;
- } else if ("Mac OS X".equals(System.getProperty("os.name"))) {
+ } else if (Platform.isOSX) {
outlinesPositioned = true;
drawGlyphVectorWorks = false;
glyphVectorTransformWorks = false;
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/renderer/ConcreteImageRendererFactory.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/renderer/ConcreteImageRendererFactory.java?rev=713578&r1=713577&r2=713578&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/renderer/ConcreteImageRendererFactory.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/renderer/ConcreteImageRendererFactory.java Wed Nov 12 16:28:21 2008
@@ -18,6 +18,7 @@
*/
package org.apache.batik.gvt.renderer;
+import org.apache.batik.util.Platform;
/**
* This class provides a factory for renderers.
@@ -35,27 +36,20 @@
}
/**
- * Creates a new static image renderer
+ * Creates a new static image renderer.
*/
- public ImageRenderer createStaticImageRenderer(){
- if (onMacOSX)
+ public ImageRenderer createStaticImageRenderer() {
+ if (Platform.isOSX)
return new MacRenderer();
return new StaticRenderer();
}
/**
- * Creates a new dynamic image renderer
+ * Creates a new dynamic image renderer.
*/
- public ImageRenderer createDynamicImageRenderer(){
- if (onMacOSX)
+ public ImageRenderer createDynamicImageRenderer() {
+ if (Platform.isOSX)
return new MacRenderer();
return new DynamicRenderer();
}
-
-
- static final boolean onMacOSX;
- static {
- // This should be OK for applets.
- onMacOSX = ("Mac OS X".equals(System.getProperty("os.name")));
- }
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/util/Platform.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/util/Platform.java?rev=713578&r1=713577&r2=713578&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/util/Platform.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/util/Platform.java Wed Nov 12 16:28:21 2008
@@ -34,30 +34,4 @@
*/
public static boolean isOSX =
System.getProperty("os.name").equals("Mac OS X");
-
- /**
- * Whether we are running on JRE 1.3.
- */
- public static boolean isJRE13 =
- System.getProperty("java.version").startsWith("1.3");
-
- /**
- * Unmaximizes the specified Frame.
- */
- public static void unmaximize(Frame f) {
- if (!isJRE13) {
- try {
- Method m1 =
- Frame.class.getMethod("getExtendedState", (Class[]) null);
- Method m2 =
- Frame.class.getMethod("setExtendedState",
- new Class[] { Integer.TYPE });
- int i = ((Integer) m1.invoke(f, (Object[]) null)).intValue();
- m2.invoke(f, new Object[] { new Integer(i & ~6) });
- } catch (java.lang.reflect.InvocationTargetException ite) {
- } catch (NoSuchMethodException nsme) {
- } catch (IllegalAccessException iae) {
- }
- }
- }
}