~ubuntu-branches/ubuntu/gutsy/cairo-java/gutsy

« back to all changes in this revision

Viewing changes to src/java/org/freedesktop/cairo/SurfacePattern.java

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2006-04-16 16:15:30 UTC
  • Revision ID: james.westby@ubuntu.com-20060416161530-avdw6l5vg6n2kosy
Tags: upstream-1.0.3
ImportĀ upstreamĀ versionĀ 1.0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Java-Gnome Bindings Library
 
3
 *
 
4
 * Copyright 1998-2005 the Java-Gnome Team, all rights reserved.
 
5
 *
 
6
 * The Java-Gnome bindings library is free software distributed under
 
7
 * the terms of the GNU Library General Public License version 2.
 
8
 */
 
9
package org.freedesktop.cairo;
 
10
 
 
11
public class SurfacePattern extends Pattern {
 
12
 
 
13
    public SurfacePattern(Surface surface) {
 
14
        super(cairo_pattern_create_for_surface(surface.getHandle()));
 
15
    }
 
16
 
 
17
    /**
 
18
     * Sets the extend option for the pattern.
 
19
     * 
 
20
     * @param extend
 
21
     *            The Extend to use.
 
22
     */
 
23
    public void setExtend(Extend extend) {
 
24
        cairo_pattern_set_extend(getHandle(), extend.getValue());
 
25
    }
 
26
 
 
27
    /**
 
28
     * Returns the current extend option for the pattern.
 
29
     * 
 
30
     * @return The current extend option
 
31
     */
 
32
    public Extend getExtend() {
 
33
        return Extend.intern(cairo_pattern_get_extend(getHandle()));
 
34
    }
 
35
 
 
36
    /**
 
37
     * Sets the filter option for the pattern.
 
38
     * 
 
39
     * @param filter
 
40
     */
 
41
    public void setFilter(Filter filter) {
 
42
        cairo_pattern_set_filter(getHandle(), filter.getValue());
 
43
    }
 
44
 
 
45
    /**
 
46
     * Returns the current filter option for the pattern.
 
47
     * 
 
48
     * @return The current filter option (One of the Cairo.FILTER_xxx options).
 
49
     */
 
50
    public Filter getFilter() {
 
51
        return Filter.intern(cairo_pattern_get_filter(getHandle()));
 
52
    }
 
53
 
 
54
}