de.cau.cs.kieler.kev.views
Class KevComposite.MyUserAgent

java.lang.Object
  extended by de.cau.cs.kieler.kev.views.KevComposite.MyUserAgent
All Implemented Interfaces:
org.apache.batik.swing.svg.SVGUserAgent
Enclosing class:
KevComposite

protected class KevComposite.MyUserAgent
extends Object
implements org.apache.batik.swing.svg.SVGUserAgent

This class implements a SVG user agent.

Rating red

Constructor Summary
protected KevComposite.MyUserAgent()
          Creates a new SVGUserAgent.
 
Method Summary
 void checkLoadExternalResource(org.apache.batik.util.ParsedURL resourceURL, org.apache.batik.util.ParsedURL docURL)
          This method throws a SecurityException if the resource found at url and referenced from docURL should not be loaded.
 void checkLoadScript(String scriptType, org.apache.batik.util.ParsedURL scriptURL, org.apache.batik.util.ParsedURL docURL)
          This method throws a SecurityException if the script of given type, found at url and referenced from docURL should not be loaded.
 void displayError(Exception ex)
          Displays an error resulting from the specified Exception.
 void displayError(String message)
          Displays an error message.
 void displayMessage(String message)
          Displays a message in the User Agent interface.
 String getAlternateStyleSheet()
          Returns this user agent's alternate style-sheet title.
 float getBolderFontWeight(float f)
          Returns a bolder font-weight.
 String getDefaultFontFamily()
           
 org.apache.batik.bridge.ExternalResourceSecurity getExternalResourceSecurity(org.apache.batik.util.ParsedURL resourceURL, org.apache.batik.util.ParsedURL docURL)
          Returns the security settings for the given resource url and document url
 String getLanguages()
          Returns the language settings.
 float getLighterFontWeight(float f)
          Returns a lighter font-weight.
 String getMedia()
          Returns this user agent's CSS media.
 float getMediumFontSize()
          Returns the medium font size.
 float getPixelToMM()
          Returns the size of a px CSS unit in millimeters.
 float getPixelUnitToMillimeter()
          Returns the size of a px CSS unit in millimeters.
 org.apache.batik.bridge.ScriptSecurity getScriptSecurity(String scriptType, org.apache.batik.util.ParsedURL scriptURL, org.apache.batik.util.ParsedURL docURL)
          Returns the security settings for the given script type, script url and document url
 String getUserStyleSheetURI()
          Returns the user stylesheet uri.
 String getXMLParserClassName()
          Returns the class name of the XML parser.
 void handleElement(Element elt, Object data)
           
 boolean isXMLParserValidating()
          Returns true if the XML parser must be in validation mode, false otherwise.
 void openLink(String uri, boolean newc)
          Opens a link.
 void showAlert(String message)
          Shows an alert dialog box.
 boolean showConfirm(String message)
          Shows a confirm dialog box.
 String showPrompt(String message)
          Shows a prompt dialog box.
 String showPrompt(String message, String defaultValue)
          Shows a prompt dialog box.
 boolean supportExtension(String s)
          Tells whether the given extension is supported by this user agent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KevComposite.MyUserAgent

protected KevComposite.MyUserAgent()
Creates a new SVGUserAgent.

Method Detail

getDefaultFontFamily

public String getDefaultFontFamily()
Specified by:
getDefaultFontFamily in interface org.apache.batik.swing.svg.SVGUserAgent

displayError

public void displayError(String message)
Displays an error message.

Specified by:
displayError in interface org.apache.batik.swing.svg.SVGUserAgent

displayError

public void displayError(Exception ex)
Displays an error resulting from the specified Exception.

Specified by:
displayError in interface org.apache.batik.swing.svg.SVGUserAgent

displayMessage

public void displayMessage(String message)
Displays a message in the User Agent interface. The given message is typically displayed in a status bar.

Specified by:
displayMessage in interface org.apache.batik.swing.svg.SVGUserAgent

showAlert

public void showAlert(String message)
Shows an alert dialog box.

Specified by:
showAlert in interface org.apache.batik.swing.svg.SVGUserAgent

showPrompt

public String showPrompt(String message)
Shows a prompt dialog box.

Specified by:
showPrompt in interface org.apache.batik.swing.svg.SVGUserAgent

showPrompt

public String showPrompt(String message,
                         String defaultValue)
Shows a prompt dialog box.

Specified by:
showPrompt in interface org.apache.batik.swing.svg.SVGUserAgent

showConfirm

public boolean showConfirm(String message)
Shows a confirm dialog box.

Specified by:
showConfirm in interface org.apache.batik.swing.svg.SVGUserAgent

getPixelUnitToMillimeter

public float getPixelUnitToMillimeter()
Returns the size of a px CSS unit in millimeters.

Specified by:
getPixelUnitToMillimeter in interface org.apache.batik.swing.svg.SVGUserAgent

getPixelToMM

public float getPixelToMM()
Returns the size of a px CSS unit in millimeters. This will be removed after next release.

Specified by:
getPixelToMM in interface org.apache.batik.swing.svg.SVGUserAgent
See Also:
getPixelUnitToMillimeter();

