Creating new windows with any shapes ! |
Skin Look And Feel added Skin support to your Java applications and SkinWindow to provide a complete customization framework.
Today SkinLF strikes again and delivers Irregular Windows to the Java Platform in SkinLF.
What can I do with SkinRegion ?
You can change the shape of any window. Your application splash screen will never be the same (rectangular window) again. It can be anything !
You can also create irregular windows for your main application. Imagine your new Java MP3 player with a funny window shape !
|
Using SkinRegion |
Basics
The com.l2fprod.gui.region.RegionBuilder class holds all the methods to create and set regions on a window. Regions can be created from regular shapes (ellipsis, polygons, ...) or from an image mask.
Ellipsis, Rectangles and Polygons
-
createEllipticRegion(int x1, int y1, int x2, int y2): creates an elliptic region given two points
-
createRectangleRegion(int x1, int y1, int x2, int y2): creates a rectangle region given two points
-
createRoundRectangleRegion(int x1, int y1, int x2, int y2, int x3, int y3): creates a rounded rectangle region given two points and third point for the corner
-
createPolygonRegion(int[] xpoints, int[] ypoints, int fillMode): creates a polygon region from a set of points. Fill mode is FILL_ALTERNATE or FILL_WINDING.
-
combineRegions(Region region1, Region region2, int combineMode): combine two regions to create a new region. Combine mode is AND, COPY, DIFF, OR, or XOR.
Image Transparency
Creating a region using primitives is easy but when it comes to complex shapes, it can be really difficult. SkinRegion offers an other way for creating regions.
-
createRegion(Image image): takes an image and creates a region by removing transparent pixels.
|
Some platforms may not support all method calls. For example X11 implementation only support the createRegion(Image image) method.
|
|
|