|
|
|
@ -22,7 +22,6 @@ import java.awt.BorderLayout;
|
|
|
|
|
import java.awt.Color; |
|
|
|
|
import java.awt.Cursor; |
|
|
|
|
import java.awt.Dimension; |
|
|
|
|
import java.awt.Event; |
|
|
|
|
import java.awt.EventQueue; |
|
|
|
|
import java.awt.FileDialog; |
|
|
|
|
import java.awt.Font; |
|
|
|
@ -32,6 +31,7 @@ import java.awt.Toolkit;
|
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
import java.awt.event.ComponentAdapter; |
|
|
|
|
import java.awt.event.ComponentEvent; |
|
|
|
|
import java.awt.event.InputEvent; |
|
|
|
|
import java.awt.event.KeyEvent; |
|
|
|
|
import java.awt.event.MouseAdapter; |
|
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
@ -101,7 +101,7 @@ import org.apache.batik.bridge.UpdateManager;
|
|
|
|
|
import org.apache.batik.bridge.UpdateManagerEvent; |
|
|
|
|
import org.apache.batik.bridge.UpdateManagerListener; |
|
|
|
|
import org.apache.batik.dom.StyleSheetProcessingInstruction; |
|
|
|
|
import org.apache.batik.dom.util.HashTable; |
|
|
|
|
|
|
|
|
|
import org.apache.batik.dom.util.DOMUtilities; |
|
|
|
|
import org.apache.batik.ext.swing.JAffineTransformChooser; |
|
|
|
|
import org.apache.batik.swing.JSVGCanvas; |
|
|
|
@ -130,7 +130,7 @@ import org.apache.batik.util.ParsedURL;
|
|
|
|
|
import org.apache.batik.util.Platform; |
|
|
|
|
import org.apache.batik.util.Service; |
|
|
|
|
import org.apache.batik.util.SVGConstants; |
|
|
|
|
import org.apache.batik.util.XMLConstants; |
|
|
|
|
import org.apache.batik.constants.XMLConstants; |
|
|
|
|
import org.apache.batik.util.gui.JErrorPane; |
|
|
|
|
import org.apache.batik.util.gui.LocationBar; |
|
|
|
|
import org.apache.batik.util.gui.MemoryMonitor; |
|
|
|
@ -620,11 +620,11 @@ public class JSVGViewerFrame
|
|
|
|
|
cMap.get(JSVGCanvas.ZOOM_OUT_ACTION)); |
|
|
|
|
|
|
|
|
|
listeners.put(PREVIOUS_TRANSFORM_ACTION, previousTransformAction); |
|
|
|
|
key = KeyStroke.getKeyStroke(KeyEvent.VK_K, KeyEvent.CTRL_MASK); |
|
|
|
|
key = KeyStroke.getKeyStroke(KeyEvent.VK_K, KeyEvent.CTRL_DOWN_MASK); |
|
|
|
|
imap.put(key, previousTransformAction); |
|
|
|
|
|
|
|
|
|
listeners.put(NEXT_TRANSFORM_ACTION, nextTransformAction); |
|
|
|
|
key = KeyStroke.getKeyStroke(KeyEvent.VK_L, KeyEvent.CTRL_MASK); |
|
|
|
|
key = KeyStroke.getKeyStroke(KeyEvent.VK_L, KeyEvent.CTRL_DOWN_MASK); |
|
|
|
|
imap.put(key, nextTransformAction); |
|
|
|
|
|
|
|
|
|
listeners.put(USE_STYLESHEET_ACTION, useStylesheetAction); |
|
|
|
@ -650,9 +650,9 @@ public class JSVGViewerFrame
|
|
|
|
|
localHistory = new LocalHistory(mb, this); |
|
|
|
|
|
|
|
|
|
String[] uri = application.getVisitedURIs(); |
|
|
|
|
for (int i=0; i<uri.length; i++) { |
|
|
|
|
if (uri[i] != null && !"".equals(uri[i])) { |
|
|
|
|
localHistory.update(uri[i]); |
|
|
|
|
for (String anUri : uri) { |
|
|
|
|
if (anUri != null && !"".equals(anUri)) { |
|
|
|
|
localHistory.update(anUri); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
p = new JPanel(new BorderLayout()); |
|
|
|
@ -1012,8 +1012,8 @@ public class JSVGViewerFrame
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Initializes the debugger by massaging the GUI and attaching it |
|
|
|
|
* to the Rhino interpreter's {@link |
|
|
|
|
* org.mozilla.javascript.ContextFactory}. |
|
|
|
|
* to the Rhino interpreter's |
|
|
|
|
* org.mozilla.javascript.ContextFactory. |
|
|
|
|
*/ |
|
|
|
|
public void initialize() { |
|
|
|
|
// Customize the menubar a bit, disable menu
|
|
|
|
@ -1026,7 +1026,7 @@ public class JSVGViewerFrame
|
|
|
|
|
menu.getItem(3).setText |
|
|
|
|
(Resources.getString("Close.text")); // Exit -> "Close"
|
|
|
|
|
menu.getItem(3).setAccelerator |
|
|
|
|
(KeyStroke.getKeyStroke(KeyEvent.VK_W, Event.CTRL_MASK)); |
|
|
|
|
(KeyStroke.getKeyStroke(KeyEvent.VK_W, InputEvent.CTRL_DOWN_MASK)); |
|
|
|
|
|
|
|
|
|
debugGui.setSize(600, 460); |
|
|
|
|
debugGui.pack(); |
|
|
|
@ -1199,10 +1199,9 @@ public class JSVGViewerFrame
|
|
|
|
|
Resources.getString(OPEN_TITLE)); |
|
|
|
|
fileDialog.setFilenameFilter(new FilenameFilter() { |
|
|
|
|
public boolean accept(File dir, String name) { |
|
|
|
|
Iterator iter = getHandlers().iterator(); |
|
|
|
|
while (iter.hasNext()) { |
|
|
|
|
for (Object o : getHandlers()) { |
|
|
|
|
SquiggleInputHandler handler |
|
|
|
|
= (SquiggleInputHandler)iter.next(); |
|
|
|
|
= (SquiggleInputHandler) o; |
|
|
|
|
if (handler.accept(new File(dir, name))) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
@ -1238,10 +1237,9 @@ public class JSVGViewerFrame
|
|
|
|
|
//
|
|
|
|
|
// Add file filters from the handlers map
|
|
|
|
|
//
|
|
|
|
|
Iterator iter = getHandlers().iterator(); |
|
|
|
|
while (iter.hasNext()) { |
|
|
|
|
for (Object o : getHandlers()) { |
|
|
|
|
SquiggleInputHandler handler |
|
|
|
|
= (SquiggleInputHandler)iter.next(); |
|
|
|
|
= (SquiggleInputHandler) o; |
|
|
|
|
fileChooser.addChoosableFileFilter |
|
|
|
|
(new SquiggleInputHandlerFilter(handler)); |
|
|
|
|
} |
|
|
|
@ -1476,9 +1474,8 @@ public class JSVGViewerFrame
|
|
|
|
|
|
|
|
|
|
protected void update() { |
|
|
|
|
boolean b = localHistory.canGoBack(); |
|
|
|
|
Iterator it = components.iterator(); |
|
|
|
|
while (it.hasNext()) { |
|
|
|
|
((JComponent)it.next()).setEnabled(b); |
|
|
|
|
for (Object component : components) { |
|
|
|
|
((JComponent) component).setEnabled(b); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1503,9 +1500,8 @@ public class JSVGViewerFrame
|
|
|
|
|
|
|
|
|
|
protected void update() { |
|
|
|
|
boolean b = localHistory.canGoForward(); |
|
|
|
|
Iterator it = components.iterator(); |
|
|
|
|
while (it.hasNext()) { |
|
|
|
|
((JComponent)it.next()).setEnabled(b); |
|
|
|
|
for (Object component : components) { |
|
|
|
|
((JComponent) component).setEnabled(b); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1721,7 +1717,7 @@ public class JSVGViewerFrame
|
|
|
|
|
application.getXMLParserClassName()); |
|
|
|
|
} |
|
|
|
|
trans.addTranscodingHint |
|
|
|
|
(JPEGTranscoder.KEY_QUALITY, new Float(quality)); |
|
|
|
|
(JPEGTranscoder.KEY_QUALITY, quality); |
|
|
|
|
|
|
|
|
|
final BufferedImage img = trans.createImage(w, h); |
|
|
|
|
|
|
|
|
@ -1785,7 +1781,7 @@ public class JSVGViewerFrame
|
|
|
|
|
Boolean.TRUE ); |
|
|
|
|
|
|
|
|
|
if(isIndexed){ |
|
|
|
|
trans.addTranscodingHint(PNGTranscoder.KEY_INDEXED, new Integer(8)); |
|
|
|
|
trans.addTranscodingHint(PNGTranscoder.KEY_INDEXED, 8); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
final BufferedImage img = trans.createImage(w, h); |
|
|
|
@ -1976,9 +1972,8 @@ public class JSVGViewerFrame
|
|
|
|
|
|
|
|
|
|
protected void update() { |
|
|
|
|
boolean b = transformHistory.canGoBack(); |
|
|
|
|
Iterator it = components.iterator(); |
|
|
|
|
while (it.hasNext()) { |
|
|
|
|
((JComponent)it.next()).setEnabled(b); |
|
|
|
|
for (Object component : components) { |
|
|
|
|
((JComponent) component).setEnabled(b); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -2006,9 +2001,8 @@ public class JSVGViewerFrame
|
|
|
|
|
|
|
|
|
|
protected void update() { |
|
|
|
|
boolean b = transformHistory.canGoForward(); |
|
|
|
|
Iterator it = components.iterator(); |
|
|
|
|
while (it.hasNext()) { |
|
|
|
|
((JComponent)it.next()).setEnabled(b); |
|
|
|
|
for (Object component : components) { |
|
|
|
|
((JComponent) component).setEnabled(b); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -2048,9 +2042,9 @@ public class JSVGViewerFrame
|
|
|
|
|
if (n instanceof StyleSheetProcessingInstruction) { |
|
|
|
|
StyleSheetProcessingInstruction sspi; |
|
|
|
|
sspi = (StyleSheetProcessingInstruction)n; |
|
|
|
|
HashTable attrs = sspi.getPseudoAttributes(); |
|
|
|
|
final String title = (String)attrs.get("title"); |
|
|
|
|
String alt = (String)attrs.get("alternate"); |
|
|
|
|
HashMap<String, String> attrs = sspi.getPseudoAttributes(); |
|
|
|
|
final String title = attrs.get("title"); |
|
|
|
|
String alt = attrs.get("alternate"); |
|
|
|
|
if (title != null && "yes".equals(alt)) { |
|
|
|
|
JRadioButtonMenuItem button; |
|
|
|
|
button = new JRadioButtonMenuItem(title); |
|
|
|
@ -2093,9 +2087,8 @@ public class JSVGViewerFrame
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void update(boolean enabled) { |
|
|
|
|
Iterator it = components.iterator(); |
|
|
|
|
while (it.hasNext()) { |
|
|
|
|
((JComponent)it.next()).setEnabled(enabled); |
|
|
|
|
for (Object component : components) { |
|
|
|
|
((JComponent) component).setEnabled(enabled); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -2117,9 +2110,8 @@ public class JSVGViewerFrame
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void update(boolean enabled) { |
|
|
|
|
Iterator it = components.iterator(); |
|
|
|
|
while (it.hasNext()) { |
|
|
|
|
((JComponent)it.next()).setEnabled(enabled); |
|
|
|
|
for (Object component : components) { |
|
|
|
|
((JComponent) component).setEnabled(enabled); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -2141,9 +2133,8 @@ public class JSVGViewerFrame
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void update(boolean enabled) { |
|
|
|
|
Iterator it = components.iterator(); |
|
|
|
|
while (it.hasNext()) { |
|
|
|
|
((JComponent)it.next()).setEnabled(enabled); |
|
|
|
|
for (Object component : components) { |
|
|
|
|
((JComponent) component).setEnabled(enabled); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|