Java Code Examples for sun.java2d.pipe.Region#getInstanceXYXY()
The following examples show how to use
sun.java2d.pipe.Region#getInstanceXYXY() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SunGraphics2D.java From Bytecoder with Apache License 2.0 | 5 votes |
/** * Constrain rendering for lightweight objects. */ public void constrain(int x, int y, int w, int h, Region region) { if ((x | y) != 0) { translate(x, y); } if (transformState > TRANSFORM_TRANSLATESCALE) { clipRect(0, 0, w, h); return; } // changes parameters according to the current scale and translate. final double scaleX = transform.getScaleX(); final double scaleY = transform.getScaleY(); x = constrainX = (int) transform.getTranslateX(); y = constrainY = (int) transform.getTranslateY(); w = Region.dimAdd(x, Region.clipScale(w, scaleX)); h = Region.dimAdd(y, Region.clipScale(h, scaleY)); Region c = constrainClip; if (c == null) { c = Region.getInstanceXYXY(x, y, w, h); } else { c = c.getIntersectionXYXY(x, y, w, h); } if (region != null) { region = region.getScaledRegion(scaleX, scaleY); region = region.getTranslatedRegion(x, y); c = c.getIntersection(region); } if (c == constrainClip) { // Common case to ignore return; } constrainClip = c; if (!devClip.isInsideQuickCheck(c)) { devClip = devClip.getIntersection(c); validateCompClip(); } }
Example 2
Source File: SunGraphics2D.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Constrain rendering for lightweight objects. */ public void constrain(int x, int y, int w, int h, Region region) { if ((x | y) != 0) { translate(x, y); } if (transformState > TRANSFORM_TRANSLATESCALE) { clipRect(0, 0, w, h); return; } // changes parameters according to the current scale and translate. final double scaleX = transform.getScaleX(); final double scaleY = transform.getScaleY(); x = constrainX = (int) transform.getTranslateX(); y = constrainY = (int) transform.getTranslateY(); w = Region.dimAdd(x, Region.clipScale(w, scaleX)); h = Region.dimAdd(y, Region.clipScale(h, scaleY)); Region c = constrainClip; if (c == null) { c = Region.getInstanceXYXY(x, y, w, h); } else { c = c.getIntersectionXYXY(x, y, w, h); } if (region != null) { region = region.getScaledRegion(scaleX, scaleY); region = region.getTranslatedRegion(x, y); c = c.getIntersection(region); } if (c == constrainClip) { // Common case to ignore return; } constrainClip = c; if (!devClip.isInsideQuickCheck(c)) { devClip = devClip.getIntersection(c); validateCompClip(); } }
Example 3
Source File: RegionOps.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public void addRect(int lox, int loy, int hix, int hiy) { Region r2 = Region.getInstanceXYXY(lox, loy, hix, hiy); if (theRegion == null) { theRegion = r2; } else { theRegion = theRegion.getUnion(r2); } }
Example 4
Source File: SunGraphics2D.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * Constrain rendering for lightweight objects. */ public void constrain(int x, int y, int w, int h, Region region) { if ((x | y) != 0) { translate(x, y); } if (transformState > TRANSFORM_TRANSLATESCALE) { clipRect(0, 0, w, h); return; } // changes parameters according to the current scale and translate. final double scaleX = transform.getScaleX(); final double scaleY = transform.getScaleY(); x = constrainX = (int) transform.getTranslateX(); y = constrainY = (int) transform.getTranslateY(); w = Region.dimAdd(x, Region.clipScale(w, scaleX)); h = Region.dimAdd(y, Region.clipScale(h, scaleY)); Region c = constrainClip; if (c == null) { c = Region.getInstanceXYXY(x, y, w, h); } else { c = c.getIntersectionXYXY(x, y, w, h); } if (region != null) { region = region.getScaledRegion(scaleX, scaleY); region = region.getTranslatedRegion(x, y); c = c.getIntersection(region); } if (c == constrainClip) { // Common case to ignore return; } constrainClip = c; if (!devClip.isInsideQuickCheck(c)) { devClip = devClip.getIntersection(c); validateCompClip(); } }
Example 5
Source File: RegionOps.java From hottub with GNU General Public License v2.0 | 5 votes |
public void addRect(int lox, int loy, int hix, int hiy) { Region r2 = Region.getInstanceXYXY(lox, loy, hix, hiy); if (theRegion == null) { theRegion = r2; } else { theRegion = theRegion.getUnion(r2); } }
Example 6
Source File: SunGraphics2D.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Constrain rendering for lightweight objects. */ public void constrain(int x, int y, int w, int h, Region region) { if ((x | y) != 0) { translate(x, y); } if (transformState > TRANSFORM_TRANSLATESCALE) { clipRect(0, 0, w, h); return; } // changes parameters according to the current scale and translate. final double scaleX = transform.getScaleX(); final double scaleY = transform.getScaleY(); x = constrainX = (int) transform.getTranslateX(); y = constrainY = (int) transform.getTranslateY(); w = Region.dimAdd(x, Region.clipScale(w, scaleX)); h = Region.dimAdd(y, Region.clipScale(h, scaleY)); Region c = constrainClip; if (c == null) { c = Region.getInstanceXYXY(x, y, w, h); } else { c = c.getIntersectionXYXY(x, y, w, h); } if (region != null) { region = region.getScaledRegion(scaleX, scaleY); region = region.getTranslatedRegion(x, y); c = c.getIntersection(region); } if (c == constrainClip) { // Common case to ignore return; } constrainClip = c; if (!devClip.isInsideQuickCheck(c)) { devClip = devClip.getIntersection(c); validateCompClip(); } }
Example 7
Source File: RegionOps.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
public void addRect(int lox, int loy, int hix, int hiy) { Region r2 = Region.getInstanceXYXY(lox, loy, hix, hiy); if (theRegion == null) { theRegion = r2; } else { theRegion = theRegion.getUnion(r2); } }
Example 8
Source File: SunGraphics2D.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * Constrain rendering for lightweight objects. */ public void constrain(int x, int y, int w, int h, Region region) { if ((x | y) != 0) { translate(x, y); } if (transformState > TRANSFORM_TRANSLATESCALE) { clipRect(0, 0, w, h); return; } // changes parameters according to the current scale and translate. final double scaleX = transform.getScaleX(); final double scaleY = transform.getScaleY(); x = constrainX = (int) transform.getTranslateX(); y = constrainY = (int) transform.getTranslateY(); w = Region.dimAdd(x, Region.clipScale(w, scaleX)); h = Region.dimAdd(y, Region.clipScale(h, scaleY)); Region c = constrainClip; if (c == null) { c = Region.getInstanceXYXY(x, y, w, h); } else { c = c.getIntersectionXYXY(x, y, w, h); } if (region != null) { region = region.getScaledRegion(scaleX, scaleY); region = region.getTranslatedRegion(x, y); c = c.getIntersection(region); } if (c == constrainClip) { // Common case to ignore return; } constrainClip = c; if (!devClip.isInsideQuickCheck(c)) { devClip = devClip.getIntersection(c); validateCompClip(); } }
Example 9
Source File: RegionOps.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
public void addRect(int lox, int loy, int hix, int hiy) { Region r2 = Region.getInstanceXYXY(lox, loy, hix, hiy); if (theRegion == null) { theRegion = r2; } else { theRegion = theRegion.getUnion(r2); } }
Example 10
Source File: SunGraphics2D.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
/** * Constrain rendering for lightweight objects. */ public void constrain(int x, int y, int w, int h, Region region) { if ((x | y) != 0) { translate(x, y); } if (transformState > TRANSFORM_TRANSLATESCALE) { clipRect(0, 0, w, h); return; } // changes parameters according to the current scale and translate. final double scaleX = transform.getScaleX(); final double scaleY = transform.getScaleY(); x = constrainX = (int) transform.getTranslateX(); y = constrainY = (int) transform.getTranslateY(); w = Region.dimAdd(x, Region.clipScale(w, scaleX)); h = Region.dimAdd(y, Region.clipScale(h, scaleY)); Region c = constrainClip; if (c == null) { c = Region.getInstanceXYXY(x, y, w, h); } else { c = c.getIntersectionXYXY(x, y, w, h); } if (region != null) { region = region.getScaledRegion(scaleX, scaleY); region = region.getTranslatedRegion(x, y); c = c.getIntersection(region); } if (c == constrainClip) { // Common case to ignore return; } constrainClip = c; if (!devClip.isInsideQuickCheck(c)) { devClip = devClip.getIntersection(c); validateCompClip(); } }
Example 11
Source File: RegionOps.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public void addRect(int lox, int loy, int hix, int hiy) { Region r2 = Region.getInstanceXYXY(lox, loy, hix, hiy); if (theRegion == null) { theRegion = r2; } else { theRegion = theRegion.getUnion(r2); } }
Example 12
Source File: SunGraphics2D.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Constrain rendering for lightweight objects. */ public void constrain(int x, int y, int w, int h, Region region) { if ((x | y) != 0) { translate(x, y); } if (transformState > TRANSFORM_TRANSLATESCALE) { clipRect(0, 0, w, h); return; } // changes parameters according to the current scale and translate. final double scaleX = transform.getScaleX(); final double scaleY = transform.getScaleY(); x = constrainX = (int) transform.getTranslateX(); y = constrainY = (int) transform.getTranslateY(); w = Region.dimAdd(x, Region.clipScale(w, scaleX)); h = Region.dimAdd(y, Region.clipScale(h, scaleY)); Region c = constrainClip; if (c == null) { c = Region.getInstanceXYXY(x, y, w, h); } else { c = c.getIntersectionXYXY(x, y, w, h); } if (region != null) { region = region.getScaledRegion(scaleX, scaleY); region = region.getTranslatedRegion(x, y); c = c.getIntersection(region); } if (c == constrainClip) { // Common case to ignore return; } constrainClip = c; if (!devClip.isInsideQuickCheck(c)) { devClip = devClip.getIntersection(c); validateCompClip(); } }
Example 13
Source File: RegionOps.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public void addRect(int lox, int loy, int hix, int hiy) { Region r2 = Region.getInstanceXYXY(lox, loy, hix, hiy); if (theRegion == null) { theRegion = r2; } else { theRegion = theRegion.getUnion(r2); } }
Example 14
Source File: SunGraphics2D.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Constrain rendering for lightweight objects. */ public void constrain(int x, int y, int w, int h, Region region) { if ((x | y) != 0) { translate(x, y); } if (transformState > TRANSFORM_TRANSLATESCALE) { clipRect(0, 0, w, h); return; } // changes parameters according to the current scale and translate. final double scaleX = transform.getScaleX(); final double scaleY = transform.getScaleY(); x = constrainX = (int) transform.getTranslateX(); y = constrainY = (int) transform.getTranslateY(); w = Region.dimAdd(x, Region.clipScale(w, scaleX)); h = Region.dimAdd(y, Region.clipScale(h, scaleY)); Region c = constrainClip; if (c == null) { c = Region.getInstanceXYXY(x, y, w, h); } else { c = c.getIntersectionXYXY(x, y, w, h); } if (region != null) { region = region.getScaledRegion(scaleX, scaleY); region = region.getTranslatedRegion(x, y); c = c.getIntersection(region); } if (c == constrainClip) { // Common case to ignore return; } constrainClip = c; if (!devClip.isInsideQuickCheck(c)) { devClip = devClip.getIntersection(c); validateCompClip(); } }
Example 15
Source File: RegionOps.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public void addRect(int lox, int loy, int hix, int hiy) { Region r2 = Region.getInstanceXYXY(lox, loy, hix, hiy); if (theRegion == null) { theRegion = r2; } else { theRegion = theRegion.getUnion(r2); } }
Example 16
Source File: SunGraphics2D.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Constrain rendering for lightweight objects. */ public void constrain(int x, int y, int w, int h, Region region) { if ((x | y) != 0) { translate(x, y); } if (transformState > TRANSFORM_TRANSLATESCALE) { clipRect(0, 0, w, h); return; } // changes parameters according to the current scale and translate. final double scaleX = transform.getScaleX(); final double scaleY = transform.getScaleY(); x = constrainX = (int) transform.getTranslateX(); y = constrainY = (int) transform.getTranslateY(); w = Region.dimAdd(x, Region.clipScale(w, scaleX)); h = Region.dimAdd(y, Region.clipScale(h, scaleY)); Region c = constrainClip; if (c == null) { c = Region.getInstanceXYXY(x, y, w, h); } else { c = c.getIntersectionXYXY(x, y, w, h); } if (region != null) { region = region.getScaledRegion(scaleX, scaleY); region = region.getTranslatedRegion(x, y); c = c.getIntersection(region); } if (c == constrainClip) { // Common case to ignore return; } constrainClip = c; if (!devClip.isInsideQuickCheck(c)) { devClip = devClip.getIntersection(c); validateCompClip(); } }
Example 17
Source File: RegionOps.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
public void addRect(int lox, int loy, int hix, int hiy) { Region r2 = Region.getInstanceXYXY(lox, loy, hix, hiy); if (theRegion == null) { theRegion = r2; } else { theRegion = theRegion.getUnion(r2); } }
Example 18
Source File: SunGraphics2D.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Constrain rendering for lightweight objects. */ public void constrain(int x, int y, int w, int h, Region region) { if ((x | y) != 0) { translate(x, y); } if (transformState > TRANSFORM_TRANSLATESCALE) { clipRect(0, 0, w, h); return; } // changes parameters according to the current scale and translate. final double scaleX = transform.getScaleX(); final double scaleY = transform.getScaleY(); x = constrainX = (int) transform.getTranslateX(); y = constrainY = (int) transform.getTranslateY(); w = Region.dimAdd(x, Region.clipScale(w, scaleX)); h = Region.dimAdd(y, Region.clipScale(h, scaleY)); Region c = constrainClip; if (c == null) { c = Region.getInstanceXYXY(x, y, w, h); } else { c = c.getIntersectionXYXY(x, y, w, h); } if (region != null) { region = region.getScaledRegion(scaleX, scaleY); region = region.getTranslatedRegion(x, y); c = c.getIntersection(region); } if (c == constrainClip) { // Common case to ignore return; } constrainClip = c; if (!devClip.isInsideQuickCheck(c)) { devClip = devClip.getIntersection(c); validateCompClip(); } }
Example 19
Source File: RegionOps.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
public void addRect(int lox, int loy, int hix, int hiy) { Region r2 = Region.getInstanceXYXY(lox, loy, hix, hiy); if (theRegion == null) { theRegion = r2; } else { theRegion = theRegion.getUnion(r2); } }
Example 20
Source File: SunGraphics2D.java From jdk8u_jdk with GNU General Public License v2.0 | 4 votes |
/** * Constrain rendering for lightweight objects. */ public void constrain(int x, int y, int w, int h, Region region) { if ((x | y) != 0) { translate(x, y); } if (transformState > TRANSFORM_TRANSLATESCALE) { clipRect(0, 0, w, h); return; } // changes parameters according to the current scale and translate. final double scaleX = transform.getScaleX(); final double scaleY = transform.getScaleY(); // [tav] rounding down affects aligning by insets in WWindowPeer.getGraphics x = constrainX = (int)Math.floor(transform.getTranslateX()); y = constrainY = (int)Math.floor(transform.getTranslateY()); w = Region.dimAdd(x, Region.clipScale(w, scaleX)); h = Region.dimAdd(y, Region.clipScale(h, scaleY)); Region c = constrainClip; if (c == null) { c = Region.getInstanceXYXY(x, y, w, h); } else { c = c.getIntersectionXYXY(x, y, w, h); } if (region != null) { region = region.getScaledRegion(scaleX, scaleY); region = region.getTranslatedRegion(x, y); c = c.getIntersection(region); } if (c == constrainClip) { // Common case to ignore return; } constrainClip = c; if (!devClip.isInsideQuickCheck(c)) { devClip = devClip.getIntersection(c); validateCompClip(); } }