You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by je...@apache.org on 2007/12/19 14:22:20 UTC

svn commit: r605534 - /xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/impl/DefaultImageContext.java

Author: jeremias
Date: Wed Dec 19 05:22:20 2007
New Revision: 605534

URL: http://svn.apache.org/viewvc?rev=605534&view=rev
Log:
Convenience class if you don't have any special needs for the ImageContext.

Added:
    xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/impl/DefaultImageContext.java   (with props)

Added: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/impl/DefaultImageContext.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/impl/DefaultImageContext.java?rev=605534&view=auto
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/impl/DefaultImageContext.java (added)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/impl/DefaultImageContext.java Wed Dec 19 05:22:20 2007
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.xmlgraphics.image.loader.impl;
+
+import java.awt.Toolkit;
+
+import org.apache.xmlgraphics.image.loader.ImageContext;
+
+/**
+ * Very simple ImageContext implementation that uses the <code>Toolkit</code>'s screen resolution.
+ */
+public class DefaultImageContext implements ImageContext {
+
+    private float sourceResolution;
+    
+    /**
+     * Main constructor.
+     */
+    public DefaultImageContext() {
+        this.sourceResolution = Toolkit.getDefaultToolkit().getScreenResolution();
+    }
+    
+    /** {@inheritDoc} */
+    public float getSourceResolution() {
+        return this.sourceResolution;
+    }
+
+}

Propchange: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/impl/DefaultImageContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/impl/DefaultImageContext.java
------------------------------------------------------------------------------
    svn:keywords = Id



---------------------------------------------------------------------
Apache XML Graphics Project URL: http://xmlgraphics.apache.org/
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org