Dear users, Please note that, from Monday, August 16, 2019, RSA keys shorter than 2048bit will no longer be accepted for security reasons. Please update your keys as needed before this date. If you need assistance with regard to this process, please contact sia@list.lu

Thank you for your understanding.

Commit d7176a92 authored by Nico Mack's avatar Nico Mack

Fixed KeyListener bug causing Applications no longer being quitable via

keyboard.
Started implementation of background bluring feature for coronas. Not
operational yet!
parent fe552e0c
......@@ -7,6 +7,9 @@
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
<accessrules>
<accessrule kind="accessible" pattern="sun/java2d/**"/>
</accessrules>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
......
......@@ -196,6 +196,11 @@
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>com.jhlabs</groupId>
<artifactId>filters</artifactId>
<version>2.0.235-1</version>
</dependency>
</dependencies>
<repositories>
......
......@@ -76,7 +76,7 @@ public class Stage extends JComponent {
protected transient GraphicsDevice device;
protected JFrame window;
protected TangibleContentManager contentManager;
protected transient TangibleContentManager contentManager;
protected volatile ConcurrentHashMap<Integer, BaseWidget> objects = new ConcurrentHashMap<>();
......
/**
* Copyright Luxembourg Institute of Science and Technology, 2018. All rights reserved.
*
* This file is part of TULIP.
*
* TULIP is free software: you can redistribute it and/or modify it under the terms of the GNU
* Lesser General Public License as published by the Free Software Foundation, version 3 of the
* License.
*
* TULIP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with TULIP. If
* not, see <http://www.gnu.org/licenses/lgpl-3.0.html>.
*/
package lu.list.itis.dkd.tui.utility.filter;
import java.awt.AlphaComposite;
import java.awt.Composite;
import java.awt.CompositeContext;
import java.awt.RenderingHints;
import java.awt.image.ColorModel;
/**
* @author mack
* @since [major].[minor]
* @version [major].[minor].[micro]
*/
// ***************************************************************************
// * Class Definition and Members *
// ***************************************************************************
public final class BlurredAlphaComposite implements Composite {
AlphaComposite alphaComposite = AlphaComposite.SrcOver;
BlurredAlphaContext blurComposite = null;
float blur = 0;
private static final float MIN_RADIUS = 1f;
private static final float MAX_RADIUS = 10f;
private static float getBlurRadius(float blurFactor) {
return (MIN_RADIUS + (MAX_RADIUS - MIN_RADIUS) * blurFactor);
}
public static final BlurredAlphaComposite AlphaBlur = new BlurredAlphaComposite(1f, 0f);
private BlurredAlphaComposite(float alpha, float blur) {
alphaComposite = AlphaComposite.SrcOver.derive(alpha);
this.blur = blur;
}
/** {@inheritDoc} */
@Override
public CompositeContext createContext(ColorModel srcColorModel, ColorModel dstColorModel, RenderingHints hints) {
CompositeContext alphaContext = alphaComposite.createContext(srcColorModel, dstColorModel, hints);
blurComposite = new BlurredAlphaContext(alphaContext);
float radius = getBlurRadius(blur);
blurComposite.setHRadius(radius);
blurComposite.setVRadius(radius);
return blurComposite;
}
public BlurredAlphaComposite derive(float alpha) {
alphaComposite = alphaComposite.derive(alpha);
return this;
}
public BlurredAlphaComposite blur(float blur) {
this.blur = Math.max(0, blur);
this.blur = Math.min(this.blur, 1f);
if (blurComposite != null) {
float radius = getBlurRadius(blur);
blurComposite.setHRadius(radius);
blurComposite.setVRadius(radius);
}
return this;
}
}
/**
* Copyright Luxembourg Institute of Science and Technology, 2018. All rights reserved.
*
* This file is part of TULIP.
*
* TULIP is free software: you can redistribute it and/or modify it under the terms of the GNU
* Lesser General Public License as published by the Free Software Foundation, version 3 of the
* License.
*
* TULIP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with TULIP. If
* not, see <http://www.gnu.org/licenses/lgpl-3.0.html>.
*/
package lu.list.itis.dkd.tui.utility.filter;
import java.awt.CompositeContext;
import java.awt.image.Raster;
import java.awt.image.WritableRaster;
/**
* @author mack
* @since [major].[minor]
* @version [major].[minor].[micro]
*/
// ***************************************************************************
// * Class Definition and Members *
// ***************************************************************************
public class BlurredAlphaContext implements CompositeContext {
private CompositeContext parent;
private float hRadius;
private float vRadius;
// ---------------------------------------------------------------------------
// ***************************************************************************
// * Constructor(s) *
// ***************************************************************************
// ---------------------------------------------------------------------------
/**
* @param context
*/
// ---------------------------------------------------------------------------
public BlurredAlphaContext(CompositeContext context) {
this.parent = context;
}
// ---------------------------------------------------------------------------
// ***************************************************************************
// * Class Body *
// ***************************************************************************
// ---------------------------------------------------------------------------
/**
* @param radius
*/
// ---------------------------------------------------------------------------
public void setHRadius(float radius) {
this.hRadius = radius;
}
// ---------------------------------------------------------------------------
/**
* @param radius
*/
// ---------------------------------------------------------------------------
public void setVRadius(float radius) {
this.vRadius = radius;
}
// ---------------------------------------------------------------------------
/** {@inheritDoc} */
@Override
public void dispose() {
// Nothing to dispose of
}
// ---------------------------------------------------------------------------
/** {@inheritDoc} */
@Override
public void compose(Raster src, Raster dstIn, WritableRaster dstOut) {
// int width = dstIn.getWidth();
// int height = dstIn.getHeight();
//
// int[] inPixels = new int[width * height];
// int[] outPixels = new int[width * height];
// dstIn.getDataElements(0, 0, width, height, inPixels);
// ImageMath.premultiply(inPixels, 0, inPixels.length);
// BoxBlurFilter.blur(inPixels, outPixels, width, height, hRadius);
// BoxBlurFilter.blur(outPixels, inPixels, height, width, vRadius);
// BoxBlurFilter.blurFractional(inPixels, outPixels, width, height, hRadius);
// BoxBlurFilter.blurFractional(outPixels, inPixels, height, width, vRadius);
// ImageMath.unpremultiply(inPixels, 0, inPixels.length);
// dstOut.setDataElements(0, 0, width, height, outPixels);
// parent.compose(src, dstOut, dstOut);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment