You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by hi...@apache.org on 2001/05/10 19:25:08 UTC
cvs commit: xml-batik/sources/org/apache/batik/util/gui/resource MenuFactory.java
hillion 01/05/10 10:25:07
Modified: resources/org/apache/batik/apps/svgbrowser/resources
GUI.properties
sources/org/apache/batik/apps/svgbrowser
JSVGViewerFrame.java
sources/org/apache/batik/css/value CommonCSSContext.java
DefaultCommonCSSContext.java
DefaultSystemColorResolver.java
sources/org/apache/batik/util/gui/resource MenuFactory.java
Added: sources/org/apache/batik/extension package.html
Log:
- added code to be a little more compatible with 1.2's javac,
- double buffered rendering enabled by default.
Revision Changes Path
1.17 +5 -3 xml-batik/resources/org/apache/batik/apps/svgbrowser/resources/GUI.properties
Index: GUI.properties
===================================================================
RCS file: /home/cvs/xml-batik/resources/org/apache/batik/apps/svgbrowser/resources/GUI.properties,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- GUI.properties 2001/05/04 17:04:07 1.16
+++ GUI.properties 2001/05/10 17:24:37 1.17
@@ -9,7 +9,7 @@
# The viewer's GUI resources.
#
# Author: stephane@hillion.org
-# $Id: GUI.properties,v 1.16 2001/05/04 17:04:07 tkormann Exp $
+# $Id: GUI.properties,v 1.17 2001/05/10 17:24:37 hillion Exp $
#
ViewSource.width = 750
@@ -121,7 +121,8 @@
# View menu ################
-View = ResetTransform ZoomIn ZoomOut PreviousTransform NextTransform SetTransform - ViewSource
+View = ResetTransform ZoomIn ZoomOut PreviousTransform NextTransform SetTransform \
+ - ViewSource
View.type = MENU
View.text = View
View.mnemonic = V
@@ -226,6 +227,7 @@
ShowRendering.mnemonic = S
ShowRendering.action = ShowRenderingAction
ShowRendering.selected = false
+ShowRendering.enabled = false
AutoAdjust.type = CHECK
AutoAdjust.text = Auto Adjust Window
@@ -239,7 +241,7 @@
DoubleBuffer.icon = resources/blank.gif
DoubleBuffer.mnemonic = D
DoubleBuffer.action = DoubleBufferAction
-DoubleBuffer.selected = false
+DoubleBuffer.selected = true
Language.type = ITEM
Language.text = Choose User Languages
1.35 +20 -18 xml-batik/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java
Index: JSVGViewerFrame.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- JSVGViewerFrame.java 2001/05/07 23:51:26 1.34
+++ JSVGViewerFrame.java 2001/05/10 17:24:43 1.35
@@ -133,7 +133,7 @@
* This class represents a SVG viewer swing frame.
*
* @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
- * @version $Id: JSVGViewerFrame.java,v 1.34 2001/05/07 23:51:26 vhardy Exp $
+ * @version $Id: JSVGViewerFrame.java,v 1.35 2001/05/10 17:24:43 hillion Exp $
*/
public class JSVGViewerFrame
extends JFrame
@@ -395,6 +395,8 @@
svgCanvas = new JSVGCanvas(userAgent, true, true);
+ svgCanvas.setDoubleBufferedRendering(true);
+
JPanel p = null;
try {
// Create the menu
@@ -520,26 +522,26 @@
locationBar.addActionListener(new AbstractAction() {
public void actionPerformed(ActionEvent e) {
- String s = locationBar.getText().trim();
- int i = s.indexOf("#");
+ String st = locationBar.getText().trim();
+ int i = st.indexOf("#");
String t = "";
if (i != -1) {
- t = s.substring(i + 1);
- s = s.substring(0, i);
+ t = st.substring(i + 1);
+ st = st.substring(0, i);
}
- if (!s.equals("")) {
+ if (!st.equals("")) {
try{
- File f = new File(s);
+ File f = new File(st);
if (f.exists()) {
if (f.isDirectory()) {
- s = null;
+ st = null;
} else {
try {
- s = f.getCanonicalPath();
- if (s.startsWith("/")) {
- s = "file:" + s;
+ st = f.getCanonicalPath();
+ if (st.startsWith("/")) {
+ st = "file:" + st;
} else {
- s = "file:/" + s;
+ st = "file:/" + st;
}
} catch (IOException ex) {
}
@@ -552,12 +554,12 @@
// more to do at this point.
}
- if (s != null) {
+ if (st != null) {
if (svgDocument != null) {
try {
SVGOMDocument doc = (SVGOMDocument)svgDocument;
URL docURL = doc.getURLObject();
- URL url = new URL(docURL, s);
+ URL url = new URL(docURL, st);
String fi = svgCanvas.getFragmentIdentifier();
fi = (fi == null) ? "" : fi;
if (docURL.equals(url) && t.equals(fi)) {
@@ -567,11 +569,11 @@
}
}
if (t.length() != 0) {
- s += "#" + t;
+ st += "#" + t;
}
- locationBar.setText(s);
- locationBar.addToHistory(s);
- svgCanvas.loadSVGDocument(s);
+ locationBar.setText(st);
+ locationBar.addToHistory(st);
+ svgCanvas.loadSVGDocument(st);
}
}
}
1.4 +2 -1 xml-batik/sources/org/apache/batik/css/value/CommonCSSContext.java
Index: CommonCSSContext.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/css/value/CommonCSSContext.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CommonCSSContext.java 2001/03/13 16:28:42 1.3
+++ CommonCSSContext.java 2001/05/10 17:24:47 1.4
@@ -11,13 +11,14 @@
import java.util.List;
import org.apache.batik.css.CSSOMReadOnlyValue;
+import org.apache.batik.css.value.CommonCSSContext.Color;
/**
* This interface represents the context the application must provides
* to the CSS engine in order to resolve the relative CSS values.
*
* @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
- * @version $Id: CommonCSSContext.java,v 1.3 2001/03/13 16:28:42 hillion Exp $
+ * @version $Id: CommonCSSContext.java,v 1.4 2001/05/10 17:24:47 hillion Exp $
*/
public interface CommonCSSContext {
/**
1.4 +2 -1 xml-batik/sources/org/apache/batik/css/value/DefaultCommonCSSContext.java
Index: DefaultCommonCSSContext.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/css/value/DefaultCommonCSSContext.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DefaultCommonCSSContext.java 2001/03/13 16:28:42 1.3
+++ DefaultCommonCSSContext.java 2001/05/10 17:24:49 1.4
@@ -12,6 +12,7 @@
import java.util.List;
import org.apache.batik.css.CSSOMReadOnlyValue;
+import org.apache.batik.css.value.CommonCSSContext.Color;
import org.apache.batik.util.CSSConstants;
import org.w3c.dom.css.CSSPrimitiveValue;
@@ -20,7 +21,7 @@
* This class is the default implementation of the CommonCSSContext.
*
* @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
- * @version $Id: DefaultCommonCSSContext.java,v 1.3 2001/03/13 16:28:42 hillion Exp $
+ * @version $Id: DefaultCommonCSSContext.java,v 1.4 2001/05/10 17:24:49 hillion Exp $
*/
public class DefaultCommonCSSContext implements CommonCSSContext {
1.2 +3 -1 xml-batik/sources/org/apache/batik/css/value/DefaultSystemColorResolver.java
Index: DefaultSystemColorResolver.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/css/value/DefaultSystemColorResolver.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DefaultSystemColorResolver.java 2001/03/13 16:36:56 1.1
+++ DefaultSystemColorResolver.java 2001/05/10 17:24:50 1.2
@@ -10,11 +10,13 @@
import java.awt.SystemColor;
+import org.apache.batik.css.value.SystemColorResolver.Color;
+
/**
* This class provides a default implementation of a SystemColorResolver.
*
* @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
- * @version $Id: DefaultSystemColorResolver.java,v 1.1 2001/03/13 16:36:56 hillion Exp $
+ * @version $Id: DefaultSystemColorResolver.java,v 1.2 2001/05/10 17:24:50 hillion Exp $
*/
public class DefaultSystemColorResolver implements SystemColorResolver {
1.1 xml-batik/sources/org/apache/batik/extension/package.html
Index: package.html
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<body bgcolor="#FFFFFF">
This package contains Batik's extensions to standard SVG (custom elements,
additional bridges...).
</body>
</html>
1.3 +9 -1 xml-batik/sources/org/apache/batik/util/gui/resource/MenuFactory.java
Index: MenuFactory.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/util/gui/resource/MenuFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MenuFactory.java 2000/10/29 15:28:07 1.2
+++ MenuFactory.java 2001/05/10 17:25:01 1.3
@@ -45,6 +45,7 @@
* Menu1.accelerator = accelerator
* Menu1.action = action_name
* Menu1.selected = true | false
+ * Menu1.enabled = true | false
* ...
* mnemonic is a single character
* accelerator is of the form: mod+mod+...+X
@@ -55,7 +56,7 @@
* Consecutive RADIO items are put in a ButtonGroup
*
* @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
- * @version $Id: MenuFactory.java,v 1.2 2000/10/29 15:28:07 hillion Exp $
+ * @version $Id: MenuFactory.java,v 1.3 2001/05/10 17:25:01 hillion Exp $
*/
public class MenuFactory extends ResourceManager {
// Constants
@@ -72,6 +73,7 @@
private final static String ACCELERATOR_SUFFIX = ".accelerator";
private final static String ACTION_SUFFIX = ".action";
private final static String SELECTED_SUFFIX = ".selected";
+ private final static String ENABLED_SUFFIX = ".enabled";
private final static String ICON_SUFFIX = ".icon";
/**
@@ -339,6 +341,12 @@
if (a instanceof JComponentModifier) {
((JComponentModifier)a).addJComponent(item);
}
+ } catch (MissingResourceException e) {
+ }
+
+ // is the item enabled?
+ try {
+ item.setEnabled(getBoolean(name+ENABLED_SUFFIX));
} catch (MissingResourceException e) {
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org