getMediumFontSize

public float getMediumFontSize()
Returns the medium font size.

Specified by:
getMediumFontSize in interface org.apache.batik.swing.svg.SVGUserAgent

getLighterFontWeight

public float getLighterFontWeight(float f)
Returns a lighter font-weight.

Specified by:
getLighterFontWeight in interface org.apache.batik.swing.svg.SVGUserAgent

getBolderFontWeight

public float getBolderFontWeight(float f)
Returns a bolder font-weight.

Specified by:
getBolderFontWeight in interface org.apache.batik.swing.svg.SVGUserAgent

getLanguages

public String getLanguages()
Returns the language settings.

Specified by:
getLanguages in interface org.apache.batik.swing.svg.SVGUserAgent

getUserStyleSheetURI

public String getUserStyleSheetURI()
Returns the user stylesheet uri.

Specified by:
getUserStyleSheetURI in interface org.apache.batik.swing.svg.SVGUserAgent
Returns:
null if no user style sheet was specified.

getXMLParserClassName

public String getXMLParserClassName()
Returns the class name of the XML parser.

Specified by:
getXMLParserClassName in interface org.apache.batik.swing.svg.SVGUserAgent

isXMLParserValidating

public boolean isXMLParserValidating()
Returns true if the XML parser must be in validation mode, false otherwise.

Specified by:
isXMLParserValidating in interface org.apache.batik.swing.svg.SVGUserAgent

getMedia

public String getMedia()
Returns this user agent's CSS media.

Specified by:
getMedia in interface org.apache.batik.swing.svg.SVGUserAgent

getAlternateStyleSheet

public String getAlternateStyleSheet()
Returns this user agent's alternate style-sheet title.

Specified by:
getAlternateStyleSheet in interface org.apache.batik.swing.svg.SVGUserAgent

openLink

public void openLink(String uri,
                     boolean newc)
Opens a link.

Specified by:
openLink in interface org.apache.batik.swing.svg.SVGUserAgent
Parameters:
uri - The document URI.
newc - Whether the link should be activated in a new component.

supportExtension

public boolean supportExtension(String s)
Tells whether the given extension is supported by this user agent.

Specified by:
supportExtension in interface org.apache.batik.swing.svg.SVGUserAgent

handleElement

public void handleElement(Element elt,
                          Object data)
Specified by:
handleElement in interface org.apache.batik.swing.svg.SVGUserAgent

getScriptSecurity

public org.apache.batik.bridge.ScriptSecurity getScriptSecurity(String scriptType,
                                                                org.apache.batik.util.ParsedURL scriptURL,
                                                                org.apache.batik.util.ParsedURL docURL)
Returns the security settings for the given script type, script url and document url

Specified by:
getScriptSecurity in interface org.apache.batik.swing.svg.SVGUserAgent
Parameters:
scriptType - type of script, as found in the type attribute of the <script> element.
scriptURL - url for the script, as defined in the script's xlink:href attribute. If that attribute was empty, then this parameter should be null
docURL - url for the document into which the script was found.

checkLoadScript

public void checkLoadScript(String scriptType,
                            org.apache.batik.util.ParsedURL scriptURL,
                            org.apache.batik.util.ParsedURL docURL)
                     throws SecurityException
This method throws a SecurityException if the script of given type, found at url and referenced from docURL should not be loaded. This is a convenience method to call checkLoadScript on the ScriptSecurity strategy returned by getScriptSecurity.

Specified by:
checkLoadScript in interface org.apache.batik.swing.svg.SVGUserAgent
Parameters:
scriptType - type of script, as found in the type attribute of the <script> element.
scriptURL - url for the script, as defined in the script's xlink:href attribute. If that attribute was empty, then this parameter should be null
docURL - url for the document into which the script was found.
Throws:
SecurityException

getExternalResourceSecurity

public org.apache.batik.bridge.ExternalResourceSecurity getExternalResourceSecurity(org.apache.batik.util.ParsedURL resourceURL,
                                                                                    org.apache.batik.util.ParsedURL docURL)
Returns the security settings for the given resource url and document url

Specified by:
getExternalResourceSecurity in interface org.apache.batik.swing.svg.SVGUserAgent
Parameters:
resourceURL - url for the resource, as defined in the resource's xlink:href attribute. If that attribute was empty, then this parameter should be null
docURL - url for the document into which the resource was found.

checkLoadExternalResource

public void checkLoadExternalResource(org.apache.batik.util.ParsedURL resourceURL,
                                      org.apache.batik.util.ParsedURL docURL)
                               throws SecurityException
This method throws a SecurityException if the resource found at url and referenced from docURL should not be loaded. This is a convenience method to call checkLoadExternalResource on the ExternalResourceSecurity strategy returned by getExternalResourceSecurity.

Specified by:
checkLoadExternalResource in interface org.apache.batik.swing.svg.SVGUserAgent
Parameters:
scriptURL - url for the script, as defined in the script's xlink:href attribute. If that attribute was empty, then this parameter should be null
docURL - url for the document into which the script was found.
Throws:
SecurityException