src/com/ 0000755 0001750 0001750 00000000000 10072542100 012350 5 ustar twerner twerner src/com/incors/ 0000755 0001750 0001750 00000000000 10072542100 013645 5 ustar twerner twerner src/com/incors/plaf/ 0000755 0001750 0001750 00000000000 10072542100 014567 5 ustar twerner twerner src/com/incors/plaf/ColorUIResource2.java 0000644 0001750 0001750 00000006244 07372206354 020567 0 ustar twerner twerner package com.incors.plaf;
/**
* This class had to be created because ColorUIResouce
does not allow
* transparency. Hopefully one day support for transparency will be added to we
* ColorUIResouce and we can get rid of this class. Wrapping a Color
* object to make a pseudo subclass is very ugly.
*/
import java.awt.Color;
import java.awt.PaintContext;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.color.ColorSpace;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import java.awt.image.ColorModel;
import javax.swing.plaf.ColorUIResource;
public class ColorUIResource2 extends ColorUIResource {
private Color myColor;
// constructors
public ColorUIResource2(Color c) {
super(0, 0, 0);
myColor = c;
}
public ColorUIResource2(int r, int g, int b) {
super(0, 0, 0);
myColor = new Color(r, g, b);
}
public ColorUIResource2(int r, int g, int b, int a) {
super(0, 0, 0);
myColor = new Color(r, g, b, a);
}
public ColorUIResource2(int rgb) {
super(0, 0, 0);
myColor = new Color(rgb);
}
public ColorUIResource2(int rgba, boolean hasalpha) {
super(0, 0, 0);
myColor = new Color(rgba, hasalpha);
}
public ColorUIResource2(float r, float g, float b) {
super(0, 0, 0);
myColor = new Color(r, g, b);
}
public ColorUIResource2(float r, float g, float b, float alpha) {
super(0, 0, 0);
myColor = new Color(r, g, b, alpha);
}
// non static methods
public int getRed() {
return myColor.getRed();
}
public int getGreen() {
return myColor.getGreen();
}
public int getBlue() {
return myColor.getBlue();
}
public int getAlpha() {
return myColor.getAlpha();
}
public int getRGB() {
return myColor.getRGB();
}
public Color brighter() {
return myColor.brighter();
}
public Color darker() {
return myColor.darker();
}
public int hashCode() {
return myColor.hashCode();
}
public boolean equals(Object obj) {
return myColor.equals(obj);
}
public String toString() {
return myColor.toString();
}
public float[] getRGBComponents(float[] compArray) {
return myColor.getRGBComponents(compArray);
}
public float[] getRGBColorComponents(float[] compArray) {
return myColor.getRGBColorComponents(compArray);
}
public float[] getComponents(float[] compArray) {
return myColor.getComponents(compArray);
}
public float[] getColorComponents(float[] compArray) {
return myColor.getColorComponents(compArray);
}
public float[] getComponents(ColorSpace cspace, float[] compArray) {
return myColor.getComponents(cspace, compArray);
}
public float[] getColorComponents(ColorSpace cspace, float[] compArray) {
return myColor.getColorComponents(cspace, compArray);
}
public ColorSpace getColorSpace() {
return myColor.getColorSpace();
}
public PaintContext createContext(ColorModel cm, Rectangle r, Rectangle2D r2d,
AffineTransform xform, RenderingHints hints) {
return myColor.createContext(cm, r, r2d, xform, hints);
}
public int getTransparency() {
return myColor.getTransparency();
}
} src/com/incors/plaf/FastGradientPaint.java 0000644 0001750 0001750 00000001537 07421104710 021014 0 ustar twerner twerner package com.incors.plaf;
/*
* This code was contributed by Sebastian Ferreyra (sebastianf@citycolor.net).
* It is published under the terms of the GNU Lesser General Public License.
*/
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.ColorModel;
public class FastGradientPaint implements Paint {
int startColor, endColor;
boolean isVertical;
public FastGradientPaint( Color sc, Color ec, boolean isV ) {
startColor = sc.getRGB();
endColor = ec.getRGB();
isVertical = isV;
}
public synchronized PaintContext createContext( ColorModel cm, Rectangle r, Rectangle2D r2d, AffineTransform xform, RenderingHints hints ) {
return new FastGradientPaintContext( cm, r, startColor, endColor, isVertical );
}
public int getTransparency() {
return ( ( ( (startColor & endColor) >> 24) & 0xFF ) == 0xFF) ? OPAQUE : TRANSLUCENT;
}
}
src/com/incors/plaf/FastGradientPaintContext.java 0000644 0001750 0001750 00000011730 10072545126 022363 0 ustar twerner twerner package com.incors.plaf;
/*
* This code was contributed by Sebastian Ferreyra (sebastianf@citycolor.net).
* It is published under the terms of the GNU Lesser General Public License.
*/
import java.awt.PaintContext;
import java.awt.Rectangle;
import java.awt.image.ColorModel;
import java.awt.image.Raster;
import java.awt.image.WritableRaster;
import java.util.LinkedList;
import java.util.HashMap;
import java.util.WeakHashMap;
class FastGradientPaintContext implements PaintContext {
private class GradientInfo {
ColorModel model;
int parallelLength, startColor, endColor;
boolean isVertical;
public boolean equals( Object o ) {
if ( ! ( o instanceof GradientInfo ) ) return false;
GradientInfo gi = (GradientInfo) o;
if ( gi.model.equals(model) && gi.parallelLength == parallelLength && gi.startColor == startColor && gi.endColor == endColor && gi.isVertical == isVertical ) return true;
return false;
}
public int hashCode() {
return parallelLength;
}
public String toString() {
return "Direction:" + (isVertical?"ver":"hor") + ", Length: "+Integer.toString( parallelLength )+", Color1: "+Integer.toString( startColor, 16 )+", Color2: "+Integer.toString( endColor, 16 );
}
}
private class Gradient {
GradientInfo info;
int perpendicularLength = 0;
WritableRaster raster;
HashMap childRasterCache;
Gradient ( GradientInfo i ) { info = i; }
private Raster getRaster( int parallelPos, int perpendicularLength, int parallelLength ) {
if ( raster == null || ( this.perpendicularLength < perpendicularLength ) ) createRaster( perpendicularLength );
Integer key = new Integer( parallelPos );
Object o = childRasterCache.get( key );
if ( o !=null ) return (Raster) o;
else {
Raster r;
if ( info.isVertical ) r = raster.createChild( 0, parallelPos, this.perpendicularLength, info.parallelLength-parallelPos, 0, 0, null );
else r = raster.createChild( parallelPos, 0, info.parallelLength-parallelPos, this.perpendicularLength, 0, 0, null );
childRasterCache.put( key, r );
//System.out.println( "Storing child raster in cache. Position: " + Integer.toString(parallelPos) );
return r;
}
}
public void dispose() {
// raster = null;
}
private void createRaster( int perpendicularLength ) {
int gradientWidth, gradientHeight;
if ( info.isVertical ) {
gradientHeight = info.parallelLength;
gradientWidth = this.perpendicularLength = perpendicularLength;
} else {
gradientWidth = info.parallelLength;
gradientHeight = this.perpendicularLength = perpendicularLength;
}
int sa = (info.startColor >> 24) & 0xFF;
int sr = (info.startColor >> 16) & 0xFF;
int sg = (info.startColor >> 8) & 0xFF;
int sb = info.startColor & 0xFF;
int da = ((info.endColor >> 24) & 0xFF) - sa;
int dr = ((info.endColor >> 16) & 0xFF) - sr;
int dg = ((info.endColor >> 8) & 0xFF) - sg;
int db = (info.endColor & 0xFF) - sb;
raster = info.model.createCompatibleWritableRaster( gradientWidth, gradientHeight );
Object c = null;
int pl = info.parallelLength;
for ( int i = 0 ; i < pl ; i++ ) {
c = info.model.getDataElements( (sa+(i*da)/pl)<<24 | (sr+(i*dr)/pl)<<16 | (sg+(i*dg)/pl)<<8 | (sb+(i*db)/pl), c );
for ( int j = 0 ; j < perpendicularLength ; j++ ) {
if ( info.isVertical ) raster.setDataElements( j, i, c );
else raster.setDataElements( i, j, c );
}
}
childRasterCache = new HashMap();
}
}
private static WeakHashMap gradientCache = new WeakHashMap();
private static LinkedList recentInfos = new LinkedList();
GradientInfo info;
int parallelDevicePos;
Gradient gradient;
FastGradientPaintContext(ColorModel cm, Rectangle r, int sc, int ec, boolean ver ) {
info = new GradientInfo();
if ( (((sc & ec)>>24) & 0xFF) != 0xFF ) info.model = ColorModel.getRGBdefault();
else info.model = cm;
info.startColor = sc;
info.endColor = ec;
if ( info.isVertical = ver ) {
parallelDevicePos = r.y;
info.parallelLength = r.height;
} else {
parallelDevicePos = r.x;
info.parallelLength = r.width;
}
recentInfos.remove( info );
recentInfos.add( 0, info );
if ( recentInfos.size() > 16 ) recentInfos.removeLast();
Object o = gradientCache.get( info );
if ( o != null ) o = ( ( java.lang.ref.WeakReference )o ).get();
if ( o != null ) {
gradient = (Gradient) o;
} else {
gradientCache.put( info, new java.lang.ref.WeakReference( gradient = new Gradient( info ) ) );
//System.out.println( "Storing gradient in cache. Info: " + info.toString() );
}
}
public void dispose() {
gradient.dispose();
}
public ColorModel getColorModel() {
return info.model;
}
public synchronized Raster getRaster( int x, int y, int w, int h ) {
if ( info.isVertical ) return gradient.getRaster( y - parallelDevicePos, w, h );
else return gradient.getRaster( x - parallelDevicePos, h, w );
}
}
src/com/incors/plaf/kunststoff/ 0000755 0001750 0001750 00000000000 10072542102 016777 5 ustar twerner twerner src/com/incors/plaf/kunststoff/GradientTheme.java 0000644 0001750 0001750 00000003156 07410117670 022401 0 ustar twerner twerner package com.incors.plaf.kunststoff;
/*
* This code was developed by INCORS GmbH (www.incors.com).
* It is published under the terms of the GNU Lesser General Public License.
*/
import java.awt.*;
import javax.swing.plaf.*;
import javax.swing.plaf.metal.*;
/**
* Interface that provides methods for getting the colors for all gradients
* in the Kunststoff Look&Feel. This interface can be implemented by subclasses
* of javax.swing.plaf.metal.MetalTheme
to have a theme that provides
* standard colors as well as gradient colors.
*/
public interface GradientTheme {
/**
* Returns the upper gradient color for components like JButton, JMenuBar,
* and JProgressBar.
* Will return null
if upper gradient should not be painted.
*/
public ColorUIResource getComponentGradientColorReflection();
/**
* Returns the lower gradient color for components like JButton, JMenuBar,
* and JProgressBar.
* Will return null
if lower gradient should not be painted.
*/
public ColorUIResource getComponentGradientColorShadow();
/**
* Returns the upper gradient color for text components like JTextField and
* JPasswordField.
* Will return null
if upper gradient should not be painted.
*/
public ColorUIResource getTextComponentGradientColorReflection();
/**
* Returns the lower gradient color for text components like JTextField and
* JPasswordField.
* Will return null
if lower gradient should not be painted.
*/
public ColorUIResource getTextComponentGradientColorShadow();
public int getBackgroundGradientShadow();
} src/com/incors/plaf/kunststoff/icons/ 0000755 0001750 0001750 00000000000 10072542102 020112 5 ustar twerner twerner src/com/incors/plaf/kunststoff/icons/Error.gif 0000644 0001750 0001750 00000002771 07264133040 021707 0 ustar twerner twerner GIF89a s11s91s99{99{B9{BBFBJJ{kk{ksOJRJRRZTc^kssss{s{ss{]Wlh{z{sƜġΠΧ֭ƱέұέƵεεƽƽƽνֵֵֵֽֽֽ ! X , H.XP!#bqR+WPHI
*Hㅔ+TR%K(b@'*X":tʣLLBBcϟA!Dt4J:j
#jD$! :|:u@yP(CC(ܠ>ZX$%6!AHٸ7X,ywq[0T
@`ID)<fБ3[P(h@*
E'Mg. &\A
Tށ1 40Dvn`}F@4$a"( 'hp@|
3\*-$ A%xz#
4֠B7
M*`@dp: *)l,AAxc:BRW L0*
@d)@cX\
XP@ٰ@ oT